From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Earnshaw To: gcc-gnats@gcc.gnu.org Subject: middle-end/3544: SJLJ exceptions with dwarf2 debug broken Date: Tue, 03 Jul 2001 07:16:00 -0000 Message-id: <200107031405.PAA26426@sun18.cambridge.arm.com> X-SW-Source: 2001-07/msg00066.html List-Id: >Number: 3544 >Category: middle-end >Synopsis: SJLJ exceptions with dwarf2 debug broken >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Tue Jul 03 07:16:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Richard Earnshaw >Release: 3.0 >Organization: >Environment: System: SunOS sun18 5.7 Generic_106541-11 sun4u sparc SUNW,Ultra-5_10 Architecture: sun4 host: sparc-sun-solaris2.7 build: sparc-sun-solaris2.7 target: arm-unknown-elf configured with: /home/rearnsha/thirdparty/gcc/configure --prefix=/home/rearnsha/thirdparty/install --target=arm-elf --with-headers=/home/rearnsha/thirdparty/utils/newlib/libc/include --enable-languages=c,c++,objc,f77 >Description: Building libstdc++-v3 with an arm-elf cross compiler generates object files that reference non-existent internal labels from the unwind information tables. This seems to be occuring because dwarf2out.c and except.c maintain distinct counters for the funcdef number and that these are getting out of step. In dwarf2out (dwarf2out_begin_prologue) we have: fde->funcdef_number = current_funcdef_number; and (output_call_frame_info) has: ASM_GENERATE_INTERNAL_LABEL (l1, "LLSDA", fde->funcdef_number); but in except.c (output_function_exception_table) we have if (! cfun->uses_eh_lsda) return; funcdef_number = (USING_SJLJ_EXCEPTIONS ? sjlj_funcdef_number : current_funcdef_number); ... ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LLSDA", funcdef_number); hence the generated label and the fde->funcdef_number can get out of step if not all functions use lsda information. >How-To-Repeat: Build libstdc++-v3/libsupc++/eh_aux_runtime.cc for arm-unknown-elf with the gcc-3.0 release. Note that the resulting object file defines the labels LSDA0 & LSDA1, but that the exception unwind table references LSDA1 and LSDA2. The resulting object file will fail to link. >Fix: No idea. >Release-Note: >Audit-Trail: >Unformatted: