History log of /external/elfutils/src/unstrip.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5c40529883a48e350b37e7de9ad285facdf84f6f 02-Dec-2015 Mark Wielaard <mjw@redhat.com> unstrip: Don't leak new section data.

When we copy elided sections some section data is newly allocated.
Track those allocations so we can free them when done.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/src/unstrip.c
3425454a10d307fae891fb667cf7969e945cde79 09-Oct-2015 Josh Stone <jistone@redhat.com> Trust AC_SYS_LARGEFILE to provide large file support

AC_SYS_LARGEFILE defines _FILE_OFFSET_BITS in config.h if needed for
LFS, and this automatically maps things like open to open64. But quite
a few places used explicit 64-bit names, which won't work on platforms
like FreeBSD where off_t is always 64-bit and there are no foo64 names.
It's better to just trust that AC_SYS_LARGEFILE is doing it correctly.

But we can verify this too, as some file could easily forget to include
config.h. The new tests/run-lfs-symbols.sh checks all build targets
against lfs-symbols (taken from lintian) to make sure everything was
implicitly mapped to 64-bit variants when _FILE_OFFSET_BITS is set.

Signed-off-by: Josh Stone <jistone@redhat.com>
/external/elfutils/src/unstrip.c
86ed7f7f53179d7a893329e6b9851dbb75aba405 08-Oct-2015 Mark Wielaard <mjw@redhat.com> Allocate exact amount of bytes for phdrs and shdrs.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/src/unstrip.c
7eff36d5daa6ebca5e6399638a7643af105ae5b0 07-Oct-2015 Chih-Hung Hsieh <chh@google.com> Do without union of variable length arrays.

Prepare to compile with clang.

A union like
{ T32 a32[n]; T64 a64[n]; } u;
is expanded to
size_t nbytes = n * MAX(sizeof(T32), sizeof(T64));
void *data = malloc(nbytes);
T32 (*a32)[n] = data;
T64 (*a64)[n] = data;

Signed-off-by: Chih-Hung Hsieh <chh@google.com>
/external/elfutils/src/unstrip.c
2e084502768cc845bacc2457c22d097f49808751 02-Oct-2015 Mark Wielaard <mjw@redhat.com> unstrip: Update sh_info when SH_INFO_LINK_P not just when SHF_INFO_LINK set

SHF_INFO_LINK is not consistently set when sh_info is actually a section
index reference. Use SH_INFO_LINK_P to check whether to update the sh_info
value. SH_INFO_LINK_P also checks the section type to know whether or not
sh_info is meant as section index.

Found by run-strip-strmerge.sh test with older binutils.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/src/unstrip.c
df7dfab451246e8b088040e052ca01f9d6aba774 11-Aug-2015 Mark Wielaard <mjw@redhat.com> Handle merged strtab/shstrtab string tables in strip and unstrip.

ELF files can share the section header string table (e_shstrndx) with
the symtab .strtab section. That might in some cases save a bit of space
since symbols and sections might share some (sub)strings. To handle that
eu-strip just needs to not unconditionally remove the .shstrtab section
(it will be properly marked as used/unused as needed). eu-unstrip needs
to make sure the section names are added to the strtab if it decides to
rewrite that section. Also makes sure that eu-strip won't move around
a SHT_NOBITS section that has SHF_ALLOC set. Although it is allowed to
move such sections around, there is no benefit. And some tools might
expect no allocated section to move around, not even a nobits section.
It also makes it harder to do "roundtripping" sanity checks that make
sure splitting a file with eu-strip and then reconstructed with eu-unstrip
produce the same ELF file (as is done in the new run-strip-strmerge.sh).

Introduces a somewhat large test generator elfstrmerge.c that will
hopefully turn into a more generic string table merger program.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/src/unstrip.c
2ec957327cdfae6cee592a52958a9c937ea4b13c 04-Sep-2015 Chih-Hung Hsieh <chh@google.com> Replace printf %Z length modifier with %z.

%Z is a GNU extension predating the ISO C99 %z modifier supported by
libc5 and no longer recommended.

Signed-off-by: Chih-Hung Hsieh <chh@google.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/src/unstrip.c
f9fc50c3eced243c0648fb0fbfe2c9877c25e1e4 29-Jul-2015 Mark Wielaard <mjw@redhat.com> unstrip: Handle debuginfo files with missing SHF_INFO_LINK section flags.

With GCC 5 there might be a .rela.plt section with SHF_INFO_LINK set.
Buggy binutils objdump might strip it from the section in the debug file.
Ignore such differences for relocation sections and put the flag back
if necessary.

Also improve the error message a little by only discarding the already
matched sections if there is an prelink undo section. Otherwise we will
report all sections as not matching if the file wasn't prelinked instead
of just the non-matching sections.

New testfiles generated by gcc5 and binutils objdump added.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/src/unstrip.c
b88bece422ec249215f3ab5e848c4991bef68c40 04-May-2015 Max Filippov <jcmvbkbc@gmail.com> Drop mtrace calls.

mtrace is a GNU extension not supported by uClibc and it's believed to
not be really used. Drop mtrace() calls and #include <mcheck.h>.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
/external/elfutils/src/unstrip.c
712c8faddc08844fb1f2814c8b6e817f03b0698e 22-Nov-2014 Mark Wielaard <mjw@redhat.com> Use elf_getphdrnum instead of accessing ehdr->e_phnum directly.

Using elf_getphdrnum lets us handle ELF files that use more than PN_XNUM
phdrs. And guards against some corrupt files.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/src/unstrip.c
bd1a0d1293e3cdc2a81370a39df5f55bf08bcbb6 26-May-2014 Mark Wielaard <mjw@redhat.com> unstrip: Allow prelinked, but non-split .bss section.

If the section sh_size of the original and undo section are equal then
match them and don't set split_bss. This is also what prelink's
undo_sections allows.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/src/unstrip.c
22497096e8759b7c73233f2c2f9adff9d2db9ce7 26-May-2014 Mark Wielaard <mjw@redhat.com> unstrip: Add --force to force combining files when ELF headers don't match.

Older versions of GNU binutils strip would drop some ELF header flags.
Causing the main ELF file and the separate .debug file to have mismatched
ELF header fields. Unfortunately some distros are still shipping such files.
eu-unstrip doesn't want to recombine such files. Add a more explicit
explanation which fields don't match and provide a --force, -F flag to
force combining such files anyway (producing a warning).

https://bugzilla.redhat.com/show_bug.cgi?id=698005
https://bugzilla.redhat.com/show_bug.cgi?id=806474

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/src/unstrip.c
de2ed97f33139af5c7a0811e4ec66fc896a13cf2 05-Jun-2012 Mark Wielaard <mjw@redhat.com> Update name, license and contributor policy.

* Change name from "Red Hat elfutils" to "elfutils".
* Update license of standalone tools and test from GPLv2 to GPLv3+.
* Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+.
* Add Developer Certificate of Origin based contributor policy.

top-level:

- COPYING: Upgraded from GPLv2 to GPLv3.
- CONTRIBUTING, COPYING-GPLv2, COPYING-LGPLv3: New files.
- NEWS: Added note about new contribution and license policy.
- Makefile.am: Updated to GPLv3, added new files to EXTRA_DIST.
- configure.ac: Update to GPLv3, changed AC_INIT name to 'elfutils'.

backends, lib, libasm, libcpu, libdw, libdwfl, libebl, libelf:

- All files updated to GPLv2/LGPLv3+. Except some very small files
(<5 lines) which didn't have any headers at all before, the linker
.maps files and the libcpu/defs files which only contain data and
libelf/elf.h which comes from glibc and is under LGPLv2+.

config:

- elfutils.spec.in: Add new License: headers and new %doc files.
- Update all license headers to GPLv2/LGPLv3+ for files used by libs.

src, tests:

- All files updated to GPLv3+. Except for the test bz2 data files, the
linker maps and script files and some very small files (<5 lines)
that don't have any headers.

Signed-off-by: Richard Fontana <rfontana@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/src/unstrip.c
3a64a3087f53ab860c7de04da0e53dabef459520 22-Jan-2012 Ulrich Drepper <drepper@gmail.com> Update copyright year
/external/elfutils/src/unstrip.c
82f77d757c1a9c0e6f66eef71bbe48484019fb1a 07-May-2011 Marek Polacek <mpolacek@redhat.com> unstrip.c: Mark function as static.
/external/elfutils/src/unstrip.c
8f6c1795ab9d41f03805eebd55767070ade55aac 09-Feb-2011 Roland McGrath <roland@redhat.com> unstrip: Remove unused variable.
/external/elfutils/src/unstrip.c
ec86e5fa64540a6bb027b0dd505322455968c8e2 15-Jun-2010 Roland McGrath <roland@redhat.com> Fix unstrip for modifying file in place.
/external/elfutils/src/unstrip.c
aa32f9237f6ce0c25cbe53291467c305b6481abb 04-Jun-2010 Roland McGrath <roland@redhat.com> unstrip: Factor common code for shdr changes.
/external/elfutils/src/unstrip.c
3b1b651d89d14b948a7e2436efdbe89d9bf691c0 04-Jun-2010 Roland McGrath <roland@redhat.com> unstrip: Bail early on bogus invocation with reversed arguments.
/external/elfutils/src/unstrip.c
b337b1fd5f3b3410fe522a690ccee70bce8519ee 15-Jan-2010 Roland McGrath <roland@redhat.com> Fix sloppy #include use, breaks with latest glibc.
/external/elfutils/src/unstrip.c
f189493154d0041deced00e6a99cc5426dc9d260 14-Jun-2009 Ulrich Drepper <drepper@redhat.com> Add aliases for elf_getshnum and elf_getshstrndx.

Sun in their implementation messed up the semantics of these functions.
To get back to source code compatibility they asked for a solution.
We simply add aliases for the two affected functions, named
elf_getshdrnum and elf_getshdrstrndx. The semantics remains the
same. Users of the old interfaces receive a warning for now. In
future we might make it impossible to link programs which request
the old interfaces (binary compatibility will of course be maintained).
/external/elfutils/src/unstrip.c
fdc93e12a77866cafd1aae4463d89cef2c01d9b1 17-Jan-2009 Ulrich Drepper <drepper@myware66.akkadia.org> Move argp_program_version_hook and argp_program_bug_address variables
in all programs into the .rodata section.
/external/elfutils/src/unstrip.c
44173edad1dfd24c4d98fcf032308f7df28db652 02-Jan-2009 Ulrich Drepper <drepper@redhat.com> Unpdate copyright in messages.
/external/elfutils/src/unstrip.c
3cbdd387c752999255aea91600b5cfdefbeac7d0 02-Jan-2008 Ulrich Drepper <drepper@redhat.com> propagate from branch 'com.redhat.elfutils.disasm' (head d15b4eb794e81e477f9896fe82a74cb5ecf4514c)
to branch 'com.redhat.elfutils' (head eaacbf01f8cc89d043ec6eca9b5e35cb5c4cde06)
/external/elfutils/src/unstrip.c
ad024afc93dcd0f4797b3e80bfb6b80c34da5c12 02-Jan-2008 Ulrich Drepper <drepper@redhat.com> Update copyright year.
/external/elfutils/src/unstrip.c
e4c22ea004c02a58f5db5eb53794275344c17958 23-Oct-2007 Roland McGrath <roland@redhat.com> 2007-10-23 Roland McGrath <roland@redhat.com>

* linux-kernel-modules.c (report_kernel_archive): Reorder the kernel
module to appear first.
/external/elfutils/src/unstrip.c
b597dfad924980dede10d7c19d87900b6172e599 16-Oct-2007 Ulrich Drepper <drepper@redhat.com> merge of '92c36bfdbc6468d1711c043b530e0dfe5abb6dec'
and 'c22c8c43f8f68b0bffd4d5ccdb2282c958268742'
/external/elfutils/src/unstrip.c
59ea7f33f781e6e3f8c9d81d457e5d99eee8f1ce 04-Oct-2007 Roland McGrath <roland@redhat.com> src/
2007-10-04 Roland McGrath <roland@redhat.com>

* readelf.c (print_archive_index): New variable.
(options, parse_opt): Accept -c/--archive-index to set it.
(dump_archive_index): New function.
(process_file): Take new arg WILL_PRINT_ARCHIVE_INDEX.
Call dump_archive_index on archives if set.
(main): Update caller.
(any_control_option): Give it file scope, moved out of ...
(parse_opt): ... here.

tests/
2007-10-04 Roland McGrath <roland@redhat.com>

* run-readelf-test4.sh: New file.
* Makefile.am (TESTS, EXTRA_DIST): Add it.
/external/elfutils/src/unstrip.c
cb6d865011ad98a8ac2018f072f396a2268739ca 23-Aug-2007 Roland McGrath <roland@redhat.com> readelf register printing sort order tweak
/external/elfutils/src/unstrip.c
b0243863149acde9e42b25688c7c2959830e69a9 06-Jun-2007 Ulrich Drepper <drepper@redhat.com> Prepare for 0.128 release.

Minor fixes.

Update gettext files to 0.16.1.
/external/elfutils/src/unstrip.c
9aa8ef7fbb5ada14b7c4585d6c1361aa5eab6f88 18-May-2007 Roland McGrath <roland@redhat.com> src/
2007-05-18 Roland McGrath <roland@redhat.com>

* unstrip.c (copy_elided_sections): Match up non-NOBITS sections with
stripped file, so as not to duplicate a section copied in both.

* strip.c (handle_elf): Keep SHT_NOTE section copies in the debug file.

tests/
2007-05-18 Roland McGrath <roland@redhat.com>

* run-strip-test4.sh (stripped, debugfile): Use new reference files.
* testfile37.bz2: New data file.
* testfile37.debug.bz2: New data file.
* run-unstrip-test2.sh: New file.
* Makefile.am (TESTS, EXTRA_DIST): Add them.
/external/elfutils/src/unstrip.c
4be1524398af8e24011cfdfa77c66832f8654a56 25-Apr-2007 Roland McGrath <roland@redhat.com> 2007-04-24 Roland McGrath <roland@redhat.com>

* run-strip-test.sh: When we saved the debug info, test unstrip too.
/external/elfutils/src/unstrip.c