aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Brucker <jean-philippe.brucker@arm.com>2015-11-26 18:04:11 +0000
committerMark Rutland <mark.rutland@arm.com>2016-06-14 17:49:06 +0100
commit9f01bed3a1c944c3d2bac84b497cbffdacb707ad (patch)
treecbd600b1206627eb25e57345ea212974f5fdbca1
parent988b01a8eabdee19866a472a7b290a2b5ac1e3e3 (diff)
downloadboot-wrapper-aarch64-9f01bed3a1c944c3d2bac84b497cbffdacb707ad.tar.gz
Pass object files on the ld command line
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>
-rw-r--r--Makefile.am10
-rw-r--r--model.lds.S6
2 files changed, 6 insertions, 10 deletions
diff --git a/Makefile.am b/Makefile.am
index 4f5bfdd..b1b9a4f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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 $@ $<
diff --git a/model.lds.S b/model.lds.S
index 6be474f..09a2452 100644
--- a/model.lds.S
+++ b/model.lds.S
@@ -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)