public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Disable symbol hack in libc_nonshared.a
@ 2021-09-24 16:41 H.J. Lu
  2021-09-27 13:30 ` Florian Weimer
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2021-09-24 16:41 UTC (permalink / raw)
  To: libc-alpha

Don't reference __GI_memmove, __GI_memset, __GI_memcpy, __divdi3_internal,
__udivdi3_internal and __moddi3_internal in libc_nonshared.a.
---
 sysdeps/generic/symbol-hacks.h            | 3 ++-
 sysdeps/wordsize-32/divdi3-symbol-hacks.h | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sysdeps/generic/symbol-hacks.h b/sysdeps/generic/symbol-hacks.h
index 3586e6ed38..1115e4c0a7 100644
--- a/sysdeps/generic/symbol-hacks.h
+++ b/sysdeps/generic/symbol-hacks.h
@@ -1,6 +1,7 @@
 /* Some compiler optimizations may transform loops into memset/memmove
    calls and without proper declaration it may generate PLT calls.  */
-#if !defined __ASSEMBLER__ && IS_IN (libc) && defined SHARED
+#if !defined __ASSEMBLER__ && IS_IN (libc) && defined SHARED \
+    && !defined LIBC_NONSHARED
 asm ("memmove = __GI_memmove");
 asm ("memset = __GI_memset");
 asm ("memcpy = __GI_memcpy");
diff --git a/sysdeps/wordsize-32/divdi3-symbol-hacks.h b/sysdeps/wordsize-32/divdi3-symbol-hacks.h
index 3e7c54bd0c..efbb0cce8b 100644
--- a/sysdeps/wordsize-32/divdi3-symbol-hacks.h
+++ b/sysdeps/wordsize-32/divdi3-symbol-hacks.h
@@ -23,7 +23,8 @@
    assembler.
    Note: in_divdi3_c is only used to avoid symbol alias on divdi3
    build itself.  */
-#if !defined __ASSEMBLER__ && !defined in_divdi3_c && IS_IN (libc) && defined SHARED
+#if !defined __ASSEMBLER__ && !defined in_divdi3_c && IS_IN (libc) \
+    && defined SHARED && !defined LIBC_NONSHARED
 asm ("__divdi3 = __divdi3_internal");
 asm ("__udivdi3 = __udivdi3_internal");
 asm ("__moddi3 = __moddi3_internal");
-- 
2.31.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Disable symbol hack in libc_nonshared.a
  2021-09-24 16:41 [PATCH] Disable symbol hack in libc_nonshared.a H.J. Lu
@ 2021-09-27 13:30 ` Florian Weimer
  2021-09-27 14:44   ` H.J. Lu
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Weimer @ 2021-09-27 13:30 UTC (permalink / raw)
  To: H.J. Lu via Libc-alpha

* H. J. Lu via Libc-alpha:

> Don't reference __GI_memmove, __GI_memset, __GI_memcpy, __divdi3_internal,
> __udivdi3_internal and __moddi3_internal in libc_nonshared.a.

Patch looks correct me.  Commit subject should say “lib*_nonshared.a”
(it's not restricted to libc, despite the macro name).

Thanks,
Florian


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Disable symbol hack in libc_nonshared.a
  2021-09-27 13:30 ` Florian Weimer
@ 2021-09-27 14:44   ` H.J. Lu
  2021-09-27 14:48     ` Florian Weimer
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu @ 2021-09-27 14:44 UTC (permalink / raw)
  To: Florian Weimer; +Cc: H.J. Lu via Libc-alpha

On Mon, Sep 27, 2021 at 6:30 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * H. J. Lu via Libc-alpha:
>
> > Don't reference __GI_memmove, __GI_memset, __GI_memcpy, __divdi3_internal,
> > __udivdi3_internal and __moddi3_internal in libc_nonshared.a.
>
> Patch looks correct me.  Commit subject should say “lib*_nonshared.a”
> (it's not restricted to libc, despite the macro name).

The symbol hack only applies to libc:

diff --git a/sysdeps/generic/symbol-hacks.h b/sysdeps/generic/symbol-hacks.h
index 3586e6ed38..1115e4c0a7 100644
--- a/sysdeps/generic/symbol-hacks.h
+++ b/sysdeps/generic/symbol-hacks.h
@@ -1,6 +1,7 @@
 /* Some compiler optimizations may transform loops into memset/memmove
    calls and without proper declaration it may generate PLT calls.  */
-#if !defined __ASSEMBLER__ && IS_IN (libc) && defined SHARED
                                                         ^^^^^^^^^^^
+#if !defined __ASSEMBLER__ && IS_IN (libc) && defined SHARED \
+    && !defined LIBC_NONSHARED
 asm ("memmove = __GI_memmove");
 asm ("memset = __GI_memset");
 asm ("memcpy = __GI_memcpy");

and

diff --git a/sysdeps/wordsize-32/divdi3-symbol-hacks.h
b/sysdeps/wordsize-32/divdi3-symbol-hacks.h
index 3e7c54bd0c..efbb0cce8b 100644
--- a/sysdeps/wordsize-32/divdi3-symbol-hacks.h
+++ b/sysdeps/wordsize-32/divdi3-symbol-hacks.h
@@ -23,7 +23,8 @@
    assembler.
    Note: in_divdi3_c is only used to avoid symbol alias on divdi3
    build itself.  */
-#if !defined __ASSEMBLER__ && !defined in_divdi3_c && IS_IN (libc) &&
defined SHARED

                        ^^^^^^^^^^^
+#if !defined __ASSEMBLER__ && !defined in_divdi3_c && IS_IN (libc) \
+    && defined SHARED && !defined LIBC_NONSHARED

I am checking in my patch ASIS.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Disable symbol hack in libc_nonshared.a
  2021-09-27 14:44   ` H.J. Lu
@ 2021-09-27 14:48     ` Florian Weimer
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Weimer @ 2021-09-27 14:48 UTC (permalink / raw)
  To: H.J. Lu; +Cc: H.J. Lu via Libc-alpha

* H. J. Lu:

> On Mon, Sep 27, 2021 at 6:30 AM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> * H. J. Lu via Libc-alpha:
>>
>> > Don't reference __GI_memmove, __GI_memset, __GI_memcpy, __divdi3_internal,
>> > __udivdi3_internal and __moddi3_internal in libc_nonshared.a.
>>
>> Patch looks correct me.  Commit subject should say “lib*_nonshared.a”
>> (it's not restricted to libc, despite the macro name).
>
> The symbol hack only applies to libc:

> I am checking in my patch ASIS.

Yes, you are right.  Thanks.

Florian


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-09-27 14:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-24 16:41 [PATCH] Disable symbol hack in libc_nonshared.a H.J. Lu
2021-09-27 13:30 ` Florian Weimer
2021-09-27 14:44   ` H.J. Lu
2021-09-27 14:48     ` Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).