summaryrefslogtreecommitdiff
path: root/bfd/linker.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2012-02-13 18:08:50 +0000
committerRichard Henderson <rth@redhat.com>2012-02-13 18:08:50 +0000
commit05906ac72f0f047472989a99dec1e66713157629 (patch)
tree72852afacbcafaa113e43e8c887d610ccb78659e /bfd/linker.c
parent970e3314a826406826bd4bc03cac445fdf8c5cf9 (diff)
downloadbinutils-redhat-05906ac72f0f047472989a99dec1e66713157629.tar.gz
PR ld/13621
bfd/ * linker.c (fix_syms): Force symbols outside any section into bfd_abs_section_ptr. ld/testsuite/ * ld-elf/warn2.d: Expect ABS section for Foo. * ld-elf/zerosize1.d, zerosize1.s: New test.
Diffstat (limited to 'bfd/linker.c')
-rw-r--r--bfd/linker.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bfd/linker.c b/bfd/linker.c
index c51c5df93b..04044743f2 100644
--- a/bfd/linker.c
+++ b/bfd/linker.c
@@ -3208,6 +3208,12 @@ fix_syms (struct bfd_link_hash_entry *h, void *data)
op = op1;
}
+ /* Refuse to choose a section for which we are out of bounds. */
+ /* ??? This may make most of the above moot. */
+ if (h->u.def.value < op->vma
+ || h->u.def.value > op->vma + op->size)
+ op = bfd_abs_section_ptr;
+
h->u.def.value -= op->vma;
h->u.def.section = op;
}