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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:04:01+00:00 2026-05-17T18:04:01+00:00

this en.wikipedia.org/wiki/Hot_swapping#cite_note-1 says that VS can do it with the help of its debugger.

  • 0

this

en.wikipedia.org/wiki/Hot_swapping#cite_note-1

says that VS can do it with the help of its debugger. Does gdb provide a similar functionality ?

this is the closest i could find, but doesn’t seem to be ready to be used:

http://www.aitdspace.gr/xmlui/handle/123456789/219

dlopen/dlsym/dlclose are also close, but will not work for -lmylib referenced libraries (reference count never gets to 0).

alternatives i’ve considered:

1) using -Wl,-wrap,foo and on __wrap_foo() { func = dlopen(); func(); }

2) making libfoo.so a shared library and when we need to hotswap we dlopen(RTLD_GLOBAL) to load the new code and provide updated symbols to the next call to foo();

1) doesn’t work very well because it requires me to enumerate all the functions i want to hotswap, which are all of them.

2) doesn’t work very well because when foo() is called, the new code is loaded, but foo has forever the reference to that symbol. calling dlopen multiple times make foo to be re evaluated.

  • 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-17T18:04:02+00:00Added an answer on May 17, 2026 at 6:04 pm

    You could certainly hack yourself a system where you store a list of function pointers and can change these pointers to point to whatever library you have dlopen()’d at the time.

    You’re right, there isn’t any easy way to intercept calls to routines with fixed linkage. You can always clobber the start of the routine with an assembly jump to another routine, but that can be dangerous (and isn’t C).

    Maybe a symbol which is weak in your code and strong in a dlopen()’d library would work?

    In any of these cases, you have to deal with the situation where the old code is currently running. That isn’t easy either, unless you have points in your program where you know no thread is in the library you want to swap.

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

Sidebar

Related Questions

Can anyone provide some information on how to programmatically translate HRESULT ( http://en.wikipedia.org/wiki/HRESULT )
From this Wikipedia article: http://en.wikipedia.org/wiki/Hamiltonian_path_problem A randomized algorithm for Hamiltonian path that is fast
Following this question Wikipedia says: http://en.wikipedia.org/wiki/First_normal_form#Repeating_groups_within_columns A query such as Which pairs of customers
I have got a url in this form - http:\\/\\/en.wikipedia.org\\/wiki\\/The_Truman_Show . How can I
Suppose I want to turn this : http://en.wikipedia.org/wiki/Anarchy into this : en.wikipedia.org or even
I was reading this: http://en.wikipedia.org/wiki/Thread_safety Is the following function thread-safe? void foo(int y){ int
I just found this code on Wikipedia. Link: http://en.wikipedia.org/wiki/Sizeof#Use The code: /* the following
I wish to use Wikipedia api to extract the result of this page: http://en.wikipedia.org/wiki/Special:PrefixIndex
http://en.wikipedia.org/wiki/All_nearest_smaller_values . This is the site of the problem and here is my code,
I'm trying to implement this protocol: http://en.wikipedia.org/wiki/Chord_(peer-to-peer ) What i understood from it is

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.