diff options
author | Richard Henderson <rth@redhat.com> | 2012-02-13 18:08:51 +0000 |
---|---|---|
committer | Richard Henderson <rth@redhat.com> | 2012-02-13 18:08:51 +0000 |
commit | e1741a1ed122cb64e0d4fb6aa936574763de0d4c (patch) | |
tree | a5ceec8ce44d58c2d3bac7212b9810d9c5d8f8c9 /bfd | |
parent | cec7aa6aca5ff815b52fbd29b99bfe191a6abf7b (diff) | |
download | gdb-e1741a1ed122cb64e0d4fb6aa936574763de0d4c.zip gdb-e1741a1ed122cb64e0d4fb6aa936574763de0d4c.tar.gz gdb-e1741a1ed122cb64e0d4fb6aa936574763de0d4c.tar.bz2 |
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')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/linker.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 490120b..0a53fad 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2012-02-13 Richard Henderson <rth@redhat.com> + + PR ld/13621 + * linker.c (fix_syms): Force symbols outside any section into + bfd_abs_section_ptr. + 2012-02-13 Alan Modra <amodra@gmail.com> * elf32-m68hc1x.c (elf32_m68hc11_merge_symbol_attribute): New function. diff --git a/bfd/linker.c b/bfd/linker.c index c51c5df..0404474 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; } |