From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9880 invoked by alias); 3 Aug 2009 04:32:19 -0000 Received: (qmail 9832 invoked by uid 22791); 3 Aug 2009 04:32:19 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.redpinesignals.com (HELO mail.redpinesignals.com) (203.196.161.92) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 03 Aug 2009 04:32:14 +0000 Received: from [192.168.40.84] ([192.168.40.84]) (authenticated user sumanth.gundapneni@redpinesignals.com) by mail.redpinesignals.com; Mon, 3 Aug 2009 09:53:25 +0530 Message-ID: <4A76641A.1010503@redpinesignals.com> Date: Mon, 03 Aug 2009 04:32:00 -0000 From: sumanth User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Jim Wilson CC: gcc@gcc.gnu.org Subject: Re: extern variable References: <4A71B07A.1030600@redpinesignals.com> <4A75EA44.8050201@codesourcery.com> In-Reply-To: <4A75EA44.8050201@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-08/txt/msg00025.txt.bz2 Jim, If I define USER_LABEL_PREFIX "" and declare a global variable using names r0/r1...r15 ( my register names ) , my assembler is generating an error message saying " r0 is already defined , cannot use register in expression " ........ How can i make sure my tool chain knows the difference between global variable r0 and register r0. Regards, Sumanth G Jim Wilson wrote: > On 07/30/2009 07:38 AM, sumanth wrote: >> How can I make sure the debugging information printed by my compiler for >> extern variables is correct. >> I am able to print them in gdb in with an _ (underscore). I am using >> Gcc-4.3.4 and gdb 5.3 > > ELF targets usually don't prepend an underscore to symbol names. But > if you are prepending an underscore for some reason, then you need to > make sure that your ASM_OUTPUT_* macros handle this correctly. You > set USER_LABEL_PREFIX to an underscore, and then you add the > USER_LABEL_PREFIX unless the symbol name starts with '*'. See the > ASM_GENERATE_INTERNAL_LABEL docs. This stuff can be tricky. You will > probably have to step through your cc1 port in gdb to see exactly what > is going on. It will be useful to look at an existing port that > handles this correctly; step through it in gdb to see how it works. > > Jim > >