This is the mail archive of the binutils@sourceware.org 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: Support for ELF's STT_COMMON symbol type


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

> On Wed, Oct 03, 2007 at 07:41:17AM -0700, Ian Lance Taylor wrote:
> > Alan Modra <amodra@bigpond.net.au> 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:

http://sco.com/developers/gabi/latest/ch4.symtab.html#stt_common

Ian


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