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.
This commit is contained in:
Richard Henderson 2012-02-13 18:08:51 +00:00
parent cec7aa6aca
commit e1741a1ed1
4 changed files with 19 additions and 1 deletions

View file

@ -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;
}