[committed, PATCH] Check SEC_ALLOC before allocating dynamic relocation
Alan Modra
amodra@gmail.com
Thu Jun 16 02:24:00 GMT 2016
On Wed, Jun 15, 2016 at 06:44:22PM -0700, H.J. Lu wrote:
> * elf32-i386.c (elf_i386_check_relocs): Check SEC_ALLOC before
> allocating dynamic relocation.
> * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
Why stop at .rela.dyn relocs? Should references in non-alloc sections
create plt or got entries? Or anything else that check_relocs does?
See the start of elf64-ppc.c check_relocs.
if (bfd_link_relocatable (info))
return TRUE;
/* Don't do anything special with non-loaded, non-alloced sections.
In particular, any relocs in such sections should not affect GOT
and PLT reference counting (ie. we don't allow them to create GOT
or PLT entries), there's no possibility or desire to optimize TLS
relocs, and there's not much point in propagating relocs to shared
libs that the dynamic linker won't relocate. */
if ((sec->flags & SEC_ALLOC) == 0)
return TRUE;
--
Alan Modra
Australia Development Lab, IBM
More information about the Binutils
mailing list