Synchronise linker scripts which are supposed to be identical

This also report bug fixes about data alignment and bss storage to EFM32 &
LM3S targets.

Note: removed chrysn copyright statement as the file is a verbatim copy of
previous files.
This commit is contained in:
Nicolas Schodet 2013-03-19 17:44:53 +01:00
parent c0aefb6ad3
commit cba01fff5e
5 changed files with 84 additions and 70 deletions

View File

@ -1,8 +1,7 @@
/* /*
* This file is part of the libopencm3 project. * This file is part of the libopencm3 project.
* *
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>, * Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
* Copyright (C) 2012 chrysn <chrysn@fsfe.org>
* *
* This library is free software: you can redistribute it and/or modify * This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@ -15,7 +14,7 @@
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>. * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* Generic linker script for EFM32 targets using libopencm3. */ /* Generic linker script for EFM32 targets using libopencm3. */
@ -31,33 +30,44 @@ 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); . = ALIGN(4);
*(.rodata*) /* Read-only data */ *(.rodata*) /* Read-only data */
. = ALIGN(4); . = ALIGN(4);
_etext = .;
} >rom } >rom
. = ORIGIN(ram); /*
* Another section used by C++ stuff, appears when using newlib with
* 64bit (long long) printf support
*/
.ARM.extab : {
*(.ARM.extab*)
} >rom
.ARM.exidx : {
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
} >rom
.data : AT(_etext) { . = ALIGN(4);
_etext = .;
.data : {
_data = .; _data = .;
*(.data*) /* Read-write initialized data */ *(.data*) /* Read-write initialized data */
. = ALIGN(4); . = ALIGN(4);
_edata = .; _edata = .;
} >ram } >ram AT >rom
_data_loadaddr = LOADADDR(.data);
.bss : { .bss : {
*(.bss*) /* Read-write zero initialized data */ *(.bss*) /* Read-write zero initialized data */
*(COMMON) *(COMMON)
. = ALIGN(4); . = ALIGN(4);
_ebss = .; _ebss = .;
} >ram AT >rom } >ram
_data_loadaddr = LOADADDR(.data);
/* /*
* The .eh_frame section appears to be used for C++ exception handling. * The .eh_frame section appears to be used for C++ exception handling.
@ -65,12 +75,6 @@ SECTIONS
*/ */
/DISCARD/ : { *(.eh_frame) } /DISCARD/ : { *(.eh_frame) }
/*
* Another section used by C++ stuff, appears when using newlib with
* 64bit (long long) printf support - discard it for now.
*/
/DISCARD/ : { *(.ARM.exidx) }
. = ALIGN(4); . = ALIGN(4);
end = .; end = .;
} }

View File

@ -1,8 +1,7 @@
/* /*
* This file is part of the libopencm3 project. * This file is part of the libopencm3 project.
* *
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>, * Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
* Copyright (C) 2012 chrysn <chrysn@fsfe.org>
* *
* This library is free software: you can redistribute it and/or modify * This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@ -15,7 +14,7 @@
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>. * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* Generic linker script for EFM32 targets using libopencm3. */ /* Generic linker script for EFM32 targets using libopencm3. */
@ -31,33 +30,44 @@ 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); . = ALIGN(4);
*(.rodata*) /* Read-only data */ *(.rodata*) /* Read-only data */
. = ALIGN(4); . = ALIGN(4);
_etext = .;
} >rom } >rom
. = ORIGIN(ram); /*
* Another section used by C++ stuff, appears when using newlib with
* 64bit (long long) printf support
*/
.ARM.extab : {
*(.ARM.extab*)
} >rom
.ARM.exidx : {
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
} >rom
.data : AT(_etext) { . = ALIGN(4);
_etext = .;
.data : {
_data = .; _data = .;
*(.data*) /* Read-write initialized data */ *(.data*) /* Read-write initialized data */
. = ALIGN(4); . = ALIGN(4);
_edata = .; _edata = .;
} >ram } >ram AT >rom
_data_loadaddr = LOADADDR(.data);
.bss : { .bss : {
*(.bss*) /* Read-write zero initialized data */ *(.bss*) /* Read-write zero initialized data */
*(COMMON) *(COMMON)
. = ALIGN(4); . = ALIGN(4);
_ebss = .; _ebss = .;
} >ram AT >rom } >ram
_data_loadaddr = LOADADDR(.data);
/* /*
* The .eh_frame section appears to be used for C++ exception handling. * The .eh_frame section appears to be used for C++ exception handling.
@ -65,12 +75,6 @@ SECTIONS
*/ */
/DISCARD/ : { *(.eh_frame) } /DISCARD/ : { *(.eh_frame) }
/*
* Another section used by C++ stuff, appears when using newlib with
* 64bit (long long) printf support - discard it for now.
*/
/DISCARD/ : { *(.ARM.exidx) }
. = ALIGN(4); . = ALIGN(4);
end = .; end = .;
} }

View File

@ -1,8 +1,7 @@
/* /*
* This file is part of the libopencm3 project. * This file is part of the libopencm3 project.
* *
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>, * Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
* Copyright (C) 2012 chrysn <chrysn@fsfe.org>
* *
* This library is free software: you can redistribute it and/or modify * This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@ -15,7 +14,7 @@
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>. * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* Generic linker script for EFM32 targets using libopencm3. */ /* Generic linker script for EFM32 targets using libopencm3. */
@ -31,33 +30,44 @@ 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); . = ALIGN(4);
*(.rodata*) /* Read-only data */ *(.rodata*) /* Read-only data */
. = ALIGN(4); . = ALIGN(4);
_etext = .;
} >rom } >rom
. = ORIGIN(ram); /*
* Another section used by C++ stuff, appears when using newlib with
* 64bit (long long) printf support
*/
.ARM.extab : {
*(.ARM.extab*)
} >rom
.ARM.exidx : {
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
} >rom
.data : AT(_etext) { . = ALIGN(4);
_etext = .;
.data : {
_data = .; _data = .;
*(.data*) /* Read-write initialized data */ *(.data*) /* Read-write initialized data */
. = ALIGN(4); . = ALIGN(4);
_edata = .; _edata = .;
} >ram } >ram AT >rom
_data_loadaddr = LOADADDR(.data);
.bss : { .bss : {
*(.bss*) /* Read-write zero initialized data */ *(.bss*) /* Read-write zero initialized data */
*(COMMON) *(COMMON)
. = ALIGN(4); . = ALIGN(4);
_ebss = .; _ebss = .;
} >ram AT >rom } >ram
_data_loadaddr = LOADADDR(.data);
/* /*
* The .eh_frame section appears to be used for C++ exception handling. * The .eh_frame section appears to be used for C++ exception handling.
@ -65,12 +75,6 @@ SECTIONS
*/ */
/DISCARD/ : { *(.eh_frame) } /DISCARD/ : { *(.eh_frame) }
/*
* Another section used by C++ stuff, appears when using newlib with
* 64bit (long long) printf support - discard it for now.
*/
/DISCARD/ : { *(.ARM.exidx) }
. = ALIGN(4); . = ALIGN(4);
end = .; end = .;
} }

View File

@ -1,8 +1,7 @@
/* /*
* This file is part of the libopencm3 project. * This file is part of the libopencm3 project.
* *
* Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>, * Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de>
* Copyright (C) 2012 chrysn <chrysn@fsfe.org>
* *
* This library is free software: you can redistribute it and/or modify * This library is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by * it under the terms of the GNU Lesser General Public License as published by
@ -15,7 +14,7 @@
* GNU Lesser General Public License for more details. * GNU Lesser General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>. * along with this library. If not, see <http://www.gnu.org/licenses/>.
*/ */
/* Generic linker script for EFM32 targets using libopencm3. */ /* Generic linker script for EFM32 targets using libopencm3. */
@ -31,33 +30,44 @@ 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); . = ALIGN(4);
*(.rodata*) /* Read-only data */ *(.rodata*) /* Read-only data */
. = ALIGN(4); . = ALIGN(4);
_etext = .;
} >rom } >rom
. = ORIGIN(ram); /*
* Another section used by C++ stuff, appears when using newlib with
* 64bit (long long) printf support
*/
.ARM.extab : {
*(.ARM.extab*)
} >rom
.ARM.exidx : {
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
} >rom
.data : AT(_etext) { . = ALIGN(4);
_etext = .;
.data : {
_data = .; _data = .;
*(.data*) /* Read-write initialized data */ *(.data*) /* Read-write initialized data */
. = ALIGN(4); . = ALIGN(4);
_edata = .; _edata = .;
} >ram } >ram AT >rom
_data_loadaddr = LOADADDR(.data);
.bss : { .bss : {
*(.bss*) /* Read-write zero initialized data */ *(.bss*) /* Read-write zero initialized data */
*(COMMON) *(COMMON)
. = ALIGN(4); . = ALIGN(4);
_ebss = .; _ebss = .;
} >ram AT >rom } >ram
_data_loadaddr = LOADADDR(.data);
/* /*
* The .eh_frame section appears to be used for C++ exception handling. * The .eh_frame section appears to be used for C++ exception handling.
@ -65,12 +75,6 @@ SECTIONS
*/ */
/DISCARD/ : { *(.eh_frame) } /DISCARD/ : { *(.eh_frame) }
/*
* Another section used by C++ stuff, appears when using newlib with
* 64bit (long long) printf support - discard it for now.
*/
/DISCARD/ : { *(.ARM.exidx) }
. = ALIGN(4); . = ALIGN(4);
end = .; end = .;
} }

View File

@ -77,8 +77,6 @@ SECTIONS
. = ALIGN(4); . = ALIGN(4);
end = .; end = .;
_end = .;
__end = .;
} }
PROVIDE(_stack = ORIGIN(ram) + LENGTH(ram)); PROVIDE(_stack = ORIGIN(ram) + LENGTH(ram));