public inbox for gas2@sourceware.org
 help / color / mirror / Atom feed
From: "Eric Youngdale" <eric@aib.com>
To: hjl@nynexst.com (H.J. Lu)
Cc: bonn@eskimo.com (David Bonn),
	kjahds@kjahds.com (Kenneth Albanowski),
	lmfken@lmf.ericsson.se (Kenneth Osterberg),
	ian@lasermoon.co.uk, mat@ardi.com (Mat Hostetter),
	ecn@clark.net (Eric C. Newton),
	doughera@lafcol.lafayette.edu (Andy Dougherty),
	brian@mathworks.com (Brian Bourgault),
	jchristy@bga.com (John W. Christy),
	craig@metrolink.com (Craig Groeschel),
	imp@village.org (Warner Losh), robf@www.willows.com (Rob Farnum),
	Huw.Rogers@ska.com (Huw Rogers),
	meissner@cygnus.com (Michael Meissner),
	linux-gcc@vger.rutgers.edu (linuxgcc),
	gas2@cygnus.com, raeburn@cygnus.com (Ken Raeburn),
	ian@cygnus.com (Ian Lance Taylor)
Subject: Re: DT_SYMBOLIC and -Bsymbolic
Date: Tue, 20 Jun 1995 11:55:00 -0000	[thread overview]
Message-ID: <9506201454.ZM27215@aib.com> (raw)
In-Reply-To: <9506200047.AA09538@titanic.nynexst.com>

	OK, I think the enclosed patch is more along the lines of what is
required.  The general idea is that we bypass the PLT when -Bsymbolic is
in effect, and in addition the GOT slots have a different type of relocation
(R_*_RELATIVE instead of R_*_GLOB_DAT).  I updated both the Sparc and i386
backends (others would be easy, if other backends supported shared libs).

	From what I can tell the advantages of using this are that you
get slightly better performance at runtime since you do not go through the
PLT for every function call.  In addition, there is less startup overhead
since there are no PLT slots to be initialized.  The GOT slots still exist,
but the R_*_RELOCATION relocations do not have a symbol, so you do not
have to search any of the symbol tables to perform these relocations, and
there would be yet another very slight performance increase.

	The Solaris linker does put a DT_SYMBOLIC entry in the .dynamic
section, but I am not sure what it is used for.  It is possible that it
would be used in cases where you attempt to link non-PIC code into a
shared library, since you would still be emitting relocations to the
output file in this case.  Thus patches to the dynamic loader should still
be required.

	The drawbacks to using this flag are that the library is less
sharable.  In other words, the user cannot redefine functions in the
library and expect that their redefinition will work for calls to the
function from within the library.

	I vaguely recall a few months ago seeing a discussion between some
of the members of the ABI+ committee (who are charged with updating the
SVr4 ABI, and merging differences between Solaris and Unixware).  Apparently
some (but not all) SVr4 vendors are using -Bsymbolic with libc - apparently
for performance reasons.

	FWIW, I would recommend against ever using this switch except in
certain specific cases - people need to know exactly what they are doing
when they turn this one on, and they need to know the ramifications.

-Eric

-- 
"The woods are lovely, dark and deep.  But I have promises to keep,
And lines to code before I sleep, And lines to code before I sleep."

      reply	other threads:[~1995-06-20 11:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-06-19  7:01 H.J. Lu
1995-06-19  7:42 ` Eric Youngdale
1995-06-19  8:01   ` H.J. Lu
1995-06-19  8:13     ` Eric Youngdale
1995-06-19 14:54     ` Eric Youngdale
1995-06-19 15:21 ` Eric Youngdale
1995-06-19 17:55   ` H.J. Lu
1995-06-20 11:55     ` Eric Youngdale [this message]

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=9506201454.ZM27215@aib.com \
    --to=eric@aib.com \
    --cc=Huw.Rogers@ska.com \
    --cc=bonn@eskimo.com \
    --cc=brian@mathworks.com \
    --cc=craig@metrolink.com \
    --cc=doughera@lafcol.lafayette.edu \
    --cc=ecn@clark.net \
    --cc=gas2@cygnus.com \
    --cc=hjl@nynexst.com \
    --cc=ian@cygnus.com \
    --cc=ian@lasermoon.co.uk \
    --cc=imp@village.org \
    --cc=jchristy@bga.com \
    --cc=kjahds@kjahds.com \
    --cc=linux-gcc@vger.rutgers.edu \
    --cc=lmfken@lmf.ericsson.se \
    --cc=mat@ardi.com \
    --cc=meissner@cygnus.com \
    --cc=raeburn@cygnus.com \
    --cc=robf@www.willows.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).