This is the mail archive of the
mailing list for the binutils project.
Dynamic loading of two libraries in linux
- From: Not provided <krzysiek dot kwiatkowski at gmail dot com>
- To: binutils at sourceware dot org
- Date: Mon, 27 Jun 2011 23:26:30 +0200
- Subject: Dynamic loading of two libraries in linux
- References: <BANLkTime+wtHLJ4obu9=SYGG-W4igTtM4g@mail.gmail.com>
I'm trying to improve access to mine server, but I'm a bit stuck with one
case and I need to say - have no clue how to proceed. So I decided to check
if there is a help out there in the internet.
My case is as it follows - I've a server linux process that dynamically
loads library with dlopen(). Server as such is just a communication
framework and library implements business logic. It is two step process to
make logic available to the outside world - first step is dlopen +
initialization, second step is setup of internal routing. The most important
here is that first step may take lots of time and second one is very quick.
Also service can be accessed only after second step.
Now, if there is a bug in the library I would like to fix it and make it
active without service outage. Which means that my process would be as it
Step1. load old-library
Step2. routing setup
..... service is available and at one point I find a the bug ....
Step3. load new-version of library with a bugfix (long process)
Step4. remove routing for old-library (quick)
Step5. setup routing for new-library (quick)
Step6. unload old-library
As steps 4 & 5 are very quick, I could do it between requests to the server.
I'm concerned about step 3 and relocation & resolution of symbols. In this
step I do dlopen second time on a new-library which is almost the same as
old-library (the same in a sens that it exports the same symbols). Can I be
sure that after step 6 all the code for my new library will be correctly
loaded and executed? I've already did some tests and haven't seen any
problem yet, but it doesn't mean that there is none.
Do you see any other potential problems (execpt maybe memory allocated
If I would like to study this topic in more details - where should I start?