This is the mail archive of the binutils@sourceware.cygnus.com 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]

A glibc dynamic linker or gld bug?


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]%;<NC"34KJ38%L24;00Z!ALMW<,>]@,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:#<S%(O\#K@-QG4EO6JD!J@L_B1'5UGEB5)
M&P&URVJ3_R3/W:BA/1BE@><=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"+,<XFB1P]GM
M6JE4S<WR7G(6@GMAKB%\)5V`-($OYO9K>&%>,/`MA&(1J\KL2II3-PLA2:TK
M%1-B=Q]#EDYM35KEL)2I<B.82LW<G'1[_<ED`$X.O3<FBBK^`?2^@_,Y.W?T
MO2P6YV[IA3_NA?^#E]I^#&6%K`TKW6P<.,G-^\F>&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

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