public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Geoff Keating <geoffk@ozemail.com.au>
Cc: Franz.Sirl-kernel@lauterbach.com, binutils@sourceware.cygnus.com
Subject: Re: R_PPC_LOCAL24PC c++ linking problems with current binutils
Date: Mon, 19 Jul 1999 20:05:00 -0000	[thread overview]
Message-ID: <19990719230705.A8451@drow.res.cmu.edu> (raw)
In-Reply-To: <199907200217.MAA09776@geoffk.wattle.id.au>

On Tue, Jul 20, 1999 at 12:17:08PM +1000, Geoff Keating wrote:
> OK, I see it.
> 
> The problem is that the following is happening:
> 
> 1. g++ is defining the symbol 
>  '__default_alloc_template<true, 0>::_S_chunk_alloc(unsigned int, int &)'
>    (in demangled form, which I'll just call `...' from now on :-)
>    weak in a linkonce section.
> 2. In libstdc++.so, the symbol is not defined weak.
> 3. In the same linkonce section, there is 'bl ...@local'.  The @local
>    is because it's a recursive call.
> 4. ld finds the strong definition, in the shared object.
> 5. The symbol is not therefore defined locally, and linking fails.
>   
> I assume ld is correct in emitting the linkonce section even though
> it will actually be using the shared object symbol.  I may be wrong.
> Certainly it doesn't seem to make much sense to do this.
> 
> Other fixes would be:
> (i) define the libstdc++ symbol weak, and/or
> (ii) don't use @local on weak symbols and/or 
> (iii) make @local relocs point to the symbol defined in this object
> whether or not there is a stronger definition elsewhere.

As I prepare to expose my underlying ignorance of how binutils works...

It seems to me that we know before we try to relocate anything inside
of the linkonce section whether or not we will be using this
section - either we do, or we should fairly easily be able to
determine.

If this is the case, then is it possible to simply not perform the
relocation in this case?

Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|        SCS Class of 2002       |
|   Debian GNU/Linux Developer    __    Carnegie Mellon University   |
|         dan@debian.org         |  |       dmj+@andrew.cmu.edu      |
\--------------------------------/  \--------------------------------/

  reply	other threads:[~1999-07-19 20:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-19 15:21 Franz Sirl
1999-07-19 16:49 ` Ian Lance Taylor
1999-07-19 17:49   ` Daniel Jacobowitz
1999-07-19 19:56     ` Ian Lance Taylor
1999-07-19 20:07   ` Daniel Jacobowitz
1999-07-20  9:33     ` Ian Lance Taylor
1999-07-19 19:30 ` Geoff Keating
1999-07-19 20:05   ` Daniel Jacobowitz [this message]
1999-07-20  9:43   ` 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=19990719230705.A8451@drow.res.cmu.edu \
    --to=drow@false.org \
    --cc=Franz.Sirl-kernel@lauterbach.com \
    --cc=binutils@sourceware.cygnus.com \
    --cc=geoffk@ozemail.com.au \
    /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).