From: John Reiser <jreiser@BitWagon.com>
To: binutils@sourceware.cygnus.com
Cc: Alan Modra <amodra@bigpond.net.au>
Subject: Re: optionally postpone assignment of Common
Date: Tue, 25 Sep 2001 21:13:00 -0000 [thread overview]
Message-ID: <3BB1564A.690B67F@BitWagon.com> (raw)
In-Reply-To: <20010926114341.Q3143@bubble.sa.bigpond.net.au>
Hi Alan and binutils,
Using --no-define-common can save space, and can help prevent
selecting an impostor when many dynamic modules have special
search rules for symbol resolution.
Index: ld.texinfo
===================================================================
RCS file: /cvs/src/src/ld/ld.texinfo,v
retrieving revision 1.51
diff -u -r1.51 ld.texinfo
--- ld.texinfo 2001/09/24 18:35:08 1.51
+++ ld.texinfo 2001/09/26 03:59:04
@@ -950,6 +950,24 @@
symbol is defined, the first file listed is the location of the
definition. The remaining files contain references to the symbol.
+@cindex common allocation
+@kindex --no-define-common
+@item --no-define-common
+This option inhibits the assignment of addresses to common symbols.
+The script command @code{INHIBIT_COMMON_ALLOCATION} has the same effect.
+@xref{Miscellaneous Commands}.
+
+The @samp{--no-define-common} option allows decoupling
+the decision to assign addresses to Common symbols from the choice
+of the output file type; otherwise a non-Relocatable output type
+forces assigning addresses to Common symbols.
+Using @samp{--no-define-common} allows Common symbols that are referenced
+from a shared library to be assigned addresses only in the main program.
+This eliminates the unused duplicate space in the shared library,
+and also prevents any possible confusion over resolving to the wrong
+duplicate when there are many dynamic modules with specialized search
+paths for runtime symbol resolution.
+
@cindex symbols, from command line
@kindex --defsym @var{symbol}=@var{exp}
@item --defsym @var{symbol}=@var{expression}
@@ -2310,6 +2328,13 @@
This command has the same effect as the @samp{-d} command-line option:
to make @code{ld} assign space to common symbols even if a relocatable
output file is specified (@samp{-r}).
+
+@item INHIBIT_COMMON_ALLOCATION
+@kindex INHIBIT_COMMON_ALLOCATION
+@cindex common allocation in linker script
+This command has the same effect as the @samp{--no-define-common}
+command-line option: to make @code{ld} omit the assignment of addresses
+to common symbols even for a non-relocatable output file.
@item NOCROSSREFS(@var{section} @var{section} @dots{})
@kindex NOCROSSREFS(@var{sections})
--
John Reiser, jreiser@BitWagon.com
next prev parent reply other threads:[~2001-09-25 21:13 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-07 8:56 ld: orthogonal functionality? John Reiser
2001-09-10 10:43 ` Nick Clifton
2001-09-19 9:07 ` [PATCH] " John Reiser
2001-09-19 9:13 ` H . J . Lu
2001-09-19 10:53 ` John Reiser
2001-09-19 12:14 ` John Reiser
2001-09-24 23:38 ` Where can I add "-lm" flag to compile tc-*.c jw c
2001-09-25 11:55 ` optionally postpone assignment of Common John Reiser
2001-09-25 19:13 ` Alan Modra
2001-09-25 21:13 ` John Reiser [this message]
2001-09-29 5:58 ` Alan Modra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3BB1564A.690B67F@BitWagon.com \
--to=jreiser@bitwagon.com \
--cc=amodra@bigpond.net.au \
--cc=binutils@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).