From owner-freebsd-hackers Sat Jul 26 08:00:50 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id IAA02862 for hackers-outgoing; Sat, 26 Jul 1997 08:00:50 -0700 (PDT) Received: from zeus.gel.usherb.ca (zeus.gel.usherb.ca [132.210.70.7]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id IAA02857 for ; Sat, 26 Jul 1997 08:00:48 -0700 (PDT) Received: from castor.gel.usherb.ca by zeus.gel.usherb.ca (4.1/SMI-4.1) id AA14047; Sat, 26 Jul 97 11:00:46 EDT Received: by castor.gel.usherb.ca (SMI-8.6/SMI-SVR4) id LAA13984; Sat, 26 Jul 1997 11:00:45 -0400 Date: Sat, 26 Jul 1997 11:00:44 -0400 (EDT) From: "Alex.Boisvert" To: freebsd-hackers@freebsd.org Subject: gdb and shared libraries Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Hello all hackers - I'm trying to port the JDK 1.1.2 to FreeBSD and I am having a few difficulties with shared libraries. The VM gets a segmentation faults when going through the _GLOBAL_OFFSET_TABLE_ to execute a function in a dynamic library (in this case, libawt_g.so). The libawt_g.so library is loaded via a dlopen() call. In gdb, I get the following output after the library is loaded and the VM crashed: ---- cut here ----- Program received signal SIGSEGV, Segmentation fault. 0x0 in ?? () (gdb) info sharedlibrary >From To Syms Read Shared Object Library 0x0807a000 0x0808a000 Yes /usr/libexec/ld.so 0x08091000 0x080ab000 Yes /usr/lib/libm.so.2.0 0x080aa000 0x081a5434 Yes /usr/X11R6/lib/libXm.so.1.2 0x081a5000 0x081e7000 Yes /usr/X11R6/lib/libXt.so.6.0 0x081e6000 0x081f0000 Yes /usr/X11R6/lib/libXext.so.6.1 0x081ef000 0x082851a0 Yes /usr/X11R6/lib/libX11.so.6.1 0x08285000 0x082ef710 Yes /usr/lib/libc.so.3.0 0x09403000 0x0946552c No /home/alex/jdk/javasrc/build/lib/i386/green_threads/libawt_g.so (gdb) ------ cut here ------ Notice the "No" for libawt_g.so in the column "Syms Read". What does this mean??? Have I forgotten to do something after dlopen()? Regards, Alex. PS: I am using dlsym() to get the address of the function.