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.
I have a similar problem. Has anybody taken care of the matter?