Problem with static linking
Hendrik Muhs
Hendrik.Muhs@student.uni-magdeburg.de
Sat Jan 19 00:54:00 GMT 2002
> Hi Hendrik,
> Perhaps the problem is that when you compile both binaries
> "statically" the binaries generated do not use address independent
> memmory references? That is, maybe in both binaries, the memory
> references begin at the same point in memory, and your malloc
> is stomping over part of your running code.
>
> I'm wondering if using -fPIC to build your binaries would help.
> I'm not 100% sure if -fPIC and 'static' binaries go together, but
> this is the only thing I can think of.
Hi Robert,
thank your for your answer.
I also thought about PIC, unfortunately this segfaults, too.
In my Opinion the example code(and my real code) and the compiler options are
OK. It should not fail.
Hendrik
--
More information about the Gcc-help
mailing list