Re: -lall_load
Re: -lall_load
- Subject: Re: -lall_load
- From: Jens Alfke <email@hidden>
- Date: Thu, 08 Nov 2012 18:38:01 -0800
Thanks, Roland. That works. Still, it seems that the tools should be able to generate code to load the appropriate methods at runtime, if that's what needs to happen.
What happens is that the linker dead-strips the entire .o file generated from the .m file containing the category, if there is nothing in it but category methods, because from the linker’s POV it looks like nothing calls it. This is arguably a linker bug, but for some reason it must be impractical to fix it. I also wish there was a way to dead-strip code, even if it required me to manually indicate which methods could go.
You can manually indicate the methods to dead-strip by surrounding them with “#ifdef 0” and “#endif” :)
Seriously, there is no way to automatically dead-strip Obj-C methods because the language is so dynamic that there’s no way to tell at build time whether there are calls to a particular method. *Any* method is potentially reachable by means of -performSelector: or by constructing an NSInvocation.
—Jens |
_______________________________________________
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