arm: Discard unwanted sections in linker script

There are a handful of sections that are not useful in the U-Boot output
binary. At present, the linker script moves these to the end of the
binary, after the _image_binary_end marker symbol, so that they don't
get loaded.

The linker script syntax supports discarding sections that shouldn't be
included in the output. Switch to this instead, to make the intention
clearer and reduce the ELF sections that have to be handled later in the
build. This is also consistent with the other architectures' linker
scripts.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
This commit is contained in:
Sam Edwards 2025-03-15 15:18:03 -07:00 committed by Tom Rini
parent deba40dd0b
commit 16448c443c

View file

@ -181,14 +181,14 @@ SECTIONS
__bss_end = .; __bss_end = .;
} }
.dynsym _image_binary_end : { *(.dynsym) } /DISCARD/ : { *(.dynsym) }
.dynbss : { *(.dynbss) } /DISCARD/ : { *(.dynbss) }
.dynstr : { *(.dynstr*) } /DISCARD/ : { *(.dynstr*) }
.dynamic : { *(.dynamic*) } /DISCARD/ : { *(.dynamic*) }
.plt : { *(.plt*) } /DISCARD/ : { *(.plt*) }
.interp : { *(.interp*) } /DISCARD/ : { *(.interp*) }
.gnu.hash : { *(.gnu.hash) } /DISCARD/ : { *(.gnu.hash) }
.gnu : { *(.gnu*) } /DISCARD/ : { *(.gnu*) }
.ARM.exidx : { *(.ARM.exidx*) } /DISCARD/ : { *(.ARM.exidx*) }
.gnu.linkonce.armexidx : { *(.gnu.linkonce.armexidx.*) } /DISCARD/ : { *(.gnu.linkonce.armexidx.*) }
} }