This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Linker script and dependency search path


Hi,

Mike Frysinger <vapier@gentoo.org> writes:

> On Friday 21 May 2010 10:05:18 Ludovic CourtÃs wrote:
>> Mike Frysinger writes:
>> > On Thursday 20 May 2010 05:35:25 Ludovic CourtÃs wrote:
>> >> Hans-Peter Nilsson <hp@bitrange.com> writes:
>> >> > You're looking for -rpath-link; cf. ld.info.
>> >> 
>> >> Yes, but thatâs inconvenient for the libc itself: I find it more
>> >> convenient if linking with glibc just works without passing additional
>> >> flags (as on GNU/Linux), and augmenting the linker script does that
>> >> nicely.
>> > 
>> > you get the same behavior with glibc+linux cross-compilers.  if you dont
>> > use a sysrooted toolchain, the linker scripts have troubles finding
>> > things.
>> 
>> Thereâs a significant difference though: on GNU/Linux doesnât have
>> anything NEEDED (except ld-linux.so).
>
> that isnt true ... glibc linker scripts pull in libc_nonshared.a too.  but 
> even the ldso needs to be looked up & located somehow.

Sorry, I wasnât clear:

--8<---------------cut here---------------start------------->8---
$ uname -o
GNU/Linux
$ objdump -x ~/.nix-profile/lib/libc.so.6 |grep NEEDED
  NEEDED               ld-linux-x86-64.so.2
--8<---------------cut here---------------end--------------->8---

compared to:

--8<---------------cut here---------------start------------->8---
$ uname -o
GNU
$ objdump -x /lib/libc.so.0.3 |grep NEEDED
  NEEDED               ld.so.1
  NEEDED               libmachuser.so.1
  NEEDED               libhurduser.so.0.3
--8<---------------cut here---------------end--------------->8---

Thanks,
Ludoâ.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]