This is the mail archive of the
glibc-linux@ricardo.ecn.wfu.edu
mailing list for the glibc project.
Re: Library mapping
- From: Andreas Jaeger <aj at suse dot de>
- To: Muzaffer Ozakca <muzaffer dot ozakca at bilten dot metu dot edu dot tr>
- Cc: glibc list <glibc-linux at ricardo dot ecn dot wfu dot edu>
- Date: Thu, 13 Dec 2001 14:29:46 +0100
- Subject: Re: Library mapping
- References: <3C187222.8010701@bilten.metu.edu.tr>
- Reply-to: glibc-linux at ricardo dot ecn dot wfu dot edu
Muzaffer Ozakca <muzaffer.ozakca@bilten.metu.edu.tr> writes:
> Hello,
>
> I'm watching through /proc/<pid>/maps on my Linux 2.4.3 computers that
> the same program gets its libraries (and their data segments) mapped
> to different locations on virtual memory. The same OS configuration
> and libraries are installed on a (1) Pentium 225 and a (2) Pentium III.
>
> I'm a compiling the program on (1) and executing on both of them. I'm
> expecting to see their /proc/<pid>/maps be the same for the same point
> in the program. But they are not. Might this be because of their
> hardware differences? When a program compiled (non-statically), are
> the locations where shared objects are mapped known at compile time or
> are they resolved at load time by ld.so?
They're resolved at load time. The libs are PIC (position independend
code) and can be loaded at any adddres.
Andreas
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.inka.de
http://www.suse.de/~aj