This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Ignore symbols defined in SHF_EXCLUDE sections
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Alan Modra <amodra at gmail dot com>, Nick Clifton <nickc at redhat dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 2 Sep 2016 08:00:11 -0700
- Subject: Re: Ignore symbols defined in SHF_EXCLUDE sections
- Authentication-results: sourceware.org; auth=none
- References: <20160831095618.GO3677@bubble.grove.modra.org> <CAMe9rOoo21CfLroYMdwQpP7ZVEhV97hYAJemf0OSw19gEGJkzQ@mail.gmail.com>
On Thu, Sep 1, 2016 at 12:06 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> 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.
I checked in this to limit pr20513c/pr20513d to Linux and GNU targets.
--
H.J.
---
diff --git a/ld/ChangeLog b/ld/ChangeLog
index e7b9bab..8ef9e51 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,9 @@
+2016-09-02 H.J. Lu <hongjiu.lu@intel.com>
+
+ * testsuite/ld-elf/pr20513c.d: Limit to *-*-linux* and *-*-gnu*
+ targets.
+ * testsuite/ld-elf/pr20513d.d: Likewise.
+
2016-09-01 H.J. Lu <hongjiu.lu@intel.com>
PR ld/20513
diff --git a/ld/testsuite/ld-elf/pr20513c.d b/ld/testsuite/ld-elf/pr20513c.d
index 6a019ef..ab9b360 100644
--- a/ld/testsuite/ld-elf/pr20513c.d
+++ b/ld/testsuite/ld-elf/pr20513c.d
@@ -2,6 +2,7 @@
#source: pr20513b.s
#ld: -shared
#readelf: -S --wide
+#target: *-*-linux* *-*-gnu*
#failif
#...
diff --git a/ld/testsuite/ld-elf/pr20513d.d b/ld/testsuite/ld-elf/pr20513d.d
index 9b7199f..d1700a7 100644
--- a/ld/testsuite/ld-elf/pr20513d.d
+++ b/ld/testsuite/ld-elf/pr20513d.d
@@ -2,6 +2,7 @@
#source: pr20513a.s
#ld: -shared
#readelf: -S --wide
+#target: *-*-linux* *-*-gnu*
#failif
#...