Help on Prelink.

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Help on Prelink.

Sakthi
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Help on Prelink.

Sakthi
This post was updated on .
Hi All,

I'm not sure this is the current forum to post this question, if not please guide me to move to appropriate forum.

We're working on porting an application to different GCC version (3.4.3 - > 4.4.1), during which noticed the base addresses of few system libraries are changes which is causing a problem to get more VM space.

In order to get contigious VM space, opted to use PRE-LINK tool to move the libs to a desired address.

Currently, the movement is based on the existing map. Steps:

Captured the process map (cat /proc/<PID>/maps) without pre-link :

For : ld.so

0ffc0000-0ffdf000 r-xp 00000000 00:0f 8270796    /lib/ld-2.11.1.so
0ffee000-0ffef000 r--p 0001e000 00:0f 8270796    /lib/ld-2.11.1.so
0ffef000-0fff0000 rw-p 0001f000 00:0f 8270796    /lib/ld-2.11.1.so

0ffc0000 - 0fff0000 = ~192KB


root@localhost:/root> readelf -h /lib/ld-2.11.1.so
ELF Header:
  Magic:   7f 45 4c 46 01 02 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF32
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              DYN (Shared object file)
  Machine:                           PowerPC
  Version:                           0x1
  Entry point address:               0xffd660c
  Start of program headers:          52 (bytes into file)
  Start of section headers:          130576 (bytes into file)
  Flags:                             0x0
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         6
  Size of section headers:           40 (bytes)
  Number of section headers:         26
  Section header string table index: 25

I tried to sum up all the size, but which is not matching with above count/mapping. Also, intersted if someone could shed lighton the "Entry point address" field.

So if we need to prelink ld.so to a desired address then allocation needs to happen like desired address + 192 KB + 4KB gap  before start next allocation ?

Thanks in Advance
Reply | Threaded
Open this post in threaded view
|

Re: Help on Prelink.

Carlos O'Donell-6
In reply to this post by Sakthi
On 05/03/2013 02:53 AM, Sakthi wrote:
> I'm not sure this is the current forum to post this question, if not please
> guide me to move to appropriate forum.

Please repost the question to [hidden email].

Please also describe exactly what problem you are trying to solve.

Cheers,
Carlos.