patchelf/tests
Rolf Eike Beer b4cb6cac78 fix corrupted library names when using --replace-needed multiple times
When it happens that the .gnu.version_r stores the strings in .dynstr it can
come to corruption of the library names written into DT_NEEDED:

-the library names in DT_NEEDED are replaced, new entries are written to the end
 of .dynstr
-the version library names are replaced, and written to the end of the string
 section.

If the section for the version strings is also ".dynstr", the previous
modifications were _not_ taken into account and things were written from the old
end of .dynstr again. The order in which these strings were written is not the
same as the previous replacement, so things would end up with the same size, but
different offsets. The .gnu.version_r table is correct, the file contents are
fine, but the offsets in the DT_NEEDED entries are wrong. Since they are printed
as 0-terminated strings the first one replaced will always be shown correct,
which also is the case if the argument is only used once as the string is
replaced with itself afterwards.
2021-11-27 11:06:49 +01:00
..
endianness tests: add e_machine endianness test (#269) 2021-07-24 01:32:37 +02:00
invalid-elf Add test case with invalid phdr offset 2020-11-15 16:46:53 +01:00
no-rpath-prebuild Add regression tests for powerpc PIE endianness 2020-10-03 23:43:53 -05:00
Makefile.am fix corrupted library names when using --replace-needed multiple times 2021-11-27 11:06:49 +01:00
add-rpath.sh Added option --add-rpath 2020-10-05 17:06:15 +01:00
args-from-file.sh rename test: external.sh -> args-from-file.sh 2021-09-11 07:34:42 +02:00
bar.c * Add tests. 2005-09-29 12:03:56 +00:00
basic-flags.sh add flag tests 2021-08-25 21:43:41 +00:00
big-dynstr.sh Allow parallel execution of tests 2012-07-10 18:16:24 -04:00
build-id.sh add regression test for NOTE section relocation 2020-07-31 08:33:32 +01:00
contiguous-note-sections.ld tests/contiguous-note-sections: rename for consistency 2021-08-10 14:36:25 +02:00
contiguous-note-sections.s tests/contiguous-note-sections: rename for consistency 2021-08-10 14:36:25 +02:00
contiguous-note-sections.sh tests/contiguous-note-sections: rename for consistency 2021-08-10 14:36:25 +02:00
endianness.sh tests: add e_machine endianness test (#269) 2021-07-24 01:32:37 +02:00
foo.c * Regression test for NIXPKGS-98: patchelf barfs on dynamic libraries 2009-06-16 15:26:30 +00:00
force-rpath.sh Consistently use --force-rpath (fixes #94) 2020-06-03 13:37:13 +02:00
grow-file.sh grow-test: fix on non-gcc systems 2021-09-13 17:55:05 +02:00
invalid-elf.sh Add test case with invalid phdr offset 2020-11-15 16:46:53 +01:00
main.c * Fix the tests on FreeBSD. On FreeBSD, the RPATH is scoped: adding a 2008-05-09 15:46:54 +00:00
no-dynamic-section.sh add failing test for .dynamic == NOBITS 2021-08-23 20:57:47 +02:00
no-gnu-hash.sh fix binaries without .gnu.hash section 2021-08-10 07:54:50 +02:00
no-rpath-pie-powerpc.sh Add regression tests for powerpc PIE endianness 2020-10-03 23:43:53 -05:00
no-rpath-prebuild.sh Fixed tests to be running with parallel-tests 2017-08-02 16:57:33 +05:00
no-rpath.c rewrite no-rpath test 2012-07-11 10:10:32 +02:00
no-rpath.sh rewrite no-rpath test 2012-07-11 10:10:32 +02:00
output-flag.sh Added --output flag 2020-06-01 12:12:54 -07:00
phdr-corruption.ld tests: add testcase for PT_PHDR VirtAddr corruption 2021-09-26 19:09:55 +03:00
phdr-corruption.sh tests: add testcase for PT_PHDR VirtAddr corruption 2021-09-26 19:09:55 +03:00
plain-fail.sh * Add a test for programs that crash when .dynstr etc. are moved. 2005-10-03 18:22:32 +00:00
plain-needed.sh tests: plain-needed.sh: add tescases for --add-needed-/--remove-needed 2021-07-24 19:25:16 +03:00
plain-run.sh * Add tests. 2005-09-29 12:03:56 +00:00
replace-needed.sh fix corrupted library names when using --replace-needed multiple times 2021-11-27 11:06:49 +01:00
set-empty-rpath.sh fix setting empty rpath 2021-09-12 10:27:01 +02:00
set-interpreter-long.sh Allow parallel execution of tests 2012-07-10 18:16:24 -04:00
set-interpreter-short.sh Allow parallel execution of tests 2012-07-10 18:16:24 -04:00
set-rpath-library.sh tests: Do not exit on an expected failure code. 2016-07-10 03:53:01 +03:00
set-rpath-rel-map.sh Adjust DT_MIPS_RLD_MAP_REL dynamic section entry if present 2021-08-11 17:49:41 +04:00
set-rpath.sh Allow parallel execution of tests 2012-07-10 18:16:24 -04:00
shrink-rpath-with-allowed-prefixes.sh Add '--allowed-rpath-prefixes' option to '--shrink-rpath' 2016-06-04 00:25:02 +03:00
shrink-rpath.sh Allow parallel execution of tests 2012-07-10 18:16:24 -04:00
simple.c * Added some real tests. 2005-09-29 14:21:40 +00:00
soname.sh soname test: set an initial DT_SONAME entry 2015-07-13 19:54:30 +02:00
too-many-strtab.c Handle libraries with more than one .shstrtab section 2020-09-22 20:59:55 +01:00
too-many-strtab.sh Handle libraries with more than one .shstrtab section 2020-09-22 20:59:55 +01:00
void.c tests: add testcase for PT_PHDR VirtAddr corruption 2021-09-26 19:09:55 +03:00