summaryrefslogtreecommitdiff
path: root/src/commonlib
diff options
context:
space:
mode:
authorSridhar Siricilla <sridhar.siricilla@intel.com>2022-06-25 16:30:52 +0530
committerFelix Held <felix-coreboot@felixheld.de>2022-06-30 13:57:18 +0000
commit5902d88264353436c33580d9a9ae82247dbb52ab (patch)
treeabbea3e670813d458ea012493833d155a9f820bc /src/commonlib
parent9dbf9689c98bf67cd541a15b7944696ce19295c0 (diff)
commonlib: Handle DIR64 relocation type in FSP relocation code
It seems fixup or adjustment addition for relocation type EFI_IMAGE_REL_BASED_DIR64 is missing in the fsp rebasing code. The patch address the miss. Without extending the fixup for the relocation type, build system throws warnings during the rebasing of FSP-M and FSP-S blobs which are built with 64bit. Portion of build output containing warning with debug enabled cbfs lib: ................................................... E: file offset: 9218 E: file type = 4 E: file attribs = 0 E: section offset: 9230 E: section type: 12 E: TE image at offset 9234 E: TE Image 0xffed80d4 -> 0xff256234 adjust value: ff37e000 E: Relocs for RVA offset 12000 E: Num relocs in block: 18 E: reloc type a offset f40 E: Unknown reloc type: a Portion of build output after fix: .................................. E: file offset: 9218 E: file type = 4 E: file attribs = 0 E: section offset: 9230 E: section type: 12 E: TE image at offset 9234 E: TE Image 0xffed80d4 -> 0xff256234 adjust value: ff37e000 E: Relocs for RVA offset 12000^M E: Num relocs in block: 18 E: reloc type a offset f40 E: Adjusting 0x7f2e7f377024 ffee9192 -> ff267192 E: reloc type a offset f48 TEST: Integrate FSP blobs built with 64 bit and do boot test. Signed-off-by: Sridhar Siricilla <sridhar.siricilla@intel.com> Change-Id: I894007ec50378357c00d635ec86d044710892aab Reviewed-on: https://review.coreboot.org/c/coreboot/+/65383 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Subrata Banik <subratabanik@google.com>
Diffstat (limited to 'src/commonlib')
-rw-r--r--src/commonlib/fsp_relocate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/commonlib/fsp_relocate.c b/src/commonlib/fsp_relocate.c
index 421dae9012..4d89a70e23 100644
--- a/src/commonlib/fsp_relocate.c
+++ b/src/commonlib/fsp_relocate.c
@@ -170,7 +170,8 @@ static int te_relocate(uintptr_t new_addr, void *te)
printk(FSP_DBG_LVL, "reloc type %x offset %zx\n",
type, offset);
- if (type == EFI_IMAGE_REL_BASED_HIGHLOW) {
+ if (type == EFI_IMAGE_REL_BASED_HIGHLOW ||
+ type == EFI_IMAGE_REL_BASED_DIR64) {
uint32_t *reloc_addr;
uint32_t val;