diff mbox series

[RFC,06/10] arm: discard .gnu.version* sections

Message ID 20230520205547.1009254-7-CFSworks@gmail.com
State RFC
Delegated to: Tom Rini
Headers show
Series Improve ARM target's support for LLVM toolchain | expand

Commit Message

Sam Edwards May 20, 2023, 8:55 p.m. UTC
These are often a consequence of --pie, but they aren't actually
used in the runtime relocation code. It is better to discard them
than to aggregate them, because they tend to be of different types,
and this upsets some linkers (e.g. LLD).

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
---

 arch/arm/cpu/u-boot.lds | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/arch/arm/cpu/u-boot.lds b/arch/arm/cpu/u-boot.lds
index fc4f63d834..8cdf08a730 100644
--- a/arch/arm/cpu/u-boot.lds
+++ b/arch/arm/cpu/u-boot.lds
@@ -229,6 +229,12 @@  SECTIONS
 		KEEP(*(.__bss_end));
 	}
 
+	/*
+	 * LLD's --pie may synthesize these sections, even if they are empty;
+	 * discard them, for we do not need version symbols
+	 */
+	/DISCARD/ : { *(.gnu.version*) }
+
 	.dynsym _image_binary_end : { *(.dynsym) }
 	.dynbss : { *(.dynbss) }
 	.dynstr : { *(.dynstr*) }