Commit 49f1389a authored by Boris Shingarov's avatar Boris Shingarov

Fix ld error in elf maketarget

The sdram_init ELF fails to link:

powerpc64le-linux-gnu-ld -static -nostdlib -T \
    --gc-sections -o sdram_init.elf head.o main.o sdram.o console.o \
powerpc64le-linux-gnu-ld: error: linker script file ''
    appears multiple times
make: *** [Makefile:70: sdram_init.elf] Error 1

This is because is one of the prerequisites, and thus is
contained in $^.  However, it is also explicitly specified as part of
LDFLAGS, as the argument to -T.
Signed-off-by: default avatarBoris Shingarov <>
parent 7566f04f
......@@ -67,7 +67,7 @@ $(OBJ)/libc.o: $(LIBC_OBJ)
$(call Q,LD, $(LD) -r -o $@ $^, $@)
$(OBJ)/$(PROGRAM).elf: $(OBJECTS) $(OBJ)/libc.o $(OBJ)/$(PROGRAM).lds
$(call Q,LD, $(LD) $(LDFLAGS) -o $@ $^, $@)
$(call Q,LD, $(LD) $(LDFLAGS) -o $@ $(OBJECTS) $(OBJ)/libc.o, $@)
$(OBJ)/$(PROGRAM).bin: $(OBJ)/$(PROGRAM).elf
$(call Q,OC, $(OBJCOPY) -O binary -S $^ $@, $@)
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment