From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,3664bf15b733551d X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1993-12-17 06:20:49 PST Newsgroups: comp.unix.osf.osf1 Path: gmd.de!xlink.net!sol.ctr.columbia.edu!howland.reston.ans.net!torn!watserv2.uwaterloo.ca!undergrad.math.uwaterloo.ca!watcgl!pbgmayo From: pbgmayo@watcgl.UWaterloo.CA (Peter Mayo [CGL]) Subject: Re: Core Dump From Sendmail 8.6.4 When Linked With Shared Libraries Message-ID: Sender: pbgmayo@watcgl (Peter Mayo [CGL]) Organization: University of Waterloo References: <2eqaoj$7rg@agate.berkeley.edu> Date: Thu, 16 Dec 1993 22:27:16 GMT >From man cc: NOTES The standard library, /usr/ccs/lib/libc.a or /usr/shlib/libc.so, is loaded by using the -lc loader option and not a full path name. The wrong one could be loaded if there are files with the name libc.{so,a} string in the directories specified with the -L loader option or in the default direc- tories searched by the loader. The compile line: cc -L/usr/lib hello.c will produce an a.out that seg. faults before entering user code, even for the classic ``hello world'' program. This is because ld at run time grabs /usr/lib/libc.a before it even tries /usr/shlib/libc.so . all of cc -L/usr/lib -non_shared hello.c cc hello.c cc -L/usr/shlib -L/usr/lib hello.c gcc -L/usr/shlib -L/usr/lib hello.c gcc -L/usr/lib -static hello.c gcc hello.c work as expected and produce runnable code. cc -L/usr/lib hello.c gcc -L/usr/lib hello.c produce executable that seg fault in the morecore called before main. -- Peter B.G. Mayo