diff options
author | David Sidrane <david_s5@nscdg.com> | 2015-03-24 15:43:33 -1000 |
---|---|---|
committer | David Sidrane <david_s5@nscdg.com> | 2015-03-24 15:43:33 -1000 |
commit | 2864e2d0f3ebaeda8c3d6783f42ab413b6b3d41e (patch) | |
tree | 45b836275562234efa2a475938c10518c1dd41ca | |
parent | b984c7bc49130864b96979c88d926284fb1cf7fc (diff) | |
download | px4-firmware-2864e2d0f3ebaeda8c3d6783f42ab413b6b3d41e.tar.gz px4-firmware-2864e2d0f3ebaeda8c3d6783f42ab413b6b3d41e.tar.bz2 px4-firmware-2864e2d0f3ebaeda8c3d6783f42ab413b6b3d41e.zip |
Fixed Visibility and ld script - Runs On Olimexini-STM32
-rw-r--r-- | nuttx-configs/px4cannode-v1/scripts/ld.script | 128 | ||||
-rw-r--r-- | src/drivers/boards/px4cannode-v1/px4cannode_can.c | 2 |
2 files changed, 72 insertions, 58 deletions
diff --git a/nuttx-configs/px4cannode-v1/scripts/ld.script b/nuttx-configs/px4cannode-v1/scripts/ld.script index ceef71e8c..29719d454 100644 --- a/nuttx-configs/px4cannode-v1/scripts/ld.script +++ b/nuttx-configs/px4cannode-v1/scripts/ld.script @@ -47,70 +47,84 @@ MEMORY } OUTPUT_ARCH(arm) -ENTRY(_stext) +ENTRY(__start) /* treat __start as the anchor for dead code stripping */ +EXTERN(_vectors) /* force the vectors to be included in the output */ +/* + * Ensure that abort() is present in the final object. The exception handling + * code pulled in by libgcc.a requires it (and that code cannot be easily avoided). + */ +EXTERN(abort) SECTIONS { - .text : { - _stext = ABSOLUTE(.); - *(.vectors) - *(.text .text.*) - *(.fixup) - *(.gnu.warning) - *(.rodata .rodata.*) - *(.gnu.linkonce.t.*) - *(.glue_7) - *(.glue_7t) - *(.got) - *(.gcc_except_table) - *(.gnu.linkonce.r.*) - _etext = ABSOLUTE(.); - } > flash + .text : { + _stext = ABSOLUTE(.); + *(.vectors) + *(.text .text.*) + *(.fixup) + *(.gnu.warning) + *(.rodata .rodata.*) + *(.gnu.linkonce.t.*) + *(.got) + *(.gcc_except_table) + *(.gnu.linkonce.r.*) + _etext = ABSOLUTE(.); + /* + * This is a hack to make the newlib libm __errno() call + * use the NuttX get_errno_ptr() function. + */ + __errno = get_errno_ptr; + } > flash + +/* + * Init functions (static constructors and the like) + */ + .init_section : { + _sinit = ABSOLUTE(.); + KEEP(*(.init_array .init_array.*)) + _einit = ABSOLUTE(.); + } > flash - .init_section : { - _sinit = ABSOLUTE(.); - *(.init_array .init_array.*) - _einit = ABSOLUTE(.); - } > flash + .ARM.extab : { + *(.ARM.extab*) + } > flash - .ARM.extab : { - *(.ARM.extab*) - } > flash + __exidx_start = ABSOLUTE(.); + .ARM.exidx : { + *(.ARM.exidx*) + } > flash + __exidx_end = ABSOLUTE(.); - __exidx_start = ABSOLUTE(.); - .ARM.exidx : { - *(.ARM.exidx*) - } > flash - __exidx_end = ABSOLUTE(.); + _eronly = ABSOLUTE(.); - _eronly = ABSOLUTE(.); + /* The STM32F103CB has 20Kb of SRAM beginning at the following address */ - .data : { - _sdata = ABSOLUTE(.); - *(.data .data.*) - *(.gnu.linkonce.d.*) - CONSTRUCTORS - _edata = ABSOLUTE(.); - } > sram AT > flash + .data : { + _sdata = ABSOLUTE(.); + *(.data .data.*) + *(.gnu.linkonce.d.*) + CONSTRUCTORS + _edata = ABSOLUTE(.); + } > sram AT > flash - .bss : { - _sbss = ABSOLUTE(.); - *(.bss .bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - _ebss = ABSOLUTE(.); - } > sram + .bss : { + _sbss = ABSOLUTE(.); + *(.bss .bss.*) + *(.gnu.linkonce.b.*) + *(COMMON) + _ebss = ABSOLUTE(.); + } > sram - /* Stabs debugging sections. */ - .stab 0 : { *(.stab) } - .stabstr 0 : { *(.stabstr) } - .stab.excl 0 : { *(.stab.excl) } - .stab.exclstr 0 : { *(.stab.exclstr) } - .stab.index 0 : { *(.stab.index) } - .stab.indexstr 0 : { *(.stab.indexstr) } - .comment 0 : { *(.comment) } - .debug_abbrev 0 : { *(.debug_abbrev) } - .debug_info 0 : { *(.debug_info) } - .debug_line 0 : { *(.debug_line) } - .debug_pubnames 0 : { *(.debug_pubnames) } - .debug_aranges 0 : { *(.debug_aranges) } + /* Stabs debugging sections. */ + .stab 0 : { *(.stab) } + .stabstr 0 : { *(.stabstr) } + .stab.excl 0 : { *(.stab.excl) } + .stab.exclstr 0 : { *(.stab.exclstr) } + .stab.index 0 : { *(.stab.index) } + .stab.indexstr 0 : { *(.stab.indexstr) } + .comment 0 : { *(.comment) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_info 0 : { *(.debug_info) } + .debug_line 0 : { *(.debug_line) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_aranges 0 : { *(.debug_aranges) } } diff --git a/src/drivers/boards/px4cannode-v1/px4cannode_can.c b/src/drivers/boards/px4cannode-v1/px4cannode_can.c index 59bfec574..d0bf9e24b 100644 --- a/src/drivers/boards/px4cannode-v1/px4cannode_can.c +++ b/src/drivers/boards/px4cannode-v1/px4cannode_can.c @@ -108,7 +108,7 @@ int can_devinit(void); * ************************************************************************************/ -int can_devinit(void) +__EXPORT int can_devinit(void) { static bool initialized = false; struct can_dev_s *can; |