LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-16-2007, 12:18 PM   #1
mozart1997
LQ Newbie
 
Registered: Aug 2007
Posts: 2

Rep: Reputation: 0
ELF .so compatibility


I have a question regarding a compatibility issue when modification is made to the code in a .so library.

I have set up some simple sample code. In my library libtest.so, I have a class A with a virtual method foo(). In my executable a.out main(), I have an instance of A as a stack object. main() calls a.foo().

Despite foo() is virtual, since the instance of A was declared as a stack object, the compiler was able to figure out it is A::foo() that main() is calling without having to go through the vtable. This explains the entry of _ZN1A4fooEv in the .dynsym table of a.out when I used readelf on a.out.

Everything makes sense so far. However, what bothers me was the "Size" information on the .dynsym entry for A::foo(). Whenever I change the implementation of A::foo(), the size of _ZN1A4fooEv in the .dynsym table changes in a.out after re-linking. How is this size information used by the dynamic linker? If I create a version of the library as libtest.so.1.1 and link a.out with it, then I changed the implementation of A::foo() and create libtest.so.1.2. Without re-linking a.out, will a.out be compatible with libtest.so.1.2?

Thanks.
 
Old 08-17-2007, 10:43 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between Linux ELF Format and win32 ELF Format cmemo Linux - Hardware 1 05-11-2007 05:32 PM
Difference between Linux ELF Format and win32 ELF Format cmemo Linux - General 1 05-11-2007 03:44 PM
Difference between Linux ELF Format and win32 ELF Format cmemo Linux - Software 1 05-11-2007 03:31 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration