Richard Henderson <r...@redhat.com> writes: > My recent change to fix PR48076 broke arm-linux, and probably mips-linux, > where one must defer to the kernel in order to achieve a memory barrier > for the currently running cpu. > > The __sync* family of functions was put into libgcc.a, and not into the > shared library, so that invocations of these functions would be fast and > not go through symbol resolution and the PLT. > > My change ensures that libgcc_s.so.1, like any other library that would > be built, contains a copy of whatever symbols it requires from libgcc.a. > Since these functions are hidden, this does not change the exported ABI > of the shared library. > > This does add 3K to the size of libgcc_s.so. That could be reduced by > breaking up the arm linux-atomic.c file into per-function units. Or we > just ignore the problem because 3K isn't worth worrying about. > > Alternately, we could take this opportunity to adjust things so that > the symbols *are* exported from the shared library. Obviously we cannot > do this on any of the release branches. I'll leave that choice to the > ARM maintainers.
FWIW, the MIPS16 helper routines are tiny and each one is already in a separate object, so I think this patch is what we want there regardless of what we do for ARM. Although I suppose it's academic, because there isn't yet a target for building MIPS16 libgcc.sos out of the box. Richard