Re: Prebinding strategies
Re: Prebinding strategies
- Subject: Re: Prebinding strategies
- From: Hauke Klein <email@hidden>
- Date: Thu, 30 Dec 2004 12:56:21 +0100
On 29.12.2004, at 22:42, E. Wing wrote:
I'm trying to select good prebinding addresses for a set of Frameworks
I have. Can anybody give me some good strategies for doing this? I'm
having problems on several different fronts:
1) Sometimes I don't pick enough space for my frameworks and I think
the address spaces are running over each other. For example, I may set
framework 1 to -seg1addr 0x10000000 and framework 2 to -seg1addr
0x11000000, and then I get a linking warning about the prebinding
addresses being disabled. If I set framework 2 to -seg1addr
0x12000000, the warning goes away. This gets worse if I change my
compile optimization flags from -Os to -O3.
Is there a way I can know how much space I need to set between
frameworks? I'm choosing these numbers through trial and error.
I don't know the official way to do this, but the following method works
for me. After building a framework, run 'otool -l' on the created shared
library (not on the bundle directory) and look for load commands of type
LC_SEGMENT. These commands have fields 'vmaddr' and 'vmsize'
containing the address and size of the corresponding segments.
This will give you the address range required by the framework. I'm
using the attached perl script to read the output of 'otool -l'.
Attachment:
osegs.pl
Description: Binary data
I'm pretty sure there are better ways to do these things, but I don't
know them.
3) I don't know if this has changed in the current versions of Xcode,
but in my older versions, changing the prebinding address was a
painful process of rebuilding the whole thing. I place -seg1addr
0x10000000 in the "Other Linker Flags" setting in Xcode. If I change
it, the only way I can get Xcode to change the address is to rebuild
the whole thing (or maybe modify a file and rebuild that file and
relink). My frameworks take a very long time to compile, and I would
prefer it if I could just redo the linking process (or just change the
prebinding address without relinking if possible).
Is there a way to change the address more quickly?
This is probably cheating, but you can use the finder to remove the
framework from the build directory. When rebuilding the target, Xcode
will relink the actual shared library using the already compiled object
files.
Hauke
_______________________________________________
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