This is the mail archive of the
mailing list for the binutils project.
Re: Support for ELF's STT_COMMON symbol type
Alan Modra <email@example.com> writes:
> On Wed, Oct 03, 2007 at 07:41:17AM -0700, Ian Lance Taylor wrote:
> > Alan Modra <firstname.lastname@example.org> writes:
> > > ld.so won't like STT_COMMON..
> > I hope that is not correct.
> See glibc/elf/do-lookup.h
> if (__builtin_expect (ELFW(ST_TYPE) (sym->st_info) > STT_FUNC
> && ELFW(ST_TYPE) (sym->st_info) != STT_TLS, 0))
> /* Ignore all but STT_NOTYPE, STT_OBJECT and STT_FUNC
> entries (and STT_TLS if TLS is supported) since these
> are no code/data definitions. */
> return NULL;
I believe this is a bug which should be fixed in glibc. The whole
point of STT_COMMON, as I understand it, is to get around the
limitation that SHN_COMMON disappears in a shared library.
The ABI draft is clear that STT_COMMON symbols are permitted in
executables and shared libraries: