public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Michael Matz <matz@suse.de>
To: Stephan Bergmann <sbergman@redhat.com>
Cc: binutils@sourceware.org
Subject: Re: Deliberate deduplication of -rpath arguments in ld.bfd and ld.gold?
Date: Wed, 6 Jul 2022 11:32:29 +0000 (UTC)	[thread overview]
Message-ID: <alpine.LSU.2.20.2207061125130.24606@wotan.suse.de> (raw)
In-Reply-To: <38ff8f84-c34c-8a90-6070-4cbe62835940@redhat.com>

Hello,

On Wed, 6 Jul 2022, Stephan Bergmann via Binutils wrote:

> Over in the comments at <https://reviews.llvm.org/D129142> "[LLD][ELF] Drop
> duplicates from rpath" we wonder what the rationale might be that both ld.bfd
> and ld.gold apparently deliberately drop duplicated -rpath arguments with
> identical paths

The rationale would be "avoid waste in the real world".  If you don't do 
that then you will find that when building certain software it will end up 
with hundreds of copies of things like "RUNPATH 
/usr/lib/my-strange-module-path/" because its build-system is strange, and 
blindly collects linker arguments from e.g. pkg-config files, but doesn't 
remove duplicates itself.  As the runtime linker doesn't do duplicate 
removal either (speed!) it would then end up looking into loading the same 
non-existing file that same hundred times.

Instead of fixing all these build systems, something simply has to remove 
the duplicates and the linker is the most sensible choice.


Ciao,
Michael.

      reply	other threads:[~2022-07-06 11:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-06  9:06 Stephan Bergmann
2022-07-06 11:32 ` Michael Matz [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=alpine.LSU.2.20.2207061125130.24606@wotan.suse.de \
    --to=matz@suse.de \
    --cc=binutils@sourceware.org \
    --cc=sbergman@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).