From 92a5742b5f9f217ba6315fa13d075ba98ebc3fd6 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 10 Jan 2010 00:38:53 -0500 Subject: [PATCH] Add explicit Program Headers to linker scripts. Looks like some versions of binutils are aligning the LOAD program header to a large size. This is causing an issue for coreboot users, so add an explicit LOAD program header with a reasonable value. --- src/rombios.lds.S | 6 +++++- src/rombios16.lds.S | 3 +++ src/rombios32seg.lds.S | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/rombios.lds.S b/src/rombios.lds.S index 20cbebe..4cbc15a 100644 --- a/src/rombios.lds.S +++ b/src/rombios.lds.S @@ -9,6 +9,10 @@ OUTPUT_FORMAT("elf32-i386") OUTPUT_ARCH("i386") ENTRY(post32) +PHDRS +{ + text PT_LOAD AT ( code32flat_start ) ; +} SECTIONS { .text code32flat_start : { @@ -22,7 +26,7 @@ SECTIONS . = text16_start + BUILD_BIOS_ADDR - code32flat_start ; *(.text16) final_text16_end = . ; - } + } :text /DISCARD/ : { *(.text*) *(.data*) *(.bss*) *(.rodata*) *(COMMON) *(.discard*) *(.eh_frame) diff --git a/src/rombios16.lds.S b/src/rombios16.lds.S index d4e7648..6d382f0 100644 --- a/src/rombios16.lds.S +++ b/src/rombios16.lds.S @@ -6,6 +6,9 @@ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH("i386") +PHDRS +{ +} SECTIONS { .data16 data16_start : { diff --git a/src/rombios32seg.lds.S b/src/rombios32seg.lds.S index 9961c50..377f4e7 100644 --- a/src/rombios32seg.lds.S +++ b/src/rombios32seg.lds.S @@ -6,6 +6,9 @@ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH("i386") +PHDRS +{ +} SECTIONS { .text32seg code32seg_start : { -- 2.39.5