diff options
| author | Bernard Xiong <[email protected]> | 2014-11-01 14:06:51 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2014-11-01 14:06:51 +0800 |
| commit | 38be10cf89958872e15e650ba1271b234554d7e6 (patch) | |
| tree | c749eff320052da4510342710511612a9f133be6 /bsp | |
| parent | 796c49347e275065b8e902d031f5b27b5ada4eb1 (diff) | |
[BSP] fix GCC compiling issue when enable C++ support
Diffstat (limited to 'bsp')
| -rw-r--r-- | bsp/lpc408x/rtconfig.py | 2 | ||||
| -rw-r--r-- | bsp/lpc408x/rtthread-lpc408x.ld | 23 |
2 files changed, 23 insertions, 2 deletions
diff --git a/bsp/lpc408x/rtconfig.py b/bsp/lpc408x/rtconfig.py index e66b2449a3..a2a6fac53f 100644 --- a/bsp/lpc408x/rtconfig.py +++ b/bsp/lpc408x/rtconfig.py @@ -33,7 +33,7 @@ if PLATFORM == 'gcc': CXX = PREFIX + 'g++' AS = PREFIX + 'gcc' AR = PREFIX + 'ar' - LINK = PREFIX + 'gcc' + LINK = PREFIX + 'g++' TARGET_EXT = 'elf' SIZE = PREFIX + 'size' OBJDUMP = PREFIX + 'objdump' diff --git a/bsp/lpc408x/rtthread-lpc408x.ld b/bsp/lpc408x/rtthread-lpc408x.ld index 021d51a504..adcfa03c36 100644 --- a/bsp/lpc408x/rtthread-lpc408x.ld +++ b/bsp/lpc408x/rtthread-lpc408x.ld @@ -38,10 +38,25 @@ SECTIONS __vsymtab_end = .; . = ALIGN(4); + PROVIDE(__ctors_start__ = .); + /* old GCC version uses .ctors */ + KEEP(*(SORT(.ctors.*))) + KEEP(*(.ctors)) + /* new GCC version uses .init_array */ + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + PROVIDE(__ctors_end__ = .); + . = ALIGN(4); _etext = .; } > CODE = 0 + .ARM.extab : + { + *(.ARM.extab*) + } > CODE + + /* The .ARM.exidx section is used for C++ exception handling. */ /* .ARM.exidx is sorted, so has to go in its own output section. */ __exidx_start = .; .ARM.exidx : @@ -58,6 +73,12 @@ SECTIONS .data : AT (_sidata) { . = ALIGN(4); + PROVIDE(__dtors_start__ = .); + KEEP(*(SORT(.dtors.*))) + KEEP(*(.dtors)) + PROVIDE(__dtors_end__ = .); + + . = ALIGN(4); /* This is used by the startup in order to initialize the .data secion */ _sdata = . ; @@ -68,7 +89,7 @@ SECTIONS . = ALIGN(4); /* This is used by the startup in order to initialize the .data secion */ _edata = . ; - } >DATA + } > DATA .stack : { |
