From: pbgmayo@watcgl.UWaterloo.CA (Peter Mayo [CGL])
Subject: Re: Core Dump From Sendmail 8.6.4 When Linked With Shared Libraries
Date: Thu, 16 Dec 1993 22:27:16 GMT [thread overview]
Message-ID: <CI5FpG.67I@undergrad.math.uwaterloo.ca> (raw)
In-Reply-To: 2eqaoj$7rg@agate.berkeley.edu
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 <pbgmayo@watcgl.UWaterloo.Ca>
prev parent reply other threads:[~1993-12-16 22:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1993-12-16 18:52 Core Dump From Sendmail 8.6.4 When Linked With Shared Libraries Jon Forrest
1993-12-16 22:27 ` Peter Mayo [CGL] [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox