]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
x86/EFI: correct section offsets in mkreloc diagnostics
authorJan Beulich <jbeulich@suse.com>
Mon, 4 May 2020 09:53:42 +0000 (11:53 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 4 May 2020 09:53:42 +0000 (11:53 +0200)
These are more helpful if they point at the address where the relocated
value starts, rather than at the specific byte of the difference.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/efi/mkreloc.c

index 1aca79672a5501e5a59adeae36e8e59238b8f741..83a0afa00b837e7b076a371c311bb6db8d57211d 100644 (file)
@@ -238,7 +238,7 @@ static void diff_sections(const unsigned char *ptr1, const unsigned char *ptr2,
             fprintf(stderr,
                     "Difference at %.8s:%08" PRIxFAST32 " is %#" PRIxFAST64
                     " (expected %#" PRIxFAST64 ")\n",
-                    sec->name, i, delta, diff);
+                    sec->name, i - disp, delta, diff);
             continue;
         }
         if ( width == 8 && (val1.u64 < base || val1.u64 > end) )
@@ -263,14 +263,14 @@ static void diff_sections(const unsigned char *ptr1, const unsigned char *ptr2,
         {
             fprintf(stderr,
                     "Cannot handle decreasing RVA (at %.8s:%08" PRIxFAST32 ")\n",
-                    sec->name, i);
+                    sec->name, i - disp);
             exit(3);
         }
 
         if ( !(sec->flags & COFF_SECTION_WRITEABLE) )
             fprintf(stderr,
                     "Warning: relocation to r/o section %.8s:%08" PRIxFAST32 "\n",
-                    sec->name, i);
+                    sec->name, i - disp);
 
         printf("\t.word (%u << 12) | 0x%03" PRIxFAST32 "\n",
                reloc, sec->rva + i - disp - rva);