From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1770 invoked by alias); 11 Nov 2010 11:08:06 -0000 Received: (qmail 1611 invoked by uid 22791); 11 Nov 2010 11:08:04 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from snape.CeBiTec.Uni-Bielefeld.DE (HELO smtp-relay.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Nov 2010 11:07:05 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 9E49B6D6 for ; Thu, 11 Nov 2010 12:07:02 +0100 (CET) Received: from smtp-relay.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id EN2Ffq28a24r for ; Thu, 11 Nov 2010 12:07:00 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (manam.CeBiTec.Uni-Bielefeld.DE [129.70.161.120]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-relay.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 675E16D5 for ; Thu, 11 Nov 2010 12:07:00 +0100 (CET) Received: (from ro@localhost) by manam.CeBiTec.Uni-Bielefeld.DE (8.14.4+Sun/8.14.4/Submit) id oABB6lfg006546; Thu, 11 Nov 2010 12:06:47 +0100 (MET) From: Rainer Orth To: binutils@sourceware.org Subject: Produce Stabs-in-ELF on IRIX 5 with -no-mdebug Date: Thu, 11 Nov 2010 11:08:00 -0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (usg-unix-v) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2010-11/txt/msg00201.txt.bz2 As reported in GCC PR debug/39104 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39104 stabs debug info fails on IRIX 5.3 all -gstabs* testcases in the GCC testsuite currently fail: $ touch debug.c $ gcc -gstabs -c debug.c /var/tmp//ccDaTzn4.s: Assembler messages: /var/tmp//ccDaTzn4.s:3: Warning: illegal .stabs directive, bad character [...] With -v, one sees that gas is invoked like this $ /vol/gcc/bin/gas-2.20.1 -v -EB -g -no-mdebug -mabi=32 -v -o debug.o debug.s gcc emits .stab* directives for use with Stabs-in-ELF (thus the -no-mdebug), but the IRIX 5 binutils are configured to support both ECOFF (and thus Stabs-in-mdebug for compatibility with IRIX 4) and ELF (this Stabs-in-ELF). Unfortunately, gas/config/obj-elf.c isn't able to deal with ECOFF_DEBUGGING not being a compile-time constant, which is the case here: gas/config/obj-elf.h has #define ECOFF_DEBUGGING mips_flag_mdebug To fix the problem, we need to turn the preprocessor check into a runtime check, which is exactly what the following patch does. The gcc testcase now assembles correctly and I could verify with objdump -g and objdump -s that the .stab/.stabstr sections are created as expected. A full GCC mainline bootstrap is currently running. It will take about a week to complete. Ok for mainline and 2.21 branch if that passes? Rainer 2010-04-18 Rainer Orth * config/obj-elf.c (elf_generate_asm_lineno): New function. (elf_process_stab): New function. (elf_format_ops): Always use them as generate_asm_lineno, process_stab members. --- gas/config/obj-elf.c~ Mon Sep 14 13:43:27 2009 +++ gas/config/obj-elf.c Sun Apr 18 00:34:40 2010 @@ -2351,6 +2351,29 @@ #endif /* SCO_ELF */ +static void +elf_generate_asm_lineno (void) +{ +#ifdef NEED_ECOFF_DEBUG + if (ECOFF_DEBUGGING) + ecoff_generate_asm_lineno (); +#endif +} + +static void +elf_process_stab (segT sec, + int what, + const char *string, + int type, + int other, + int desc) +{ +#ifdef NEED_ECOFF_DEBUG + if (ECOFF_DEBUGGING) + ecoff_stab (sec, what, string, type, other, desc); +#endif +} + static int elf_separate_stab_sections (void) { @@ -2391,13 +2414,8 @@ 0, /* s_get_type */ 0, /* s_set_type */ elf_copy_symbol_attributes, -#ifdef NEED_ECOFF_DEBUG - ecoff_generate_asm_lineno, - ecoff_stab, -#else - 0, /* generate_asm_lineno */ - 0, /* process_stab */ -#endif + elf_generate_asm_lineno, + elf_process_stab, elf_separate_stab_sections, elf_init_stab_section, elf_sec_sym_ok_for_reloc, -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University