This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/65886] [5/6 Regression] Copy reloc in PIE incompatible with DSO created by -Wl,-Bsymbolic


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65886

--- Comment #7 from Thiago Macieira <thiago at kde dot org> ---
(In reply to H.J. Lu from comment #4)
> (In reply to Thiago Macieira from comment #3)
> > Thanks H.J.!
> > 
> > Can I ask that -fsymbolic be the default? Otherwise, code with -fPIE MUST
> > add -fsymbolic in GCC 5+, but can't add it prior because the option didn't
> > exist. Please leave that for a release or two so that we can adapt
> 
> Linux kernel has things like
> 
> M16_CFLAGS	 := $(call cc-option, -m16, $(CODE16GCC_CFLAGS))
> 
> It adds -m16 only if it exits. Why can't KDE do something like this?
> There are many ways to achieve it and it works with all compilers.

We can. The problem is not the ability, it's the need to do it.

No buildsystem currently has support for -fsymbolic, since it doesn't exist
yet. However, the lack of such option will produce subtle bugs. I'm asking for
a grace period until the changes propagate.

I can add a runtime check to QtCore, though.

> By default, GCC should be psABI compliant.  -Bsymbolic isn't psABI compliant
> since the resulting shared library doesn't work with normal executable.  I
> don't believe -fsymbolic should be the default, just like that -Bsymbolic
> shouldn't be the default for linker either.

I would argue that those should be the default and that we're optimising for
the wrong thing. For example, in your email with the patch, you said:

> Some experiments on google and SPEC CPU benchmarks show that the extra
> instruction affects performance by 1% to 5%.

You're not accounting for loss of performance in the shared libraries that
can't use -Bsymbolic due to the copy relocations, both at load-time
(relocations by name) and at runtime (indirect addressing to local symbols).
Maybe our experiences with shared libraries isn't the same: mine is that
libraries are 10x bigger and more complex than the applications using them. 

So I submit that your benchmarks are incomplete.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]