This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: _DYNAMIC and _GLOBAL_OFFSET_TABLE_


Alan Modra <amodra@bigpond.net.au> writes:

> Can anyone comment on the history of the following code in elf32-i386.c?
> 
>   /* Mark _DYNAMIC and _GLOBAL_OFFSET_TABLE_ as absolute.  */
>   if (strcmp (h->root.root.string, "_DYNAMIC") == 0
>       || strcmp (h->root.root.string, "_GLOBAL_OFFSET_TABLE_") == 0)
>     sym->st_shndx = SHN_ABS;

I sure with I still had access to the Cygnus repository.

I have a vague recollection that the Solaris linker marked these
symbols as absolute, so I did it in elf32-sparc.c, and copied the code
into elf32-i386.c.  I can't find the ChangeLog entry, unfortunately.

> It's particularly curious given that absolute symbols are relocated
> by current glibc ld.so.

That sounds wrong--it seems to me that an SHN_ABS symbol should always
the value in the symbol table.  I don't understand why ld.so would
change that.  It's easy to get a relocatable symbol, but how are you
supposed to get an absolute symbol?

Ian


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