mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-21 15:07:03 +08:00
Now allows override of base address via -Ttext command to linker.
This commit is contained in:
@@ -12,12 +12,14 @@ ENTRY(_start)
|
||||
|
||||
PROVIDE(CPU_PPC_CLICKS_PER_MS = 16500);
|
||||
|
||||
/*
|
||||
MEMORY
|
||||
{
|
||||
VECTORS : ORIGIN = 0, LENGTH = 64K
|
||||
RAM : ORIGIN = 1M, LENGTH = 15M
|
||||
RAM : ORIGIN = 1M, LENGTH = 31M
|
||||
EPROM : ORIGIN = 0xFFF00000, LENGTH = 0x80000
|
||||
}
|
||||
*/
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
@@ -28,7 +30,6 @@ SECTIONS
|
||||
|
||||
/* Read-only sections, merged into text segment: */
|
||||
/* SDS ROM worked at 0x30000 */
|
||||
. = 0x100000;
|
||||
.interp : { *(.interp) }
|
||||
.hash : { *(.hash) }
|
||||
.dynsym : { *(.dynsym) }
|
||||
@@ -50,23 +51,26 @@ SECTIONS
|
||||
.rela.sdata2 : { *(.rela.sdata2) }
|
||||
.rela.sbss2 : { *(.rela.sbss2) }
|
||||
.plt : { *(.plt) }
|
||||
.text :
|
||||
.text 0x100000:
|
||||
{
|
||||
|
||||
*(.text)
|
||||
*(.gnu.linkonce.t.*)
|
||||
*(.descriptors)
|
||||
/* .gnu.warning sections are handled specially by elf32.em. */
|
||||
*(.gnu.warning)
|
||||
} >RAM
|
||||
.init : { *(.init) } >RAM
|
||||
.fini : { *(.fini) } >RAM
|
||||
.rodata : { *(.rodata) *(.gnu.linkonce.r*) } >RAM
|
||||
.rodata1 : { *(.rodata1) } >RAM
|
||||
_etext = .;
|
||||
PROVIDE (etext = .);
|
||||
}
|
||||
.init : { *(.init) }
|
||||
.fini : { *(.fini) }
|
||||
.rodata : { *(.rodata) *(.gnu.linkonce.r*) }
|
||||
.rodata1 : {
|
||||
*(.rodata1)
|
||||
_etext = .;
|
||||
PROVIDE (_etext = .);
|
||||
}
|
||||
PROVIDE (__SDATA2_START__ = .);
|
||||
.sdata2 : { *(.sdata2) } >RAM
|
||||
.sbss2 : { *(.sbss2) } >RAM
|
||||
.sdata2 : { *(.sdata2) }
|
||||
.sbss2 : { *(.sbss2) }
|
||||
PROVIDE (__SBSS2_END__ = .);
|
||||
/* Adjust the address for the data segment. We want to adjust up to
|
||||
the same address within the page on the next page up. It would
|
||||
@@ -89,45 +93,49 @@ SECTIONS
|
||||
*(.data)
|
||||
*(.gnu.linkonce.d.*)
|
||||
CONSTRUCTORS
|
||||
} >RAM
|
||||
}
|
||||
PROVIDE (__EXCEPT_START__ = .);
|
||||
.gcc_except_table : { *(.gcc_except_table) } >RAM
|
||||
.gcc_except_table : { *(.gcc_except_table) }
|
||||
PROVIDE (__EXCEPT_END__ = .);
|
||||
|
||||
.data1 : { *(.data1) } >RAM
|
||||
.got1 : { *(.got1) } >RAM
|
||||
.dynamic : { *(.dynamic) } >RAM
|
||||
.data1 : { *(.data1) }
|
||||
.got1 : { *(.got1) }
|
||||
.dynamic : { *(.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 */
|
||||
PROVIDE (_GOT2_START_ = .);
|
||||
.got2 : { *(.got2) } >RAM
|
||||
.got2 : { *(.got2) }
|
||||
PROVIDE (__GOT2_END__ = .);
|
||||
PROVIDE (__CTOR_LIST__ = .);
|
||||
.ctors : { *(.ctors) } >RAM
|
||||
.ctors : { *(.ctors) }
|
||||
PROVIDE (__CTOR_END__ = .);
|
||||
PROVIDE (__DTOR_LIST__ = .);
|
||||
.dtors : { *(.dtors) } >RAM
|
||||
.dtors : { *(.dtors) }
|
||||
PROVIDE (__DTOR_END__ = .);
|
||||
PROVIDE (_FIXUP_START_ = .);
|
||||
.fixup : { *(.fixup) } >RAM
|
||||
.fixup : { *(.fixup) }
|
||||
PROVIDE (_FIXUP_END_ = .);
|
||||
PROVIDE (__FIXUP_END__ = .);
|
||||
PROVIDE (_GOT2_END_ = .);
|
||||
PROVIDE (_GOT_START_ = .);
|
||||
s.got = .;
|
||||
.got : { *(.got) } >RAM
|
||||
.got.plt : { *(.got.plt) } >RAM
|
||||
.got : {
|
||||
PROVIDE (_GOT_START_ = .);
|
||||
s.got = .;
|
||||
*(.got)
|
||||
}
|
||||
.got.plt : { *(.got.plt) }
|
||||
PROVIDE (_GOT_END_ = .);
|
||||
PROVIDE (__GOT_END__ = .);
|
||||
/* We want the small data sections together, so single-instruction offsets
|
||||
can access them all, and initialized data all before uninitialized, so
|
||||
we can shorten the on-disk segment size. */
|
||||
PROVIDE (__SDATA_START__ = .);
|
||||
.sdata : { *(.sdata) } >RAM
|
||||
_edata = .;
|
||||
PROVIDE (edata = .);
|
||||
PROVIDE (RAM_END = 10M);
|
||||
.sdata : {
|
||||
*(.sdata)
|
||||
_edata = .;
|
||||
}
|
||||
PROVIDE (_edata = .);
|
||||
PROVIDE (RAM_END = ADDR(.text) + 10M);
|
||||
. = ALIGN(8) + 0x1000;
|
||||
PROVIDE (__SBSS_START__ = .);
|
||||
.sbss :
|
||||
@@ -136,19 +144,19 @@ SECTIONS
|
||||
*(.sbss)
|
||||
*(.scommon)
|
||||
PROVIDE (__sbss_end = .);
|
||||
} >RAM
|
||||
}
|
||||
PROVIDE (__SBSS_END__ = .);
|
||||
.bss :
|
||||
{
|
||||
PROVIDE (__bss_start = .);
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
} >RAM
|
||||
. = ALIGN(8) + 0x8000;
|
||||
PROVIDE (__stack = .);
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
PROVIDE (__bss_start = .);
|
||||
*(.dynbss)
|
||||
*(.bss)
|
||||
*(COMMON)
|
||||
. = ALIGN(8) + 0x8000;
|
||||
PROVIDE (__stack = .);
|
||||
_end = . ;
|
||||
PROVIDE (end = .);
|
||||
}
|
||||
|
||||
/* These are needed for ELF backends which have not yet been
|
||||
converted to the new style linker. */
|
||||
|
||||
Reference in New Issue
Block a user