[coreboot-gerrit] New patch to review for filo: Use LPGCC and LPAS
Stefan Reinauer (stefan.reinauer@coreboot.org)
gerrit at coreboot.org
Fri Apr 15 01:06:12 CEST 2016
Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14369
-gerrit
commit 660f90cd4ce9e5dc89596506c0666d6f800c469a
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date: Thu Apr 14 16:04:21 2016 -0700
Use LPGCC and LPAS
FILO used to have its own ldscript because it used a bigger
heap and stack that standard libpayload. These days, heap and
stack are configurable in libpayload, so a separate script is
not needed anymore.
Change-Id: I81f6d8d3b3b3a11b58afd8d29e312d4264922dcd
Signed-off-by: Stefan Reinauer <stefan.reinauer at coreboot.org>
---
Makefile | 8 ++++--
x86/ldscript | 93 ------------------------------------------------------------
2 files changed, 5 insertions(+), 96 deletions(-)
diff --git a/Makefile b/Makefile
index 303ee00..de1df17 100644
--- a/Makefile
+++ b/Makefile
@@ -100,6 +100,8 @@ LIBPAYLOAD = $(LIBPAYLOAD_PREFIX)/lib/libpayload.a
INCPAYLOAD = $(LIBPAYLOAD_PREFIX)/include
LIBGCC = $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
GCCINCDIR = $(shell $(CC) -print-search-dirs | head -n 1 | cut -d' ' -f2)include
+LPGCC = $(LIBPAYLOAD_PREFIX)/bin/lpgcc
+LPAS = $(LIBPAYLOAD_PREFIX)/bin/lpas
ARCHDIR-$(CONFIG_TARGET_I386) := x86
@@ -142,7 +144,7 @@ endif
$(obj)/filo: $(OBJS) $(LIBPAYLOAD)
printf " LD $(subst $(shell pwd)/,,$(@))\n"
- $(LD) -N -T $(ARCHDIR-y)/ldscript $(OBJS) --start-group $(LIBS) --end-group -o $@
+ CC=$(CC) $(LPGCC) $(OBJS) $(LIBS) -o $@
$(obj)/filo.bzImage: $(TARGET) $(obj)/i386/linux_head.o
$(OBJCOPY) -O binary $(obj)/i386/linux_head.o $@.tmp1
@@ -162,11 +164,11 @@ $(KCONFIG_AUTOHEADER): $(src)/.config
$(OBJS): $(KCONFIG_AUTOHEADER) $(obj)/version.h | libpayload
$(obj)/%.o: $(src)/%.c
printf " CC $(subst $(shell pwd)/,,$(@))\n"
- $(CC) -MMD $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+ CC=$(CC) $(LPGCC) -MMD $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
$(obj)/%.S.o: $(src)/%.S
printf " AS $(subst $(shell pwd)/,,$(@))\n"
- $(AS) $(ASFLAGS) -o $@ $<
+ AS=$(AS) $(LPAS) $(ASFLAGS) -o $@ $<
$(obj)/%.map: $(obj)/%
printf " SYMS $(subst $(shell pwd)/,,$(@))\n"
diff --git a/x86/ldscript b/x86/ldscript
deleted file mode 100644
index b260c51..0000000
--- a/x86/ldscript
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * This file is part of FILO.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/* When started from General Software BIOS */
-/* BASE_ADDR = 0x40000; */
-/* When started from coreboot */
-BASE_ADDR = 0x100000;
-
-
-OUTPUT_FORMAT(elf32-i386)
-OUTPUT_ARCH(i386)
-
-ENTRY(entry)
-
-/* 1024KB heap and 64KB stack */
-HEAP_SIZE = 1 * 1024 * 1024;
-STACK_SIZE = 64 * 1024;
-
-SECTIONS
-{
- . = BASE_ADDR;
-
- /* Put Multiboot header near beginning of file, if any. */
- .hdr : { *(.hdr) *(.hdr.*) }
-
- /* Start of the program.
- * Now the version string is in the note, we must include it
- * in the program. Otherwise we lose the string after relocation. */
- . = ALIGN(4096);
- _start = .;
-
- /* Putting ELF notes near beginning of file might help bootloaders.
- * We discard .note sections other than .note.ELFBoot and .note.pinfo,
- * because some versions of GCC generates useless ones. */
- .note : { *(.note.ELFBoot) *(note.pinfo) }
-
- /* Normal sections */
- .boot : { *(.boot) *(.boot.*) }
- .text : { *(.text) *(.text.*) }
- .rodata : {
- . = ALIGN(4);
- drivers_start = .;
- *(.rodata.drivers)
- drivers_end = .;
- *(.rodata)
- *(.rodata.*)
- }
- .data : { *(.data) *(.data.*) }
-
- .bss : {
- *(.sbss)
- *(.sbss.*)
- *(.bss)
- *(.bss.*)
- *(COMMON)
-
- /* heap and stack */
-
- . = ALIGN(16);
- _heap = .;
- . += HEAP_SIZE;
- . = ALIGN(16);
- _eheap = .;
-
- _stack = .;
- . += STACK_SIZE;
- . = ALIGN(16);
- _estack = .;
- }
-
- .initctx : {
- /* Initial contents of stack. This MUST BE just after the stack. */
- *(.initctx)
- }
-
- _end = .;
-
- /DISCARD/ : { *(.comment) *(.note) }
-}
More information about the coreboot-gerrit
mailing list