This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: _DYNAMIC and _GLOBAL_OFFSET_TABLE_
- From: Ian Lance Taylor <ian at airs dot com>
- To: Alan Modra <amodra at bigpond dot net dot au>
- Cc: binutils at sources dot redhat dot com
- Date: 27 Aug 2003 21:06:53 -0700
- Subject: Re: _DYNAMIC and _GLOBAL_OFFSET_TABLE_
- References: <20030828033534.GO1320@bubble.sa.bigpond.net.au>
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