still need .init section

This commit is contained in:
Dave Murphy 2016-12-05 10:14:02 +00:00
parent 7b9a6387f4
commit a0f7e4e2da
5 changed files with 30 additions and 5 deletions

View File

@ -26,6 +26,11 @@ SECTIONS
.plt : { *(.plt) } >ewram = 0xff .plt : { *(.plt) } >ewram = 0xff
.init :
{
KEEP (*(SORT_NONE(.init)))
} >ewram
.text : /* ALIGN (4): */ .text : /* ALIGN (4): */
{ {
*(EXCLUDE_FILE (*.itcm*) .text) *(EXCLUDE_FILE (*.itcm*) .text)

View File

@ -28,8 +28,14 @@ SECTIONS
KEEP (*(.crt0)) KEEP (*(.crt0))
. = ALIGN(4); /* REQUIRED. LD is flaky without it. */ . = ALIGN(4); /* REQUIRED. LD is flaky without it. */
} >rom = 0xff } >rom = 0xff
.plt : { *(.plt) } >rom = 0xff .plt : { *(.plt) } >rom = 0xff
.init :
{
KEEP (*(SORT_NONE(.init)))
} >ewram
.text : /* ALIGN (4): */ .text : /* ALIGN (4): */
{ {
*(EXCLUDE_FILE (*.iwram*) .text) *(EXCLUDE_FILE (*.iwram*) .text)

View File

@ -79,6 +79,11 @@ SECTIONS
. = ALIGN(4); /* REQUIRED. LD is flaky without it. */ . = ALIGN(4); /* REQUIRED. LD is flaky without it. */
} >rom } >rom
.init :
{
KEEP (*(SORT_NONE(.init)))
} >rom
.text : /* ALIGN (4): */ .text : /* ALIGN (4): */
{ {
*(EXCLUDE_FILE (*.iwram*) .text) *(EXCLUDE_FILE (*.iwram*) .text)

View File

@ -1,7 +1,10 @@
.section ".crt0","ax" .section ".crt0","ax"
.global _start .global _start
.align .align
.arm .arm
.cpu arm7tdmi
@--------------------------------------------------------------------------------- @---------------------------------------------------------------------------------
_start: _start:
@--------------------------------------------------------------------------------- @---------------------------------------------------------------------------------
@ -43,8 +46,8 @@ __slave_number:
.word 0 @ reserved .word 0 @ reserved
.word 0 @ reserved .word 0 @ reserved
.global start_vector .global start_vector
.align .align
@--------------------------------------------------------------------------------- @---------------------------------------------------------------------------------
start_vector: start_vector:
@--------------------------------------------------------------------------------- @---------------------------------------------------------------------------------

View File

@ -61,18 +61,24 @@ __irq_flags = 0x03007ff8;
SECTIONS SECTIONS
{ {
. = __text_start; . = __text_start;
.init : . = __text_start;
.crt0 :
{ {
KEEP (*(.init)) KEEP (*(.crt0))
. = ALIGN(4); . = ALIGN(4);
} >ewram =0xff } >ewram =0xff
.plt : .plt :
{ {
*(.plt) *(.plt)
. = ALIGN(4); /* REQUIRED. LD is flaky without it. */ . = ALIGN(4); /* REQUIRED. LD is flaky without it. */
} >ewram } >ewram
.init :
{
KEEP (*(SORT_NONE(.init)))
} >ewram
.text ALIGN (4): .text ALIGN (4):
{ {
*(EXCLUDE_FILE (*.iwram*) .text) *(EXCLUDE_FILE (*.iwram*) .text)