aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2020-02-29 20:02:11 -0800
committerRob Landley <rob@landley.net>2020-03-01 01:46:05 -0600
commit1a79bd562843eab3d2b630249719fdaffb06c641 (patch)
tree1ddf3a6180b4f11047f77a6e78fd018205bb11b4 /tests
parent04bec3ee366cad5bb4664ace7e3fdcd1dda8cfc8 (diff)
downloadtoybox-1a79bd562843eab3d2b630249719fdaffb06c641.tar.gz
readelf: various fixes.
Add -e, and stop documenting no-op -W. Fix sign issues, and add a few extra sanity checks. Redo the BE/LE 16/32/64 reading. Remove the NOSPACE=1 from the -l test, and fix the -l code to match the binutils output. Most usefully, this fixes the weird way the NULL section's empty name would cause misalignment in the section to segment mapping output. Add a test for -s (symbol table).
Diffstat (limited to 'tests')
-rwxr-xr-xtests/readelf.test19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/readelf.test b/tests/readelf.test
index 9c0e9567..a015e23a 100755
--- a/tests/readelf.test
+++ b/tests/readelf.test
@@ -70,7 +70,7 @@ Section Headers:
[31] .strtab STRTAB 0000000000000000 001b18 0001f4 00 0 0 1
" "" ""
-NOSPACE=1 testing "-l" "readelf -lW $elf-short" "
+testing "-l" "readelf -lW $elf-short" "
Elf file type is DYN (Shared object file)
Entry point 0x1001
There are 10 program headers, starting at offset 52
@@ -200,3 +200,20 @@ Hex dump of section '.shstrtab':
0x000000f0 64656275 67646174 61000000 000000 debugdata......
" "" ""
+
+# TODO: remove the sed when we handle symbol versions
+testing "-s" "readelf -s $elf-short | sed s/@.*//" "
+Symbol table '.dynsym' contains 11 entries:
+ Num: Value Size Type Bind Vis Ndx Name
+ 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
+ 1: 00000000 0 FUNC GLOBAL DEFAULT UND __libc_init
+ 2: 00000000 0 FUNC GLOBAL DEFAULT UND __stack_chk_fail
+ 3: 00000000 0 OBJECT GLOBAL DEFAULT UND __stack_chk_guard
+ 4: 00000000 0 FUNC GLOBAL DEFAULT UND memset
+ 5: 000010d8 12 FUNC GLOBAL DEFAULT 13 __aeabi_memclr
+ 6: 000010d8 12 FUNC GLOBAL DEFAULT 13 __aeabi_memclr4
+ 7: 000010d8 12 FUNC GLOBAL DEFAULT 13 __aeabi_memclr8
+ 8: 000010c8 16 FUNC GLOBAL DEFAULT 13 __aeabi_memset
+ 9: 000010c8 16 FUNC GLOBAL DEFAULT 13 __aeabi_memset4
+ 10: 000010c8 16 FUNC GLOBAL DEFAULT 13 __aeabi_memset8
+" "" ""