This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: linking of inline static methods
"Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de> writes:
> 0804984c R_386_COPY _16TestInlineStatic.staticVar
>
> Why is it needed to copy the variable into the program image at run
> time? Couldn't it live in the shared library just fine?
In many ABIs, including ia32, the program can only reference variables
at fixed addresses. Since shared libraries don't have fixed addresses,
variables are copied at startup time. Normally, this is OK because
the copied version overrides the one in the shared library, but this
doesn't work if -Bsymbolic is used.
--
- Geoffrey Keating <geoffk@cygnus.com>