public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: sumanth <sumanth.gundapneni@redpinesignals.com>
To: Jim Wilson <wilson@codesourcery.com>
Cc: gcc@gcc.gnu.org
Subject: Re: extern variable
Date: Mon, 03 Aug 2009 04:32:00 -0000	[thread overview]
Message-ID: <4A76641A.1010503@redpinesignals.com> (raw)
In-Reply-To: <4A75EA44.8050201@codesourcery.com>

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
>
>


  reply	other threads:[~2009-08-03  4:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30 14:53 sumanth
2009-08-02  2:22 ` Michael Eager
2009-08-02 19:34 ` Jim Wilson
2009-08-03  4:32   ` sumanth [this message]
2009-08-03 16:02     ` Jim Wilson
2009-08-03 18:54       ` sumanth
2009-08-03 20:10         ` Jim Wilson
2009-08-04 15:35           ` sumanth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A76641A.1010503@redpinesignals.com \
    --to=sumanth.gundapneni@redpinesignals.com \
    --cc=gcc@gcc.gnu.org \
    --cc=wilson@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).