aboutsummaryrefslogtreecommitdiffstats
path: root/support/ld/common.inc
Commit message (Collapse)AuthorAgeFilesLines
* Add support for ARM's GCC ARM embedded toolchain.Marti Bolivar2012-08-051-12/+20
| | | | | | | 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>
* Fix linking and C runtime initialization on F1.Marti Bolivar2012-04-111-30/+23
| | | | | | | | | | | | Reorder the .data and .rodata sections in common.inc. This seems necessary to get the linker to place the data ROM disk and the pointer to it in the right places. Switch from long long to int in start_c.c. I have no idea why this helps, but it does. F1 will crash if you don't do this. It will probably slow things down unnecessarily on F2, but I don't care. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* Remove "CS3" prefix from libmaple symbol names.Marti Bolivar2012-04-111-7/+7
| | | | | | | | | | | | | | | | | | | We're no longer even marginally compatible with CS3, so it's inappropriate to use that prefix in our names. Rename: __cs3_stm32_vector_table -> __stm32_vector_table. __cs3_stack -> __msp_init __cs3_reset -> __exc_reset __cs3_start_c -> start_c Also add an MIT license header and assert LeafLabs copyright over wirish/start.S and wirish/start_c.c. These files are modified from the original CodeSourcery versions, which were distributed under a license that permits modifications to be distributed under a different copyright and licensing terms than the originals. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* Remove CS3-style initialization.Marti Bolivar2012-04-111-32/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove libcs3-related bits from support/ld. Break them out into libmaple proper and Wirish as appropriate: vector table definition and ISR declarations go into libmaple proper, and startup code goes into Wirish. Vector table symbols are included into common.inc from an STM32 family-specific directory under support/ld/stm32. This is a combination of 5 commits. Individual commit messages follow: libcs3_stm32_src: Don't depend on cs3.h. So we can use the existing toolchain. Move ISR decls/vector table into libmaple proper. This allows us to configure the vector table on a per-family basis. - Move support/ld/libcs3_stm32_src/stm32_isrs.S stm32_vector_table.S to libmaple/stm32f1/isrs_performance.S vector_table_performance.S, respectively. The directory libmaple/stm32f1/ is intended to hold all STM32F1-specific code within libmaple. Obviously, there's a lot of work to do before this becomes true. - support/ld/libcs3_stm32_src/Makefile: Don't try to compile stm32_isrs.S and stm32_vector_table.S anymore. - Add libmaple/stm32f1/rules.mk to include these new files in the standard libmaple build. - support/make/target-config.mk: Add LIBMAPLE_MODULE_FAMILY, which selects a directory to use as a family-specific libmaple submodule. - Makefile: Add LIBMAPLE_MODULE_FAMILY to LIBMAPLE_MODULES. Remove support/ld/libcs3_stm32_src and derived object files. From support/ld/libcs3_stm32_src, move start.S and start_c.c into Wirish. Modify wirish/rules.mk accordingly. Delete support/ld/libcs3_stm32_*_density.a. These are no longer necessary, as the relevant objects are included in the standard Wirish build. Remove the GROUP statements from the board linker scripts accordingly. Remove SEARCH_DIR(.) from common.inc; it's no longer necessary. Also fix up some comments that are now out of date. wirish/start_c.c: Don't use CS3-style memory initialization. Switch memory initialization to a simpler style of initializing .data if necessary, then zeroing .bss. Initializing .data is only necessary during Flash builds, since during RAM builds, LOADADDR(.data) == ADDR(.data). This makes libmaple completely incompatible with the CS3 startup sequence. Subsequent commits will clean up the namespace to reflect that fact. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* Make vector table symbols family-specific during linking.Marti Bolivar2011-11-151-4/+7
| | | | | | | | | | | | | | | | | - support/make/target-config.mk: add LD_FAMILY_PATH, the directory to search for STM32 family-specific link configuration files. For now, this is just a stub which points to support/ld/stm32/f1/performance, since that's all we currently support. We can add the logic to support different STM32 families here later. - Makefile: Pass -L $(LD_FAMILY_PATH) to linker. - Rename support/ld/names.inc to support/ld/stm32/f1/performance/vector_symbols.inc. - common.inc: INCLUDE vector_symbols.inc instead of names.inc. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
* [support/ld] Unify linker scripts.Marti Bolivar2011-09-131-0/+231
Add new common.inc, which is common_rom.inc with some DEFINED(_FLASH_BUILD) usages thrown in to allow for RAM builds. It also uses a new REGION_RODATA region alias for read-only data. Move section .USER_FLASH to REGION_RODATA. This means it lives in RAM under RAM builds. Although this might be surprising, not doing so would make RAM builds useless. Modify the individual board linker scripts to properly set REGION_RODATA and _FLASH_BUILD before calling out to common.inc. Delete common_rom.inc, common_ram.inc, common_header.inc, in favor of common.inc. This should fix RAM builds on all boards.