This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [patch] Add discriminator support to gas .loc directive
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Dave Korn <dave dot korn dot cygwin at googlemail dot com>, Cary Coutant <ccoutant at google dot com>, Nick Clifton <nickc at redhat dot com>, Binutils <binutils at sourceware dot org>
- Date: Tue, 30 Jun 2009 18:21:28 +0100
- Subject: Re: [patch] Add discriminator support to gas .loc directive
- References: <c17be2b30904201838nbb02752r9372787844a1634e@mail.gmail.com> <49ED7B85.7060606@redhat.com> <c17be2b30904211027w3e8359aen7cdf268cfee5b7f1@mail.gmail.com> <c17be2b30904211146u2f4c8ed2m967ca5d95d665318@mail.gmail.com> <49F16BFA.3040201@redhat.com> <c17be2b30904241133v1dc5a2a4s9484dda8bf5c1674@mail.gmail.com> <4A49F5A4.3040209@gmail.com> <6dc9ffc80906300949o6d3208fdqc77a30a7ce67084c@mail.gmail.com>
H.J. Lu wrote:
> On Tue, Jun 30, 2009 at 4:23 AM, Dave
> Korn<dave.korn.cygwin@googlemail.com> wrote:
>> Cary Coutant wrote:
>>>>> * NEWS: Add item about discriminator support.
>>>>> * dwarf2dbg.h (struct dwarf2_line_info): Add discriminator field.
>>>>> * dwarf2dbg.c (current): Add discriminator field.
>>>>> (dwarf2_where): Copy discriminator value.
>>>>> (dwarf2_consume_line_info): Set discriminator to 0.
>>>>> (dwarf2_directive_loc): Process discriminator sub-op.
>>>>> (out_leb128): New function.
>>>>> (process_entries): Output DW_LNE_set_discriminator.
>>>>> * doc/as.texinfo: Add discriminator operand to .loc directive.
>>>>> * testsuite/gas/lns/lns-common-1.d: Add test for discriminator.
>>>>> * testsuite/gas/lns/lns-common-1.s: Likewise.
>>>> Approved - please apply.
>>> Thanks! Committed.
>> Hi Gary,
>>
>> Now that GCC HEAD has begun actually generating this form of directives, we
>> are seeing a lot of these errors on Cygwin:
>>
>> libtool: link: /gnu/gcc/obj-patched3/./gcc/gcj
>> -B/gnu/gcc/obj-patched3/i686-pc-cygwin/libjava/ -B/gnu/gcc/obj-patched3/./gcc/
>> -B/opt/gcc-tools/i686-pc-cygwin/bin/ -B/opt/gcc-tools/i686-pc-cygwin/lib/
>> -isystem /opt/gcc-tools/i686-pc-cygwin/include -isystem
>> /opt/gcc-tools/i686-pc-cygwin/sys-include -ffloat-store -fomit-frame-pointer
>> -Usun -g -O2 -o .libs/jv-convert.exe --main=gnu.gcj.convert.Convert
>> -shared-libgcc -L/gnu/gcc/obj-patched3/i686-pc-cygwin/libjava/.libs
>> -L/gnu/gcc/obj-patched3/i686-pc-cygwin/libjava ./.libs/libgcj.a -ldl
>> -L/opt/gcc-tools/lib/gcc/i686-pc-cygwin/4.5.0
>> /opt/gcc-tools/bin/ld: Dwarf Error: mangled line number section.
>>
>> This turns out to be because you overlooked to add support for the new
>> DW_LNE_ extended opcode in the decoding loop at
>> bfd/dwarf2.c:decode_line_info()#1334.
>>
>
> Why doesn't it fail on Linux?
I don't know. Does GCC HEAD on Linux maybe not generate the discriminator
form of ".loc" directive in the same circumstances as the Cygwin target? In
an entire bootstrap, the first (and possibly only) instance I ran into was
this one in libffi, so it may be something that's only infrequently emitted.
Alternatively, I think it may not cause a link failure on its own; if there
hadn't by chance also been undefined references in the same file for an
unrelated reason to bring my bootstrap crashing to a halt, I might easily have
overlooked that message in the build log.
cheers,
DaveK