summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-30 15:43:16 (UTC)
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-12-16 14:15:00 (UTC)
commit287bbb65afd24ffc6254ae5f328733213f184205 (patch)
treeda78f3ae3f708e3e8bc51f3beec5ae3957b5a5fb
parent43c6268509057c3ad6aeeff765a2c3469bda60d8 (diff)
downloadrtems-287bbb65afd24ffc6254ae5f328733213f184205.tar.bz2
bsps/arm: Use ALIGN_WITH_INPUT
This requires at least Binutils 2.24.
-rw-r--r--c/src/lib/libbsp/arm/shared/include/linker-symbols.h6
-rw-r--r--c/src/lib/libbsp/arm/shared/include/start.h7
-rw-r--r--c/src/lib/libbsp/arm/shared/startup/linkcmds.base194
3 files changed, 88 insertions, 119 deletions
diff --git a/c/src/lib/libbsp/arm/shared/include/linker-symbols.h b/c/src/lib/libbsp/arm/shared/include/linker-symbols.h
index 1cc1e8d..6555e04 100644
--- a/c/src/lib/libbsp/arm/shared/include/linker-symbols.h
+++ b/c/src/lib/libbsp/arm/shared/include/linker-symbols.h
@@ -83,12 +83,6 @@ LINKER_SYMBOL(bsp_section_rodata_size)
LINKER_SYMBOL(bsp_section_rodata_load_begin)
LINKER_SYMBOL(bsp_section_rodata_load_end)
-LINKER_SYMBOL(bsp_section_armexidx_begin)
-LINKER_SYMBOL(bsp_section_armexidx_end)
-LINKER_SYMBOL(bsp_section_armexidx_size)
-LINKER_SYMBOL(bsp_section_armexidx_load_begin)
-LINKER_SYMBOL(bsp_section_armexidx_load_end)
-
LINKER_SYMBOL(bsp_section_data_begin)
LINKER_SYMBOL(bsp_section_data_end)
LINKER_SYMBOL(bsp_section_data_size)
diff --git a/c/src/lib/libbsp/arm/shared/include/start.h b/c/src/lib/libbsp/arm/shared/include/start.h
index 9330271..2241ffc 100644
--- a/c/src/lib/libbsp/arm/shared/include/start.h
+++ b/c/src/lib/libbsp/arm/shared/include/start.h
@@ -99,13 +99,6 @@ BSP_START_TEXT_SECTION static inline void bsp_start_copy_sections(void)
(size_t) bsp_section_rodata_size
);
- /* Copy .ARM.exidx section */
- bsp_start_memcpy(
- (int *) bsp_section_armexidx_begin,
- (const int *) bsp_section_armexidx_load_begin,
- (size_t) bsp_section_armexidx_size
- );
-
/* Copy .data section */
bsp_start_memcpy(
(int *) bsp_section_data_begin,
diff --git a/c/src/lib/libbsp/arm/shared/startup/linkcmds.base b/c/src/lib/libbsp/arm/shared/startup/linkcmds.base
index 40b9c30..8920f38 100644
--- a/c/src/lib/libbsp/arm/shared/startup/linkcmds.base
+++ b/c/src/lib/libbsp/arm/shared/startup/linkcmds.base
@@ -65,7 +65,7 @@ MEMORY {
}
SECTIONS {
- .start : {
+ .start : ALIGN_WITH_INPUT {
bsp_section_start_begin = .;
KEEP (*(.bsp_start_text))
KEEP (*(.bsp_start_data))
@@ -73,78 +73,78 @@ SECTIONS {
} > REGION_START AT > REGION_START
bsp_section_start_size = bsp_section_start_end - bsp_section_start_begin;
- .xbarrier : {
+ .xbarrier : ALIGN_WITH_INPUT {
. = ALIGN (bsp_section_xbarrier_align);
} > REGION_VECTOR
- .text : ALIGN(32) {
+ .text : ALIGN_WITH_INPUT {
bsp_section_text_begin = .;
-
- /* .text */
*(.text.unlikely .text.*_unlikely)
*(.text .stub .text.* .gnu.linkonce.t.*)
/* .gnu.warning sections are handled specially by elf32.em. */
*(.gnu.warning)
*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)
-
- /* .init */
+ } > REGION_TEXT AT > REGION_TEXT_LOAD
+ .init : ALIGN_WITH_INPUT {
KEEP (*(.init))
-
- /* .fini */
+ } > REGION_TEXT AT > REGION_TEXT_LOAD
+ .fini : ALIGN_WITH_INPUT {
KEEP (*(.fini))
-
bsp_section_text_end = .;
} > REGION_TEXT AT > REGION_TEXT_LOAD
bsp_section_text_size = bsp_section_text_end - bsp_section_text_begin;
bsp_section_text_load_begin = LOADADDR (.text);
bsp_section_text_load_end = bsp_section_text_load_begin + bsp_section_text_size;
- .robarrier : {
+ .robarrier : ALIGN_WITH_INPUT {
. = ALIGN (bsp_section_robarrier_align);
} > REGION_RODATA
- .rodata : ALIGN(32) {
+ .rodata : ALIGN_WITH_INPUT {
bsp_section_rodata_begin = .;
-
- /* .rodata */
*(.rodata .rodata.* .gnu.linkonce.r.*)
-
- /* .rodata1 */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .rodata1 : ALIGN_WITH_INPUT {
*(.rodata1)
-
- /* .ARM.extab */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .ARM.extab : ALIGN_WITH_INPUT {
*(.ARM.extab* .gnu.linkonce.armextab.*)
-
- /* .eh_frame */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .ARM.exidx : ALIGN_WITH_INPUT {
+ __exidx_start = .;
+ *(.ARM.exidx* .gnu.linkonce.armexidx.*)
+ __exidx_end = .;
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .eh_frame : ALIGN_WITH_INPUT {
KEEP (*(.eh_frame))
-
- /* .gcc_except_table */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .gcc_except_table : ALIGN_WITH_INPUT {
*(.gcc_except_table .gcc_except_table.*)
-
- /* .tdata */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .tdata : ALIGN_WITH_INPUT {
*(.tdata .tdata.* .gnu.linkonce.td.*)
-
- /* .tbss */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .tbss : ALIGN_WITH_INPUT {
*(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
-
- /* .preinit_array */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .preinit_array : ALIGN_WITH_INPUT {
PROVIDE_HIDDEN (__preinit_array_start = .);
KEEP (*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .);
-
- /* .init_array */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .init_array : ALIGN_WITH_INPUT {
PROVIDE_HIDDEN (__init_array_start = .);
KEEP (*(SORT(.init_array.*)))
KEEP (*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .);
-
- /* .fini_array */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .fini_array : ALIGN_WITH_INPUT {
PROVIDE_HIDDEN (__fini_array_start = .);
KEEP (*(.fini_array))
KEEP (*(SORT(.fini_array.*)))
PROVIDE_HIDDEN (__fini_array_end = .);
-
- /* .ctors */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .ctors : ALIGN_WITH_INPUT {
/* gcc uses crtbegin.o to find the start of
the constructors, so we make sure it is
first. Because this is a wildcard, it
@@ -163,49 +163,49 @@ SECTIONS {
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
KEEP (*(SORT(.ctors.*)))
KEEP (*(.ctors))
-
- /* .dtors */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .dtors : ALIGN_WITH_INPUT {
KEEP (*crtbegin.o(.dtors))
KEEP (*crtbegin?.o(.dtors))
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
KEEP (*(SORT(.dtors.*)))
KEEP (*(.dtors))
-
- /* .data.rel.ro */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .data.rel.ro : ALIGN_WITH_INPUT {
*(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*)
*(.data.rel.ro* .gnu.linkonce.d.rel.ro.*)
-
- /* .jcr */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .jcr : ALIGN_WITH_INPUT {
KEEP (*(.jcr))
-
- /* .interp */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .interp : ALIGN_WITH_INPUT {
*(.interp)
-
- /* .note.gnu.build-id */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .note.gnu.build-id : ALIGN_WITH_INPUT {
*(.note.gnu.build-id)
-
- /* .hash */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .hash : ALIGN_WITH_INPUT {
*(.hash)
-
- /* .gnu.hash */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .gnu.hash : ALIGN_WITH_INPUT {
*(.gnu.hash)
-
- /* .dynsym */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .dynsym : ALIGN_WITH_INPUT {
*(.dynsym)
-
- /* .dynstr */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .dynstr : ALIGN_WITH_INPUT {
*(.dynstr)
-
- /* .gnu.version */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .gnu.version : ALIGN_WITH_INPUT {
*(.gnu.version)
-
- /* .gnu.version_d */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .gnu.version_d : ALIGN_WITH_INPUT {
*(.gnu.version_d)
-
- /* .gnu.version_r */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .gnu.version_r : ALIGN_WITH_INPUT {
*(.gnu.version_r)
-
- /* .rel.dyn */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .rel.dyn : ALIGN_WITH_INPUT {
*(.rel.init)
*(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
*(.rel.fini)
@@ -223,8 +223,8 @@ SECTIONS {
PROVIDE_HIDDEN (__rel_iplt_end = .);
PROVIDE_HIDDEN (__rela_iplt_start = .);
PROVIDE_HIDDEN (__rela_iplt_end = .);
-
- /* .rela.dyn */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .rela.dyn : ALIGN_WITH_INPUT {
*(.rela.init)
*(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
*(.rela.fini)
@@ -241,25 +241,26 @@ SECTIONS {
PROVIDE_HIDDEN (__rela_iplt_start = .);
*(.rela.iplt)
PROVIDE_HIDDEN (__rela_iplt_end = .);
-
- /* .rel.plt */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .rel.plt : ALIGN_WITH_INPUT {
*(.rel.plt)
-
- /* .rela.plt */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .rela.plt : ALIGN_WITH_INPUT {
*(.rela.plt)
-
- /* .plt */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .plt : ALIGN_WITH_INPUT {
*(.plt)
-
- /* .iplt */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .iplt : ALIGN_WITH_INPUT {
*(.iplt)
-
- /* .dynamic */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .dynamic : ALIGN_WITH_INPUT {
*(.dynamic)
-
- /* .got */
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .got : ALIGN_WITH_INPUT {
*(.got.plt) *(.igot.plt) *(.got) *(.igot)
-
+ } > REGION_RODATA AT > REGION_RODATA_LOAD
+ .robsdsets : ALIGN_WITH_INPUT {
/* Special FreeBSD linker set sections */
__start_set_sysctl_set = .;
*(set_sysctl_*);
@@ -279,25 +280,11 @@ SECTIONS {
bsp_section_rodata_load_begin = LOADADDR (.rodata);
bsp_section_rodata_load_end = bsp_section_rodata_load_begin + bsp_section_rodata_size;
- .ARM.exidx : ALIGN(32) {
- bsp_section_armexidx_begin = .;
-
- /* .ARM.exidx */
- __exidx_start = .;
- *(.ARM.exidx* .gnu.linkonce.armexidx.*)
- __exidx_end = .;
-
- bsp_section_armexidx_end = .;
- } > REGION_RODATA AT > REGION_RODATA_LOAD
- bsp_section_armexidx_size = bsp_section_armexidx_end - bsp_section_armexidx_begin;
- bsp_section_armexidx_load_begin = LOADADDR (.ARM.exidx);
- bsp_section_armexidx_load_end = bsp_section_armexidx_load_begin + bsp_section_armexidx_size;
-
- .rwbarrier : {
+ .rwbarrier : ALIGN_WITH_INPUT {
. = ALIGN (bsp_section_rwbarrier_align);
} > REGION_DATA
- .vector : {
+ .vector : ALIGN_WITH_INPUT {
bsp_section_vector_begin = .;
. = . + DEFINED (bsp_vector_table_in_start_section) ? 0 : bsp_vector_table_size;
@@ -333,14 +320,13 @@ SECTIONS {
bsp_stack_secondary_processors_end = .;
*(.bsp_vector)
-
bsp_section_vector_end = .;
} > REGION_VECTOR AT > REGION_VECTOR
bsp_section_vector_size = bsp_section_vector_end - bsp_section_vector_begin;
bsp_vector_table_begin = DEFINED (bsp_vector_table_in_start_section) ? bsp_section_start_begin : bsp_section_vector_begin;
bsp_vector_table_end = bsp_vector_table_begin + bsp_vector_table_size;
- .fast_text : {
+ .fast_text : ALIGN_WITH_INPUT {
bsp_section_fast_text_begin = .;
*(.bsp_fast_text)
bsp_section_fast_text_end = .;
@@ -349,7 +335,7 @@ SECTIONS {
bsp_section_fast_text_load_begin = LOADADDR (.fast_text);
bsp_section_fast_text_load_end = bsp_section_fast_text_load_begin + bsp_section_fast_text_size;
- .fast_data : ALIGN(32) {
+ .fast_data : ALIGN_WITH_INPUT {
bsp_section_fast_data_begin = .;
*(.bsp_fast_data)
bsp_section_fast_data_end = .;
@@ -358,16 +344,15 @@ SECTIONS {
bsp_section_fast_data_load_begin = LOADADDR (.fast_data);
bsp_section_fast_data_load_end = bsp_section_fast_data_load_begin + bsp_section_fast_data_size;
- .data : ALIGN(32) {
+ .data : ALIGN_WITH_INPUT {
bsp_section_data_begin = .;
-
- /* .data */
*(.data .data.* .gnu.linkonce.d.*)
SORT(CONSTRUCTORS)
-
- /* .data1 */
+ } > REGION_DATA AT > REGION_DATA_LOAD
+ .data1 : ALIGN_WITH_INPUT {
*(.data1)
-
+ } > REGION_DATA AT > REGION_DATA_LOAD
+ .rwbsdsets : ALIGN_WITH_INPUT {
/* Special FreeBSD linker set sections */
_bsd__start_set_sysinit_set = .;
*(_bsd_set_sysinit_set);
@@ -379,19 +364,16 @@ SECTIONS {
bsp_section_data_load_begin = LOADADDR (.data);
bsp_section_data_load_end = bsp_section_data_load_begin + bsp_section_data_size;
- .bss : {
+ .bss : ALIGN_WITH_INPUT {
bsp_section_bss_begin = .;
-
- /* .bss */
*(.dynbss)
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
-
bsp_section_bss_end = .;
} > REGION_BSS AT > REGION_BSS
bsp_section_bss_size = bsp_section_bss_end - bsp_section_bss_begin;
- .work : {
+ .work : ALIGN_WITH_INPUT {
/*
* The work section will occupy the remaining REGION_WORK region and
* contains the RTEMS work space and heap.
@@ -402,7 +384,7 @@ SECTIONS {
} > REGION_WORK AT > REGION_WORK
bsp_section_work_size = bsp_section_work_end - bsp_section_work_begin;
- .stack : {
+ .stack : ALIGN_WITH_INPUT {
/*
* The stack section will occupy the remaining REGION_STACK region and may
* contain the task stacks. Depending on the region distribution this