aboutsummaryrefslogtreecommitdiffstats
path: root/support/ld
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-08-05 13:27:13 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-08-05 13:27:13 -0400
commitd8830b1448809b84ed95047a90a6793d59527ca0 (patch)
tree019d860680b38b2e3ffc7c5f95b402a33fb31b22 /support/ld
parent5b66935b6ec54d16b3536cf13d8fca53358d8777 (diff)
downloadlibrambutan-d8830b1448809b84ed95047a90a6793d59527ca0.tar.gz
librambutan-d8830b1448809b84ed95047a90a6793d59527ca0.zip
Add support for ARM's GCC ARM embedded toolchain.
Based on patches provided by Hanspeter Portner: http://forums.leaflabs.com/topic.php?id=1717#post-11812 Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'support/ld')
-rw-r--r--support/ld/common.inc32
1 files changed, 20 insertions, 12 deletions
diff --git a/support/ld/common.inc b/support/ld/common.inc
index f749b19..f5a0f5b 100644
--- a/support/ld/common.inc
+++ b/support/ld/common.inc
@@ -5,12 +5,20 @@
*/
OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
-ENTRY(_start)
/*
- * Link against libgcc, libc, and libm
+ * Configure other libraries we want in the link.
+ *
+ * libgcc, libc, and libm are common across supported toolchains.
+ * However, some toolchains require additional archives which aren't
+ * present everywhere (e.g. ARM's gcc-arm-embedded releases).
+ *
+ * To hack around this, we let the build system specify additional
+ * archives by putting the right extra_libs.inc (in a directory under
+ * toolchains/) in our search path.
*/
GROUP(libgcc.a libc.a libm.a)
+INCLUDE extra_libs.inc
/*
* These force the linker to search for vector table symbols.
@@ -35,8 +43,9 @@ EXTERN(__msp_init)
PROVIDE(__msp_init = ORIGIN(ram) + LENGTH(ram));
/* Reset vector and chip reset entry point */
-EXTERN(_start)
-PROVIDE(__exc_reset = _start);
+EXTERN(__start__)
+ENTRY(__start__)
+PROVIDE(__exc_reset = __start__);
/* Heap boundaries, for libmaple */
EXTERN(_lm_heap_start);
@@ -44,10 +53,9 @@ EXTERN(_lm_heap_end);
SECTIONS
{
- /* TODO pull out rodata and stick into separate sections */
.text :
{
- _text = .;
+ __text_start__ = .;
/*
* STM32 vector table. Leave this here. Yes, really.
*/
@@ -107,7 +115,7 @@ SECTIONS
.text.align :
{
. = ALIGN(8);
- _etext = .;
+ __text_end__ = .;
} > REGION_TEXT
/*
@@ -126,13 +134,13 @@ SECTIONS
.data :
{
. = ALIGN(8);
- _data = .;
+ __data_start__ = .;
*(.got.plt) *(.got)
*(.data .data.* .gnu.linkonce.d.*)
. = ALIGN(8);
- _edata = .;
+ __data_end__ = .;
} > REGION_DATA AT> REGION_RODATA
/*
@@ -166,12 +174,12 @@ SECTIONS
.bss :
{
. = ALIGN(8);
- _bss = .;
+ __bss_start__ = .;
*(.bss .bss.* .gnu.linkonce.b.*)
*(COMMON)
. = ALIGN (8);
- _ebss = .;
- _end = _ebss;
+ __bss_end__ = .;
+ _end = __bss_end__;
} > REGION_BSS
/*