fix for NRF51822 linker script

pull/435/head
Janek Mann 2014-08-11 11:42:41 +01:00
parent 7e2001b980
commit c5f07dc672
2 changed files with 9 additions and 13 deletions

View File

@ -43,8 +43,8 @@ SECTIONS
KEEP(*(.Vectors)) KEEP(*(.Vectors))
*(.text*) *(.text*)
*(.init) KEEP(*(.init))
*(.fini) KEEP(*(.fini))
/* .ctors */ /* .ctors */
*crtbegin.o(.ctors) *crtbegin.o(.ctors)
@ -62,7 +62,7 @@ SECTIONS
*(.rodata*) *(.rodata*)
*(.eh_frame*) KEEP(*(.eh_frame*))
} > FLASH } > FLASH
@ -89,22 +89,22 @@ SECTIONS
. = ALIGN(4); . = ALIGN(4);
/* preinit data */ /* preinit data */
PROVIDE_HIDDEN (__preinit_array_start = .); PROVIDE_HIDDEN (__preinit_array_start = .);
*(.preinit_array) KEEP(*(.preinit_array))
PROVIDE_HIDDEN (__preinit_array_end = .); PROVIDE_HIDDEN (__preinit_array_end = .);
. = ALIGN(4); . = ALIGN(4);
/* init data */ /* init data */
PROVIDE_HIDDEN (__init_array_start = .); PROVIDE_HIDDEN (__init_array_start = .);
*(SORT(.init_array.*)) KEEP(*(SORT(.init_array.*)))
*(.init_array) KEEP(*(.init_array))
PROVIDE_HIDDEN (__init_array_end = .); PROVIDE_HIDDEN (__init_array_end = .);
. = ALIGN(4); . = ALIGN(4);
/* finit data */ /* finit data */
PROVIDE_HIDDEN (__fini_array_start = .); PROVIDE_HIDDEN (__fini_array_start = .);
*(SORT(.fini_array.*)) KEEP(*(SORT(.fini_array.*)))
*(.fini_array) KEEP(*(.fini_array))
PROVIDE_HIDDEN (__fini_array_end = .); PROVIDE_HIDDEN (__fini_array_end = .);
*(.jcr) *(.jcr)
@ -149,4 +149,3 @@ SECTIONS
/* Check if data + heap + stack exceeds RAM limit */ /* Check if data + heap + stack exceeds RAM limit */
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
} }

View File

@ -75,10 +75,7 @@ class GCC(mbedToolchain):
self.cc = [join(GOANNA_PATH, "goannacc"), "--with-cc=" + main_cc.replace('\\', '/'), "-std=gnu99", "--dialect=gnu", '--output-format="%s"' % self.GOANNA_FORMAT] + common_flags self.cc = [join(GOANNA_PATH, "goannacc"), "--with-cc=" + main_cc.replace('\\', '/'), "-std=gnu99", "--dialect=gnu", '--output-format="%s"' % self.GOANNA_FORMAT] + common_flags
self.cppc= [join(GOANNA_PATH, "goannac++"), "--with-cxx=" + main_cppc.replace('\\', '/'), "-std=gnu++98", "-fno-rtti", "--dialect=gnu", '--output-format="%s"' % self.GOANNA_FORMAT] + common_flags self.cppc= [join(GOANNA_PATH, "goannac++"), "--with-cxx=" + main_cppc.replace('\\', '/'), "-std=gnu++98", "-fno-rtti", "--dialect=gnu", '--output-format="%s"' % self.GOANNA_FORMAT] + common_flags
if target.name in ["NRF51822"]: self.ld = [join(tool_path, "arm-none-eabi-gcc"), "-Wl,--gc-sections", "-Wl,--wrap,main"] + self.cpu
self.ld = [join(tool_path, "arm-none-eabi-gcc"), "-Wl,--wrap,main"] + self.cpu
else:
self.ld = [join(tool_path, "arm-none-eabi-gcc"), "-Wl,--gc-sections", "-Wl,--wrap,main"] + self.cpu
self.sys_libs = ["stdc++", "supc++", "m", "c", "gcc"] self.sys_libs = ["stdc++", "supc++", "m", "c", "gcc"]
self.ar = join(tool_path, "arm-none-eabi-ar") self.ar = join(tool_path, "arm-none-eabi-ar")