diff options
author | Alan Modra <amodra@gmail.com> | 2020-07-27 17:33:59 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-07-27 22:31:37 +0930 |
commit | 93fd13c70468a7baac5ac7d56b71feb172509f7a (patch) | |
tree | 9d6ec61aef3f9cc7ae2ecc60df26064f887ff3ee /bfd | |
parent | 8fab9282e5d231faa9105eb48eca9c3d4d990c93 (diff) | |
download | gdb-93fd13c70468a7baac5ac7d56b71feb172509f7a.zip gdb-93fd13c70468a7baac5ac7d56b71feb172509f7a.tar.gz gdb-93fd13c70468a7baac5ac7d56b71feb172509f7a.tar.bz2 |
Accept --just-symbols symbols as absolute for xcoff
This patch is aimed at curing
just-symbols-1.o: loader reloc in unrecognized section `*ABS*'
for xcoff by treating symbols defined by --just-symbols objects as
absolute.
* xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and
similar as absolute.
(bfd_xcoff_import_symbol): Don't fuss over absolute symbol
redefinitions here.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 7 | ||||
-rw-r--r-- | bfd/xcofflink.c | 18 |
2 files changed, 19 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b161e20..dfc3cbc 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2020-07-27 Alan Modra <amodra@gmail.com> + + * xcofflink.c (xcoff_need_ldrel_p): Accept --just-symbols symbols and + similar as absolute. + (bfd_xcoff_import_symbol): Don't fuss over absolute symbol + redefinitions here. + 2020-07-24 Nick Clifton <nickc@redhat.com> * config.bfd: Move xc16x target to the obsolete list. diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c index 985e221..8870525 100644 --- a/bfd/xcofflink.c +++ b/bfd/xcofflink.c @@ -2685,9 +2685,17 @@ xcoff_need_ldrel_p (struct bfd_link_info *info, struct internal_reloc *rel, case R_RLA: /* Absolute relocations against absolute symbols can be resolved statically. */ - if (h != NULL && bfd_is_abs_symbol (&h->root)) - return FALSE; - + if (h != NULL + && (h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && !h->root.rel_from_abs) + { + asection *sec = h->root.u.def.section; + if (bfd_is_abs_section (sec) + || (sec != NULL + && bfd_is_abs_section (sec->output_section))) + return FALSE; + } return TRUE; } } @@ -3118,9 +3126,7 @@ bfd_xcoff_import_symbol (bfd *output_bfd, if (val != (bfd_vma) -1) { - if (h->root.type == bfd_link_hash_defined - && (!bfd_is_abs_symbol (&h->root) - || h->root.u.def.value != val)) + if (h->root.type == bfd_link_hash_defined) (*info->callbacks->multiple_definition) (info, &h->root, output_bfd, bfd_abs_section_ptr, val); |