]> xenbits.xensource.com Git - people/julieng/boot-wrapper-aarch64.git/commitdiff
Pass object files on the ld command line
authorJean-Philippe Brucker <jean-philippe.brucker@arm.com>
Thu, 26 Nov 2015 18:04:11 +0000 (18:04 +0000)
committerMark Rutland <mark.rutland@arm.com>
Tue, 14 Jun 2016 16:49:06 +0000 (17:49 +0100)
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>
Makefile.am
model.lds.S

index 4f5bfddab23e9f8e8bd395f69a7e78094a338483..b1b9a4f82bde20024d57120c7975556e23303245 100644 (file)
@@ -18,7 +18,7 @@ DEFINES               += -DCPU_IDS=$(CPU_IDS)
 DEFINES                += -DSYSREGS_BASE=$(SYSREGS_BASE)
 DEFINES                += -DUART_BASE=$(UART_BASE)
 
-BOOTLOADER     := boot.S
+OFILES         =
 
 if PSCI
 BOOTMETHOD     := psci.o
@@ -80,12 +80,14 @@ endif
 
 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 $@ $<
index 6be474f8769a6773a8bab24dbc029e601e72c3fa..09a2452faabb21910b0dc4e76d280ca084241feb 100644 (file)
@@ -11,12 +11,6 @@ OUTPUT_FORMAT("elf64-littleaarch64")
 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)