Location lists again

Michal Ludvig mludvig@suse.cz
Thu Feb 13 16:36:00 GMT 2003


Hi Daniel,
I propose a small modification to .debug_loc output. Now it's generated 
in a form of:
         .section        .debug_loc,"",@progbits
.LLST0:
         .quad   .LVL0-.text     # Location list begin address (*.LLST0)
         .quad   .LVL1-.text     # Location list end address (*.LLST0)
         .value  0x1     # Location expression size
         .byte   0x55    # DW_OP_reg5
[...]

So the address range is recorded as offsets from beginning of .text 
section in a given .o file. When I link several of .o files together, 
these offsets don't get updated to reflect curent position and current 
offset in the resulting binary. Would it be possible to change the 
output to absolute addresses?

         .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.
If I manually change the .s file generated from .c, remove '-.text' and 
compile it seems to work perfectly.

Thanks in advance!

Michal Ludvig
-- 
* SuSE CR, s.r.o     * mludvig@suse.cz
* (+420) 296.545.373 * http://www.suse.cz



More information about the Gcc mailing list