Skip to content

Commit

Permalink
arch/x86/bootblock: Link in object files selected with bootblock-y
Browse files Browse the repository at this point in the history
As part of preparing for systems with non-memory-mapped media, we want
to be able to call into C code. This change allows us to link C code
directly into the bootblock. The steps of going from bootblock main()
to CAR setup to C code will be implemented in subsequent patches.

Note that a few files selected with bootblock-y will now be compiled
for the bootblock as well, but since we enabled garbage collection,
they will not be included in the final binary.

Change-Id: I5ca6dcaf176f5469c6a3bb925859399123493bc6
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Reviewed-on: http://review.coreboot.org/11783
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
  • Loading branch information
mrnuke committed Oct 8, 2015
1 parent 0017b00 commit dbeedbe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/arch/x86/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ $(objgenerated)/bootblock.inc: $(src)/arch/x86/$(subst ",,$(CONFIG_BOOTBLOCK_SOU
$< > $(objgenerated)/bootblock.inc.d
$(ROMCC) -c -S $(bootblock_romccflags) -I. $(CPPFLAGS_bootblock) $< -o $@

$(objcbfs)/bootblock.debug: $(obj)/arch/x86/bootblock.bootblock.o $(obj)/arch/x86/bootblock.bootblock.ld
# $(obj)/arch/x86/bootblock.bootblock.ld is part of $(bootblock-objs)
$(objcbfs)/bootblock.debug: $$(bootblock-objs)
@printf " LINK $(subst $(obj)/,,$(@))\n"
$(LD_bootblock) $(LDFLAGS_bootblock) -static -o $@ -L$(obj) $< \
$(LD_bootblock) $(LDFLAGS_bootblock) -o $@ -L$(obj) \
$(filter-out %.ld,$(bootblock-objs)) \
-T $(obj)/arch/x86/bootblock.bootblock.ld


Expand Down
4 changes: 4 additions & 0 deletions src/arch/x86/failover.ld
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ SECTIONS
*(.rom.text);
*(.rom.data);
*(.rom.data.*);
*(.text);
*(.text.*);
*(.rodata);
*(.rodata.*);
_erom = .;
} >rom = 0xff
Expand All @@ -65,6 +68,7 @@ SECTIONS
*(.note)
*(.comment.*)
*(.note.*)
*(.eh_frame)
*(.iplt)
*(.rel.*)
*(.igot.*)
Expand Down

0 comments on commit dbeedbe

Please sign in to comment.