Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8338971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:45:21+00:00 2026-06-09T04:45:21+00:00

Is it possible to load a library from memory instead of from the filesystem

  • 0

Is it possible to load a library from memory instead of from the filesystem on mac/gcc?

With windows I’m using MemoryModule but it’s obviously not cross-platform compatible.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:45:22+00:00Added an answer on June 9, 2026 at 4:45 am

    First things first, to do this I advise you use read the OS X ABI Dynamic Loader Reference.

    To do this, you must use the NSCreateObjectFileImageFromMemory API.

    Given a pointer to a Mach-O file in memory, this function creates and returns an NSObjectFileImage reference. The current implementation works only with bundles, so you must build the Mach-O executable file using the -bundle linker option.

    The memory block that address points to, must be allocated with vm_allocate (/usr/include/mach/vm_map.h).

    Make sure to abide by the requirement that vm_allocate is used for the memory block containing the module.

    Once you acquire the object file image, you must use NSLinkModule function to link the module into the program.

    When you call this function, all libraries referenced by the given module are added to the library search list. Unless you pass the NSLINKMODULE_OPTION_PRIVATE, NSLinkModule adds all global symbols in the module to the global symbol list.

    After linking, don’t forget to clean up by calling the NSDestroyObjectFileImage function.

    When this function is called, the dynamic loader calls vm_deallocate (/usr/include/mach/vm_map.h) on the memory pointed to by the objectFileImage parameter.

    Note that while these functions are deprecated, there is no substitute (to the best of my knowledge) using the suggested alternative dlopen et. al.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to load a single plugin from outside the cake root using
In modern processors it is possible to load a register from memory and then
Is it possible to use MPMediaPickerController to load audio files from library and save
Is it possible to load an library from within a library in code igniter?
Is it possible to load a Zend_Form from a view helper? I'm using thise
Is it possible in codeigniter to call/load a controller/view/model from a plugin/library? if possible
Is it possible to load a premain-class from a jar library packed within a
Is it possible to load images from an array in jQuery? The array looks
Is it possible to load an html document using ajax and then perform a
Is it possible to load new lines from a text file to variables in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.