summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-09-06 10:45:18 -0500
committerAaron Durbin <adurbin@chromium.org>2015-09-09 19:36:08 +0000
commit83bc0db777ef4906b0e0d2b588bfb14e1b82c84e (patch)
tree3bee4a5d1a725a29774680fbc40d289665f6deaa /src/lib
parentc9b053d07d1edbd2b0016d19cb6730597ee0a21e (diff)
x86: link ramstage the same way regardless of RELOCATABLE_RAMSTAGE
Previously there were 2 paths in linking ramstage. One was used for RELOCATABLE_RAMSTAGE while the other was fixed location. Now that rmodtool can handle multiple secitons for a single proram segment there's no need for linking ramstage using lib/rmodule.ld. That also means true rmodules don't have symbols required for ramstage purposes so fix memlayout.h. Lastly add default rules for creating rmod files from the known file names and locations. BUG=chrome-os-partner:44827 BRANCH=None TEST=Built rambi. Inspected ramstage.debug as well as rmodules created during the build. Change-Id: I98d249036c27cb4847512ab8bca5ea7b02ce04bd Signed-off-by: Aaron Durbin <adubin@chromium.org> Reviewed-on: http://review.coreboot.org/11524 Tested-by: build bot (Jenkins) Tested-by: Raptor Engineering Automated Test Stand <noreply@raptorengineeringinc.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Makefile.inc9
-rw-r--r--src/lib/program.ld6
2 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index a89f7d4018..f4d8c2c2ea 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -218,9 +218,12 @@ define rmodule_link
$(strip $(1)): $(strip $(2)) $$(COMPILER_RT_rmodules_$(4)) $(obj)/lib/rmodule.rmodules_$(4).ld | $$(RMODTOOL)
$$(LD_rmodules_$(4)) $$(LDFLAGS_rmodules_$(4)) $(RMODULE_LDFLAGS) -T $(obj)/lib/rmodule.rmodules_$(4).ld --defsym=__heap_size=$(strip $(3)) -o $$@ --whole-archive --start-group $(filter-out %.ld,$(2)) --end-group
$$(NM_rmodules_$(4)) -n $$@ > $$(basename $$@).map
-
-$(strip $(1)).rmod: $(strip $(1))
- $$(RMODTOOL) -i $$^ -o $$@
endef
endif
+
+$(objcbfs)/%.debug.rmod: $(objcbfs)/%.debug | $(RMODTOOL)
+ $(RMODTOOL) -i $< -o $@
+
+$(obj)/%.elf.rmod: $(obj)/%.elf | $(RMODTOOL)
+ $(RMODTOOL) -i $< -o $@
diff --git a/src/lib/program.ld b/src/lib/program.ld
index d6e3e54c09..9f28d659f3 100644
--- a/src/lib/program.ld
+++ b/src/lib/program.ld
@@ -38,14 +38,14 @@
*(.text);
*(.text.*);
-#if ENV_RAMSTAGE || ENV_ROMSTAGE || ENV_RMODULE
+#if ENV_RAMSTAGE || ENV_ROMSTAGE
. = ALIGN(ARCH_POINTER_ALIGN_SIZE);
_cbmem_init_hooks = .;
KEEP(*(.rodata.cbmem_init_hooks));
_ecbmem_init_hooks = .;
#endif
-#if ENV_RAMSTAGE || ENV_RMODULE
+#if ENV_RAMSTAGE
. = ALIGN(ARCH_POINTER_ALIGN_SIZE);
_pci_drivers = .;
KEEP(*(.rodata.pci_driver));
@@ -92,7 +92,7 @@
#ifdef __PRE_RAM__
PROVIDE(_preram_cbmem_console = .);
PROVIDE(_epreram_cbmem_console = _preram_cbmem_console);
-#elif ENV_RAMSTAGE || ENV_RMODULE
+#elif ENV_RAMSTAGE
. = ALIGN(ARCH_POINTER_ALIGN_SIZE);
_bs_init_begin = .;
KEEP(*(.bs_init));