Incorrect .debug_frame FDE entries on 64 bit architectures
Original Reporter info from Mantis: denial
-
Reporter name: Daniel Glöckner
Original Reporter info from Mantis: denial
- Reporter name: Daniel Glöckner
Description:
On 64 architectures Free Pascal will emit FDE entries with 64 bit CIE_pointer values. This shifts the following fields by four bytes so that the FDE entries are no longer associated with the correct code regions.
DWARF 3 allows for 64 bit CIE_pointer values if the length value is also emitted as a 64 bit value and prefixed with $ffffffff. TDebugInfoDwarf has code to work in this 64 bit DWARF mode in other places, but TDwarfAsmCFILowLevel can't access that information. It looks like the 64 bit mode of TDebugInfoDwarf is never enabled anyway.
Steps to reproduce:
Compile something with -gw for x86-64 Linux.
Use "readelf -wF" to look at the debug frame info.
The pc ranges for the FDE entries are all shifted by 32 bits.
Additional information:
The attached patch works for me but should be changed to share its use_64bit_headers, offsetreltype, and offsetabstype variables with TDebugInfoDwarf.
Mantis conversion info:
- Mantis ID: 36520
- OS: Linux
- Platform: x86_64
- Version: 3.3.1