On 9/17/18 3:50 PM, Sergei Trofimovich wrote: > On Mon, 17 Sep 2018 15:29:08 -0600 > Jeff Law <l...@redhat.com> wrote: > >> On 9/17/18 3:18 PM, Sergei Trofimovich wrote: >>> On Sat, 28 Jul 2018 20:42:02 +0100 >>> "slyfox.inbox.ru via gcc-patches" <gcc-patches@gcc.gnu.org> wrote: >>> >>>> From: Sergei Trofimovich <sly...@gentoo.org> >>>> >>>> Cc: Ian Lance Taylor <i...@airs.com> >>>> Cc: Jeff Law <l...@redhat.com> >>>> Cc: Andreas Schwab <sch...@linux-m68k.org> >>>> Signed-off-by: Sergei Trofimovich <sly...@gentoo.org> >>>> --- >>>> libgcc/config/m68k/lb1sf68.S | 3 +++ >>>> 1 file changed, 3 insertions(+) >>>> >>>> diff --git a/libgcc/config/m68k/lb1sf68.S b/libgcc/config/m68k/lb1sf68.S >>>> index 325a7c17d9b..d5240d4aa55 100644 >>>> --- a/libgcc/config/m68k/lb1sf68.S >>>> +++ b/libgcc/config/m68k/lb1sf68.S >>>> @@ -435,6 +435,7 @@ $_exception_handler: >>>> .text >>>> FUNC(__mulsi3) >>>> .globl SYM (__mulsi3) >>>> + .hidden SYM (__mulsi3) >>>> SYM (__mulsi3): >>>> movew sp@(4), d0 /* x0 -> d0 */ >>>> muluw sp@(10), d0 /* x0*y1 */ >>>> @@ -458,6 +459,7 @@ SYM (__mulsi3): >>>> .text >>>> FUNC(__udivsi3) >>>> .globl SYM (__udivsi3) >>>> + .hidden SYM (__udivsi3) >>>> SYM (__udivsi3): >>>> #ifndef __mcoldfire__ >>>> movel d2, sp@- >>>> @@ -534,6 +536,7 @@ L2: subql IMM (1),d4 >>>> .text >>>> FUNC(__divsi3) >>>> .globl SYM (__divsi3) >>>> + .hidden SYM (__divsi3) >>>> SYM (__divsi3): >>>> movel d2, sp@- >>>> >>>> -- >>>> 2.18.0 >>>> >>> >>> Patch ping. Not sure which is preferable v1 (as other targets do) or v2. >> Hmm, I thought Andreas NAK'd V1. And I think Rich's comments >> essentially NAK'd V2. > > Aha. I'm trying to clarify the desired state then to try to tweak > patch properly: > > Current: > - static library: > * global public __divsi3 > - shared library: > * global public __divsi3 Right. And presumably the problem here is with public visibility we have to support the possibility to interposition which can be costly.
> > Desired: > - static library: > * global hidden __divsi3 [ABI change:public->hidden] Right. But since everything should be linking against libgcc, each DSO or executable should end up carrying whatever libgcc functions it needs and we can hide them from the dynamic linker becuase we don't need to support interposition and/or function pointer testing on them. > - shared library: > * global public __divsi3 [no change] > * global hidden __divsi3_internal [change:new symbol for internal > references] > > Does that sound reasonable? > Should all targets follow the same pattern? I think they don't today. And in the shared case we need to leave the original symbol alone and provide an alias with hidden visibility IIRC. I might have mis-understood Rich Felker's objection. Jeff