This is the mail archive of the
mailing list for the binutils project.
Re: [committed, PATCH] Check SEC_ALLOC before allocating dynamic relocation
- From: Alan Modra <amodra at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: binutils at sourceware dot org
- Date: Thu, 16 Jun 2016 11:53:59 +0930
- Subject: Re: [committed, PATCH] Check SEC_ALLOC before allocating dynamic relocation
- Authentication-results: sourceware.org; auth=none
- References: <20160616014422 dot GA17309 at intel dot com>
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))
/* 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)
Australia Development Lab, IBM