Clean up and make linker scripts more uniform
This includes: - fix some comments indent, - add entry point, - align exported symbols, - remove unneeded "." assignments.
This commit is contained in:
parent
11727f56c9
commit
2a35377980
@ -24,31 +24,34 @@
|
|||||||
/* Enforce emmition of the vector table. */
|
/* Enforce emmition of the vector table. */
|
||||||
EXTERN (vector_table)
|
EXTERN (vector_table)
|
||||||
|
|
||||||
|
/* Define the entry point of the output file. */
|
||||||
|
ENTRY(reset_handler)
|
||||||
|
|
||||||
/* Define sections. */
|
/* Define sections. */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
. = ORIGIN(rom);
|
|
||||||
|
|
||||||
.text : {
|
.text : {
|
||||||
*(.vectors) /* Vector table */
|
*(.vectors) /* Vector table */
|
||||||
*(.text*) /* Program code */
|
*(.text*) /* Program code */
|
||||||
|
. = ALIGN(4);
|
||||||
*(.rodata*) /* Read-only data */
|
*(.rodata*) /* Read-only data */
|
||||||
|
. = ALIGN(4);
|
||||||
_etext = .;
|
_etext = .;
|
||||||
} >rom
|
} >rom
|
||||||
|
|
||||||
. = ORIGIN(ram);
|
|
||||||
|
|
||||||
.data : {
|
.data : {
|
||||||
_data = .;
|
_data = .;
|
||||||
*(.data*) /* Read-write initialized data */
|
*(.data*) /* Read-write initialized data */
|
||||||
|
. = ALIGN(4);
|
||||||
_edata = .;
|
_edata = .;
|
||||||
} >ram AT >rom
|
} >ram AT >rom
|
||||||
|
|
||||||
.bss : {
|
.bss : {
|
||||||
*(.bss*) /* Read-write zero initialized data */
|
*(.bss*) /* Read-write zero initialized data */
|
||||||
*(COMMON)
|
*(COMMON)
|
||||||
|
. = ALIGN(4);
|
||||||
_ebss = .;
|
_ebss = .;
|
||||||
} >ram AT >rom
|
} >ram
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The .eh_frame section appears to be used for C++ exception handling.
|
* The .eh_frame section appears to be used for C++ exception handling.
|
||||||
@ -62,6 +65,7 @@ SECTIONS
|
|||||||
*/
|
*/
|
||||||
/DISCARD/ : { *(.ARM.exidx) }
|
/DISCARD/ : { *(.ARM.exidx) }
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
end = .;
|
end = .;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,31 +24,34 @@
|
|||||||
/* Enforce emmition of the vector table. */
|
/* Enforce emmition of the vector table. */
|
||||||
EXTERN (vector_table)
|
EXTERN (vector_table)
|
||||||
|
|
||||||
|
/* Define the entry point of the output file. */
|
||||||
|
ENTRY(reset_handler)
|
||||||
|
|
||||||
/* Define sections. */
|
/* Define sections. */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
. = ORIGIN(rom);
|
|
||||||
|
|
||||||
.text : {
|
.text : {
|
||||||
*(.vectors) /* Vector table */
|
*(.vectors) /* Vector table */
|
||||||
*(.text*) /* Program code */
|
*(.text*) /* Program code */
|
||||||
|
. = ALIGN(4);
|
||||||
*(.rodata*) /* Read-only data */
|
*(.rodata*) /* Read-only data */
|
||||||
|
. = ALIGN(4);
|
||||||
_etext = .;
|
_etext = .;
|
||||||
} >rom
|
} >rom
|
||||||
|
|
||||||
. = ORIGIN(ram);
|
|
||||||
|
|
||||||
.data : {
|
.data : {
|
||||||
_data = .;
|
_data = .;
|
||||||
*(.data*) /* Read-write initialized data */
|
*(.data*) /* Read-write initialized data */
|
||||||
|
. = ALIGN(4);
|
||||||
_edata = .;
|
_edata = .;
|
||||||
} >ram AT >rom
|
} >ram AT >rom
|
||||||
|
|
||||||
.bss : {
|
.bss : {
|
||||||
*(.bss*) /* Read-write zero initialized data */
|
*(.bss*) /* Read-write zero initialized data */
|
||||||
*(COMMON)
|
*(COMMON)
|
||||||
|
. = ALIGN(4);
|
||||||
_ebss = .;
|
_ebss = .;
|
||||||
} >ram AT >rom
|
} >ram
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The .eh_frame section appears to be used for C++ exception handling.
|
* The .eh_frame section appears to be used for C++ exception handling.
|
||||||
@ -62,6 +65,7 @@ SECTIONS
|
|||||||
*/
|
*/
|
||||||
/DISCARD/ : { *(.ARM.exidx) }
|
/DISCARD/ : { *(.ARM.exidx) }
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
end = .;
|
end = .;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the libopencm3 project.
|
* This file is part of the libopencm3 project.
|
||||||
*
|
*
|
||||||
@ -31,28 +30,28 @@ ENTRY(reset_handler)
|
|||||||
/* Define sections. */
|
/* Define sections. */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
. = ORIGIN(rom);
|
|
||||||
|
|
||||||
.text : {
|
.text : {
|
||||||
*(.vectors) /* Vector table */
|
*(.vectors) /* Vector table */
|
||||||
*(.text*) /* Program code */
|
*(.text*) /* Program code */
|
||||||
|
. = ALIGN(4);
|
||||||
*(.rodata*) /* Read-only data */
|
*(.rodata*) /* Read-only data */
|
||||||
|
. = ALIGN(4);
|
||||||
_etext = .;
|
_etext = .;
|
||||||
} >rom
|
} >rom
|
||||||
|
|
||||||
. = ORIGIN(ram);
|
|
||||||
|
|
||||||
.data : {
|
.data : {
|
||||||
_data = .;
|
_data = .;
|
||||||
*(.data*) /* Read-write initialized data */
|
*(.data*) /* Read-write initialized data */
|
||||||
|
. = ALIGN(4);
|
||||||
_edata = .;
|
_edata = .;
|
||||||
} >ram AT >rom
|
} >ram AT >rom
|
||||||
|
|
||||||
.bss : {
|
.bss : {
|
||||||
*(.bss*) /* Read-write zero initialized data */
|
*(.bss*) /* Read-write zero initialized data */
|
||||||
*(COMMON)
|
*(COMMON)
|
||||||
|
. = ALIGN(4);
|
||||||
_ebss = .;
|
_ebss = .;
|
||||||
} >ram AT >rom
|
} >ram
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The .eh_frame section appears to be used for C++ exception handling.
|
* The .eh_frame section appears to be used for C++ exception handling.
|
||||||
@ -66,6 +65,7 @@ SECTIONS
|
|||||||
*/
|
*/
|
||||||
/DISCARD/ : { *(.ARM.exidx) }
|
/DISCARD/ : { *(.ARM.exidx) }
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
end = .;
|
end = .;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,8 +32,6 @@ ENTRY(reset_handler)
|
|||||||
/* Define sections. */
|
/* Define sections. */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
. = ORIGIN(rom);
|
|
||||||
|
|
||||||
.text : {
|
.text : {
|
||||||
. = ALIGN(0x400);
|
. = ALIGN(0x400);
|
||||||
_text_ram = 0; /* Start of Code in RAM NULL because Copy of Code from ROM to RAM disabled */
|
_text_ram = 0; /* Start of Code in RAM NULL because Copy of Code from ROM to RAM disabled */
|
||||||
@ -51,12 +49,11 @@ SECTIONS
|
|||||||
} > rom
|
} > rom
|
||||||
__exidx_end = .;
|
__exidx_end = .;
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
_etext = .;
|
_etext = .;
|
||||||
_etext_ram = 0; /* Start of Code in RAM NULL because Copy of Code from ROM to RAM disabled */
|
_etext_ram = 0; /* Start of Code in RAM NULL because Copy of Code from ROM to RAM disabled */
|
||||||
_etext_rom = 0; /* Start of Code in RAM NULL because Copy of Code from ROM to RAM disabled */
|
_etext_rom = 0; /* Start of Code in RAM NULL because Copy of Code from ROM to RAM disabled */
|
||||||
|
|
||||||
. = ORIGIN(ram);
|
|
||||||
|
|
||||||
.data : {
|
.data : {
|
||||||
_data = .;
|
_data = .;
|
||||||
*(.data*) /* Read-write initialized data */
|
*(.data*) /* Read-write initialized data */
|
||||||
@ -88,6 +85,7 @@ SECTIONS
|
|||||||
*/
|
*/
|
||||||
/DISCARD/ : { *(.ARM.exidx) }
|
/DISCARD/ : { *(.ARM.exidx) }
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
end = .;
|
end = .;
|
||||||
|
|
||||||
/* Leave room above stack for IAP to run. */
|
/* Leave room above stack for IAP to run. */
|
||||||
|
@ -32,8 +32,6 @@ ENTRY(reset_handler)
|
|||||||
/* Define sections. */
|
/* Define sections. */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
. = ORIGIN(rom);
|
|
||||||
|
|
||||||
.text : {
|
.text : {
|
||||||
. = ALIGN(0x400);
|
. = ALIGN(0x400);
|
||||||
_text_ram = (. - ORIGIN(rom)) + ORIGIN(ram); /* Start of Code in RAM */
|
_text_ram = (. - ORIGIN(rom)) + ORIGIN(ram); /* Start of Code in RAM */
|
||||||
@ -52,6 +50,7 @@ SECTIONS
|
|||||||
} > rom
|
} > rom
|
||||||
__exidx_end = .;
|
__exidx_end = .;
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
_etext = .;
|
_etext = .;
|
||||||
_etext_ram = (. - ORIGIN(rom)) + ORIGIN(ram);
|
_etext_ram = (. - ORIGIN(rom)) + ORIGIN(ram);
|
||||||
_etext_rom = (. - ORIGIN(rom)) + ORIGIN(rom_flash);
|
_etext_rom = (. - ORIGIN(rom)) + ORIGIN(rom_flash);
|
||||||
@ -64,7 +63,6 @@ SECTIONS
|
|||||||
} >ram_data AT >rom
|
} >ram_data AT >rom
|
||||||
|
|
||||||
.bss : {
|
.bss : {
|
||||||
. = _edata;
|
|
||||||
*(.bss*) /* Read-write zero initialized data */
|
*(.bss*) /* Read-write zero initialized data */
|
||||||
*(COMMON)
|
*(COMMON)
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
@ -89,6 +87,7 @@ SECTIONS
|
|||||||
*/
|
*/
|
||||||
/DISCARD/ : { *(.ARM.exidx) }
|
/DISCARD/ : { *(.ARM.exidx) }
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
end = .;
|
end = .;
|
||||||
|
|
||||||
/* Leave room above stack for IAP to run. */
|
/* Leave room above stack for IAP to run. */
|
||||||
|
@ -30,8 +30,6 @@ ENTRY(reset_handler)
|
|||||||
/* Define sections. */
|
/* Define sections. */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
. = ORIGIN(rom);
|
|
||||||
|
|
||||||
.text : {
|
.text : {
|
||||||
*(.vectors) /* Vector table */
|
*(.vectors) /* Vector table */
|
||||||
*(.text*) /* Program code */
|
*(.text*) /* Program code */
|
||||||
@ -42,9 +40,9 @@ SECTIONS
|
|||||||
} >rom
|
} >rom
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Another section used by C++ stuff, appears when using newlib with
|
* Another section used by C++ stuff, appears when using newlib with
|
||||||
* 64bit (long long) printf support
|
* 64bit (long long) printf support
|
||||||
*/
|
*/
|
||||||
.ARM.extab : {
|
.ARM.extab : {
|
||||||
*(.ARM.extab*)
|
*(.ARM.extab*)
|
||||||
} >rom
|
} >rom
|
||||||
@ -54,8 +52,6 @@ SECTIONS
|
|||||||
__exidx_end = .;
|
__exidx_end = .;
|
||||||
} >rom
|
} >rom
|
||||||
|
|
||||||
. = ORIGIN(ram);
|
|
||||||
|
|
||||||
.data : AT (__exidx_end) {
|
.data : AT (__exidx_end) {
|
||||||
_data = .;
|
_data = .;
|
||||||
*(.data*) /* Read-write initialized data */
|
*(.data*) /* Read-write initialized data */
|
||||||
@ -68,7 +64,7 @@ SECTIONS
|
|||||||
*(COMMON)
|
*(COMMON)
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_ebss = .;
|
_ebss = .;
|
||||||
} >ram AT >rom
|
} >ram
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The .eh_frame section appears to be used for C++ exception handling.
|
* The .eh_frame section appears to be used for C++ exception handling.
|
||||||
|
@ -30,8 +30,6 @@ ENTRY(reset_handler)
|
|||||||
/* Define sections. */
|
/* Define sections. */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
. = ORIGIN(rom);
|
|
||||||
|
|
||||||
.text : {
|
.text : {
|
||||||
*(.vectors) /* Vector table */
|
*(.vectors) /* Vector table */
|
||||||
*(.text*) /* Program code */
|
*(.text*) /* Program code */
|
||||||
@ -42,9 +40,9 @@ SECTIONS
|
|||||||
} >rom
|
} >rom
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Another section used by C++ stuff, appears when using newlib with
|
* Another section used by C++ stuff, appears when using newlib with
|
||||||
* 64bit (long long) printf support
|
* 64bit (long long) printf support
|
||||||
*/
|
*/
|
||||||
.ARM.extab : {
|
.ARM.extab : {
|
||||||
*(.ARM.extab*)
|
*(.ARM.extab*)
|
||||||
} >rom
|
} >rom
|
||||||
@ -54,8 +52,6 @@ SECTIONS
|
|||||||
__exidx_end = .;
|
__exidx_end = .;
|
||||||
} >rom
|
} >rom
|
||||||
|
|
||||||
. = ORIGIN(ram);
|
|
||||||
|
|
||||||
.data : AT (__exidx_end) {
|
.data : AT (__exidx_end) {
|
||||||
_data = .;
|
_data = .;
|
||||||
*(.data*) /* Read-write initialized data */
|
*(.data*) /* Read-write initialized data */
|
||||||
@ -68,7 +64,7 @@ SECTIONS
|
|||||||
*(COMMON)
|
*(COMMON)
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_ebss = .;
|
_ebss = .;
|
||||||
} >ram AT >rom
|
} >ram
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The .eh_frame section appears to be used for C++ exception handling.
|
* The .eh_frame section appears to be used for C++ exception handling.
|
||||||
|
@ -30,8 +30,6 @@ ENTRY(reset_handler)
|
|||||||
/* Define sections. */
|
/* Define sections. */
|
||||||
SECTIONS
|
SECTIONS
|
||||||
{
|
{
|
||||||
. = ORIGIN(rom);
|
|
||||||
|
|
||||||
.text : {
|
.text : {
|
||||||
*(.vectors) /* Vector table */
|
*(.vectors) /* Vector table */
|
||||||
*(.text*) /* Program code */
|
*(.text*) /* Program code */
|
||||||
@ -48,6 +46,7 @@ SECTIONS
|
|||||||
__exidx_end = .;
|
__exidx_end = .;
|
||||||
|
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
_etext = .;
|
_etext = .;
|
||||||
|
|
||||||
.data : {
|
.data : {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user