H.J. Lu 10ca4b042d 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.
2020-04-14 05:00:34 -07:00
..
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2018-02-26 09:31:04 +10:30
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2015-05-28 15:21:17 -07:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2013-10-13 10:17:20 +00:00
2012-05-13 09:45:45 +00:00
2012-05-13 09:45:45 +00:00
2013-09-24 22:15:38 +00:00
2013-05-03 15:19:27 +00:00
2013-05-03 15:19:27 +00:00
2013-05-03 15:19:27 +00:00
2012-08-06 21:05:54 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2013-02-13 14:08:58 +00:00
2012-08-06 21:05:54 +00:00
2013-05-29 16:22:14 +00:00
2013-05-29 16:22:14 +00:00
2011-07-24 14:20:15 +00:00
2011-07-24 14:20:15 +00:00
2011-07-24 14:20:15 +00:00
2011-07-24 14:20:15 +00:00
2011-07-24 14:20:15 +00:00
2011-07-24 14:20:15 +00:00
2015-08-12 17:10:22 +01:00
2011-07-24 14:20:15 +00:00
2012-05-13 09:55:45 +00:00
2012-05-13 09:55:45 +00:00
2012-05-13 09:55:45 +00:00
2013-08-23 07:54:19 +00:00
2013-02-13 14:08:58 +00:00
2015-08-12 17:10:22 +01:00
2018-06-14 11:32:01 +09:30
2019-09-11 13:45:18 +09:30
2019-09-11 13:45:18 +09:30
2013-07-12 15:58:15 +00:00
2013-07-12 15:58:15 +00:00
2013-07-12 15:58:15 +00:00
2013-07-12 15:58:15 +00:00
2018-06-14 11:32:01 +09:30
2013-09-24 22:15:38 +00:00
2013-09-24 22:15:38 +00:00
2013-09-24 22:15:38 +00:00
2013-09-24 22:15:38 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2013-10-13 10:03:22 +00:00
2012-06-06 10:50:18 +00:00
2013-02-11 18:09:24 +00:00
2013-02-11 18:09:24 +00:00
2013-02-11 18:06:10 +00:00
2013-02-11 18:06:10 +00:00
2019-07-13 09:57:50 +09:30
2015-08-12 17:10:22 +01:00
2013-02-11 17:46:02 +00:00
2019-07-13 09:57:50 +09:30
2019-07-13 09:57:50 +09:30
2019-07-13 09:57:50 +09:30
2015-08-12 17:10:22 +01:00
2019-07-13 09:57:50 +09:30
2018-02-26 10:51:12 +10:30
2018-02-26 10:51:12 +10:30
2018-02-26 10:51:12 +10:30
2018-02-26 10:51:12 +10:30
2017-11-07 17:01:16 +10:30