Mailing Lists: Apple Mailing Lists

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

-weak_framework entry point testing?



I have some existing code that worked fine using Xcode 2.0 and GCC 3.3,
which crashes when built with Xcode 2.1 and GCC 4.0. In particular, I'm
testing an entry point in a weak-linked framework to make sure it's
available before I call it:

    #include    <StuffIt/StuffIt.h>

    if (NULL != StuffItEngineLibraryAvailable)
    {
        /*...*/
    }

When I remove /Library/Frameworks/StuffIt.framework/ , the test crashes.
Disassembly in the debugger shows:

    bl  0x71C420 <dyld_stub_StuffItEngineLibraryAvailable>

The function at that address is:

0x0071c420 <dyld_stub_StuffItEngineLibraryAvailable+0>: lis r11,143
0x0071c424 <dyld_stub_StuffItEngineLibraryAvailable+4>: lwzu    r12,548(r11)
0x0071c428 <dyld_stub_StuffItEngineLibraryAvailable+8>: mtctr   r12
0x0071c42c <dyld_stub_StuffItEngineLibraryAvailable+12>:    bctr

If the symbol is in fact unresolved, then obviously the bctr will crash,
but I'm wondering why that suddenly stopped working, and why this isn't
a problem with identical source code built using GCC 3.3. Any advice
would be much appreciated.

Thanks,

R.
-- 
Rich Siegel                                 Bare Bones Software, Inc.
<email@hidden>                      <http://www.barebones.com/>

Someday I'll look back on all this and laugh... until they sedate me.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to 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.