arm64: use generic RW_DATA_SECTION macro in linker script
authorMark Salter <msalter@redhat.com>
Mon, 4 Nov 2013 16:38:47 +0000 (16:38 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Mon, 4 Nov 2013 18:17:25 +0000 (18:17 +0000)
The .data section in the arm64 linker script currently lacks a
definition for page-aligned data. This leads to a .page_aligned
section being placed between the end of data and start of bss.
This patch corrects that by using the generic RW_DATA_SECTION
macro which includes support for page-aligned data.

Signed-off-by: Mark Salter <msalter@redhat.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/vmlinux.lds.S

index 991ffddf49dfa2df60695ab97d04d731a628858d..5161ad9920910038d710bbf54815503c01b68494 100644 (file)
@@ -96,30 +96,13 @@ SECTIONS
        PERCPU_SECTION(64)
 
        __init_end = .;
-       . = ALIGN(THREAD_SIZE);
-       __data_loc = .;
-
-       .data : AT(__data_loc) {
-               _data = .;              /* address in memory */
-               _sdata = .;
-
-               /*
-                * first, the init task union, aligned
-                * to an 8192 byte boundary.
-                */
-               INIT_TASK_DATA(THREAD_SIZE)
-               NOSAVE_DATA
-               CACHELINE_ALIGNED_DATA(64)
-               READ_MOSTLY_DATA(64)
-
-               /*
-                * and the usual data section
-                */
-               DATA_DATA
-               CONSTRUCTORS
-
-               _edata = .;
-       }
+
+       . = ALIGN(PAGE_SIZE);
+       _data = .;
+       __data_loc = _data - LOAD_OFFSET;
+       _sdata = .;
+       RW_DATA_SECTION(64, PAGE_SIZE, THREAD_SIZE)
+       _edata = .;
        _edata_loc = __data_loc + SIZEOF(.data);
 
        BSS_SECTION(0, 0, 0)