This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils 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: how to force C++ objects to an address? (ABI issue B-7)


Anthony Heading <aheading@jpmorgan.com> writes:

> > I'm slightly confused as to how this should work.  The idea
> > is to create a new segment where we specify a particular virtual
> > address in the relevant program header?  If the dynamic
> > loader will use that, why would it not do so for the ordinary
> > segment that contains the '.text' section etc?  I'm not
> > quite understanding how moving anything to a custom segment
> > evades the point you made that the dynamic linker 'does not
> > guarantee any particular address'.

Sorry, I switched directions on you.  First I talked about using a
shared library as you suggested.  Then I switched to not using a
shared library.

Using a linker script would be helpful if you were not using a shared
library for the vtable functions.  Instead, you would compile each
relevant executable using the linker script.  The vtable functions
would wind up in each executable.  Since the executable must be loaded
at a fixed address, you would not have to worry about what the dynamic
linker does.

Admittedly you lose the advantage of a shared library, as the vtable
functions are duplicated in each executable rather than shared in a
single instance.  Unfortunately you may have to give up something to
get this to work.

Ian


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