[haiku-commits] r40937 - haiku/trunk/src/system/ldscripts/arm

  • From: ithamar.adema@xxxxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 14 Mar 2011 00:17:30 +0100 (CET)

Author: ithamar
Date: 2011-03-14 00:17:29 +0100 (Mon, 14 Mar 2011)
New Revision: 40937
Changeset: http://dev.haiku-os.org/changeset/40937

Modified:
   haiku/trunk/src/system/ldscripts/arm/kernel.ld
Log:
Fix aligment of data segment, by moving our ARM ldscript closer to the X86 one. 
This restores
the state of the ARM port to booting all the way up to the idle thread again.

However, will still need to investigate why we need the PHDRS magic, likely due 
to improper
setup of the ARM toolchain. If anyone has ideas, please let me know!



Modified: haiku/trunk/src/system/ldscripts/arm/kernel.ld
===================================================================
--- haiku/trunk/src/system/ldscripts/arm/kernel.ld      2011-03-13 21:20:53 UTC 
(rev 40936)
+++ haiku/trunk/src/system/ldscripts/arm/kernel.ld      2011-03-13 23:17:29 UTC 
(rev 40937)
@@ -1,8 +1,6 @@
 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
 
-ENTRY(_start)
-
 /* XXX: this shouldn't be needed to make kernel_arm have separate text and 
data segments!!! */
 PHDRS
 {
@@ -11,6 +9,9 @@
        data PT_LOAD ;
        dynamic PT_DYNAMIC ;
 }
+
+ENTRY(_start)
+SEARCH_DIR("libgcc");
 SECTIONS
 {
        . = 0x80000000 + SIZEOF_HEADERS;
@@ -43,36 +44,21 @@
        .plt : { *(.plt) }
 
        /* text/read-only data */
-       .text : { *(.text .text.* .glue_7* .gnu.linkonce.t.*) } :text =0x9090
+       .text : { *(.text .gnu.linkonce.t.*) } :text =0x9090
 
-       .rodata : { 
-               *(.rodata .rodata.* .gnu.linkonce.r.*)
-               . = ALIGN(4);
-               __commands_start = .;
-               KEEP (*(.commands))
-               __commands_end = .;
-               . = ALIGN(4);
-               __apps_start = .;
-               KEEP (*(.apps))
-               __apps_end = .;
-               . = ALIGN(4); 
-               __rodata_end = . ;              
-       }
+       .rodata : { *(.rodata) }
 
        /* exception unwinding - should really not be needed! XXX: find the 
correct place. */
        __exidx_start = .;
        .ARM.exidx   : { *(.ARM.exidx* .gnu.linkonce.armexidx.*) }
        __exidx_end = .;
 
-
-       .dynamic : { *(.dynamic) } :dynamic :data
-
-
        /* writable data  */
-       __data_start_rom = .;   /* in one segment binaries, the rom data 
address is on top of the ram data address */
+       . = ALIGN(0x1000);
        __data_start = .;
-       .data : SUBALIGN(4) { *(.data .data.* .gnu.linkonce.d.*) } :data
+       .data : { *(.data .gnu.linkonce.d.*) } :data
 
+       . = ALIGN(0x4);
        __ctor_list = .;
        .ctors : { *(.ctors) }
        __ctor_end = .;
@@ -80,20 +66,15 @@
        .dtors : { *(.dtors) }
        __dtor_end = .;
        .got : { *(.got.plt) *(.got) }
+       .dynamic : { *(.dynamic) } :dynamic :data
 
-       __data_end = .;
-
        /* uninitialized data (in same segment as writable data) */
-       . = ALIGN(4);
        __bss_start = .;
-       .bss : { *(.bss .bss.*) }
+       .bss : { *(.bss) }
 
-       . = ALIGN(4); 
+       . = ALIGN(0x1000);
        _end = .;
 
-/*     . =  0x80000000 + %MEMSIZE%; */
-       _end_of_ram = .;
-
        /* Strip unnecessary stuff */
        /DISCARD/ : { *(.comment .note .eh_frame) }
 }


Other related posts:

  • » [haiku-commits] r40937 - haiku/trunk/src/system/ldscripts/arm - ithamar . adema