Skip to content
This repository was archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
[arm] fix problem with gcc 4.4 to ensure the boot code is in the binary
Browse files Browse the repository at this point in the history
seems that gcc 4.4 or the newer binutils likes to put linker generated
shims first in link order. Tweak the boot code to use a special section
that is ordered first by the linker script.

Conflicts:

	arch/arm/crt0.S

Change-Id: Ib38697ce3de375965f607fd17c56bfc16b7774e1
  • Loading branch information
Ajay Dudani committed Jul 28, 2011
1 parent 12403e3 commit c713ab8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion arch/arm/crt0.S
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define DSB .byte 0x4f, 0xf0, 0x7f, 0xf5
#define ISB .byte 0x6f, 0xf0, 0x7f, 0xf5

.text
.section ".text.boot"
.globl _start
_start:
b reset
Expand Down
7 changes: 4 additions & 3 deletions arch/arm/system-onesegment.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ SECTIONS
{
. = %MEMBASE%;

/* text/read-only data */
.text.boot : { *(.text.boot) }
.text : { *(.text .text.* .glue_7* .gnu.linkonce.t.*) } =0x9090

.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
Expand Down Expand Up @@ -33,9 +37,6 @@ SECTIONS
.init : { *(.init) } =0x9090
.plt : { *(.plt) }

/* text/read-only data */
.text : { *(.text .text.* .glue_7* .gnu.linkonce.t.*) } =0x9090

.rodata : {
*(.rodata .rodata.* .gnu.linkonce.r.*)
. = ALIGN(4);
Expand Down
7 changes: 4 additions & 3 deletions arch/arm/system-twosegment.ld
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ SECTIONS
{
. = %ROMBASE%;

/* text/read-only data */
.text.boot : { *(.text.boot) }
.text : { *(.text .text.* .glue_7* .gnu.linkonce.t.*) } =0x9090

.interp : { *(.interp) }
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
Expand Down Expand Up @@ -33,9 +37,6 @@ SECTIONS
.init : { *(.init) } =0x9090
.plt : { *(.plt) }

/* text/read-only data */
.text : { *(.text .text.* .glue_7* .gnu.linkonce.t.*) } =0x9090

.rodata : {
*(.rodata .rodata.* .gnu.linkonce.r.*)
. = ALIGN(4);
Expand Down

0 comments on commit c713ab8

Please sign in to comment.