This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: printing exceptions?
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Adam Megacz <gcj at lists dot megacz dot com>
- Cc: Java Discuss List <java at gcc dot gnu dot org>
- Date: Wed, 6 Mar 2002 13:51:19 -0500 (EST)
- Subject: Re: printing exceptions?
On 6 Mar 2002, Adam Megacz wrote:
> > You must never link -lc ahead of -lpthread. The latter often overrides
> > symbols in the former (e.g. wait).
>
> BTW, why does the order of -l arguments matter?
The runtime linker resolves symbols by searching libraries in link order.
The order is only important if symbols are duplicated, as in
libpthread.so:
[jsturm@suzy jsturm]$ readelf -s /lib/libpthread.so.0 | grep fork
218: 00008650 198 FUNC WEAK DEFAULT 12 fork@@GLIBC_2.0
[jsturm@suzy jsturm]$ readelf -s /lib/libc.so.6 | grep fork
1241: 000bb160 50 FUNC WEAK DEFAULT 11 fork@@GLIBC_2.0
(output trimmed for clarity.)
By placing -lc first, you will bind to the wrong implementation of fork().
Jeff