diff options
author | Tom Rini <trini@konsulko.com> | 2018-06-14 13:28:03 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2018-06-14 13:28:03 -0400 |
commit | 9d0dc69235e8327dba5536761c768d40c4e514e5 (patch) | |
tree | 3530f43c7f2a1d1ed5480aee804b60d71cc6dd2d /lib | |
parent | 606fddd76c7a045c09d544357806b0b4de4845c7 (diff) | |
parent | 58bc69d20aaf2e32e93e977d708fe6a1af0ad6d1 (diff) | |
download | u-boot-9d0dc69235e8327dba5536761c768d40c4e514e5.zip u-boot-9d0dc69235e8327dba5536761c768d40c4e514e5.tar.gz u-boot-9d0dc69235e8327dba5536761c768d40c4e514e5.tar.bz2 |
Merge tag 'signed-efi-next' of git://github.com/agraf/u-boot
Patch queue for efi - 2018-06-14
A few minor fixes for the release:
- Compile fixes
- HI20 relocations for RISC-V
- Fix bootefi without load path
- Fix Runtime Services with certain compilers
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_image_loader.c | 14 | ||||
-rw-r--r-- | lib/efi_loader/efi_runtime.c | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c index 3cffe9e..ecdb77e 100644 --- a/lib/efi_loader/efi_image_loader.c +++ b/lib/efi_loader/efi_image_loader.c @@ -126,6 +126,20 @@ static efi_status_t efi_loader_relocate(const IMAGE_BASE_RELOCATION *rel, case IMAGE_REL_BASED_DIR64: *x64 += (uint64_t)delta; break; +#ifdef __riscv + case IMAGE_REL_BASED_RISCV_HI20: + *x32 = ((*x32 & 0xfffff000) + (uint32_t)delta) | + (*x32 & 0x00000fff); + break; + case IMAGE_REL_BASED_RISCV_LOW12I: + case IMAGE_REL_BASED_RISCV_LOW12S: + /* We know that we're 4k aligned */ + if (delta & 0xfff) { + printf("Unsupported reloc offset\n"); + return EFI_LOAD_ERROR; + } + break; +#endif default: printf("Unknown Relocation off %x type %x\n", offset, type); diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c index 65f2bcf..4874eb6 100644 --- a/lib/efi_loader/efi_runtime.c +++ b/lib/efi_loader/efi_runtime.c @@ -28,6 +28,10 @@ static efi_status_t __efi_runtime EFIAPI efi_unimplemented(void); static efi_status_t __efi_runtime EFIAPI efi_device_error(void); static efi_status_t __efi_runtime EFIAPI efi_invalid_parameter(void); +/* + * TODO(sjg@chromium.org): These defines and structs should come from the elf + * header for each arch (or a generic header) rather than being repeated here. + */ #if defined(CONFIG_ARM64) #define R_RELATIVE 1027 #define R_MASK 0xffffffffULL |