From mboxrd@z Thu Jan 1 00:00:00 1970 From: hjl@lucon.org (H.J. Lu) To: drepper@cygnus.com (Ulrich Drepper) Cc: ian@cygnus.com (Ian Lance Taylor), binutils@sourceware.cygnus.com, libc-hacker@sourceware.cygnus.com (GNU C Library), jgg@ualberta.ca Subject: A glibc dynamic linker or gld bug? Date: Sun, 04 Jul 1999 13:52:00 -0000 Message-id: <19990704205206.7C71E57B9@ocean.lucon.org> X-SW-Source: 1999-q3/msg00030.html Hi, Here is a testcase for a glibc dynamic linker or gld bug: # make cc -shared -o libfoo.so -fPIC -O -g foo.c cc -o bar1.o -c -fPIC -O -g bar.c cc -o foo1 -O -g libfoo.so main.c bar1.o -Wl,-rpath,. cc -o bar2.o -c -O -g bar.c cc -o foo2 -O -g libfoo.so main.c bar2.o -Wl,-rpath,. for f in foo1 foo2; do echo "Running: $f"; ./$f; \ if [ $? != 0 ]; then echo Failed; fi; done Running: foo1 Failed Running: foo2 The same testcase ran fine under Solaris/x86 and Solaris/Sparc even with the GNU ld. I suspect the bug is in the weak symbol handling in the glibc dynamic linker. Since the Solaris dynamic linker treats weak as strong, the bug may also be in gld. -- H.J. Lu (hjl@gnu.org) -- begin 644 shared.tar.gz M'XL(`,S'?S<``^V7WVO;,!#'\QK]%;]@,4 MQTZ\.G)1'/HP]K]/LA,O@2;9'NP.>I^'&%FZTSFGK^^\6D@=S_A%IT'`H\+W MH0/`A$_M%=B(E]<-%"`0(R&\D:#<=R3_WZOS3P#>SS/."#M"&XMGCF><_507,8IEE M>22+&"Z!AN2I8T+:8ZO_C_(N3M(L;F*/4_H77-3Z#T1@9CGG#/7?!I.K#V_? M?;ITKL&9$W)S>VT&8(H!LS^<$/-F&$.O7TX,2#?)-220JOI6"+,&%>,/`MA&(1J\KL2II3-PLA2:TK M%1-B=Q]#EDYM35KEL)2I&T*J<,=VPQVS:GETR((? MMMA?&V6Q5&/2U4OCJDX&#.V3#LWS_77^M_JO_IYFSM@I_7/ZI_YSP6S]#SC6 M_U9X>:_E?"GA(99W.XT`>:PO*&\.[?F$_J`:$GMNS(C\)*7*^Z]VC(S8J[4# M8M,LI[DN*DL`'1=KK:S77]AO/"%;_;OSV315:='$'B?[?V9J?C#R&?>-_*W^ MN>D`4/]M,-56^*:V$;U6J,1GQU;_9=/1T!ZG],]VOO\Y$]7WOT#]M\&A^G^D G`;"-ZJ;B;ZKX3M''>HX@"((@"((@"((@"((@_P^_`1H*[V<`*``` ` end