For a PE image, "objcopy --add-gnu-debuglink" is used to add a debug link
section in PE image.
>From PeCoff's spec, the "debug link" section's (MSFT point to PDB path) should
be described in "Debug Directory" in Data Directory in PE optional header. You
could use objdump -p UsbBusDxe.MSFT.efi, to look at OptionalHeader-
>DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG].
The Data Directory
Entry 0 0000000000000000 00000000 Export Directory [.edata (or where ever we
found it)]
Entry 1 0000000000000000 00000000 Import Directory [parts of .idata]
Entry 2 0000000000000000 00000000 Resource Directory [.rsrc]
Entry 3 0000000000000000 00000000 Exception Directory [.pdata]
Entry 4 0000000000000000 00000000 Security Directory
Entry 5 0000000000006880 00000054 Base Relocation Directory [.reloc]
Entry 6 0000000000004fe0 0000001c Debug Directory <======= Debug
section's
offset and size [MSFT]
Entry 7 0000000000000000 00000000 Description Directory
Entry 8 0000000000000000 00000000 Special Directory
Entry 9 0000000000000000 00000000 Thread Storage Directory [.tls]
Entry a 0000000000000000 00000000 Load Configuration Directory
Entry b 0000000000000000 00000000 Bound Import Directory
Entry c 0000000000000000 00000000 Import Address Table Directory
Entry d 0000000000000000 00000000 Delay Import Directory
Entry e 0000000000000000 00000000 CLR Runtime Header
Entry f 0000000000000000 00000000 Reserved
But if I use "objcopy --add-gnu-debuglink" to generate ".gnu_debuglink"
section, this section's address/size was not described in OptionalHeader-
>DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG].
The Data Directory
Entry 0 0000000000007f60 00000036 Export Directory [.edata (or where ever we
found it)]
Entry 1 0000000000007fa0 00000014 Import Directory [parts of .idata]
Entry 2 0000000000000000 00000000 Resource Directory [.rsrc]
Entry 3 0000000000000000 00000000 Exception Directory [.pdata]
Entry 4 0000000000000000 00000000 Security Directory
Entry 5 0000000000007fc0 00000054 Base Relocation Directory [.reloc]
Entry 6 0000000000000000 00000000 Debug Directory <========= No debug
section information in [GNU]
Entry 7 0000000000000000 00000000 Description Directory
Entry 8 0000000000000000 00000000 Special Directory
Entry 9 0000000000000000 00000000 Thread Storage Directory [.tls]
Entry a 0000000000000000 00000000 Load Configuration Directory
Entry b 0000000000000000 00000000 Bound Import Directory
Entry c 0000000000000000 00000000 Import Address Table Directory
Entry d 0000000000000000 00000000 Delay Import Directory
Entry e 0000000000000000 00000000 CLR Runtime Header
Entry f 0000000000000000 00000000 Reserved
So in GNU world, I could only hardcode to use "gnu_debuglink" section name to
search debug link section. In MSFT, our code use the offset information in
OptionalHeader->DataDirectory[IMAGE_DIRECTORY_ENTRY_DEBUG] to locate the debug
section.
--
Summary: GNU debuglink section is not described in DEBUG entry in
data directory in PE's optional header
Product: binutils
Version: 2.21 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: binutils
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: ken dot lu at intel dot com
CC: bug-binutils at gnu dot org
http://sourceware.org/bugzilla/show_bug.cgi?id=11401
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
_______________________________________________
bug-binutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-binutils