Merge branch 'master' of git://1984.lsi.us.es/nf-next
[firefly-linux-kernel-4.4.55.git] / arch / mips / kernel / vmlinux.lds.S
index df243a64f4305305564ec1e1e5b7f68c4c6e55ad..007ccbe1e26474a6788ef61ee046e226c480d877 100644 (file)
@@ -1,6 +1,13 @@
 #include <asm/asm-offsets.h>
 #include <asm/page.h>
 #include <asm/thread_info.h>
+
+/*
+ * Put .bss..swapper_pg_dir as the first thing in .bss. This will
+ * ensure that it has .bss alignment (64K).
+ */
+#define BSS_FIRST_SECTIONS *(.bss..swapper_pg_dir)
+
 #include <asm-generic/vmlinux.lds.h>
 
 #undef mips
@@ -119,11 +126,21 @@ SECTIONS
        }
 
        PERCPU_SECTION(1 << CONFIG_MIPS_L1_CACHE_SHIFT)
-       . = ALIGN(PAGE_SIZE);
+       /*
+        * Align to 64K in attempt to eliminate holes before the
+        * .bss..swapper_pg_dir section at the start of .bss.  This
+        * also satisfies PAGE_SIZE alignment as the largest page size
+        * allowed is 64K.
+        */
+       . = ALIGN(0x10000);
        __init_end = .;
        /* freed after init ends here */
 
-       BSS_SECTION(0, 0, 0)
+       /*
+        * Force .bss to 64K alignment so that .bss..swapper_pg_dir
+        * gets that alignment.  .sbss should be empty, so there will be
+        * no holes after __init_end. */
+       BSS_SECTION(0, 0x10000, 0)
 
        _end = . ;