From: Aleksei Vetrov Date: Mon, 20 Nov 2023 17:44:48 +0000 (+0000) Subject: tests: Add test for duplicate entries in archive X-Git-Tag: elfutils-0.191~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e54af3a5a78dd9e0502a9ac4050098f6d8ed6506;p=thirdparty%2Felfutils.git tests: Add test for duplicate entries in archive Test dwfl-report-offline-memory against an archive that contains non-relocatable ELFs with the same name and contents. * tests/test-ar-duplicates.a.bz2: New test file. * tests/run-dwfl-report-offline-memory.sh: Test new test-ar-duplicates.a.bz2. * tests/Makefile.am (EXTRA_DIST): Add test-ar-duplicates.a.bz2. Signed-off-by: Aleksei Vetrov --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 7fb8efb13..80f6cb594 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -632,7 +632,8 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \ run-nvidia-extended-linemap-libdw.sh run-nvidia-extended-linemap-readelf.sh \ testfile_nvidia_linemap.bz2 \ testfile-largealign.o.bz2 run-strip-largealign.sh \ - run-funcretval++11.sh + run-funcretval++11.sh \ + test-ar-duplicates.a.bz2 if USE_VALGRIND diff --git a/tests/run-dwfl-report-offline-memory.sh b/tests/run-dwfl-report-offline-memory.sh index 644a45dce..85f43f536 100755 --- a/tests/run-dwfl-report-offline-memory.sh +++ b/tests/run-dwfl-report-offline-memory.sh @@ -20,7 +20,14 @@ testfiles testfile-dwfl-report-elf-align-shlib.so testfiles testarchive64.a +# echo "int _start(void) { return 0; }" > test.c +# gcc test.c -nostdlib -static -o test.o +# ar -r test-ar-duplicates.a test.o test.o test.o +# bzip2 -zf test-ar-duplicates.a +testfiles test-ar-duplicates.a + testrun ${abs_builddir}/dwfl-report-offline-memory ./testfile-dwfl-report-elf-align-shlib.so 1 testrun ${abs_builddir}/dwfl-report-offline-memory ./testarchive64.a 3 +testrun ${abs_builddir}/dwfl-report-offline-memory ./test-ar-duplicates.a 1 exit 0 diff --git a/tests/test-ar-duplicates.a.bz2 b/tests/test-ar-duplicates.a.bz2 new file mode 100644 index 000000000..e8168c6bb Binary files /dev/null and b/tests/test-ar-duplicates.a.bz2 differ