From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Lance Taylor To: dm@sgi.com Cc: gcc2@cygnus.com, gas2@cygnus.com Subject: Re: global vars and symbol visibility for mips32/elf Date: Fri, 09 Aug 1996 08:30:00 -0000 Message-id: <199608091529.LAA05118@sanguine.cygnus.com> References: <199608090946.CAA27226@neteng.engr.sgi.com> X-SW-Source: 1996/msg00076.html Date: Fri, 9 Aug 1996 02:46:18 -0700 From: "David S. Miller" The problem is caused by the symbol 'glob'. GNU libc also has a symbol glob. This is the bug. An ANSI C compliant shared library may not have a global symbol which infringes on the ANSI C namespace. The symbol must, instead, be weak. It works to have a global symbol in a normal archive library, because then it will only be included if there is no other definition. However, all symbols in a shared library are included if any are, so there must be no extraneous global symbols. The IRIX6.2 linker however places this symbol in the MIPS_ACOMMON section of the resulting executable and does not override using the libc symbol of the same name (the shared IRIX libc does in fact have a symbol named 'glob' just like my MIPS/Linux GNU libc does). If you use elfdump -Dt on the Irix 6.2 libc, you will see that glob is a weak symbol. The use of the MIPS_ACOMMON section is an Irix linker optimization, not supported by gld, which has no particular bearing on this issue. Ian