Skip to contentSkip to conversation

powerpc: Discard .rela* sections if CONFIG_RELOCATABLE is undefined

PATCH In review H.J. Lu 2 participants 2 messages Apr 27, 2020 – Apr 28, 2020 PowerPC

lore
Share & tools
lore

H.J. Lu

author
#0 lore raw

PATCH 1/1 powerpc: Discard .rela* sections if CONFIG_RELOCATABLE is undefined

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.

---
 arch/powerpc/kernel/vmlinux.lds.S | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/powerpc/kernel/vmlinux.lds.S +4 -1
index 31a0f201fb6f..4ba07734a210 100644
@@ -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
 	}
 }
Signature · 1 line
2.25.4
#1 lore raw
Quoted 11 lines · H.J. Lu

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

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

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

---
 arch/powerpc/kernel/vmlinux.lds.S | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Please insert this patch into your series prior to the patch that caused the build break.

cheers

Quoted 20 lines
arch/powerpc/kernel/vmlinux.lds.S +4 -1
index 31a0f201fb6f..4ba07734a210 100644
@@ -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
 	}
 }
Signature · 1 line
2.25.4