From 3c5029f112eaf5a68dabdd7e76c773b6e2d5abcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 21 Jul 2008 00:36:31 +0000 Subject: [PATCH] Turned out the generated kernel_m68k had a single PT_LOAD segment (RWE) instead of separate text and data like every other single binary, and everything on other platforms. This works around it by forcing sections to separate headers. It's still beyong me why I have to do this here, ld should do it on its own. Anyone has a clue ? git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26536 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/ldscripts/m68k/kernel.ld | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/system/ldscripts/m68k/kernel.ld b/src/system/ldscripts/m68k/kernel.ld index 4fc697ded7..89a281f2a9 100644 --- a/src/system/ldscripts/m68k/kernel.ld +++ b/src/system/ldscripts/m68k/kernel.ld @@ -3,11 +3,19 @@ OUTPUT_ARCH(m68k) ENTRY(_start) SEARCH_DIR("libgcc"); +/* XXX: this shouldn't be needed to make kernel_m68k have separate text and data segments!!! */ +PHDRS +{ + headers PT_PHDR PHDRS ; + text PT_LOAD FILEHDR PHDRS ; + data PT_LOAD ; + dynamic PT_DYNAMIC ; +} SECTIONS { . = 0x80000000 + SIZEOF_HEADERS; - .interp : { *(.interp) } + .interp : { *(.interp) } :text .hash : { *(.hash) } .dynsym : { *(.dynsym) } .dynstr : { *(.dynstr) } @@ -35,14 +43,14 @@ SECTIONS .plt : { *(.plt) } /* text/read-only data */ - .text : { *(.text .gnu.linkonce.t.*) } =0x9090 + .text : { *(.text .gnu.linkonce.t.*) } :text =0x9090 .rodata : { *(.rodata) } /* writable data */ . = ALIGN(0x1000); __data_start = .; - .data : { *(.data .gnu.linkonce.d.*) } + .data : { *(.data .gnu.linkonce.d.*) } :data . = ALIGN(0x4); __ctor_list = .;