
The specification of gnu-debuglink can be found at: https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html The file CRC or the CRC value from the .gnu_debuglink section is now used to calculate the module UUID as a fallback, to allow verifying that the debug object does match the executable. Note that if a CodeView build id exists, it still takes precedence. This works even for MinGW builds because LLD writes a synthetic CodeView build id which does not get stripped from the debug object. The `Minidump/Windows/find-module` test also needs a fix by adding a CodeView record to the exe to match the one in the minidump, otherwise it fails due to the new UUID calculated from the file CRC. Fixes https://github.com/llvm/llvm-project/issues/54344 Reviewed By: DavidSpickett Differential Revision: https://reviews.llvm.org/D126367
51 lines
1.8 KiB
YAML
51 lines
1.8 KiB
YAML
# This test produces a stripped version of the object file and adds a
|
|
# gnu-debuglink section to it linking to the unstripped version of the object
|
|
# file. The debug info shall be loaded from the gnu-debuglink reference.
|
|
|
|
# RUN: yaml2obj %s -o %t
|
|
# RUN: llvm-objcopy --strip-all --add-gnu-debuglink=%t %t %t.stripped
|
|
# RUN: lldb-test object-file %t.stripped | FileCheck %s
|
|
|
|
# CHECK: Name: .debug_info
|
|
# CHECK-NEXT: Type: dwarf-info
|
|
|
|
--- !COFF
|
|
OptionalHeader:
|
|
AddressOfEntryPoint: 5152
|
|
ImageBase: 5368709120
|
|
SectionAlignment: 4096
|
|
FileAlignment: 512
|
|
MajorOperatingSystemVersion: 6
|
|
MinorOperatingSystemVersion: 0
|
|
MajorImageVersion: 0
|
|
MinorImageVersion: 0
|
|
MajorSubsystemVersion: 6
|
|
MinorSubsystemVersion: 0
|
|
Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI
|
|
DLLCharacteristics: [ IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA, IMAGE_DLL_CHARACTERISTICS_DYNAMIC_BASE, IMAGE_DLL_CHARACTERISTICS_NX_COMPAT, IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE ]
|
|
SizeOfStackReserve: 1048576
|
|
SizeOfStackCommit: 4096
|
|
SizeOfHeapReserve: 1048576
|
|
SizeOfHeapCommit: 4096
|
|
header:
|
|
Machine: IMAGE_FILE_MACHINE_AMD64
|
|
Characteristics: [ IMAGE_FILE_EXECUTABLE_IMAGE, IMAGE_FILE_LARGE_ADDRESS_AWARE ]
|
|
sections:
|
|
- Name: .text
|
|
Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
|
|
VirtualAddress: 4096
|
|
VirtualSize: 64
|
|
SectionData: DEADBEEFBAADF00D
|
|
- Name: .data
|
|
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
|
|
VirtualAddress: 8192
|
|
VirtualSize: 64
|
|
SectionData: DEADBEEFBAADF00D
|
|
- Name: .debug_info
|
|
Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_DISCARDABLE, IMAGE_SCN_MEM_READ ]
|
|
VirtualAddress: 16384
|
|
VirtualSize: 64
|
|
SectionData: DEADBEEFBAADF00D
|
|
symbols: []
|
|
...
|