diff options
author | Patrick Georgi <pgeorgi@chromium.org> | 2015-04-04 15:50:20 +0200 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-04-06 19:14:00 +0200 |
commit | 828e0e86f3b7ddb7cde5daddc83be4386a4d43b1 (patch) | |
tree | bd8573ffb53ff1acc6d9c7b8fac86c876f4e04e3 /src/arch/arm64 | |
parent | d126a749b86504a6f4c3a6c572fc8a3b14de6df9 (diff) | |
download | coreboot-828e0e86f3b7ddb7cde5daddc83be4386a4d43b1.tar.xz |
build system: run linker scripts through the preprocessor
This allows combining and simplifying linker scripts.
This is inspired by the commit listed below, but rewritten to match
upstream, and split in smaller pieces to keep intent clear.
Change-Id: Ie5c11bd8495a399561cefde2f3e8dd300f4feb98
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Based-On-Change-Id: I50af7dacf616e0f8ff4c43f4acc679089ad7022b
Based-On-Signed-off-by: Julius Werner <jwerner@chromium.org>
Based-On-Reviewed-on: https://chromium-review.googlesource.com/219170
Reviewed-on: http://review.coreboot.org/9303
Tested-by: build bot (Jenkins)
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/arch/arm64')
-rw-r--r-- | src/arch/arm64/Makefile.inc | 17 | ||||
-rw-r--r-- | src/arch/arm64/bootblock.ld | 1 | ||||
-rw-r--r-- | src/arch/arm64/ramstage.ld | 3 | ||||
-rw-r--r-- | src/arch/arm64/romstage.ld | 1 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/arch/arm64/Makefile.inc b/src/arch/arm64/Makefile.inc index c1f1112280..a9fbde5acd 100644 --- a/src/arch/arm64/Makefile.inc +++ b/src/arch/arm64/Makefile.inc @@ -68,11 +68,13 @@ bootblock-y += ../../lib/memset.c bootblock-y += ../../lib/memcpy.c bootblock-y += ../../lib/memmove.c +bootblock-y += bootblock.ld + # Build the bootblock -$(objcbfs)/bootblock.debug: $(src)/arch/arm64/bootblock.ld $(obj)/ldoptions $$(bootblock-objs) $(obj)/config.h +$(objcbfs)/bootblock.debug: $(obj)/arch/arm64/bootblock.bootblock.ld $$(bootblock-objs) $(obj)/config.h @printf " LINK $(subst $(obj)/,,$(@))\n" - $(LD_bootblock) --gc-sections -static -o $@ -L$(obj) --start-group $(bootblock-objs) --end-group -T $(src)/arch/arm64/bootblock.ld + $(LD_bootblock) --gc-sections -static -o $@ -L$(obj) --start-group $(bootblock-objs) --end-group -T $(obj)/arch/arm64/bootblock.bootblock.ld endif # CONFIG_ARCH_BOOTBLOCK_ARM64 @@ -94,6 +96,8 @@ romstage-y += ../../lib/memmove.c romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c romstage-y += transition.c transition_asm.S +romstage-y += romstage.ld + rmodules_arm64-y += ../../lib/memset.c rmodules_arm64-y += ../../lib/memcpy.c rmodules_arm64-y += ../../lib/memmove.c @@ -102,9 +106,9 @@ rmodules_arm64-y += eabi_compat.c # Build the romstage VBOOT_STUB_DEPS += $(obj)/arch/arm/eabi_compat.rmodules_arm64.o -$(objcbfs)/romstage.debug: $$(romstage-objs) $(src)/arch/arm64/romstage.ld $(obj)/ldoptions +$(objcbfs)/romstage.debug: $$(romstage-objs) $(obj)/arch/arm64/romstage.romstage.ld @printf " LINK $(subst $(obj)/,,$(@))\n" - $(LD_romstage) -nostdlib --gc-sections -static -o $@ -L$(obj) --start-group $(romstage-objs) --end-group -T $(src)/arch/arm64/romstage.ld + $(LD_romstage) -nostdlib --gc-sections -static -o $@ -L$(obj) --start-group $(romstage-objs) --end-group -T $(obj)/arch/arm64/romstage.romstage.ld endif # CONFIG_ARCH_ROMSTAGE_ARM64 @@ -140,14 +144,15 @@ secmon-$(CONFIG_ARCH_USE_SECURE_MONITOR) += ../../lib/memcmp.c secmon-$(CONFIG_ARCH_USE_SECURE_MONITOR) += ../../lib/memcpy.c ramstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c +ramstage-y += ramstage.ld ramstage-srcs += $(wildcard src/mainboard/$(MAINBOARDDIR)/mainboard.c) # Build the ramstage -$(objcbfs)/ramstage.debug: $$(ramstage-objs) $(src)/arch/arm64/ramstage.ld $(obj)/ldoptions +$(objcbfs)/ramstage.debug: $$(ramstage-objs) $(obj)/arch/arm64/ramstage.ramstage.ld @printf " CC $(subst $(obj)/,,$(@))\n" - $(LD_ramstage) -nostdlib --gc-sections -o $@ -L$(obj) --start-group $(ramstage-objs) --end-group -T $(src)/arch/arm64/ramstage.ld + $(LD_ramstage) -nostdlib --gc-sections -o $@ -L$(obj) --start-group $(ramstage-objs) --end-group -T $(obj)/arch/arm64/ramstage.ramstage.ld $(objgenerated)/ramstage.o: $(stages_o) $$(ramstage-objs) @printf " CC $(subst $(obj)/,,$(@))\n" diff --git a/src/arch/arm64/bootblock.ld b/src/arch/arm64/bootblock.ld index 775111bfd0..98c6454182 100644 --- a/src/arch/arm64/bootblock.ld +++ b/src/arch/arm64/bootblock.ld @@ -21,7 +21,6 @@ /* We use ELF as output format. So that we can debug the code in some form. */ OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64") OUTPUT_ARCH(aarch64) -INCLUDE ldoptions PHDRS { diff --git a/src/arch/arm64/ramstage.ld b/src/arch/arm64/ramstage.ld index d767778860..7022e4f151 100644 --- a/src/arch/arm64/ramstage.ld +++ b/src/arch/arm64/ramstage.ld @@ -20,9 +20,6 @@ * 2005.12 yhlu add ramstage cross the vga font buffer handling */ -/* We use ELF as output format. So that we can debug the code in some form. */ -INCLUDE ldoptions - ENTRY(stage_entry) PHDRS diff --git a/src/arch/arm64/romstage.ld b/src/arch/arm64/romstage.ld index c56d5ad3ff..fef2ac50fc 100644 --- a/src/arch/arm64/romstage.ld +++ b/src/arch/arm64/romstage.ld @@ -22,7 +22,6 @@ /* We use ELF as output format. So that we can debug the code in some form. */ OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-littleaarch64") OUTPUT_ARCH(aarch64) -INCLUDE ldoptions PHDRS { |