Let’s consider a libmisc.so.1.0 usefull for lot of programs.
Now I want to add a general functionnality in libmisc.so.
So, I build a libmisc.so.1.1, which is EXACTLY libmisc.so.1.0 plus
something.
my_prog doesn’t take care of the new functionnality so, I don’t want to
rebuilt it.
I replace the old lib, and I link libmisc.so.1.0 on libmisc.so.1.1
Now I start my_prog and I get:
attempt to load libmisc.so.1.0
loaded lib at addr B8200000(text) B820AA50(data)
…
attempt to load libmisc.so.1.0
loaded lib at addr B8217000(text) B820AA50(data)
attempt to load libmisc.so.1.0
loaded lib at addr B8222000(text) B820AA50(data)
attempt to load libmisc.so.1.0
loaded lib at addr B8222d000(text) B820AA50(data)
segmentation violation (core dumped)
Now I want to add a general functionnality in libmisc.so.
So, I build a libmisc.so.1.1, which is EXACTLY libmisc.so.1.0 plus
something.
I replace the old lib, and I link libmisc.so.1.0 on libmisc.so.1.1
Things like this usually involves setting SONAME in the *.so,
but SIGSEGV should be another cause.
Post exactly what you’re doing, including sample source if possible.
Found that sigsegv came from a static lib I put in a shared lib. I
didn’t take care of that first. I though to have the so version.
About multiple loading of the shared lib, it’s effectively caused by the
fact that I load a libmisc.so.1.1 , even though over shared libs that
my_prog loads are built for libmisc.so.1.0.
SO_NAME=libmisc.so.1.1
That way is commonly used in UNIX. Does it happen the same thing, or do
I have to set my SO_NAME differently?
Now I want to add a general functionnality in libmisc.so.
So, I build a libmisc.so.1.1, which is EXACTLY libmisc.so.1.0 plus
something.
I replace the old lib, and I link libmisc.so.1.0 on libmisc.so.1.1
Things like this usually involves setting SONAME in the *.so,
but SIGSEGV should be another cause.
Post exactly what you’re doing, including sample source if possible.
which mostly applies to other ELF-based systems.
(Latest Solaris has lots of useful quirks which don’t apply to other OS;
for beginners, stick to older releases’ docs)
GNU ld’s native info file isn’t helpful for primer.