Unwrap symbols for debug information

Fixes issues with dwz multi-file (-m) and ld's -wrap option.
Symbols referenced from DWARF debug info in a separate file, eg. to
specify low and high pc, must use the real symbol.  The DWARF info
is specifying attributes of the real function, not one interposed
with --wrap.

include/
	* bfdlink.h (unwrap_hash_lookup): Declare.
bfd/
	* linker.c (unwrap_hash_lookup): New function.
	* elf-bfd (RELOC_FOR_GLOBAL_SYMBOL): Call unwrap_hash_lookup.
	* elf32-i370.c (i370_elf_relocate_section): Likewise.
	* elf32-m32c.c (m32c_elf_relocate_section): Likewise.
	* elf32-m32r.c (m32r_elf_relocate_section): Likewise.
	* elf32-score.c (s3_bfd_score_elf_relocate_section): Likewise.
	* elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
	* elf32-spu.c (spu_elf_relocate_section): Likewise.
	* elf64-hppa.c (elf64_hppa_relocate_section): Likewise.
This commit is contained in:
Alan Modra 2014-06-10 21:50:21 +09:30
parent 0e58ee40a2
commit 8a5da09b9e
10 changed files with 86 additions and 2 deletions

View file

@ -186,6 +186,12 @@ extern struct bfd_link_hash_entry *bfd_wrapped_link_hash_lookup
(bfd *, struct bfd_link_info *, const char *, bfd_boolean,
bfd_boolean, bfd_boolean);
/* If H is a wrapped symbol, ie. the symbol name starts with "__wrap_"
and the remainder is found in wrap_hash, return the real symbol. */
extern struct bfd_link_hash_entry *unwrap_hash_lookup
(struct bfd_link_info *, bfd *, struct bfd_link_hash_entry *);
/* Traverse a link hash table. */
extern void bfd_link_hash_traverse
(struct bfd_link_hash_table *,