This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Where do number suffixes in symbol names come from?
- From: Brian Drummond <brian at shapes dot demon dot co dot uk>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 30 Jun 2016 14:39:43 +0100
- Subject: Re: Where do number suffixes in symbol names come from?
- Authentication-results: sourceware.org; auth=none
- References: <CAKmQUfbLbNE5czEENat2xc8WuB6xmeoGChmo3JQ=1-Ee+n3Mbg at mail dot gmail dot com> <20160630103350 dot GB15848 at frosties> <CAKmQUfax6q30vvWhDoW=zhFEc+w1chPz+1+o+CDuWgjSGk6fiQ at mail dot gmail dot com>
- Reply-to: brian at shapes dot demon dot co dot uk
On Thu, 2016-06-30 at 12:59 +0200, john smith wrote:
> On 6/30/16, Goswin von Brederlow <goswin-v-b@web.de> wrote:
> >
> > On Thu, Jun 30, 2016 at 11:55:27AM +0200, john smith wrote:
> > >
> > > All static symbol have a short number attached to its name, for
> > > example:
> > >
> > > static const int def[9999999] = {1};
> > >
> > > shows up as:
> > >
> > > 0000000000400920 r def.2802
> > >
> > >Â
> ok, maybe I wasn't clear enough. I wonder how are these numbers
> chosen? It's not a random number because it stays the same after
> every
> compilation. It's not a hash made from an object name because it
> stays
> the same after changing the name.
It might be inherited from the internal representation format, gimple.
This numbers just about everything in the code, including labels on
statements, so that loops, conditionals etc can be translated to
"goto"s. This happens before the optimisation passes transform it and
eliminate whatever they can.
You could test this by compiling with theÂ-fdump-tree-gimple flag.
https://gcc.gnu.org/onlinedocs/gccint/GIMPLE.html
-- Brian