arm-none-eabi-ld link fail

Asked by Gary

I am using the latest windows arm-none-eabi toolchain version 4.9 to generate image for cortex-m3 base mcu.

arm-none-eabi-gcc options CFLAGS:
-march=armv7-m
-mcpu=cortex-m3
-mthumb
-mlittle-endian
-Os
-ffunction-sections
-fdata-sections

arm-none-eabi-as options AS_FLAGS:
-march=armv7-m
-mcpu=cortex-m3
-mthumb
-mlittle-endian

arm-none-eabi-ld options LD_FLAGS:
-static
--gc-sections
-T mcu.lds
-L$(CROSS_BASE)/lib/gcc/arm-none-eabi/4.9.3/armv7-m

Compile & assemble all ok, but the last step fail:
arm-none-eabi-ld $(LD_FLAGS) -o mcu.elf staruptup.o main.o -lc

It shows lots of symbol undefined, such as memset, strlen, sprintf...
I've tried the lib "-lgcc" in other directory, but get the same errors.

How to link these APIs?

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was originally filed as bug #1409197.

Revision history for this message
Joey Ye (jinyun-ye) said :
#1

Convert to a question

Revision history for this message
Joey Ye (jinyun-ye) said :
#2

Answered

Can you help with this problem?

Provide an answer of your own, or ask Gary for more information if necessary.

To post a message you must log in.