Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Aug 1996 19:35:37 +0800
From:      Peter Wemm <peter@spinner.DIALix.COM>
To:        Bruce Evans <bde@zeta.org.au>
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 
Message-ID:  <199608131135.TAA22996@spinner.DIALix.COM>
In-Reply-To: Your message of "Tue, 13 Aug 1996 21:01:20 %2B1000." <199608131101.VAA10191@godzilla.zeta.org.au> 

next in thread | previous in thread | raw e-mail | index | archive | help
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





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