aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-mips-elf
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2020-04-14 05:00:22 -0700
committerH.J. Lu <hjl.tools@gmail.com>2020-04-14 05:00:34 -0700
commit10ca4b042d15cd0727300cf3f5a9f11ac8d6abff (patch)
treee77a3dcf4134f8bc808afffc0e8afcdaa0d8d510 /ld/testsuite/ld-mips-elf
parent21b0982c778bf20de6fc42e7ae7735055cdd35c5 (diff)
downloadfsf-binutils-gdb-10ca4b042d15cd0727300cf3f5a9f11ac8d6abff.zip
fsf-binutils-gdb-10ca4b042d15cd0727300cf3f5a9f11ac8d6abff.tar.gz
fsf-binutils-gdb-10ca4b042d15cd0727300cf3f5a9f11ac8d6abff.tar.bz2
readelf: Consolidate --syms --use-dynamic with --dyn-syms
When reconstructing dynamic symbol table from the PT_DYNAMIC segment, compute dynamic symbol table size from hash table. For DT_HASH, the number of dynamic symbol table entries equals the number of chains. For DT_GNU_HASH/DT_MIPS_XHASH, only defined symbols with non-STB_LOCAL indings are in hash table. Since DT_GNU_HASH/DT_MIPS_XHASH place all symbols with STB_LOCAL binding before symbols with other bindings and all undefined symbols defined ones in dynamic symbol table, the highest symbol index in DT_GNU_HASH/DT_MIPS_XHASH is the highest dynamic symbol table index. Rewrite print_dynamic_symbol to dump dynamic symbol table for --dyn-syms and --syms --use-dynamic. binutils/ PR binutils/25707 * readelf.c (nbuckets): New. (nchains): Likewise. (buckets): Likewise. (chains): Likewise. (ngnubuckets): Likewise. (gnubuckets): Likewise. (gnuchains): Likewise. (mipsxlat): Likewise. (ngnuchains): Likewise. (gnusymidx): Likewise. (VALID_SYMBOL_NAME): Likewise. (VALID_DYNAMIC_NAME): Use it. (get_dynamic_data): Moved before process_dynamic_section. (get_num_dynamic_syms): New function. (process_dynamic_section): Use DT_SYMTAB, DT_SYMENT, DT_HASH, DT_GNU_HASH and DT_MIPS_XHASH to reconstruct dynamic symbol table. Use DT_STRTAB and DT_STRSZ to reconstruct dynamic string table. (get_symbol_index_type): Don't print "bad section index" when there is no section header. (print_dynamic_symbol): Rewrite. (process_symbol_table): Call print_dynamic_symbol to dump dynamic symbol table. ld/ PR binutils/25707 * testsuite/ld-arm/armthumb-lib.sym: Updated. * testsuite/ld-arm/farcall-mixed-app.sym: Likewise. * testsuite/ld-arm/farcall-mixed-app2.sym: Likewise. * testsuite/ld-arm/fdpic-main-m.sym: Likewise. * testsuite/ld-arm/fdpic-main.sym: Likewise. * testsuite/ld-arm/fdpic-shared-m.sym: Likewise. * testsuite/ld-arm/fdpic-shared.sym: Likewise. * testsuite/ld-arm/mixed-app.sym: Likewise. * testsuite/ld-arm/mixed-lib.sym: Likewise. * testsuite/ld-arm/preempt-app.sym: Likewise. * testsuite/ld-elf/hash.d: Likewise. * testsuite/ld-elf/pr13195.d: Likewise. * testsuite/ld-elfvsb/hidden2.d: Likewise. * testsuite/ld-mips-elf/hash2.d: Likewise.
Diffstat (limited to 'ld/testsuite/ld-mips-elf')
-rw-r--r--ld/testsuite/ld-mips-elf/hash2.d8
1 files changed, 4 insertions, 4 deletions
diff --git a/ld/testsuite/ld-mips-elf/hash2.d b/ld/testsuite/ld-mips-elf/hash2.d
index 122edb8..aec48e1 100644
--- a/ld/testsuite/ld-mips-elf/hash2.d
+++ b/ld/testsuite/ld-mips-elf/hash2.d
@@ -6,11 +6,11 @@
#...
+0x[0-9a-z]+ +\(MIPS_XHASH\) +0x[0-9a-z]+
#...
- +[0-9]+ +[0-9]+: +[0-9a-f]+ +[0-9]+ +FUNC +GLOBAL +DEFAULT +([1-9]|PRC) _start
+ +[0-9]+: +[0-9a-f]+ +[0-9]+ +FUNC +GLOBAL +DEFAULT +([1-9]|PRC\[[0x[0-9a-f]+\]) __start
#...
- +[0-9]+ +[0-9]+: +[0-9a-f]+ +[0-9]+ +FUNC +GLOBAL +DEFAULT +([1-9]|PRC) main
+ +[0-9]+: +[0-9a-f]+ +[0-9]+ +FUNC +GLOBAL +DEFAULT +([1-9]|PRC\[[0x[0-9a-f]+\]) _start
#...
- +[0-9]+ +[0-9]+: +[0-9a-f]+ +[0-9]+ +FUNC +GLOBAL +DEFAULT +([1-9]|PRC) start
+ +[0-9]+: +[0-9a-f]+ +[0-9]+ +FUNC +GLOBAL +DEFAULT +([1-9]|PRC\[[0x[0-9a-f]+\]) main
#...
- +[0-9]+ +[0-9]+: +[0-9a-f]+ +[0-9]+ +FUNC +GLOBAL +DEFAULT +([1-9]|PRC) __start
+ +[0-9]+: +[0-9a-f]+ +[0-9]+ +FUNC +GLOBAL +DEFAULT +([1-9]|PRC\[[0x[0-9a-f]+\]) start
#...