This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/65886] [5/6 Regression] Copy reloc in PIE incompatible with DSO created by -Wl,-Bsymbolic
- From: "thiago at kde dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 25 Apr 2015 17:33:04 +0000
- Subject: [Bug target/65886] [5/6 Regression] Copy reloc in PIE incompatible with DSO created by -Wl,-Bsymbolic
- Auto-submitted: auto-generated
- References: <bug-65886-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65886
--- Comment #8 from Thiago Macieira <thiago at kde dot org> ---
(In reply to H.J. Lu from comment #6)
> (In reply to H.J. Lu from comment #5)
> >
> > BTW, you should add -fsymbolic to -fPIC if the shared library will be
> > created by -Bsymbolic. It will improve shared library performance.
Will do.
> /export/build/gnu/gcc-5/build-x86_64-linux/gcc/xgcc
> -B/export/build/gnu/gcc-5/build-x86_64-linux/gcc/ -flto -Wl,-Bsymbolic -g
> -O2 -fsymbolic -shared -o libb.so b.o a.o
Will the LTO be required here? Or will it work without LTO too?
> Dump of assembler code for function bar:
> 0x00000000000005e0 <+0>: movl $0x1e,0x2002be(%rip) # 0x2008a8 <a>
> 0x00000000000005ea <+10>: retq
> End of assembler dump.
I've been accomplishing the same with protected visibility, but I keep running
into linker bugs, so I haven't been able to enable it by default. Looks like
the option here will be the proper solution.