Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #43752

Re: can linker symbols be defined in C?

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: can linker symbols be defined in C?
Date 2014-04-28 18:01 -0400
Organization Self
Message-ID <535ECFA6.5040500@verizon.net> (permalink)
References <2231b9bc-305e-4ed5-af87-e203dd64780a@googlegroups.com> <slrn3vfsllthbi.b9a.andrews@sdf.lonestar.org>

Show all headers | View raw


On 04/28/2014 05:17 PM, Andrew Smallshaw wrote:
...
> No.  The C standards don't even explicitly acknowledge the existence
> of a linker (references to "compiliation units" are the nearest
> you get), never mind providing a method of providing what are
> inevitably platform-specific directions to it.

The standard mentions linkers in footnote 71 (n1570.pdf): "On systems in
which linkers cannot accept extended characters, an encoding of the
universal character name may be used in forming valid external
identifiers.". This is a non-normative footnote, and describes a very
specific special case, so it doesn't count for much.

"The separate translation units of a program communicate by (for
example) calls to functions whose identifiers have external
linkage, manipulation of objects whose identifiers have external linkage
... Translation units may be separately translated and then later linked
to produce an executable program." (5.1.1.1p1)

The standard does not require that a separate program handle that
process. However, if such a program is used, it seems to me to be
reasonable to use the term "linker" to refer to it. I think it still
makes sense to describe the part of the implementation that handles
linking together translation units as the "linker", even if it isn't
actually a separate program.

"In the set of translation units and libraries that constitutes an
entire program, each declaration of a particular identifier with
external linkage denotes the same object or function." (6.2.2p2)

Those three citations seems to me to be more than enough to qualify as
"explicitly acknowledging the existence of a linker". They don't do much
more than acknowledging it, and there's not much more in the rest of the
standard about linking. The rules about how external linkage works imply
some constraints on how a linker could be implemented, but no details
are given.

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

can linker symbols be defined in C? Ralph Doncaster <ralphdoncaster@gmail.com> - 2014-04-28 13:53 -0700
  Re: can linker symbols be defined in C? James Kuyper <jameskuyper@verizon.net> - 2014-04-28 17:15 -0400
  Re: can linker symbols be defined in C? Andrew Smallshaw <andrews@sdf.lonestar.org> - 2014-04-28 21:17 +0000
    Re: can linker symbols be defined in C? Keith Thompson <kst-u@mib.org> - 2014-04-28 14:53 -0700
      Re: can linker symbols be defined in C? glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2014-04-28 23:28 +0000
    Re: can linker symbols be defined in C? James Kuyper <jameskuyper@verizon.net> - 2014-04-28 18:01 -0400
  Re: can linker symbols be defined in C? jacob navia <jacob@spamsink.net> - 2014-04-29 00:26 +0200
    Re: can linker symbols be defined in C? "Bill Cunningham" <nospam@nspam.invalid> - 2014-04-28 19:39 -0400
    Re: can linker symbols be defined in C? Ian Collins <ian-news@hotmail.com> - 2014-04-29 11:45 +1200
    Re: can linker symbols be defined in C? Ralph Doncaster <ralphdoncaster@gmail.com> - 2014-04-28 20:15 -0700
      Re: can linker symbols be defined in C? Kaz Kylheku <kaz@kylheku.com> - 2014-04-29 04:11 +0000
        Re: can linker symbols be defined in C? Ralph Doncaster <ralphdoncaster@gmail.com> - 2014-04-29 16:29 -0700
      Re: can linker symbols be defined in C? Noob <root@127.0.0.1> - 2014-04-29 08:33 +0200
  Re: can linker symbols be defined in C? Siri Crews <chine.bleu@yahoo.com> - 2014-04-28 16:54 -0700
    Re: can linker symbols be defined in C? Ralph Doncaster <ralphdoncaster@gmail.com> - 2014-04-28 20:01 -0700
  Re: can linker symbols be defined in C? Kaz Kylheku <kaz@kylheku.com> - 2014-04-29 00:20 +0000
    Re: can linker symbols be defined in C? Ralph Doncaster <ralphdoncaster@gmail.com> - 2014-04-28 19:57 -0700

csiph-web