Re: Need to link shared objects after changing source code but not
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Re: Need to link shared objects after changing source code but not




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: Need to link shared objects after changing source code but not  
Chuck Dillon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:51 PM

Sebastian Wagner wrote:
quote:
> Hi! > > In our company we have a big c++ software project devided into several > shared object libs. several programs link particular so's to > executables. > > my question is: assuming that the .h files don't change but only the > .cpp files and maybe some compilerflags: is it necessarry to re_link_ > the executables after building a new .so file? >
Linking to a .so just resolves references to symbols that are used by the program (or other libraries). So if your new .so build doesn't change or remove any of the symbols that the program (or other .sos) resolved when it was linked then the program will execute without relinking. For example, you could build a skeleton version of an API what does nothing (i.e. stubs) but can be built to a .so. Then you could link programs against that .so containing stubs. When you replace the stub version with a fully implemented version the programs will run, no linking necessary. Of course, if you change the interface to the .so from what it was when the program was *compiled* then it will still run but unpredictable results can be predicted. -- ced -- Chuck Dillon Senior Software Engineer NimbleGen Systems Inc.




[ Post a follow-up to this message ]



    Re: Need to link shared objects after changing source code but not  
Chuck Dillon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:51 PM

Sebastian Wagner wrote:
quote:
> Hi! > > In our company we have a big c++ software project devided into several > shared object libs. several programs link particular so's to > executables. > > my question is: assuming that the .h files don't change but only the > .cpp files and maybe some compilerflags: is it necessarry to re_link_ > the executables after building a new .so file? >
Linking to a .so just resolves references to symbols that are used by the program (or other libraries). So if your new .so build doesn't change or remove any of the symbols that the program (or other .sos) resolved when it was linked then the program will execute without relinking. For example, you could build a skeleton version of an API what does nothing (i.e. stubs) but can be built to a .so. Then you could link programs against that .so containing stubs. When you replace the stub version with a fully implemented version the programs will run, no linking necessary. Of course, if you change the interface to the .so from what it was when the program was *compiled* then it will still run but unpredictable results can be predicted. -- ced -- Chuck Dillon Senior Software Engineer NimbleGen Systems Inc.




[ Post a follow-up to this message ]



    Re: Need to link shared objects after changing source code but not  
Chuck Dillon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:01 PM

Sebastian Wagner wrote:
quote:
> Hi! > > In our company we have a big c++ software project devided into several > shared object libs. several programs link particular so's to > executables. > > my question is: assuming that the .h files don't change but only the > .cpp files and maybe some compilerflags: is it necessarry to re_link_ > the executables after building a new .so file? >
Linking to a .so just resolves references to symbols that are used by the program (or other libraries). So if your new .so build doesn't change or remove any of the symbols that the program (or other .sos) resolved when it was linked then the program will execute without relinking. For example, you could build a skeleton version of an API what does nothing (i.e. stubs) but can be built to a .so. Then you could link programs against that .so containing stubs. When you replace the stub version with a fully implemented version the programs will run, no linking necessary. Of course, if you change the interface to the .so from what it was when the program was *compiled* then it will still run but unpredictable results can be predicted. -- ced -- Chuck Dillon Senior Software Engineer NimbleGen Systems Inc.




[ Post a follow-up to this message ]



    Re: Need to link shared objects after changing source code but not  
Chuck Dillon


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 10:17 PM

Sebastian Wagner wrote:
quote:
> Hi! > > In our company we have a big c++ software project devided into several > shared object libs. several programs link particular so's to > executables. > > my question is: assuming that the .h files don't change but only the > .cpp files and maybe some compilerflags: is it necessarry to re_link_ > the executables after building a new .so file? >
Linking to a .so just resolves references to symbols that are used by the program (or other libraries). So if your new .so build doesn't change or remove any of the symbols that the program (or other .sos) resolved when it was linked then the program will execute without relinking. For example, you could build a skeleton version of an API what does nothing (i.e. stubs) but can be built to a .so. Then you could link programs against that .so containing stubs. When you replace the stub version with a fully implemented version the programs will run, no linking necessary. Of course, if you change the interface to the .so from what it was when the program was *compiled* then it will still run but unpredictable results can be predicted. -- ced -- Chuck Dillon Senior Software Engineer NimbleGen Systems Inc.




[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:20 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register