Commit dd3230d0 authored by Paul Menzel's avatar Paul Menzel Committed by Peter Jones

shim: Extend invalid reloc size warning message

Knowing the value of the reloc directory size is helpful for debugging,
cf. issue #131 [1],

[1]: https://github.com/rhboot/shim/issues/131Signed-off-by: 's avatarPaul Menzel <pmenzel@molgen.mpg.de>
parent f442c842
......@@ -280,8 +280,14 @@ static EFI_STATUS relocate_coff (PE_COFF_LOADER_IMAGE_CONTEXT *context,
while (RelocBase < RelocBaseEnd) {
Reloc = (UINT16 *) ((char *) RelocBase + sizeof (EFI_IMAGE_BASE_RELOCATION));
if ((RelocBase->SizeOfBlock == 0) || (RelocBase->SizeOfBlock > context->RelocDir->Size)) {
perror(L"Reloc %d block size %d is invalid\n", n, RelocBase->SizeOfBlock);
if (RelocBase->SizeOfBlock == 0) {
perror(L"Reloc %d block size 0 is invalid\n", n);
return EFI_UNSUPPORTED;
} else if (RelocBase->SizeOfBlock > context->RelocDir->Size) {
perror(L"Reloc %d block size %d greater than reloc dir"
"size %d, which is invalid\n", n,
RelocBase->SizeOfBlock,
context->RelocDir->Size);
return EFI_UNSUPPORTED;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment