aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/s390/boot/vmlinux.lds.S16
-rw-r--r--arch/s390/kernel/vmlinux.lds.S16
2 files changed, 32 insertions, 0 deletions
diff --git a/arch/s390/boot/vmlinux.lds.S b/arch/s390/boot/vmlinux.lds.S
index 389df0e0d9e5..cb4e95c691ae 100644
--- a/arch/s390/boot/vmlinux.lds.S
+++ b/arch/s390/boot/vmlinux.lds.S
@@ -39,6 +39,9 @@ SECTIONS
*(.rodata.*)
_erodata = . ;
}
+ .got : {
+ *(.got)
+ }
NOTES
.data : {
_data = . ;
@@ -118,6 +121,19 @@ SECTIONS
}
_end = .;
+ /*
+ * Sections that should stay zero sized, which is safer to
+ * explicitly check instead of blindly discarding.
+ */
+ .got.plt : {
+ *(.got.plt)
+ }
+ ASSERT(SIZEOF(.got.plt) == 0, "Unexpected GOT/PLT entries detected!")
+ .plt : {
+ *(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt)
+ }
+ ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
+
/* Sections to be discarded */
/DISCARD/ : {
*(.eh_frame)
diff --git a/arch/s390/kernel/vmlinux.lds.S b/arch/s390/kernel/vmlinux.lds.S
index d231a3faf981..725e3122c214 100644
--- a/arch/s390/kernel/vmlinux.lds.S
+++ b/arch/s390/kernel/vmlinux.lds.S
@@ -62,6 +62,9 @@ SECTIONS
.data.rel.ro : {
*(.data.rel.ro .data.rel.ro.*)
}
+ .got : {
+ *(.got)
+ }
. = ALIGN(PAGE_SIZE);
_sdata = .; /* Start of data section */
@@ -241,6 +244,19 @@ SECTIONS
DWARF_DEBUG
ELF_DETAILS
+ /*
+ * Sections that should stay zero sized, which is safer to
+ * explicitly check instead of blindly discarding.
+ */
+ .got.plt : {
+ *(.got.plt)
+ }
+ ASSERT(SIZEOF(.got.plt) == 0, "Unexpected GOT/PLT entries detected!")
+ .plt : {
+ *(.plt) *(.plt.*) *(.iplt) *(.igot .igot.plt)
+ }
+ ASSERT(SIZEOF(.plt) == 0, "Unexpected run-time procedure linkages detected!")
+
/* Sections to be discarded */
DISCARDS
/DISCARD/ : {