aboutsummaryrefslogtreecommitdiff
path: root/bfd/xcofflink.c
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2009-03-14 09:15:34 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2009-03-14 09:15:34 +0000
commit0e3212adedf457b6f7b877b18667190cc79f0848 (patch)
tree8f75d612efcba9893eb8e3587a6e500fa3156eed /bfd/xcofflink.c
parent62008a1686c7043e11fdf8f28aafba721d9cb2b3 (diff)
downloadgdb-0e3212adedf457b6f7b877b18667190cc79f0848.zip
gdb-0e3212adedf457b6f7b877b18667190cc79f0848.tar.gz
gdb-0e3212adedf457b6f7b877b18667190cc79f0848.tar.bz2
bfd/
* xcofflink.c (xcoff_mark, xcoff_link_input_bfd): Don't copy R_POS and R_NEG relocations against absolute symbols to the .loader section. ld/testsuite/ * ld-powerpc/aix-abs-reloc-1.ex, ld-powerpc/aix-abs-reloc-1.im, ld-powerpc/aix-abs-reloc-1.od, ld-powerpc/aix-abs-reloc-1.s: New test. * ld-powerpc/aix52.exp: Run it.
Diffstat (limited to 'bfd/xcofflink.c')
-rw-r--r--bfd/xcofflink.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/bfd/xcofflink.c b/bfd/xcofflink.c
index 21d9a2d..0a38ac3 100644
--- a/bfd/xcofflink.c
+++ b/bfd/xcofflink.c
@@ -2335,6 +2335,11 @@ xcoff_mark (struct bfd_link_info *info, asection *sec)
case R_NEG:
case R_RL:
case R_RLA:
+ if (h != NULL
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && bfd_is_abs_section (h->root.u.def.section))
+ break;
++xcoff_hash_table (info)->ldrel_count;
if (h != NULL)
h->flags |= XCOFF_LDREL;
@@ -4460,6 +4465,11 @@ xcoff_link_input_bfd (struct xcoff_final_link_info *finfo,
case R_NEG:
case R_RL:
case R_RLA:
+ if (h != NULL
+ && (h->root.type == bfd_link_hash_defined
+ || h->root.type == bfd_link_hash_defweak)
+ && bfd_is_abs_section (h->root.u.def.section))
+ break;
/* This reloc needs to be copied into the .loader
section. */
ldrel.l_vaddr = irel->r_vaddr;