Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP
Path: utzoo!utcsri!greg
From: greg@utcsri.UUCP (Gregory Smith)
Newsgroups: comp.lang.c
Subject: Re: Questions on X3J11 draft
Message-ID: <3812@utcsri.UUCP>
Date: Fri, 19-Dec-86 14:39:19 EST
Article-I.D.: utcsri.3812
Posted: Fri Dec 19 14:39:19 1986
Date-Received: Fri, 19-Dec-86 23:23:04 EST
References: <351@danews.ATT.COM> <7373@utzoo.UUCP> <3800@watmath.UUCP> <775@axis.UUCP> <780@wjvax.wjvax.UUCP> <5449@brl-smoke.ARPA>
Reply-To: greg@utcsri.UUCP (Gregory Smith)
Organization: CSRI, University of Toronto
Lines: 21
Summary: 

In article <5449@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes:
>In article <780@wjvax.wjvax.UUCP> brett@wjvax.UUCP (Brett Galloway) writes:
>>My real question is in implementation -- are there any loaders/compilers which
>>(stupidly) link in text which is referenced in an extern but not used?
>
>Yes, there are, but a simple trick in the compiler can avoid generating
>references to unused external names.

Scratch the 'stupidly'. This is widely used as a mechanism to force loading
of startup code ( E.g. the code that calls 'main' ). Besides, the
decision of whether or not to load stuff must often be made before
references are resolved. As Doug says, this is better done in the
compiler ( I wouldn't call it a 'trick'...).

I guess the compiler/loader combination would be 'stupid' if unused
externs caused loading.

-- 
----------------------------------------------------------------------
Greg Smith     University of Toronto      UUCP: ..utzoo!utcsri!greg
Have vAX, will hack...