Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining a segment address for prebinding



Hi Ebrahim,

Please double check the library is build prebound with the following cmd:
otool -hv yourlib

Another way to determine if a Mach-O executable is prebound is to enable the
prebinding debugging option and launch your executable. You can do this
using the following steps:
Launch Terminal.
At the Terminal prompt, type the following:
setenv DYLD_PREBIND_DEBUG

A rough way to find prebound addresses is to do the following:
Check size of the app (say size is a), reserve space from 0x0 to size of
your app for the app.
Start Library 1 at a + some delta.
Start Library 2 at (a + some delta) + size lib 1 + delta etc...

DTS is working on a tool to do this automatically and if I'm not mistaken
otool can as well tell you what the last address used in your lib.

More info on prebinding can be found here:
http://developer.apple.com/documentation/Performance/Conceptual/LaunchTime/T
asks/Prebinding.html

Try that:
LDFLAGS = -prebind -seg1addr 0x0A000000 -twolevel_namespace -L/usr/local/lib
-L/sw/lib -L/usr/lib -framework CoreAudio

http://developer.apple.com/documentation/ReleaseNotes/Prebinding.html

Hope this helps,

X 
Le 4/6/04 4:51 AM, Ebrahim Mayat at email@hidden wrote:

> Hi
> 
> I have posted this request previously on the unix-porting list..without
> any response:-( So, I'm hoping that someone on this list may be of help
> :-)
> 
> I'm trying to build a prebound dynamic library. The build goes without
> a problem except that at the end I always get an ld warning that my
> library is not prebound.
> 
> The LD_FLAGS in my Makefile is shown below. I am in the right address
> range of 0x00000000 to 0x3FFFFFFF; yet I always get the "library is not
> prebound" diagnostic at the end of my build. This after having tried a
> few addresses.
> 
> LDFLAGS = -prebind -seg1addr 0x90000000 -twolevel_namespace
> -L/usr/local/lib -L/sw/lib -L/usr/lib -framework CoreAudio
> 
> To be more precise in my allocation for the first segment address, I
> would need to find out  which addresses are available for allocation, I
> presume. How does one go about obtaining the right address to assign?
> 
> Thanks in advance.
> Ebrahim Mayat
> _______________________________________________
> scitech mailing list | email@hidden
> Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/scitech
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
scitech mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/scitech
Do not post admin requests to the list. They will be ignored.


References: 
 >Determining a segment address for prebinding (From: Ebrahim Mayat <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.