Re: Weak linking failing on Intel?
Re: Weak linking failing on Intel?
- Subject: Re: Weak linking failing on Intel?
- From: Alexei Kosut <email@hidden>
- Date: Sat, 6 May 2006 12:00:07 -0700
On May 4, 2006, at 6:37 PM, Rosyna wrote:
I'm trying to weak link an entire framework for a preference pane.
This works fine on a PPC mac and nm correctly shows it is weak linked:
[...]
Why is it completely skipping the if check? As I said, this exact
same code works fine on a PPC mac. If it matters, the PPC code is
being compiled with GCC 3.3.
Yes, it matters. GCC 3.3 would let you check any symbol against
NULL, but GCC 4.0 knows that the function has not been weak linked,
so optimizes away your check for NULL. If a symbol is to be weak-
linked, you should ensure it is declared with __attribute__
((weak_import)). This tells the compiler that a check against NULL
could be true.
Alexei
_______________________________________________
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