diff mbox series

x86/EFI: correct section offsets in mkreloc diagnostics

Message ID 5708d246-694a-424f-0998-261f26ccd118@suse.com (mailing list archive)
State New, archived
Headers show
Series x86/EFI: correct section offsets in mkreloc diagnostics | expand

Commit Message

Jan Beulich April 30, 2020, 10:24 a.m. UTC
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>

Comments

Andrew Cooper April 30, 2020, 1:36 p.m. UTC | #1
On 30/04/2020 11:24, Jan Beulich wrote:
> 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>
diff mbox series

Patch

--- a/xen/arch/x86/efi/mkreloc.c
+++ b/xen/arch/x86/efi/mkreloc.c
@@ -238,7 +238,7 @@  static void diff_sections(const unsigned
             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
         {
             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);