This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Where do number suffixes in symbol names come from?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]