From a2e098c378a96e7d7760aa52c1b49680c67674be Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 22 Nov 2019 13:24:58 +0000 Subject: [PATCH] Update the linker documentation regarding the /DISCARD/ linker script section and its interaction with ELF section groups. * ld.texi (Output Section Discarding): Add note indicating that /DISCARD/ed sections ignore ELF section grouping. --- ld/ChangeLog | 5 +++++ ld/ld.texi | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ld/ChangeLog b/ld/ChangeLog index 43d858b5f5c..6498fb0e7ec 100644 --- a/ld/ChangeLog +++ b/ld/ChangeLog @@ -1,3 +1,8 @@ +2019-11-22 Nick Clifton + + * ld.texi (Output Section Discarding): Add note indicating that + /DISCARD/ed sections ignore ELF section grouping. + 2019-11-22 Nick Clifton * ldlang.h (LANG_FOR_EACH_INPUT_STATEMENT): Use cast instead of diff --git a/ld/ld.texi b/ld/ld.texi index 3b2d05411f4..ed538fbfe2b 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 -- 2.30.2