Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Apr 1997 21:15:22 +0200
From:      j@uriah.heep.sax.de (J Wunsch)
To:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Dynamic linking libraries [Q]
Message-ID:  <19970423211522.OX52607@uriah.heep.sax.de>
In-Reply-To: <199704231741.KAA29305@phaeton.artisoft.com>; from Terry Lambert on Apr 23, 1997 10:41:17 -0700
References:  <199704230223.LAA18646@genesis.atrad.adelaide.edu.au> <199704231741.KAA29305@phaeton.artisoft.com>

next in thread | previous in thread | raw e-mail | index | archive | help
As Terry Lambert wrote:

> Try using 'nm' instead.  The error messages are static, so they can
> be mapped in as data, since they are referenced by the mapped in code
> in order to set up the global:

> 00001670 F _exit.o
> 000015ac T _main
> 000020ec D _sys_errlist		<*************************************
> 000015a0 t gcc2_compiled.
> 00001038 T start
> 
> The marked data is from the libc for the sys_errlist[] reference.

...which actually turns out to be:

j@uriah 912% gdb -q a.out
(gdb) b main
Breakpoint 1 at 0x160c: file foo.c, line 6.
(gdb) run
Starting program: /tmp/a.out 

Breakpoint 1, main () at foo.c:6
6               printf("%s\n", sys_errlist[E2BIG]);
(gdb) p/x sys_errlist
$1 = 0x80624fc

(Thus inside the shared lib.)

-- 
cheers, J"org

joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19970423211522.OX52607>