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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6/30/16, Goswin von Brederlow <goswin-v-b@xxxxxx> 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
>>
>> What does this number represent? I know I can change it using
>> __asm__("def").
>>
>> I read this https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40831 and
>> this https://patchwork.ozlabs.org/patch/118607/ but I couldn't find a
>> definitive explanations of what these numbers mean.
>
> I'm guessing that is just a unique number generated to avoid name
> colisions in the binary. Think about this:
>
> Say you have two compilation units (files) and both have:
>
>     static const int def[9999999] = {1};

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.
-- 
<wempwer@xxxxxxxxx>



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux