public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Deliberate deduplication of -rpath arguments in ld.bfd and ld.gold?
@ 2022-07-06  9:06 Stephan Bergmann
  2022-07-06 11:32 ` Michael Matz
  0 siblings, 1 reply; 2+ messages in thread
From: Stephan Bergmann @ 2022-07-06  9:06 UTC (permalink / raw)
  To: binutils

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 (as in

> $ cat test.c
> void f(void) {}
> $ gcc -c test.c
> $ ld.bfd -rpath=/path -rpath=/path -shared test.o
> $ readelf -d a.out | grep RUNPATH
>  0x000000000000001d (RUNPATH)            Library runpath: [/path]

for example).

For the relevant code in ld.bfd see `/* First see whether OPTARG is 
already in the path.  */` ever since 
<https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=252b5132c753830d5fd56823373aed85f2a0db63> 
"19990502 sourceware import") and for the relevant code in ld.gold see 
`// Eliminate duplicates.` since 
<https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=41f542e70b89b9ea2875c438b0c9a60ac46092dd> 
"Add support for -rpath."


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-06 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-06  9:06 Deliberate deduplication of -rpath arguments in ld.bfd and ld.gold? Stephan Bergmann
2022-07-06 11:32 ` Michael Matz

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).