From 1126f04e99f5df070353c63439645b2cb15850a3 Mon Sep 17 00:00:00 2001 From: Juergen Beisert Date: Tue, 21 Dec 2010 12:48:26 +0100 Subject: [PATCH] x86: Use the generic linker script initializing Signed-off-by: Juergen Beisert --- arch/x86/Makefile | 6 ++++++ arch/x86/lib/barebox.lds.S | 2 +- .../asm => mach-i386/include/mach}/barebox.lds.h | 14 -------------- include/asm-generic/barebox.lds.h | 2 +- scripts/setupmbr/setupmbr.c | 2 +- 5 files changed, 9 insertions(+), 17 deletions(-) rename arch/x86/{include/asm => mach-i386/include/mach}/barebox.lds.h (89%) diff --git a/arch/x86/Makefile b/arch/x86/Makefile index e607b893a..3b034c051 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -19,7 +19,13 @@ all: $(KBUILD_IMAGE) +machdirs := $(patsubst %,arch/x86/mach-%/,$(machine-y)) +ifeq ($(KBUILD_SRC),) +CPPFLAGS += $(patsubst %,-I%include,$(machdirs)) +else +CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs)) +endif ifneq ($(board-y),) BOARD := arch/x86/boards/$(board-y)/ diff --git a/arch/x86/lib/barebox.lds.S b/arch/x86/lib/barebox.lds.S index e0919a68e..fffc3a55c 100644 --- a/arch/x86/lib/barebox.lds.S +++ b/arch/x86/lib/barebox.lds.S @@ -20,7 +20,7 @@ */ #undef i386 -#include +#include OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH(i386) diff --git a/arch/x86/include/asm/barebox.lds.h b/arch/x86/mach-i386/include/mach/barebox.lds.h similarity index 89% rename from arch/x86/include/asm/barebox.lds.h rename to arch/x86/mach-i386/include/mach/barebox.lds.h index 6cbf15f5c..81c326e48 100644 --- a/arch/x86/include/asm/barebox.lds.h +++ b/arch/x86/mach-i386/include/mach/barebox.lds.h @@ -23,20 +23,6 @@ * @brief Adapt linker script content in accordance to Kconfig settings */ -#define INITCALLS \ - KEEP(*(.initcall.0)) \ - KEEP(*(.initcall.1)) \ - KEEP(*(.initcall.2)) \ - KEEP(*(.initcall.3)) \ - KEEP(*(.initcall.4)) \ - KEEP(*(.initcall.5)) \ - KEEP(*(.initcall.6)) \ - KEEP(*(.initcall.7)) - -#define BAREBOX_CMDS KEEP(*(SORT_BY_NAME(.barebox_cmd*))) - -#define BAREBOX_SYMS KEEP(*(__usymtab)) - /** * Area in the MBR of the barebox basic boot code. This offset must be in * accordance to the 'indirect_sector_lba' label. diff --git a/include/asm-generic/barebox.lds.h b/include/asm-generic/barebox.lds.h index fc141a474..2d1dc411d 100644 --- a/include/asm-generic/barebox.lds.h +++ b/include/asm-generic/barebox.lds.h @@ -1,5 +1,5 @@ -#if defined CONFIG_ARCH_IMX25 || defined CONFIG_ARCH_IMX35 || defined CONFIG_ARCH_IMX51 +#if defined CONFIG_ARCH_IMX25 || defined CONFIG_ARCH_IMX35 || defined CONFIG_ARCH_IMX51 || defined CONFIG_X86 #include #endif diff --git a/scripts/setupmbr/setupmbr.c b/scripts/setupmbr/setupmbr.c index dd7f38ccb..74ede94d3 100644 --- a/scripts/setupmbr/setupmbr.c +++ b/scripts/setupmbr/setupmbr.c @@ -43,7 +43,7 @@ /* include the info from this barebox release */ #include "../../include/generated/utsrelease.h" -#include "../../arch/x86/include/asm/barebox.lds.h" +#include "../../arch/x86/mach-i386/include/mach/barebox.lds.h" /** define to disable integrity tests and debug messages */ #define NDEBUG