This is the mail archive of the libc-help@sourceware.org mailing list for the glibc 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: Glibc and shared libraries


On Fri, Jul 10, 2009 at 1:09 PM, Ryan Arnold<ryan.arnold@gmail.com> wrote:
> On Fri, Jul 10, 2009 at 9:33 AM, booleandomain<booleandomain@gmail.com> wrote:
>
>>
>> I found
>> http://sourceware.org/glibc/wiki/Tips_and_Tricks/Loader_Tips_and_Tricks, but
>> it didn't tell me anything new. Please let me know if you were speaking
>> about a different page.
>>
>
>
> This may be more useful to you:
>
> http://sources.redhat.com/glibc/wiki/Debugging/Loader_Debugging#Debugging_With_an_Alternate_Loader
>
> This also shows you how to invoke the compiler with the
> -dynamic-linker path set and the -rpath:
>
> http://sourceware.org/glibc/wiki/Debugging/Development_Debugging
>

Here's some explicit information:

SYSROOT=<path to the GLIBC install directory>

gcc ... \
  --sysroot=${SYSROOT} \
  -Wl,--rpath=${SYSROOT}/lib \
  -Wl,--dynamic-linker=${SYSROOT}/lib/ld.so.1

You can then verify the dynamic loader is set using readelf:

ELF Header:
...
Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  PHDR           0x000034 0x10000034 0x10000034 0x00100 0x00100 R E 0x4
  INTERP         0x000134 0x10000134 0x10000134 0x0002d 0x0002d R   0x1
      [Requesting program interpreter: /home/user/path/sysroot/lib/ld.so.1]
...


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