Add support for calling a function before main()

Also added a test for this feature (MBED_A22).
Fixes PRMBED-906.
pull/23/head
Bogdan Marinescu 2013-08-07 14:51:30 +03:00
parent ad5516f898
commit 7b9081b59c
2 changed files with 7 additions and 1 deletions

View File

@ -203,6 +203,12 @@ TESTS = [
"dependencies": [MBED_LIBRARIES, TEST_MBED_LIB],
"peripherals": ["digital_loop"]
},
{
"id": "MBED_A22", "description": "Call function before main (mbed_main)",
"source_dir": join(TEST_DIR, "mbed", "call_before_main"),
"dependencies": [MBED_LIBRARIES, TEST_MBED_LIB],
"automated": True,
},
# Size benchmarks
{

View File

@ -64,7 +64,7 @@ class GCC(mbedToolchain):
self.cc = [join(tool_path, "arm-none-eabi-gcc"), "-std=gnu99"] + common_flags
self.cppc =[join(tool_path, "arm-none-eabi-g++"), "-std=gnu++98"] + common_flags
self.ld = [join(tool_path, "arm-none-eabi-gcc"), "-Wl,--gc-sections"] + self.cpu
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.ar = join(tool_path, "arm-none-eabi-ar")