linker script, /DISCARD/ section and SHT_GROUP
Nick Clifton
nickc@redhat.com
Thu Nov 21 15:49:00 GMT 2019
Hi Fanguri, Hi Alan,
OK, so what do you think of this small patch which just updates
the linker documentation:
diff --git a/ld/ld.texi b/ld/ld.texi
index 3b2d05411f..ed538fbfe2 100644
--- a/ld/ld.texi
+++ b/ld/ld.texi
@@ -4994,6 +4994,11 @@ The special output section name @samp{/DISCARD/} may be used to discard
input sections. Any input sections which are assigned to an output
section named @samp{/DISCARD/} are not included in the output file.
+Note, sections that match the @samp{/DISCARD/} output section will be
+discarded even if they are in an ELF section group which has other
+members which are not being discarded. This is deliberate.
+Discarding takes precedence over grouping.
+
@node Output Section Attributes
@subsection Output Section Attributes
@cindex output section attributes
> Now that we started to discuss garbage collection. Please allow me to
> start a related topic about SHF_LINK_ORDER, see
> https://sourceware.org/ml/binutils/2019-11/msg00266.html
Yes, this is on my list, although I was hoping that somebody else would
take the lead on it. I will try to find some tine for it next week.
Cheers
Nick
More information about the Binutils
mailing list