On Thursday, February 13, 2003, at 11:28 AM, Michal Ludvig wrote:
.section .debug_loc,"",@progbits
.LLST0:
.quad .LVL0 # Location list begin address (*.LLST0)
.quad .LVL1 # Location list end address (*.LLST0)
.value 0x1 # Location expression size
.byte 0x55 # DW_OP_reg5
[...]
This way the addresses would be correctly updated on linking.
They are correct, though readelf -w will only show the offsets, because
it doesn't know what CU they go with (IE debug_loc parsing is completely
removed from debug_info parsing).
When a debugger actually loads them, it is supposed to add the base
address of the CU to each one.
I've been looking to gcc/dwarf2out.c (on rtlopt-branch) and in
output_loc_list() there is a code that could output addresses instead of
deltas: