[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/27951] New: PE64 Add-Section Virtual Address is 0 ?

From: df7729 at gmail dot com
Subject: [Bug binutils/27951] New: PE64 Add-Section Virtual Address is 0 ?
Date: Thu, 03 Jun 2021 18:06:57 +0000


            Bug ID: 27951
           Summary: PE64 Add-Section Virtual Address is 0 ?
           Product: binutils
           Version: 2.36.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: df7729 at gmail dot com
  Target Milestone: ---

I've updated to 2.36.1 to ensure this problem didn't go away but it didn't.  I
am building GRUB2 (2.04-1ubuntu26.11) for UEFI booting.   We now need to add a
.sbat section to the PE binaries loaded by shim.   However, when I attempt to
add it using either:

--add-section .sbat=my_csv_file_304_bytes.csv --set-section-flags
.sbat=contents,alloc,load,readonly,data grubx64.efi

or as the example they give in SBAT.md

--set-section-alignment '.sbat=512' --add-section
.sbat=my_csv_file_304_bytes.csv grubx64.efi

The PE won't load because the VirtualAddress set for the new .sbat section is 0
and it must be as large or larger than the SizeOfHeaders value in the Image
Optional Header (mine is 4096).

When I add .sbat to a 686 kernel like vmlinuz it creates a VirtualAddress for
the .sbat as 0xFF000000 (sorry I didn't have the 64bit kernel available to see
what it did for it).

So I'm not sure how to fix objcopy to add the section to the PE64 file with the
correct virtual address, I presume a bug or maybe I have to do something else?


You are receiving this mail because:
You are on the CC list for the bug.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]