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 8561417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:29:54+00:00 2026-06-11T16:29:54+00:00

I want to change the rpath of an executable using install_name_tool , but I

  • 0

I want to change the rpath of an executable using install_name_tool, but I can’t figure out what the rpath is right now. install_name_tool requires both the old and the new rpath‘s to be given on the commandline. What command can I use to print the rpath of an executable under macOS?

  • 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-11T16:29:55+00:00Added an answer on June 11, 2026 at 4:29 pm

    First of all, understand that an executable doesn’t contain a single rpath entry, but an array of one or more entries.

    Second, you can use otool to list an image’s rpath entries. Using otool -l, you’ll get output like the following, at the very end of which are the rpath entries:

    Load command 34
              cmd LC_LOAD_DYLIB
          cmdsize 88
             name /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (offset 24)
       time stamp 2 Wed Dec 31 19:00:02 1969
          current version 1038.32.0
    compatibility version 45.0.0
    
    Load command 35
              cmd LC_RPATH
          cmdsize 40
             path @loader_path/../Frameworks (offset 12)
    

    Look for the LC_RPATH commands and note the path under the path entry.

    EDIT: regarding what @loader_path is: it’s a generic and dynamic way to refer to the Mach-O object that wants to do the loading of the framework.

    While this is a rather contrived example, I think it should get the point across. Let’s say we have an app MyApp.app that uses a framework MyFramework.framework. We’ll also say that to function properly, I require that my app is installed in the /Applications and nowhere else. So the structure of said app and framework would be the following:

    /Applications/MyApp.app/Contents/MacOS/MyApp (executable)
    /Applications/MyApp.app/Contents/Frameworks/MyFramework.framework/MyFramework (Mach-O dylib)

    If we were to run otool -L (note the capital L) on the executable it would show the following regarding MyFramework:

    @rpath/MyFramework.framework/Versions/A/MyFramework
    /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
    /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
    /usr/lib/libobjc.A.dylib
    /usr/lib/libSystem.B.dylib
    ....
    

    Note that because the MyFramework.framework uses an @rpath install name/path, we’ll need to have runtime search path entries that will be substituted in place of @rpath at runtime. Now, I could have a single rpath entry of:

    /Applications/MyApp.app/Contents/Frameworks
    

    That would work, and at runtime the two parts would be put together:

    /Applications/MyApp.app/Contents/Frameworks + /MyFramework.framework/Versions/A/MyFramework ==

    /Applications/MyApp.app/Contents/Frameworks/MyFramework.framework/Versions/A/MyFramework
    

    Obviously, hard-coding a path like this is not ideal, as simply moving the app to a different folder or renaming the app itself would cause linking to fail.

    @loader_path is simply a dynamic way to refer to the app’s executable wherever it may exist on the filesystem. In this particular case, at runtime it will be filled in with the path to the running executable: /Applications/MyApp.app/Contents/MacOS/MyApp. Then we can say that to find the MyFramework.framework, you simply go up a directory and over to Frameworks.

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

Sidebar

Related Questions

I implemented the Line graph using the achartengine. But i want change the line
I want to change content of a Button in XAML using a DataTrigger. Conditionally
can i change border color of checkbox by use css or jquery. i want
I am using the dojo dateTimePicker in my application. Now i want to limit
I want change my class=value on select option using jQuery Example <select name=color_scheme id=color_scheme>
I want change latin number to persian number and add commas, but it don't
Currently I'm catching only generic exceptions, but i want change this to catch the
i want change title's color of navigation controller but i dont know why doesn't
I am going call Stored procedure in another stored procedure. But I want change
I use UITableView and I want change the height of different cells. But I

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.