sparc: split the kernel into separate data and exec regions
This is what our bootloader expects. For some reason, ld does this by default on x86, but not on other platforms. So, define the headers ourselves. Change-Id: I4b37938e7e6d48b19c8af68cf4a77193269335d4 Reviewed-on: https://review.haiku-os.org/c/haiku/+/3569 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
@@ -2,11 +2,20 @@ OUTPUT_FORMAT("elf64-sparc")
|
||||
OUTPUT_ARCH(sparc:v9)
|
||||
|
||||
ENTRY(_start)
|
||||
|
||||
PHDRS
|
||||
{
|
||||
headers PT_PHDR PHDRS ;
|
||||
text PT_LOAD FILEHDR PHDRS ;
|
||||
data PT_LOAD ;
|
||||
dynamic PT_DYNAMIC ;
|
||||
}
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
. = 0xFFFFFFFF80000000 + SIZEOF_HEADERS;
|
||||
|
||||
.interp : { *(.interp) }
|
||||
.interp : { *(.interp) } : text
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
.dynstr : { *(.dynstr) }
|
||||
@@ -24,19 +33,19 @@ SECTIONS
|
||||
.plt : { *(.plt) }
|
||||
|
||||
/* text/read-only data */
|
||||
.text : { *(.text .text.* .gnu.linkonce.t.*) } =0x90909090
|
||||
.text : { *(.text .text.* .gnu.linkonce.t.*) } :text =0x90909090
|
||||
|
||||
.rodata : { *(.rodata) }
|
||||
.rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
|
||||
|
||||
. = ALIGN(0x8);
|
||||
altcodepatch_begin = .;
|
||||
.altcodepatch : { *(.altcodepatch) }
|
||||
altcodepatch_end = .;
|
||||
|
||||
/* writable data */
|
||||
. = ALIGN(0x1000);
|
||||
/* writable data */
|
||||
. = ALIGN (0x1000);
|
||||
__data_start = .;
|
||||
.data : { *(.data .gnu.linkonce.d.*) }
|
||||
.data : { *(.data .data.* .gnu.linkonce.d.*) } :data
|
||||
|
||||
. = ALIGN(0x4);
|
||||
__ctor_list = .;
|
||||
@@ -46,11 +55,11 @@ SECTIONS
|
||||
.dtors : { *(.dtors) }
|
||||
__dtor_end = .;
|
||||
.got : { *(.got.plt) *(.got) }
|
||||
.dynamic : { *(.dynamic) }
|
||||
.dynamic : { *(.dynamic) } :dynamic :data
|
||||
|
||||
/* uninitialized data (in same segment as writable data) */
|
||||
__bss_start = .;
|
||||
.bss : { *(.bss) }
|
||||
.bss : { *(.bss .bss.* .gnu.linkonce.b.*) } :data
|
||||
|
||||
. = ALIGN(0x1000);
|
||||
_end = . ;
|
||||
|
||||
Reference in New Issue
Block a user