Shared library seems corrupted. ??? (fwd)

Shared library seems corrupted. ??? (fwd)

Post by G. Georgie » Thu, 30 Apr 1998 04:00:00



        Hi,

        I create a shared library where I put some stuff I use for
different programs which makes a lot of grief to me. The problem is that
some of the functions seems to be not correctly linked in my executables
sometimes and only with some recompilations of the shared library. When I
call a function instead of enterring inside that function like normal, the
program jumps to completely different line in another function of the
shared library. Seems like the linker did not put the proper offset from
the library text start in the executable.

        There is no text segment overwrite by some pointer at this moment
as I execute it as the first line in the main() function, stack is not
involved as it is a call and not a return, and it happens the same way in
three different programs I link against the library and it happens only
after some recompilations of the library, on other recompilations with the
same library it works well.

        How I create the library:
cc -Wall -c -ggdb aflib.c
cc -shared -o libaf.so aflib.o
cp libaf.so /usr/local/lib/

        How I compile:
gcc l3.c -laf -lmq -o l3 -ggdb -Wall -pedantic

        I use gcc 2.7.2.1, link dynamic of cource. The program is
recompiled every time I touch the library.

        How may I get a load map for the library and the programs? How may
I identify if the library is well created? And what this problem may be at
all?

                                        George.

 
 
 

Shared library seems corrupted. ??? (fwd)

Post by Andy Jefferso » Sat, 09 May 1998 04:00:00



>    Hi,
>    I create a shared library where I put some stuff I use for
> different programs which makes a lot of grief to me. The problem is that
> some of the functions seems to be not correctly linked in my executables
> sometimes and only with some recompilations of the shared library. When I
> call a function instead of enterring inside that function like normal, the
> program jumps to completely different line in another function of the
> shared library. Seems like the linker did not put the proper offset from
> the library text start in the executable.
>    There is no text segment overwrite by some pointer at this moment
> as I execute it as the first line in the main() function, stack is not
> involved as it is a call and not a return, and it happens the same way in
> three different programs I link against the library and it happens only
> after some recompilations of the library, on other recompilations with the
> same library it works well.
>    I use gcc 2.7.2.1, link dynamic of cource. The program is
> recompiled every time I touch the library.

George,

as I told you in a mail, I had also had some problems with use of dynamic
libs. I've just changed to using the egcs compiler, and this has seemingly
solved all problems. Give it a try maybe ?

HTH
--
Andy Jefferson

 
 
 

1. Shared library seems corrupted. ???

        Hi,

        I create a shared library where I put some stuff I use for
different programs which makes a lot of grief to me. The problem is that
some of the functions seems to be not correctly linked in my executables
sometimes and only with some recompilations of the shared library. When I
call a function instead of enterring inside that function like normal, the
program jumps to completely different line in another function of the
shared library. Seems like the linker did not put the proper offset from
the library text start in the executable.

        There is no text segment overwrite by some pointer at this moment
as I execute it as the first line in the main() function, stack is not
involved as it is a call and not a return, and it happens the same way in
three different programs I link against the library and it happens only
after some recompilations of the library, on other recompilations with the
same library it works well.

        How I create the library:
cc -Wall -c -ggdb aflib.c
cc -shared -o libaf.so aflib.o
cp libaf.so /usr/local/lib/

        How I compile:
gcc l3.c -laf -lmq -o l3 -ggdb -Wall -pedantic

        I use gcc 2.7.2.1, link dynamic of cource. The program is
recompiled every time I touch the library.

        How may I get a load map for the library and the programs? How may
I identify if the library is well created? And what this problem may be at
all?

                                        George.

2. raid 0.90 and 2.2.16 kernel

3. non-PIC ELF shared libraries (fwd)

4. PPTP VPN Firewall questions

5. [Fwd: Questions about debugging in shared library]

6. Token Ring / PCMCIA

7. Can a user process corrupt a shared library?

8. where's netscape on RH5.1?

9. Shared library corrupted Why???

10. corrupted shared library?

11. Corrupted Shared Library

12. Will strip(debug shared library) == nodebug shared library ?

13. Help with building shared libraries with dependencies on other shared libraries