diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/config.mk | 2 | ||||
-rw-r--r-- | arch/x86/cpu/start.S | 2 | ||||
-rw-r--r-- | arch/x86/cpu/start64.S | 2 | ||||
-rw-r--r-- | arch/x86/cpu/u-boot-64.lds | 37 | ||||
-rw-r--r-- | arch/x86/cpu/u-boot.lds | 34 | ||||
-rw-r--r-- | arch/x86/dts/u-boot.dtsi | 24 | ||||
-rw-r--r-- | arch/x86/include/asm/elf.h | 45 | ||||
-rw-r--r-- | arch/x86/lib/reloc_ia32_efi.c | 1 | ||||
-rw-r--r-- | arch/x86/lib/reloc_x86_64_efi.c | 1 |
9 files changed, 71 insertions, 77 deletions
diff --git a/arch/x86/config.mk b/arch/x86/config.mk index 5f77f98e60..586e11a0dd 100644 --- a/arch/x86/config.mk +++ b/arch/x86/config.mk @@ -23,6 +23,8 @@ endif ifeq ($(IS_32BIT),y) PLATFORM_CPPFLAGS += -march=i386 -m32 +# TODO: These break on x86_64; need to debug further +PLATFORM_RELFLAGS += -fdata-sections else PLATFORM_CPPFLAGS += $(if $(CONFIG_SPL_BUILD),,-fpic) -fno-common -m64 endif diff --git a/arch/x86/cpu/start.S b/arch/x86/cpu/start.S index e4e997e3e8..e1f634ffcd 100644 --- a/arch/x86/cpu/start.S +++ b/arch/x86/cpu/start.S @@ -17,7 +17,7 @@ #include <generated/generic-asm-offsets.h> #include <generated/asm-offsets.h> -.section .text +.section .text.start .code32 .globl _start .type _start, @function diff --git a/arch/x86/cpu/start64.S b/arch/x86/cpu/start64.S index 234482b793..a473fd166d 100644 --- a/arch/x86/cpu/start64.S +++ b/arch/x86/cpu/start64.S @@ -8,7 +8,7 @@ #include <config.h> -.section .text +.section .text.start .code64 .globl _start .type _start, @function diff --git a/arch/x86/cpu/u-boot-64.lds b/arch/x86/cpu/u-boot-64.lds index 3f38681669..862aa2d35e 100644 --- a/arch/x86/cpu/u-boot-64.lds +++ b/arch/x86/cpu/u-boot-64.lds @@ -17,6 +17,23 @@ SECTIONS . = CONFIG_SYS_TEXT_BASE; /* Location of bootcode in flash */ __text_start = .; + + .text.start : { *(.text.start); } + + .__efi_runtime_start : { + *(.__efi_runtime_start) + } + + .efi_runtime : { + *(.text.efi_runtime*) + *(.rodata.efi_runtime*) + *(.data.efi_runtime*) + } + + .__efi_runtime_stop : { + *(.__efi_runtime_stop) + } + .text : { *(.text*); } . = ALIGN(4); @@ -27,7 +44,10 @@ SECTIONS } . = ALIGN(4); - .rodata : { *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) } + .rodata : { + *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) + KEEP(*(.rodata.efi.init)); + } . = ALIGN(4); .data : { *(.data*) } @@ -38,6 +58,21 @@ SECTIONS . = ALIGN(4); .got : { *(.got*) } + .efi_runtime_rel_start : + { + *(.__efi_runtime_rel_start) + } + + .efi_runtime_rel : { + *(.rel*.efi_runtime) + *(.rel*.efi_runtime.*) + } + + .efi_runtime_rel_stop : + { + *(.__efi_runtime_rel_stop) + } + . = ALIGN(4); __data_end = .; __init_end = .; diff --git a/arch/x86/cpu/u-boot.lds b/arch/x86/cpu/u-boot.lds index f0719368ba..a1cc19ce4c 100644 --- a/arch/x86/cpu/u-boot.lds +++ b/arch/x86/cpu/u-boot.lds @@ -17,6 +17,23 @@ SECTIONS . = CONFIG_SYS_TEXT_BASE; /* Location of bootcode in flash */ __text_start = .; + + .text.start : { *(.text.start); } + + .__efi_runtime_start : { + *(.__efi_runtime_start) + } + + .efi_runtime : { + *(.text.efi_runtime*) + *(.rodata.efi_runtime*) + *(.data.efi_runtime*) + } + + .__efi_runtime_stop : { + *(.__efi_runtime_stop) + } + .text : { *(.text*); } . = ALIGN(4); @@ -43,27 +60,14 @@ SECTIONS . = ALIGN(4); - .__efi_runtime_start : { - *(.__efi_runtime_start) - } - - .efi_runtime : { - *(efi_runtime_text) - *(efi_runtime_data) - } - - .__efi_runtime_stop : { - *(.__efi_runtime_stop) - } - .efi_runtime_rel_start : { *(.__efi_runtime_rel_start) } .efi_runtime_rel : { - *(.relefi_runtime_text) - *(.relefi_runtime_data) + *(.rel*.efi_runtime) + *(.rel*.efi_runtime.*) } .efi_runtime_rel_stop : diff --git a/arch/x86/dts/u-boot.dtsi b/arch/x86/dts/u-boot.dtsi index 1253fa51c2..1050236330 100644 --- a/arch/x86/dts/u-boot.dtsi +++ b/arch/x86/dts/u-boot.dtsi @@ -11,7 +11,7 @@ binman { filename = "u-boot.rom"; end-at-4gb; - sort-by-pos; + sort-by-offset; pad-byte = <0xff>; size = <CONFIG_ROM_SIZE>; #ifdef CONFIG_HAVE_INTEL_ME @@ -24,18 +24,18 @@ #endif #ifdef CONFIG_SPL u-boot-spl-with-ucode-ptr { - pos = <CONFIG_SPL_TEXT_BASE>; + offset = <CONFIG_SPL_TEXT_BASE>; }; u-boot-dtb-with-ucode2 { type = "u-boot-dtb-with-ucode"; }; u-boot { - pos = <0xfff00000>; + offset = <0xfff00000>; }; #else u-boot-with-ucode-ptr { - pos = <CONFIG_SYS_TEXT_BASE>; + offset = <CONFIG_SYS_TEXT_BASE>; }; #endif u-boot-dtb-with-ucode { @@ -45,45 +45,45 @@ }; #ifdef CONFIG_HAVE_MRC intel-mrc { - pos = <CONFIG_X86_MRC_ADDR>; + offset = <CONFIG_X86_MRC_ADDR>; }; #endif #ifdef CONFIG_HAVE_FSP intel-fsp { filename = CONFIG_FSP_FILE; - pos = <CONFIG_FSP_ADDR>; + offset = <CONFIG_FSP_ADDR>; }; #endif #ifdef CONFIG_HAVE_CMC intel-cmc { filename = CONFIG_CMC_FILE; - pos = <CONFIG_CMC_ADDR>; + offset = <CONFIG_CMC_ADDR>; }; #endif #ifdef CONFIG_HAVE_VGA_BIOS intel-vga { filename = CONFIG_VGA_BIOS_FILE; - pos = <CONFIG_VGA_BIOS_ADDR>; + offset = <CONFIG_VGA_BIOS_ADDR>; }; #endif #ifdef CONFIG_HAVE_VBT intel-vbt { filename = CONFIG_VBT_FILE; - pos = <CONFIG_VBT_ADDR>; + offset = <CONFIG_VBT_ADDR>; }; #endif #ifdef CONFIG_HAVE_REFCODE intel-refcode { - pos = <CONFIG_X86_REFCODE_ADDR>; + offset = <CONFIG_X86_REFCODE_ADDR>; }; #endif #ifdef CONFIG_SPL x86-start16-spl { - pos = <CONFIG_SYS_X86_START16>; + offset = <CONFIG_SYS_X86_START16>; }; #else x86-start16 { - pos = <CONFIG_SYS_X86_START16>; + offset = <CONFIG_SYS_X86_START16>; }; #endif }; diff --git a/arch/x86/include/asm/elf.h b/arch/x86/include/asm/elf.h deleted file mode 100644 index 7ae9c7d6da..0000000000 --- a/arch/x86/include/asm/elf.h +++ /dev/null @@ -1,45 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0+ */ -/* - * Brought in from Linux 4.1, removed things not useful to U-Boot. - * The definitions perhaps came from the GNU Library which is GPL. - */ - -#ifndef _ASM_X86_ELF_H -#define _ASM_X86_ELF_H - -/* ELF register definitions */ -#define R_386_NONE 0 -#define R_386_32 1 -#define R_386_PC32 2 -#define R_386_GOT32 3 -#define R_386_PLT32 4 -#define R_386_COPY 5 -#define R_386_GLOB_DAT 6 -#define R_386_JMP_SLOT 7 -#define R_386_RELATIVE 8 -#define R_386_GOTOFF 9 -#define R_386_GOTPC 10 -#define R_386_NUM 11 - -/* x86-64 relocation types */ -#define R_X86_64_NONE 0 /* No reloc */ -#define R_X86_64_64 1 /* Direct 64 bit */ -#define R_X86_64_PC32 2 /* PC relative 32 bit signed */ -#define R_X86_64_GOT32 3 /* 32 bit GOT entry */ -#define R_X86_64_PLT32 4 /* 32 bit PLT address */ -#define R_X86_64_COPY 5 /* Copy symbol at runtime */ -#define R_X86_64_GLOB_DAT 6 /* Create GOT entry */ -#define R_X86_64_JUMP_SLOT 7 /* Create PLT entry */ -#define R_X86_64_RELATIVE 8 /* Adjust by program base */ -/* 32 bit signed pc relative offset to GOT */ -#define R_X86_64_GOTPCREL 9 -#define R_X86_64_32 10 /* Direct 32 bit zero extended */ -#define R_X86_64_32S 11 /* Direct 32 bit sign extended */ -#define R_X86_64_16 12 /* Direct 16 bit zero extended */ -#define R_X86_64_PC16 13 /* 16 bit sign extended pc relative */ -#define R_X86_64_8 14 /* Direct 8 bit sign extended */ -#define R_X86_64_PC8 15 /* 8 bit sign extended pc relative */ - -#define R_X86_64_NUM 16 - -#endif diff --git a/arch/x86/lib/reloc_ia32_efi.c b/arch/x86/lib/reloc_ia32_efi.c index a262533c0f..d56cd50bd9 100644 --- a/arch/x86/lib/reloc_ia32_efi.c +++ b/arch/x86/lib/reloc_ia32_efi.c @@ -10,7 +10,6 @@ #include <common.h> #include <efi.h> #include <elf.h> -#include <asm/elf.h> efi_status_t EFIAPI _relocate(long ldbase, Elf32_Dyn *dyn) { diff --git a/arch/x86/lib/reloc_x86_64_efi.c b/arch/x86/lib/reloc_x86_64_efi.c index 59d6f8d3d3..2694de7110 100644 --- a/arch/x86/lib/reloc_x86_64_efi.c +++ b/arch/x86/lib/reloc_x86_64_efi.c @@ -12,7 +12,6 @@ #include <common.h> #include <efi.h> #include <elf.h> -#include <asm/elf.h> efi_status_t EFIAPI _relocate(long ldbase, Elf64_Dyn *dyn) { |