Ignore symbols defined in SHF_EXCLUDE sections
H.J. Lu
hjl.tools@gmail.com
Thu Sep 1 19:06:00 GMT 2016
On Wed, Aug 31, 2016 at 2:56 AM, Alan Modra <amodra@gmail.com> wrote:
> PR 20513
> * ldlang.c (section_already_linked): Deal with SHF_EXCLUDE sections.
>
> diff --git a/ld/ldlang.c b/ld/ldlang.c
> index aee8720..07c2182 100644
> --- a/ld/ldlang.c
> +++ b/ld/ldlang.c
> @@ -2294,6 +2294,12 @@ section_already_linked (bfd *abfd, asection *sec, void *data)
> return;
> }
>
> + /* Deal with SHF_EXCLUDE ELF sections. */
> + if (!bfd_link_relocatable (&link_info)
> + && (abfd->flags & BFD_PLUGIN) == 0
> + && (sec->flags & (SEC_GROUP | SEC_KEEP | SEC_EXCLUDE)) == SEC_EXCLUDE)
> + sec->output_section = bfd_abs_section_ptr;
> +
> if (!(abfd->flags & DYNAMIC))
> bfd_section_already_linked (abfd, sec, &link_info);
> }
>
I checked in this patch to add some tests.
--
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-tests-for-PR-ld-20513.patch
Type: text/x-patch
Size: 4102 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20160901/e677fa97/attachment.bin>
More information about the Binutils
mailing list