Skip navigation
Replies 1 2 Previous Next
  • Currently Being Moderated
    Nov 22, 2011 3:07 PM   in reply to DaveGallant

    I'm encountering something similar. I'm trying to write a native extension and have a very simple one working, however once I attempt to use a Framework library I get the "ld warning: unexpected srelocation type 9" and the app hangs after launch. I'm using XCode 4.2, AIR 3.1, and Flash Builer 4.6. Is the verdict that I need to roll back to 4.1, so I can use 4.3 as my Base SDK? Or maybe, there's a way to get Base SDK 4.3 for XCode 4.2?


    It seems if I have "Enable Linking With Shared Libraries" set to Yes, I can build and deploy the app but it crashes on start-up. If I have it set to "No" it works fine as long as I don't use any Framework libraries. If I do use one, I get link errors.


    I've tried a bunch of combinations of code generation and link options, to no real effect. Any pointers would be great. I'd hate to go down the path of reverting xcode, unless I really needed too.


    Hmm. I suppose another potention issue is I'm using FB4.6 (beta) to compile the SWC and SWF.



    - Rusty

    Mark as:
  • Currently Being Moderated
    Nov 22, 2011 10:36 PM   in reply to rusty120

    Hmm. I suppose another potention issue is I'm using FB4.6 (beta) to compile the SWC and SWF.


    I had the same issue with both FB 4.6 (with the bundled AIR 3.1) and FB 4.5.1 (with AIR 3.0), so I think you can rule that out.



    Mark as:
  • Currently Being Moderated
    Nov 25, 2011 1:33 AM   in reply to rusty120

    Update: I now have a project compiled with LLVM GCC4.2 and don't get the srelocation error. That was obviously not what's causing

    that problem. It might be that I now don't use any third party libs that have that relocation (type 9).

    As I understand it (and as andrea was on to above): the adt uses a linker (llvm?) that probably not is supporting that type of relocation.


    Frameworks:  I discovered that I had to use a platformoptions-file for some frameworks. Here is a page that explains about it: 130044f3619-7fff.html


    The additional frameworks that can be used are listed here on my win7 installation:

    c:\Program Files (x86)\Adobe\Adobe Flash Builder 4.6\sdks\4.6.0\lib\aot\stub\


    I also managed to use a third party framework (though the page above states that you can't/shouldn't);

    I extracted the single lib-file from the framework-archive and linked it with my other

    native lib in xcode. Seemed to work, but it feels like a kind of "hacky" solution.

    Mark as:
  • Currently Being Moderated
    Nov 25, 2011 2:28 AM   in reply to OlaLofberg

    Glad to hear you got it to work... did you compile with the 4.3 or the 5.0 SDK?


    I am only linking to AVFoundation (and obviously Foundation), so there should be no need for a platform options file.

    I was getting type 9 relocations in *all* functions exported from my library, including the extension initializer which does nothing except setting a pointer to the context initializer and finalizer.

    From my understanding, type 9 relocations are emitted when using optimized instructions for loading string constants, so I still think it's an issue with code generation and not with whatever frameworks you're linking to.


    I honestly have neither the time nor the motivation to get back to debugging this issue, especially seeing that there is no response whatsoever from Adobe.


    If someone is interested in digging further I can provide the full source code of the extension (which is a simple wrapper around AVAudioPlayer to allow playing back  AAC audio on iOS).



    Mark as:
  • Currently Being Moderated
    Nov 25, 2011 3:01 AM   in reply to andrea.conti

    Yes, although I did not get it to work with my initial third party lib.

    I'm using 4.3SDK.


    I understand that these things take time. It might be a compiler flag that switches off the optimization you're suggesting.

    But... a little help from Adobe would be nice.

    Mark as:
  • Currently Being Moderated
    Nov 28, 2011 7:48 AM   in reply to OlaLofberg

    Thanks for the help. Sounds like no one has gotten this to work with the

    iOS5 SDK / XCode 4.2 / Air 3.1?


    I notice XCode 4.2.1 was released recently, and the notes mention some

    compiler fixes. I'll give that a shot first, before seeing if I can find

    iOS 4.3 SDK somewhere. It wasn't included with XCode 4.2.


    - Rusty

    Mark as:
  • Currently Being Moderated
    Nov 28, 2011 8:35 AM   in reply to DaveGallant



    I would recommend following xternal-sdks-to-package-apps/ in case you are writing and ANE for iOS on xCode 4.X.

    AIR 3.1 has included some new features specifically to address the support of iOS 5. This blog is applicable only for Mac currently.


    UPDATE: If ADT throws some warnings while packaging an ipa you can ignore them. Your app should work.



    Saumitra Bhave

    Mark as:
  • Currently Being Moderated
    Nov 28, 2011 10:27 AM   in reply to Saumitra Bhave

    Thanks. I have tried including the iOS SDK using the -platformsdk flag.

    Also tried including -framework Foundation as a linker flag, though the

    blog post says it's included automatically, so that's probably not the



    To be specific:


    My extension works fine until I attempt to use the NSMutableDictionary

    class from the Foundation SDK in my extension. If I set "Enable Linking

    With Shared Libraries" to Yes, when I run adt I get linker "unexpected

    srelocation type 9" warnings and the app hangs on launch.


    If I set it to "No". I get the following link error, and am unable to build

    an ipa:


    "ld: absolute addressing (perhaps -mdynamic-no-pic) used in _getItem from

    /var/folders/rc/w16r02qs70zgy9q02g2vlq2r0000gn/T/01ce07e6-4a7b-421b-8a c6-bce683ba7ea8/libcom.kongregate.KeyChain.a(KeyChainExtensionLib.o)

    not allowed in slidable image. Use '-read_only_relocs suppress' to enable

    text relocs"


    Note: I already disabled the Generate Position Dependent Code option, to no

    avail. Not sure what is creating the absolute addressing. Adding

    -read_only_relocs suppress doesn't help much either. It just removes the

    suggestion, but fails on essentially the same error. It's very possible,

    there's some other linker or code generation option I need to throw in,

    just not sure what. I'd love some confirmation from someone that has

    successfully got this to work.

    Mark as:
  • Currently Being Moderated
    Nov 28, 2011 3:05 PM   in reply to DaveGallant

    One correction. Actually, using NSMutableDictionary is working fine, so it's not the Foundation framework. It's when I add a constant from the Security framework that's getting me stuck. If I add this line:


    CFTypeRef ref = kSecClassGenericPassword;


    I get the "ld: absolute adressing .." error and'm unable to link. Guess I'll bang on it a bit more.  Security framework should also be included with the default optoins, and I am pointing to the latest iPhoneOS5.0.sdk.

    Mark as:
  • Currently Being Moderated
    Nov 28, 2011 9:45 PM   in reply to rusty120

    Hi rusty:


    Can send us the projects which can reproduce the issue on sbhave [at] adobe [  dot ] com.

    Mark as:
  • Currently Being Moderated
    Nov 29, 2011 9:56 AM   in reply to DaveGallant

    Finally update. So reverting to XCode 4.1 and iOS SDK 4.3 fixed the problem. I am now able to link against the Security framework as a shared library. Not sure if the problem was due to the compilers in XCode 4.2, building against 5.0 SDK (using the -platformsdk option), or something else. I'll pass more info on to Adobe to see if they can get help get to the bottom of it. At least I'm up and running now, I don't really need any features from 5.0.

    Mark as:
  • Currently Being Moderated
    Dec 14, 2011 12:53 AM   in reply to DaveGallant

    Putting this up here,  the suggestions on this site helped me fix my problem


    Hope it can help someone

    Mark as:
  • Currently Being Moderated
    Jan 16, 2012 7:04 AM   in reply to rusty120



    Is there any update? I have exactly the same problem with the security Framework.


    I'm using Xcode 4.2 and AIR 3.1 and need to write a native Extension with keychain group access.


    Thank you


    Mark as:
  • Currently Being Moderated
    Mar 16, 2012 6:55 AM   in reply to DaveGallant

    I got the same problem when trying to make a extensions that use a AVAssetWriter... any update on this problem ? we will install xcode 4.1 to see if this solution work but i hope something else is possible.


    EDIT : i got the same problem as rusty ...


    compile with shared library YES return type 9 error


    Shared library to NO return


    "ld: absolute addressing (perhaps -mdynamic-no-pic) used


    We use Xcode 4.3, Air 3.2 , all the latest sdk and i don't use -platformsdk as i work on a pc.



    other important notice... if i try to set shared librarie to NO while targeting IOS 4.0... it make a build fail! if i target IOS 4.1 it work.. with error absolute addressing (perhaps -mdynamic-no-pic) used ......


    We are kind of lost with this bug.... we tried every solution giving on the subject.


    Last solution is Xcode 4.1 just like rusty said... i'll write if it work.

    Mark as:
  • Currently Being Moderated
    Mar 18, 2012 10:03 AM   in reply to DaveGallant

    rusty was right.. the only solution found was re-installing xCode 4.1... now it work


    Hope adobe come soon with better solution.

    Mark as:
  • Currently Being Moderated
    May 20, 2013 12:49 PM   in reply to pabiQC

    Same Problem for me:


    Error occurred while packaging the application:


    ld: absolute addressing (perhaps -mdynamic-no-pic) used in _ASDemoGetStringLength from /var/folders/5f/3xcbv8v96gd6_rq6kbmj13900000gp/T/aa9bb7be-0f0e-4e79-8 5df-cc835b7dc2cf/libde.das3.ane.CalendarANE.a(CalendarANE.o) not allowed in slidable image. Use '-read_only_relocs suppress' to enable text relocs

    Compilation failed while executing : ld64


    Build stops completly with this warning.

    Flash Buidler 4.7 on Mac OS 10.7.5


    Tried with AIR SDK 3.5 and AIR SDK 3.7.


    Called Function:

    FREObject ASDemoGetStringLength( FREContext ctx, void* funcData, uint32_t argc, FREObject argv[])


        NSLog(@"+++ ASDemoGetStringLength +++" );


        const uint8_t * stringArgument = NULL;

        uint32_t strLength = 0;


        FREResult status = FREGetObjectAsUTF8(argv[ 0 ], &strLength, &stringArgument);


        int32_t value = [ [NSString stringWithUTF8String:(char *) &stringArgument] length ];


        FREObject intValue = NULL;


        status = FRENewObjectFromInt32(value, &intValue);


        return intValue;


    ( line which is reponsible for the error is bold and this demo-code is no vodoo magic ).


    "Enabled Linking with shared Libraries" is set to no in XCode.


    Any solution from Adobe for this?


    This "bug" occurs since 10 months for many devs, like we can see with in this thread.

    The problem behind is also known.


    But there is no fix for this?

    Mark as:
  • Currently Being Moderated
    May 21, 2013 6:59 AM   in reply to dashart21



    I've found a fix for this "error/warning":


    In Flash Builder 4.7 update the embedded AIRSDK to version 3.5 or greater like described here: html



    Replace the embedded AIR SDK in the linked Flex-SDK like described under this link: html


    Hint: The AIR SDK version for step 1 and step 2 should be exactly the same.


    Now update the plattform namespace in your an descriptor files (ANE_NAME-platformoptions.xml and ANE_NAME-extension.xml) to:

    <platform xmlns="">

    (Should be the same like AIR SDK version)



    And last but not least update your "app-description-XML" (APPNAME-app.xml) to the used AIR SDK version:

    <application xmlns="">


    That should fix the problems ...

    Hope that helps someone.


    Happy Cooding!

    Mark as:
1 2 Previous Next

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points