@@ -59,6 +59,7 @@
#define RO_EXCEPTION_TABLE_ALIGN 4
#define RUNTIME_DISCARD_EXIT
+#define LOAD_OFFSET KIMAGE_VADDR
#include <asm-generic/vmlinux.lds.h>
#include <asm/cache.h>
@@ -70,7 +71,9 @@
#include "image.h"
OUTPUT_ARCH(aarch64)
-ENTRY(_text)
+ENTRY(elf_entry)
+
+elf_entry = ABSOLUTE(primary_entry - KIMAGE_VADDR);
jiffies = jiffies_64;
@@ -150,6 +153,11 @@ PECOFF_FILE_ALIGNMENT = 0x200;
#define PECOFF_EDATA_PADDING
#endif
+PHDRS {
+ text PT_LOAD FLAGS(5); /* R_X */
+ data PT_LOAD FLAGS(6); /* RW_ */
+}
+
SECTIONS
{
/*
@@ -166,10 +174,10 @@ SECTIONS
. = KIMAGE_VADDR;
- .head.text : {
+ .head.text : AT (0x0) {
_text = .;
HEAD_TEXT
- }
+ } :text
.text : ALIGN(SEGMENT_ALIGN) { /* Real text segment */
_stext = .; /* Text and read-only data */
IRQENTRY_TEXT
@@ -248,10 +256,6 @@ SECTIONS
__inittext_end = .;
__initdata_begin = .;
- init_idmap_pg_dir = .;
- . += INIT_IDMAP_DIR_SIZE;
- init_idmap_pg_end = .;
-
.init.data : {
INIT_DATA
INIT_SETUP(16)
@@ -259,13 +263,18 @@ SECTIONS
CON_INITCALL
INIT_RAM_FS
*(.init.altinstructions .init.bss) /* from the EFI stub */
- }
+ } :data
.exit.data : {
EXIT_DATA
}
RUNTIME_CONST_VARIABLES
+ . = ALIGN(PAGE_SIZE);
+ init_idmap_pg_dir = .;
+ . += INIT_IDMAP_DIR_SIZE;
+ init_idmap_pg_end = .;
+
PERCPU_SECTION(L1_CACHE_BYTES)
HYPERVISOR_PERCPU_SECTION
@@ -325,10 +334,12 @@ SECTIONS
init_pg_end = .;
/* end of zero-init region */
- . += SZ_4K; /* stack for the early C runtime */
- early_init_stack = .;
+ .early_init_stack : {
+ . += SZ_4K; /* stack for the early C runtime */
+ early_init_stack = .;
- . = ALIGN(SEGMENT_ALIGN);
+ . = ALIGN(SEGMENT_ALIGN);
+ }
__pecoff_data_size = ABSOLUTE(. - __initdata_begin);
_end = .;