This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
RE: gcc and -fPIC
- From: "Dave Korn" <dk at artimi dot com>
- To: <bserdar at nc dot rr dot com>,"'Gerhard Wiesinger'" <gerhard at wiesinger dot com>
- Cc: <binutils at sources dot redhat dot com>,<gcc-help at gcc dot gnu dot org>
- Date: Fri, 15 Oct 2004 19:45:53 +0100
- Subject: RE: gcc and -fPIC
> -----Original Message-----
> From: binutils-owner On Behalf Of bserdar
> Sent: 15 October 2004 19:27
> > 80485b3: e8 00 00 00 00 call 80485b8 <X::f()+0xc>
> > 80485b8: 5b pop %ebx
> > 80485b9: 81 c3 5c 12 00 00 add $0x125c,%ebx
>
> With pop ebx, it pops the eip at that instruction to ebx. I'm
> guessing it'll use ebx as a base pointer to data (or code?)
> from this point on. You can verify this guess by accessing
> some global variables from within X::f() and see whether it
> uses ebx-relative access.
>
Oh blimey, I didn't spot that. Yes, of course that's what it's doing.
Please ignore my previous post, I would now assume that the -r flag will in
fact show that no reloc is applied nor needed on that instruction.
cheers,
DaveK
--
Can't think of a witty .sigline today....