The 32-bit linker struggles with INPUT directives in linker scripts, and
tends to include the whole ELF files instead of merging their sections.
Remove INPUT for object files and pass them as arguments to ld instead.
Also sneakily remove the orphan "BOOTLOADER" variable from Makefile.am,
since we're cleaning things up. It hasn't been used for a while.
Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
DEFINES += -DSYSREGS_BASE=$(SYSREGS_BASE)
DEFINES += -DUART_BASE=$(UART_BASE)
-BOOTLOADER := boot.S
+OFILES =
if PSCI
BOOTMETHOD := psci.o
CPPFLAGS += $(INITRD_FLAGS)
+OFILES += boot.o cache.o $(GIC) mmu.o ns.o $(BOOTMETHOD)
+
all: $(IMAGE)
-CLEANFILES = $(IMAGE) boot.o cache.o $(GIC) mmu.o ns.o $(BOOTMETHOD) model.lds fdt.dtb
+CLEANFILES = $(IMAGE) $(OFILES) model.lds fdt.dtb
-$(IMAGE): boot.o cache.o $(GIC) mmu.o ns.o $(BOOTMETHOD) model.lds fdt.dtb $(KERNEL_IMAGE) $(FILESYSTEM)
- $(LD) -o $@ --script=model.lds
+$(IMAGE): $(OFILES) model.lds fdt.dtb $(KERNEL_IMAGE) $(FILESYSTEM)
+ $(LD) $(OFILES) -o $@ --script=model.lds
%.o: %.S Makefile
$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c -o $@ $<
OUTPUT_ARCH(aarch64)
TARGET(binary)
-INPUT(./boot.o)
-INPUT(./cache.o)
-INPUT(./GIC)
-INPUT(./mmu.o)
-INPUT(./ns.o)
-INPUT(./BOOTMETHOD)
INPUT(KERNEL)
INPUT(./fdt.dtb)