solib prologue

In my solib, the prologue for every function includes a mysterious “call” to
somewhere. I expect it has something to do with position-independent-code,
but I’m not completely at ease with solibs. What’s the purpose of this call?

4390: 55 push %ebp
4391: 89 e5 mov %esp,%ebp
4393: 83 ec 14 sub $0x14,%esp
4396: 53 push %ebx
4397: e8 00 00 00 00 call 439c <Shutdown2+0xc>
439c: 5b pop %ebx

QNX: 6.1.0a
gcc: 2.95.2

Thanks,
Shaun

The call is used to calculate the address of the global
offset pointer (to be placed in ebx).

Refer to the System V Application Binary Interface i386 supplement
which is at
http://www.caldera.com/developers/devspecs/abi386-4.pdf

Specifically section 3-36 and 3-37 on PIC function prologues.

Shaun Jackman <sjackman@nospam.vortek.com> wrote:

In my solib, the prologue for every function includes a mysterious “call” to
somewhere. I expect it has something to do with position-independent-code,
but I’m not completely at ease with solibs. What’s the purpose of this call?

4390: 55 push %ebp
4391: 89 e5 mov %esp,%ebp
4393: 83 ec 14 sub $0x14,%esp
4396: 53 push %ebx
4397: e8 00 00 00 00 call 439c <Shutdown2+0xc
439c: 5b pop %ebx

QNX: 6.1.0a
gcc: 2.95.2

Thanks,
Shaun


cburgess@qnx.com