summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/ChangeLog7
-rw-r--r--tests/Makefile.am2
-rwxr-xr-xtests/run-dwflsyms.sh13
-rwxr-xr-xtests/run-readelf-s.sh40
-rwxr-xr-xtests/testfilebasmin.bz2bin0 -> 1082 bytes
5 files changed, 61 insertions, 1 deletions
diff --git a/tests/ChangeLog b/tests/ChangeLog
index feb9f699..bc721c70 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,10 @@
+2013-01-23 Mark Wielaard <mjw@redhat.com>
+
+ * testfilebasmin.bz2: New testfile.
+ * Makefile.am (EXTRA_DIST): Add testfilebasmin.bz2.
+ * run-readelf-s.sh: Test testfilebasmin.
+ * run-dwflsyms.sh: Likewise.
+
2013-01-16 Mark Wielaard <mjw@redhat.com>
* Makefile.am (check_PROGRAMS): Add dwflsyms.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b46c4c23..f32ea242 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -175,7 +175,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
testfilegdbindex7.bz2 \
run-readelf-s.sh testfilebazdbg.bz2 testfilebazdyn.bz2 \
testfilebazmin.bz2 testfilebazdbg.debug.bz2 testfilebazmdb.bz2 \
- testfilebaztab.bz2 \
+ testfilebaztab.bz2 testfilebasmin.bz2 \
run-dwflsyms.sh \
run-unstrip-n.sh testcore-rtlib.bz2 testcore-rtlib-ppc.bz2 \
run-low_high_pc.sh testfile_low_high_pc.bz2 \
diff --git a/tests/run-dwflsyms.sh b/tests/run-dwflsyms.sh
index 570881ad..56a75804 100755
--- a/tests/run-dwflsyms.sh
+++ b/tests/run-dwflsyms.sh
@@ -25,6 +25,7 @@ testfiles testfilebazdbg testfilebazdbg.debug
testfiles testfilebazdyn
testfiles testfilebazmdb
testfiles testfilebazmin
+testfiles testfilebasmin
tempfiles testfile.dynsym.in testfile.symtab.in testfile.minsym.in dwflsyms.out
@@ -190,4 +191,16 @@ cat testfile.symtab.in \
cat testfile.minsym.in \
| testrun_compare ./dwflsyms -e testfilebazmin
+testrun_compare ./dwflsyms -e testfilebasmin <<\EOF
+ 0: NOTYPE LOCAL (0) 0
+ 1: FUNC LOCAL foo (18) 0x400168
+ 2: SECTION LOCAL (0) 0x400120
+ 3: SECTION LOCAL (0) 0x400144
+ 4: SECTION LOCAL (0) 0x4001c0
+ 5: SECTION LOCAL (0) 0x600258
+ 6: FUNC GLOBAL _start (21) 0x4001a8
+ 7: FUNC GLOBAL main (33) 0x400144
+ 8: FUNC GLOBAL bar (44) 0x40017a
+EOF
+
exit 0
diff --git a/tests/run-readelf-s.sh b/tests/run-readelf-s.sh
index f14b3054..bad31cf2 100755
--- a/tests/run-readelf-s.sh
+++ b/tests/run-readelf-s.sh
@@ -74,12 +74,33 @@
#
# - testfilebazmin (dynsym + gnu_debugdata)
# objcopy --remove-section=.gnu_debuglink baz testfilebazmin
+#
+#
+# Special auxiliary only, can happen with static binaries.
+# - start.c
+#
+# extern int main (int argc, char ** argv);
+# void _start (void) { for (;;) main (1, 0); }
+#
+# gcc -g -c start.c
+# gcc -static -nostdlib -o bas foo.o bar.o start.o
+#
+# eu-strip --remove-comment -f bas.debug bas
+# nm bas.debug --format=posix --defined-only | awk '{ if ($2 == "T" || $2 == "t") print $1 }' | sort > funcsyms
+# objcopy -S --remove-section .gdb_index --remove-section .comment --keep-symbols=funcsyms bas.debug mini_debuginfo
+# rm -f mini_debuginfo.xz
+# xz mini_debuginfo
+# objcopy --add-section .gnu_debugdata=mini_debuginfo.xz bas
+# rm bas.debug
+# mv bas testfilebasmin
+
testfiles testfilebaztab
testfiles testfilebazdbg testfilebazdbg.debug
testfiles testfilebazdyn
testfiles testfilebazmdb
testfiles testfilebazmin
+testfiles testfilebasmin
tempfiles testfile.dynsym.in testfile.symtab.in testfile.minsym.in
@@ -253,4 +274,23 @@ cat testfile.dynsym.in \
cat testfile.minsym.in \
| testrun_compare ../src/readelf --elf-section -s testfilebazmin
+testrun_compare ../src/readelf -s testfilebasmin <<EOF
+EOF
+
+testrun_compare ../src/readelf --elf-section -s testfilebasmin <<\EOF
+
+Symbol table [ 6] '.symtab' contains 9 entries:
+ 6 local symbols String table: [ 7] '.strtab'
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UNDEF
+ 1: 0000000000400168 18 FUNC LOCAL DEFAULT 2 foo
+ 2: 0000000000400120 0 SECTION LOCAL DEFAULT 1
+ 3: 0000000000400144 0 SECTION LOCAL DEFAULT 2
+ 4: 00000000004001c0 0 SECTION LOCAL DEFAULT 3
+ 5: 0000000000600258 0 SECTION LOCAL DEFAULT 4
+ 6: 00000000004001a8 21 FUNC GLOBAL DEFAULT 2 _start
+ 7: 0000000000400144 33 FUNC GLOBAL DEFAULT 2 main
+ 8: 000000000040017a 44 FUNC GLOBAL DEFAULT 2 bar
+EOF
+
exit 0
diff --git a/tests/testfilebasmin.bz2 b/tests/testfilebasmin.bz2
new file mode 100755
index 00000000..38439720
--- /dev/null
+++ b/tests/testfilebasmin.bz2
Binary files differ