Move the text section to the start of the output file, so that when you

create a stripped .bin file from it the entry point is the first byte of
the file.  (Will allow "load $addr $file ; go $addr" in u-boot.)
This commit is contained in:
ian 2015-05-08 19:43:53 +00:00
parent 0bf260e595
commit f872d0ea6f

View File

@ -6,6 +6,15 @@ SECTIONS
{ {
/* Read-only sections, merged into text segment: */ /* Read-only sections, merged into text segment: */
. = UBLDR_LOADADDR + SIZEOF_HEADERS; . = UBLDR_LOADADDR + SIZEOF_HEADERS;
.text :
{
*(.text)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.gnu.linkonce.t*)
} =0
_etext = .;
PROVIDE (etext = .);
.interp : { *(.interp) } .interp : { *(.interp) }
.hash : { *(.hash) } .hash : { *(.hash) }
.dynsym : { *(.dynsym) } .dynsym : { *(.dynsym) }
@ -32,15 +41,6 @@ SECTIONS
.rela.sbss : { *(.rela.sbss) } .rela.sbss : { *(.rela.sbss) }
.rela.sdata2 : { *(.rela.sdata2) } .rela.sdata2 : { *(.rela.sdata2) }
.rela.sbss2 : { *(.rela.sbss2) } .rela.sbss2 : { *(.rela.sbss2) }
.text :
{
*(.text)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.gnu.linkonce.t*)
} =0
_etext = .;
PROVIDE (etext = .);
.init : { *(.init) } =0 .init : { *(.init) } =0
.fini : { *(.fini) } =0 .fini : { *(.fini) } =0
.rodata : { *(.rodata) *(.gnu.linkonce.r*) } .rodata : { *(.rodata) *(.gnu.linkonce.r*) }