diff --git a/sys/conf/ldscript.powerpc64 b/sys/conf/ldscript.powerpc64 index 866bc05e622..969281222a7 100644 --- a/sys/conf/ldscript.powerpc64 +++ b/sys/conf/ldscript.powerpc64 @@ -6,12 +6,20 @@ OUTPUT_ARCH(powerpc:common64) ENTRY(__start) SEARCH_DIR(/usr/lib); PROVIDE (__stack = 0); -SECTIONS + +/* For loading, we use a simplified ELF structure using a single PT_LOAD section. */ +PHDRS { + /* Kernel segment contains kernel and data. The actual protections will be applied later. */ + text PT_LOAD ; + dynamic PT_DYNAMIC ; +} +SECTIONS +{ /* Low-address wrapper for bootloaders (kexec/kboot) that can't parse ELF */ . = kernbase - 0x100; - .kboot : { *(.text.kboot) } + .kboot : { *(.text.kboot) } :text /* Read-only sections, merged into text segment: */ . = kernbase; @@ -29,7 +37,6 @@ SECTIONS PROVIDE (etext = .); /* Do not emit PT_INTERP section, which confuses some loaders (kexec-lite) */ - .interpX : { *(.interp) } : NONE /DISCARD/ : { *(.interp) } /* Also delete notes */ @@ -95,7 +102,7 @@ SECTIONS . = ALIGN(4096); .got : ALIGN(8) { __tocbase = .; *(.got .toc) } - .dynamic : { *(.dynamic) } + .dynamic : { *(.dynamic) } :text :dynamic /* Put .ctors and .dtors next to the .got2 section, so that the pointers get relocated with -mrelocatable. Also put in the .fixup pointers. The current compiler no longer needs this, but keep it around for 2.7.2 */