Harry
Harry

Reputation: 709

arm-none-eabi-ld, to tell object files directory

Trying to figure out a way to link object files that I've built with arm-none-eabi-ld

Here's a directory structure for my build

Application - main.c - start.s - linker.ld

build - main.o - start.o

I just typed this command to make an executable.

Harrys-MacBook-Pro:FreeRTOS-CortexA15 kwooly$ arm-none-eabi-ld -T Application/linker.ld -lc build/start.o build/main.o -o kernel.elf

and I got following error.

arm-none-eabi-ld: cannot find start.o

Is there any way to tell ld that the start.o is in the build directory?

I've tried -L option but wasn't really good.

build/start.o: In function _start': (.text+0x0): multiple definition of_start' build/start.o:(.text+0x0): first defined here Harrys-MacBook-Pro:FreeRTOS-CortexA15 kwooly$

Upvotes: 1

Views: 1276

Answers (1)

yenWu
yenWu

Reputation: 56

This question is quite similar with this one,arm-none-eabi-ld: cannot find -lc. Therefore, you could try to reorder it, such as $arm-none-eabi-ld build/start.o build/main.o -T Application/linker.ld -lc -o kernel.elf.

Upvotes: -1

Related Questions