linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc: Discard .rela* sections if CONFIG_RELOCATABLE is undefined
@ 2020-04-28  1:48 H.J. Lu
  2020-04-28  1:49 ` [PATCH 2/2] Discard .note.gnu.property sections in generic NOTES H.J. Lu
  2020-04-28  5:31 ` [PATCH 1/2] powerpc: Discard .rela* sections if CONFIG_RELOCATABLE is undefined Christophe Leroy
  0 siblings, 2 replies; 3+ messages in thread
From: H.J. Lu @ 2020-04-28  1:48 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-arch, Yu-cheng Yu, Kees Cook, Arnd Bergmann, Paul Mackerras,
	Naveen N . Rao, Borislav Petkov, linuxppc-dev

arch/powerpc/kernel/vmlinux.lds.S has

        DISCARDS
        /DISCARD/ : {
                *(*.EMB.apuinfo)
                *(.glink .iplt .plt .rela* .comment)
                *(.gnu.version*)
                *(.gnu.attributes)
                *(.eh_frame)
        }

Since .rela* sections are needed when CONFIG_RELOCATABLE is defined,
change to discard .rela* sections if CONFIG_RELOCATABLE is undefined.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
---
 arch/powerpc/kernel/vmlinux.lds.S | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
index 31a0f201fb6f..4ba07734a210 100644
--- a/arch/powerpc/kernel/vmlinux.lds.S
+++ b/arch/powerpc/kernel/vmlinux.lds.S
@@ -366,9 +366,12 @@ SECTIONS
 	DISCARDS
 	/DISCARD/ : {
 		*(*.EMB.apuinfo)
-		*(.glink .iplt .plt .rela* .comment)
+		*(.glink .iplt .plt .comment)
 		*(.gnu.version*)
 		*(.gnu.attributes)
 		*(.eh_frame)
+#ifndef CONFIG_RELOCATABLE
+		*(.rela*)
+#endif
 	}
 }
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-28  5:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-28  1:48 [PATCH 1/2] powerpc: Discard .rela* sections if CONFIG_RELOCATABLE is undefined H.J. Lu
2020-04-28  1:49 ` [PATCH 2/2] Discard .note.gnu.property sections in generic NOTES H.J. Lu
2020-04-28  5:31 ` [PATCH 1/2] powerpc: Discard .rela* sections if CONFIG_RELOCATABLE is undefined Christophe Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).