diff mbox series

[4/7] ARM: io-acorn: fix LTO linking without CONFIG_PRINTK

Message ID 20180220215954.4092811-5-arnd@arndb.de
State New
Headers show
Series ARM: hacks for link-time optimization | expand

Commit Message

Arnd Bergmann Feb. 20, 2018, 9:59 p.m. UTC
When CONFIG_LTO is enabled, we get a link error for this file
that contains a reference to printk():

arch/arm/lib/io-acorn.o: In function `outsl':
(.text+0x38): undefined reference to `printk'

Normally the file is simply dropped, but that doesn't happen
with LTO. Making the reference conditional helps, but perhaps
a better fix would be to make sure the LTO linker drops the
entire file in the same way that we normally do.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 arch/arm/lib/io-acorn.S | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.9.0
diff mbox series

Patch

diff --git a/arch/arm/lib/io-acorn.S b/arch/arm/lib/io-acorn.S
index 69719bad674d..3522a899460b 100644
--- a/arch/arm/lib/io-acorn.S
+++ b/arch/arm/lib/io-acorn.S
@@ -27,6 +27,10 @@ 
  */
 ENTRY(insl)
 ENTRY(outsl)
+#ifdef CONFIG_PRINTK
 		adr	r0, .Liosl_warning
 		mov	r1, lr
 		b	printk
+#else
+		ret	lr
+#endif