Werner Zeh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/69682 )
Change subject: src/commonlib/fsp_relocate.c: Fix cbfstool build on 32 bit host ......................................................................
src/commonlib/fsp_relocate.c: Fix cbfstool build on 32 bit host
On a 32 bit host, uintptr_t is defined as 'unsigned int' instead of 'unsigend long int' like on a 64 bit host. When cbfstool is build on a 32 bit host, the printk format specifier '%lx' expects a 'long int' while new_addr is of type 'uintptr_t', aka 'unsigned int'. This in the end leads to a build error.
To fix this and make it build on both, 32 and 64 bit hosts, cast new_addr to (void *) and use %p as the format specifier.
Test=Build cbfstool on 32 and 64 bit hosts.
Change-Id: Ia917d2ed31778f3a29c0a6c7368f74c15319b099 Signed-off-by: Werner Zeh werner.zeh@siemens.com --- M src/commonlib/fsp_relocate.c 1 file changed, 22 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/69682/1
diff --git a/src/commonlib/fsp_relocate.c b/src/commonlib/fsp_relocate.c index 55295ca..afc3f31 100644 --- a/src/commonlib/fsp_relocate.c +++ b/src/commonlib/fsp_relocate.c @@ -219,7 +219,7 @@ delta, image_base, img_base_off, (uint32_t)((uint8_t *)&ophdr->ImageBase - pe_base));
- printk(FSP_DBG_LVL, "relocating PE32 image at addr - 0x%lx\n", new_addr); + printk(FSP_DBG_LVL, "relocating PE32 image at addr - 0x%p\n", (void *) new_addr); rsize = read_le32(&ophdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].Size); roffset = read_le32(&ophdr->DataDirectory[EFI_IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress); printk(FSP_DBG_LVL, "relocation table at offset-%x,size=%x\n", roffset, rsize);