public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Ian Lance Taylor <ian@zembu.com>
Cc: geoffk@ozemail.com.au, hjl@lucon.org, drepper@cygnus.com,
	binutils@sourceware.cygnus.com,
	libc-hacker@sourceware.cygnus.com, jgg@ualberta.ca
Subject: Re: A glibc dynamic linker or gld bug?
Date: Tue, 06 Jul 1999 19:28:00 -0000	[thread overview]
Message-ID: <19990706192811.A20081@twiddle.net> (raw)
In-Reply-To: <19990707021030.28537.qmail@daffy.airs.com>

On Tue, Jul 06, 1999 at 10:10:30PM -0400, Ian Lance Taylor wrote:
> In order to implement ``strong defined symbol in shared library
> overrides weak defined symbol in main executable'' correctly, we must
> ensure that all relocations involving weak defined symbols in the
> executable become dynamic relocations resolved at run time.

/* Should we do dynamic things to this symbol?  */

#define alpha_elf_dynamic_symbol_p(h, info)                             \
  ((((info)->shared && !(info)->symbolic)                               \
    || (((h)->elf_link_hash_flags                                       \
         & (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))     \
        == (ELF_LINK_HASH_DEF_DYNAMIC | ELF_LINK_HASH_REF_REGULAR))     \
    || (h)->root.type == bfd_link_hash_undefweak                        \
    || (h)->root.type == bfd_link_hash_defweak)                         \
   && (h)->dynindx != -1)

This should probably just be generic.

> Are we willing to pay that price for all weak defined symbols in all
> dynamically linked executables?

I think so.  There are really very few of them in practice.
And failing to override weak symbols is surprising behaviour
from my point of view.

> It is perhaps worth noting that the System V linker and the SGI
> linker, unlike the GNU linker and the Solaris linker, considers a weak
> definition followed by a strong definition to be a multiple definition
> error.

Really?  SGI does this?  I'm a bit surprised.

> (I am therefore a bit surprised to hear that the SGI dynamic
> linker permits a strong definition in a shared library to override a
> weak definition in an executable, since that appears to contradict the
> program linker's behaviour.)

This based on how Uli reported that SGI was arguing the weak symbol
behaviour at load time topic at the IA64 ELF ABI meetings.  (Which,
btw, has reportedly degenerated into a generic ELF ABI meeting.)


r~

  reply	other threads:[~1999-07-06 19:28 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-04 13:52 H.J. Lu
1999-07-05  2:38 ` Geoff Keating
1999-07-05  7:41   ` Jason Gunthorpe
1999-07-05 20:48   ` Richard Henderson
1999-07-06  1:01     ` Geoff Keating
1999-07-06 12:16       ` Geoff Keating
1999-07-06 19:11     ` Ian Lance Taylor
1999-07-06 19:28       ` Richard Henderson [this message]
1999-07-06 19:31         ` Ian Lance Taylor
1999-07-06 21:45       ` H.J. Lu
1999-07-07  7:36         ` Ian Lance Taylor
1999-07-07  7:39           ` H.J. Lu
1999-07-07  7:44             ` Ian Lance Taylor
1999-07-07  7:57               ` H.J. Lu
1999-07-07  8:03                 ` Ian Lance Taylor
1999-07-07 20:12               ` Geoff Keating
1999-07-07 20:16                 ` Ian Lance Taylor
1999-07-07  1:33       ` Geoff Keating
1999-07-07  7:35         ` Ian Lance Taylor
1999-07-07 11:22         ` Ian Lance Taylor
1999-07-07 20:13           ` Geoff Keating
1999-07-07 20:28             ` Ian Lance Taylor
1999-07-08 17:29               ` Geoff Keating
1999-07-09  6:11                 ` Franz Sirl
1999-07-10  3:14                   ` Geoff Keating
1999-07-10  5:40                     ` Ian Lance Taylor

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=19990706192811.A20081@twiddle.net \
    --to=rth@twiddle.net \
    --cc=binutils@sourceware.cygnus.com \
    --cc=drepper@cygnus.com \
    --cc=geoffk@ozemail.com.au \
    --cc=hjl@lucon.org \
    --cc=ian@zembu.com \
    --cc=jgg@ualberta.ca \
    --cc=libc-hacker@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).