From owner-cvs-lib Tue Aug 13 04:36:49 1996 Return-Path: owner-cvs-lib Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id EAA09097 for cvs-lib-outgoing; Tue, 13 Aug 1996 04:36:49 -0700 (PDT) Received: from spinner.DIALix.COM (root@spinner.DIALix.COM [192.203.228.67]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id EAA09090; Tue, 13 Aug 1996 04:36:32 -0700 (PDT) Received: from spinner.DIALix.COM (peter@localhost.DIALix.oz.au [127.0.0.1]) by spinner.DIALix.COM (8.7.5/8.7.3) with ESMTP id TAA22996; Tue, 13 Aug 1996 19:35:37 +0800 (WST) Message-Id: <199608131135.TAA22996@spinner.DIALix.COM> X-Mailer: exmh version 1.6.6 3/24/96 To: Bruce Evans cc: CVS-committers@freefall.freebsd.org, ache@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-lib@freefall.freebsd.org Subject: Re: cvs commit: src/lib/libc/locale collcmp.c In-reply-to: Your message of "Tue, 13 Aug 1996 21:01:20 +1000." <199608131101.VAA10191@godzilla.zeta.org.au> Date: Tue, 13 Aug 1996 19:35:37 +0800 From: Peter Wemm Sender: owner-cvs-lib@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Bruce Evans wrote: > BTW, can anyone explain why the following program doesn't dump core > when it is linked dynamically? > --- > extern int alarm; > main() { alarm = 1; } > --- > > When this is linked statically, `alarm' is resolved to be the alarm() > function in the text segment, so the program dumps core as expected. > > Bruce I can guess.. alarm is initially bound to a trampoline function that points to the dynamic linker (the PLT?). When alarm() is first called, the lazy dynamic link happens, and this is replaced by a call to the real address. The PLT is a read/write section. Cheers, -Peter