Re: Specifying a binary's base address
Re: Specifying a binary's base address
- Subject: Re: Specifying a binary's base address
- From: Jason Molenda <email@hidden>
- Date: Wed, 26 Aug 2009 11:53:30 -0700
Jonas, can you use the -image_base linker option? This option was
called -seg1addr in the past. Explicitly setting the __TEXT load
address should accomplish the same thing but the -image_base option
was designed for what you're doing.
J
On Aug 26, 2009, at 7:34 AM, Jonas Maebe wrote:
Hello,
Some Windows resource loading API has the braindead assumption that
addresses can never be <= 0x10000. It interprets every value <=
0x10000 as an index in some resource table, and other values as
pointers to resources.
For compatibility with Delphi, we offer a resource loading API with
the same behaviour in our run time library, but on all supported
platforms. Now, on Mac OS X it's quite possible to have valid data
addresses <= 0x10000.
I can work around this in my test programs by passing "-segaddr
__TEXT 0x10000" to the linker. I've noticed that only specifying the
address of __TEXT seems to work in a fail safe way, because if you
specify the address of the __DATA segment then you have to ensure
that it doesn't overlap with whatever the linker picked as the range
where to place the __TEXT segment (which, even if you'd specify its
starting address as well, is quite hard since the compiler itself
has no idea about the size that it will have).
My question: is it safe to assume that the linker will always place
the __TEXT segment first, and that therefore specifying its address
will never result in an error message from the linker stating that
it overlaps with some other segment?
Thanks,
Jonas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@apple.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden