History log of /freebsd-current/contrib/elftoolchain/elfcopy/binary.c
Revision Date Author Comments
# 164e7901 29-Sep-2019 Aleksandr Rybalko <ray@FreeBSD.org>

Initialize baseaddr to suppres warning.

Pointy hat to: ray


# 0705bb9d 29-Sep-2019 Aleksandr Rybalko <ray@FreeBSD.org>

ections into expected offset in binary format.
Calculate binary file offset using address field, bacause software know only offset to known data, not where to load segment.
With that patch, kernel .data section can have any alignment/offset - kernel boor fine.

PR: 235391
Reviewed by: markj
MFC after: 1 month
Differential Revision: D21827


# bc589b72 04-Jun-2019 Mark Johnston <markj@FreeBSD.org>

elfcopy: Use libelftc's string table routines to build .shstrtab.

This replaces some hand-rolled routines and is substantially faster
since libelftc uses a hash table for lookups and insertions, whereas
elfcopy would perform a linear scan of the table.

PR: 234949
Reviewed by: emaste
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D20473


# aadb6884 02-Jan-2018 Ed Maste <emaste@FreeBSD.org>

elfcopy: copy raw (untranslated) contents to binary output

Previously elfcopy used elf_getdata to obtain data from ELF sections
being copied to binary output, but elf_getdata returns data that has
been translated - that is, data is in host byte order. When the host and
target differ in endianness (e.g., converting a big-endian MIPS ELF
object to binary on an x86 host) this resulted in byte-swapped data in
certain sections such as .dynamic.

Instead use elf_rawdata to keep data in the original, target endianness.

Reported by: Hiroki Mori <yamori83@yahoo.co.jp>, Bill Yuan
MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# e5c4075f 20-Apr-2016 Ed Maste <emaste@FreeBSD.org>

elfcopy: map all !alnum characters to '_' in binary input symbol names

This matches bfd and gold.

Obtained from: ELF Tool Chain r3445
Sponsored by: The FreeBSD Foundation


# 1ce1c689 11-Dec-2015 Ed Maste <emaste@FreeBSD.org>

elfcopy: include extension but replace . when converting from binary

The change in r291958 was not consistent with GNU objcopy. The start,
end and size symbols created for ELF objects converted from binary need
to include the full filename including the extension, but with the
periods replaced with underscores.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4474


# fc7284da 07-Dec-2015 Ed Maste <emaste@FreeBSD.org>

elfcopy: exclude extension when converting from binary

When converting from binary to ELF, elfcopy creates symbols
_binary_<filename>_start_, _binary_<filename>_end, and
_binary_<filename>_size. For compatibility with GNU objcopy (and to
produce sensible symbol names) the extension must be stripped off.

Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D4238