From owner-freebsd-current Tue Nov 24 20:17:28 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id UAA21236 for freebsd-current-outgoing; Tue, 24 Nov 1998 20:17:28 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from detlev.UUCP (31-sweet.camalott.com [208.239.153.31]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id UAA21231 for ; Tue, 24 Nov 1998 20:17:20 -0800 (PST) (envelope-from joelh@gnu.org) Received: (from joelh@localhost) by detlev.UUCP (8.9.1/8.9.1) id WAA14769; Tue, 24 Nov 1998 22:17:00 -0600 (CST) (envelope-from joelh) To: John Polstra Cc: current@FreeBSD.ORG Subject: Re: Elf linker question. References: From: Joel Ray Holveck Date: 24 Nov 1998 22:16:58 -0600 In-Reply-To: John Polstra's message of "Tue, 24 Nov 1998 16:30:49 -0800 (PST)" Message-ID: <86btlwxv7p.fsf@detlev.UUCP> Lines: 22 X-Mailer: Gnus v5.5/Emacs 20.3 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >> How are things like: >> sighander_t mysig = libsig; >> handled? > Any time you take the address of a function, the linker actually fills > in the address of a little stub routine. It's the same stub that > gets called when you call an external function. The first time it is > executed, the stub jumps to code in the dynamic linker that does the > lazy binding to whatever function is being called. Then it rewires > itself (an indirect jump is used) so that all future calls will go > straight to the target function. Oh, so it doesn't snap the pointer in the code? It just leaves it pointing to the stub? Thanks, joelh -- Joel Ray Holveck - joelh@gnu.org Fourth law of programming: Anything that can go wrong wi sendmail: segmentation violation - core dumped To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message