public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@bigpond.net.au>
To: Jakub Jelinek <jakub@redhat.com>
Cc: binutils@sources.redhat.com
Subject: Re: [PATCH] Fix DT_NEEDED search with --as-needed libraries (PR ld/2721)
Date: Fri, 02 Jun 2006 07:14:00 -0000	[thread overview]
Message-ID: <20060602051344.GC26009@bubble.grove.modra.org> (raw)
In-Reply-To: <20060601150907.GD3823@sunsite.mff.cuni.cz>

On Thu, Jun 01, 2006 at 05:09:07PM +0200, Jakub Jelinek wrote:
> If some --as-needed library mentioned on the command line isn't directly
> needed by executable being linked, but it is mentioned in DT_NEEDED of some
> needed library, then without this patch ld will disregard the library
> mentioned on the command line and look for a different one (e.g. in system
> paths).

According to the current specification of --as-needed, isn't that
exactly what ld should do?  --as-needed is supposed to cause ld to only
link a lib if it satisfies some reference from a regular object
(ie. non-dynamic) at that point in the link process.  This patch makes
--as-needed have another meaning entirely.

I'm willing to consider a behaviour change for --as-needed, eg. that
references from other dynamic libs cause a lib to be linked, but this
particular change seems a little odd.  Why should a library that you
decide isn't needed be considered again, unless it is also found by the
normal search mechanism?

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

  parent reply	other threads:[~2006-06-02  5:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-01 15:26 Jakub Jelinek
2006-06-01 15:31 ` Jakub Jelinek
2006-06-01 18:23 ` H. J. Lu
2006-06-02  7:14 ` Alan Modra [this message]
2006-06-02  9:03   ` Jakub Jelinek
2006-06-02 13:55     ` Diego 'Flameeyes' Pettenò
2006-06-02 14:51     ` Alan Modra
2006-06-02 15:57       ` Jakub Jelinek
2006-06-02 16:43         ` Alan Modra
2006-06-04 14:42           ` Alan Modra
2006-06-07 15:16             ` Daniel Jacobowitz
2006-06-08  9:59               ` 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=20060602051344.GC26009@bubble.grove.modra.org \
    --to=amodra@bigpond.net.au \
    --cc=binutils@sources.redhat.com \
    --cc=jakub@redhat.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).