]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
tests/run-getsrc-die.sh: Avoid using objcopy
authorAaron Merey <amerey@redhat.com>
Fri, 1 Mar 2024 00:46:09 +0000 (19:46 -0500)
committerAaron Merey <amerey@redhat.com>
Fri, 1 Mar 2024 00:46:09 +0000 (19:46 -0500)
run-getsrc-die.sh uses objcopy to remove .debug_aranges from some
testfiles.  However depending how objcopy is built, it may fail to
recognize the format of these testfiles.

Avoid using objcopy and instead add versions of the testfiles to
the testsuite with .debug_aranges already stripped.

Signed-off-by: Aaron Merey <amerey@redhat.com>
tests/run-getsrc-die.sh
tests/testfile-inlines-no-aranges.bz2 [new file with mode: 0644]
tests/testfile-lex-inlines-no-aranges.bz2 [new file with mode: 0644]
tests/testfile-no-aranges.bz2 [new file with mode: 0644]

index 54c7ad8c97d7b96884d068d1c2af83eaf7d91526..40f62480c62147dd8e07335c48b8c259b90665bc 100755 (executable)
 # Output/files/lines matched should equal what is done through addr2line
 # which uses dwfl_module_getsrc. This test uses dwarf_addrdie and
 # dwarf_getsrc_die
-testfiles testfile testfile-inlines testfile-lex-inlines
-tempfiles testfile-no-aranges testfile-inlines-no-aranges
+testfiles testfile testfile-inlines testfile-no-aranges
+testfiles testfile-lex-inlines testfile-inlines-no-aranges
 tempfiles testfile-lex-inlines-no-aranges good.out getsrc_die.out
 
-# Each test should also pass with no .debug_aranges present.
-objcopy --remove-section .debug_aranges testfile testfile-no-aranges
-objcopy --remove-section .debug_aranges testfile-inlines testfile-inlines-no-aranges
-objcopy --remove-section .debug_aranges testfile-lex-inlines testfile-lex-inlines-no-aranges
-
 cat > good.out <<\EOF
 /home/drepper/gnu/new-bu/build/ttt/f.c:3
 /home/drepper/gnu/new-bu/build/ttt/b.c:4
 EOF
 
 cat good.out | testrun_compare ${abs_top_builddir}/tests/getsrc_die testfile 0x08048468 0x0804845c
+
+# Each test should also pass with no .debug_aranges present.
 cat good.out | testrun_compare ${abs_top_builddir}/tests/getsrc_die testfile-no-aranges 0x08048468 0x0804845c
 
 cat > good.out <<\EOF
diff --git a/tests/testfile-inlines-no-aranges.bz2 b/tests/testfile-inlines-no-aranges.bz2
new file mode 100644 (file)
index 0000000..ab66b17
Binary files /dev/null and b/tests/testfile-inlines-no-aranges.bz2 differ
diff --git a/tests/testfile-lex-inlines-no-aranges.bz2 b/tests/testfile-lex-inlines-no-aranges.bz2
new file mode 100644 (file)
index 0000000..4ebc452
Binary files /dev/null and b/tests/testfile-lex-inlines-no-aranges.bz2 differ
diff --git a/tests/testfile-no-aranges.bz2 b/tests/testfile-no-aranges.bz2
new file mode 100644 (file)
index 0000000..a01db39
Binary files /dev/null and b/tests/testfile-no-aranges.bz2 differ