diff options
author | Mark Wielaard <mark@klomp.org> | 2019-05-12 00:37:45 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2019-05-16 17:57:41 +0200 |
commit | d7193bd7c9dc2a979352eee7fc446dacd3e97779 (patch) | |
tree | 3fbc54875c7c3a378d096a2689f4a19436e0bd2d /tests/Makefile.am | |
parent | a117891a00507d188fdab415bd25554ace9ed7ba (diff) |
libelf: Mark shdr_flags dirty if offset or size changes during update.
We forgot to mark the shdr_flags dirty when only the sh_size or
sh_offset changed during elf_update (). This meant that if there were
no other shdr changes we only wrote out the section data, but didn't
write out the shdr table to the file.
Add a testcase that puts some sections in the reverse order and then
writes out the resulting file again without doing any other
updates. This would show the issue after write out of the
(re-reversed) ELF file (the .shstrtab section offset would be wrong
causing all section names to be garbage). Also run a self test.
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'tests/Makefile.am')
-rw-r--r-- | tests/Makefile.am | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 80900e42..87428aa7 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -60,7 +60,7 @@ check_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \ fillfile dwarf_default_lower_bound dwarf-die-addr-die \ get-units-invalid get-units-split attr-integrate-skel \ all-dwarf-ranges unit-info next_cfi \ - elfcopy addsections xlate_notes + elfcopy addsections xlate_notes elfrdwrnop asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \ asm-tst6 asm-tst7 asm-tst8 asm-tst9 @@ -157,6 +157,7 @@ TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \ run-all-dwarf-ranges.sh run-unit-info.sh \ run-reloc-bpf.sh \ run-next-cfi.sh run-next-cfi-self.sh \ + run-reverse-sections.sh run-reverse-sections-self.sh \ run-copyadd-sections.sh run-copymany-sections.sh \ run-typeiter-many.sh run-strip-test-many.sh \ run-strip-version.sh run-xlate-note.sh \ @@ -419,6 +420,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \ run-unit-info.sh run-next-cfi.sh run-next-cfi-self.sh \ testfile-riscv64.bz2 testfile-riscv64-s.bz2 \ testfile-riscv64-core.bz2 \ + run-reverse-sections.sh run-reverse-sections-self.sh \ run-copyadd-sections.sh run-copymany-sections.sh \ run-typeiter-many.sh run-strip-test-many.sh \ testfile-debug-rel-ppc64-g.o.bz2 \ @@ -598,6 +600,7 @@ next_cfi_LDADD = $(libelf) $(libdw) elfcopy_LDADD = $(libelf) addsections_LDADD = $(libelf) xlate_notes_LDADD = $(libelf) +elfrdwrnop_LDADD = $(libelf) # We want to test the libelf header against the system elf.h header. # Don't include any -I CPPFLAGS. Except when we install our own elf.h. |