debug_loc decoding error with readelf/objdump ?

Cary Coutant ccoutant@google.com
Tue Aug 31 23:39:00 GMT 2010


>> I think this happened when code is optimized after the dwarf2
>> emission (there are places where this can happen: relaxation, ...).
>> I'll go back to look at GCC to see where this occurred.
>
> It shouldn't be able to happen within gcc itself, as dwarf2 is
> emitted last, alongside assembly output.
>
> Relaxation within the linker is a possibility though.  There are
> lots of tables that have to be updated in order to delete insns,
> and I doubt we get them all right.

This sounds similar to the problem reported here:

   http://gcc.gnu.org/ml/gcc-patches/2009-12/msg00994.html

The issue then was caused by the -ffunction-sections compiler option
combined with --gc-sections in the gold linker.

-cary



More information about the Binutils mailing list