EmbDev.net

Forum: ARM programming with GCC/GNU tools normal to have undefined symbols?


von errolflynn (Guest)


Rate this post
useful
not useful
After compiling/linking a FreeRTOS program into an ELF file for 
ARM-Cortex M4 (ARMv7E-M) using arm-none-eabi tools, I see that some 
symbols are still undefined. Some are from libc/crt libraries.

The output of
1
arm-none-eabi-objdump -tT | grep --line-buffered "UND" | tee tmp.txt

is
1
00000000  w      *UND*  00000000 malloc
2
00000000  w      *UND*  00000000 __deregister_frame_info
3
00000000  w      *UND*  00000000 software_init_hook
4
00000000  w      *UND*  00000000 hardware_init_hook
5
00000000  w      *UND*  00000000 __libc_fini
6
00000000  w      *UND*  00000000 _Jv_RegisterClasses
7
00000000  w      *UND*  00000000 __register_frame_info
8
00000000  w      *UND*  00000000 free

This project uses CMake with the following compile and link flags:
1
set(GCC_COVERAGE_COMPILE_FLAGS "-march=armv7e-m -mthumb \
2
-mfloat-abi=softfp -mfpu=fpv4-sp-d16 -Og -fmessage-length=0 \
3
-fsigned-char -ffunction-sections -fdata-sections -ffreestanding \
4
-fno-move-loop-invariants -Wall -Wextra -g3")
5
6
set(GCC_COVERAGE_LINK_FLAGS
7
"-T \"${PROJECT_SOURCE_DIR}/ldscripts/mem.ld\" \
8
-T \"${PROJECT_SOURCE_DIR}/ldscripts/libs.ld\" \
9
-T \"${PROJECT_SOURCE_DIR}/ldscripts/sections.ld\" \
10
-Xlinker --gc-sections -Wl,-Map,\"elka.map\" \
11
--specs=nosys.specs")

As you can see, it uses
1
nosys
 specs, which uses Newlib I think.

von Erl S. (errolflynn)


Rate this post
useful
not useful
Edit (new acct):
For context, the program builds and runs with closed-source build tools, 
but I switched to open-source tools and now it builds but does not run.

Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.