History log of /external/elfutils/tests/elfstrmerge.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
29ee512fb8a71b0d22065c369a2117ff758bdf5e 31-Dec-2015 Mark Wielaard <mjw@redhat.com> tests: elfstrmerge warn about STT_SECTION symbol for shstrhndx.

Old linkers might have created an STT_SECTION symbol for the section
header string table section, which isn't actually used. For now just
warn about such symbols. If such a symbol would actually really be used
(but why?) then we would have to handle it by removing it and rewriting
the symbol table.

This is a testsuite only change, but includes an extra test with files
that have such STT_SECTION symbols to make sure it will be handled in
case we "upgrade" the elfstrmerge test to a real utility.

Signed-off-by: Mark Wielaard <mjw@redhat.com>
/external/elfutils/tests/elfstrmerge.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/tests/elfstrmerge.c