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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:25:35+00:00 2026-05-26T03:25:35+00:00

I have two 3rd party libraries A.so and B.so that I am linking together

  • 0

I have two 3rd party libraries A.so and B.so that I am linking together with my executable executable.exe. A.so contains a bug that is addressed by B.so, that is, say:

  • A::subroutine1() may crash with a floating point exception when called (FP arithmetic bug)
  • B::subroutine1() is a fixed implementation that should always be called instead of A::subroutine1().

What is the correct linking order for A and B? What I am doing now is:

ifort <....> executable.exe <...> -lA -lB

I am still getting the floating point exception from time to time (the error is not reproducible exactly, so it’s pretty difficult to debug). However, when it crashes, the program lets me know that A::subroutine1() is the offender – so the wrong version of subroutine1() gets linked in for some reason.

I will flip the linking order as a 1st stab at this, but is there a tool that I can use to inspect executable.exe to see what version of subroutine1() will be called at runtime?

thanks!

  • 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-05-26T03:25:35+00:00Added an answer on May 26, 2026 at 3:25 am

    If you want subroutine1 from libB.so to be called, then correct link order is -lB -lA (for Linux and most other UNIX shared library implementations).

    is there a tool that I can use to inspect executable.exe to see what version of subroutine1() will be called at runtime

    No: that information is not usually recorded in the executable file. The rule is: whichever shared library defines the subroutine1 first is the one that will be used.

    For example, if you link with -lC -lB -lA, and at link time libC.so does not define subroutine1, but later you rebuild libC.so (without relinking the executable) so it does, then subroutine1 from libC.so will be called.

    However note that there are complications. For example, libA.so may be linked with -Bsymbolic, which will cause all calls to subroutine1 from within libA.so to bind to subroutine1 within libA.so itself.

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

Sidebar

Related Questions

I have two WCF clients consuming a 3rd party web service. These two clients
I have a 3rd-party protocol module (SNMP) that is built on top of asyncore.
I'm using two 3rd party libraries, which both implement their own 2D vector class.
There are many java standard and 3rd party libraries that in their public API,
I have two different libraries critical to my application that are dependent on different
I have a Rails application that queries a 3rd party web service. I am
Let's say a 3rd-party DLL X has a global variable G I write two
I have a standalone (3rd party) app that I'm trying to launch using a
I have a website in ASP.Net that generates PDF with a 3rd party application
I have a getViewBitmap() method that creates a Bitmap with a 3rd party library

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.