aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfnn-aarch64.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@mips.com>2018-07-17 20:04:53 +0100
committerMaciej W. Rozycki <macro@mips.com>2018-07-17 20:04:53 +0100
commitc691de6a16a87adc686ce5cd6c9be54ee0b1a8c1 (patch)
tree758decbdd8755cbfe0f9d42d60131f9698978cf4 /bfd/elfnn-aarch64.c
parentd5c928c05356b22af08450bf43b262ccc1b1d8ee (diff)
downloadgdb-c691de6a16a87adc686ce5cd6c9be54ee0b1a8c1.zip
gdb-c691de6a16a87adc686ce5cd6c9be54ee0b1a8c1.tar.gz
gdb-c691de6a16a87adc686ce5cd6c9be54ee0b1a8c1.tar.bz2
BFD: Use `bfd_is_abs_symbol' to determine whether a symbol is absolute
Use `bfd_is_abs_symbol' to determine whether a symbol is absolute, avoiding a problem with ordinary symbols defined in a linker script outside an output section definition. Such symbols have its owning section set to the absolute section up to the final link phase. A flag has been added to the link hash to identify such symbols. Rather than checking the flag by hand, use the macro that does it uniformly for all users. bfd/ * elf32-nds32.c (nds32_elf_relax_loadstore): Use `bfd_is_abs_symbol' rather than `bfd_is_abs_section' in checking whether the symbol is absolute. (nds32_elf_relax_lo12): Likewise. * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise. (elfNN_aarch64_check_relocs): Likewise. * xcofflink.c (xcoff_need_ldrel_p): Likewise. (bfd_xcoff_import_symbol): Likewise. (xcoff_write_global_symbol): Likewise.
Diffstat (limited to 'bfd/elfnn-aarch64.c')
-rw-r--r--bfd/elfnn-aarch64.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/bfd/elfnn-aarch64.c b/bfd/elfnn-aarch64.c
index cf321f3..8681444 100644
--- a/bfd/elfnn-aarch64.c
+++ b/bfd/elfnn-aarch64.c
@@ -5224,8 +5224,7 @@ elfNN_aarch64_final_link_relocate (reloc_howto_type *howto,
weak_undef_p = (h ? h->root.type == bfd_link_hash_undefweak
: bfd_is_und_section (sym_sec));
- abs_symbol_p = (h !=NULL && h->root.type == bfd_link_hash_defined
- && bfd_is_abs_section (h->root.u.def.section));
+ abs_symbol_p = h != NULL && bfd_is_abs_symbol (&h->root);
/* Since STT_GNU_IFUNC symbol must go through PLT, we handle
@@ -7363,8 +7362,7 @@ elfNN_aarch64_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (h != NULL
/* This is an absolute symbol. It represents a value instead
of an address. */
- && ((h->root.type == bfd_link_hash_defined
- && bfd_is_abs_section (h->root.u.def.section))
+ && (bfd_is_abs_symbol (&h->root)
/* This is an undefined symbol. */
|| h->root.type == bfd_link_hash_undefined))
break;