Specifying a binary's base address
Specifying a binary's base address
- Subject: Specifying a binary's base address
- From: Jonas Maebe <email@hidden>
- Date: Wed, 26 Aug 2009 16:34:36 +0200
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:
This email sent to email@hidden