linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] powerpc: Keep .rela* sections when CONFIG_RELOCATABLE is defined
@ 2020-04-28 13:21 H.J. Lu
  2020-04-28 13:21 ` [PATCH 2/2] Discard .note.gnu.property sections in generic NOTES H.J. Lu
  0 siblings, 1 reply; 8+ messages in thread
From: H.J. Lu @ 2020-04-28 13:21 UTC (permalink / raw)
  To: linux-kernel
  Cc: Yu-cheng Yu, Arnd Bergmann, linux-arch, Michael Ellerman,
	Benjamin Herrenschmidt, Paul Mackerras, Kees Cook,
	Borislav Petkov, Naveen N . Rao, linuxppc-dev

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

 #ifdef CONFIG_RELOCATABLE
 ...
        .rela.dyn : AT(ADDR(.rela.dyn) - LOAD_OFFSET)
        {
                __rela_dyn_start = .;
                *(.rela*)
        }
 #endif
 ...
        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,
don't discard .rela* sections if CONFIG_RELOCATABLE is defined.

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] 8+ messages in thread

end of thread, other threads:[~2022-09-19 17:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28 13:21 [PATCH 1/2] powerpc: Keep .rela* sections when CONFIG_RELOCATABLE is defined H.J. Lu
2020-04-28 13:21 ` [PATCH 2/2] Discard .note.gnu.property sections in generic NOTES H.J. Lu
2022-09-16 19:40   ` Omar Sandoval
2022-09-17  6:31     ` Christophe Leroy
2022-09-19 17:26       ` Omar Sandoval
2022-09-19 17:33         ` Mark Brown
2022-09-19 17:40           ` Omar Sandoval
2022-09-19 17:54             ` Mark Brown

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).