s390: vmlinux.lds.S: explicitly handle '.got' and '.plt' sections
[sfrench/cifs-2.6.git] / arch / s390 / kernel / vmlinux.lds.S
index d231a3faf9818d2bcc3475317ab51b219b6b13eb..725e3122c2143f344521b2d47183999ff8fd6d2a 100644 (file)
@@ -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/ : {