Support for exception handling in linker scripts.

This is needed even in plain C when 64 bit variable (e.g. long long int)
arithmetic is used. For example it is required when newlib is compiled with
--enable-newlib-io-long-long.

Conflicts:

	lib/stm32/f1/libopencm3_stm32f1.ld
	lib/stm32/f2/libopencm3_stm32f2.ld
This commit is contained in:
Tomaz Solc
2012-03-05 15:51:31 +01:00
committed by Piotr Esden-Tempski
parent c3038bc876
commit bf65589183
6 changed files with 34 additions and 33 deletions

View File

@@ -21,7 +21,7 @@
#define WEAK __attribute__ ((weak))
/* Symbols exported by the linker script(s): */
extern unsigned _etext, _data, _edata, _ebss, _stack;
extern unsigned __exidx_end, _data, _edata, _ebss, _stack;
void main(void);
void reset_handler(void);
@@ -224,7 +224,7 @@ void reset_handler(void)
__asm__("MSR msp, %0" : : "r"(&_stack));
for (src = &_etext, dest = &_data; dest < &_edata; src++, dest++)
for (src = &__exidx_end, dest = &_data; dest < &_edata; src++, dest++)
*dest = *src;
while (dest < &_ebss)