diff --git a/core/armelf.x b/core/armelf.x index d38dc1d..13f4916 100644 --- a/core/armelf.x +++ b/core/armelf.x @@ -10,7 +10,7 @@ SECTIONS { /* Read-only sections, merged into text segment: */ /* PROVIDE (__executable_start = 0x8000); . = 0x8000; */ -. = 0x8000 + SIZEOF_HEADERS; +. = SEGMENT_START("text-segment", 0x8000); .interp : { *(.interp) } .hash : { *(.hash) } .dynsym : { *(.dynsym) } @@ -77,7 +77,7 @@ SECTIONS .gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } /* Adjust the address for the data segment. We want to align at exactly a page boundary to make life easier for apriori. */ - . = ALIGN(4096); + . = ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)); /* Exception handling */ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } diff --git a/core/armelf.xsc b/core/armelf.xsc index 9fac3d2..8ead73d 100644 --- a/core/armelf.xsc +++ b/core/armelf.xsc @@ -6,7 +6,7 @@ ENTRY(_start) SECTIONS { /* Read-only sections, merged into text segment: */ - . = 0 + SIZEOF_HEADERS; + . = SEGMENT_START("text-segment", 0) + SIZEOF_HEADERS; .hash : { *(.hash) } .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } @@ -77,7 +77,7 @@ SECTIONS .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } /* Adjust the address for the data segment. We want to align at exactly a page boundary to make life easier for apriori. */ - . = ALIGN(4096); + . = ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)); /* Exception handling */ .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }