public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 3/3] x86-64: Mark internal symbols with attribute_hidden [BZ #18822]
@ 2017-08-18 16:29 H.J. Lu
  2017-08-21 12:38 ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: H.J. Lu @ 2017-08-18 16:29 UTC (permalink / raw)
  To: GNU C Library

Since __syscall_clock_gettime and __start_context are internal symbols
for Linux/x86-64, mark them with attribute_hidden.

OK for master?

H.J.
---
	[BZ #18822]
	* sysdeps/unix/sysv/linux/x86_64/init-first.c
	(__syscall_clock_gettime): Add attribute_hidden.
	* sysdeps/unix/sysv/linux/x86_64/makecontext.c
	(__start_context): Likewise.
---
 sysdeps/unix/sysv/linux/x86_64/init-first.c  | 3 ++-
 sysdeps/unix/sysv/linux/x86_64/makecontext.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c
index f1c46cb5bc..e5778b118c 100644
--- a/sysdeps/unix/sysv/linux/x86_64/init-first.c
+++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c
@@ -27,7 +27,8 @@ long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
 long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
   attribute_hidden;
 
-extern long int __syscall_clock_gettime (clockid_t, struct timespec *);
+extern long int __syscall_clock_gettime (clockid_t, struct timespec *)
+  attribute_hidden;
 
 
 static inline void
diff --git a/sysdeps/unix/sysv/linux/x86_64/makecontext.c b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
index 59fb77a8c1..e198a2215a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/makecontext.c
+++ b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
@@ -51,7 +51,7 @@
 void
 __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
 {
-  extern void __start_context (void);
+  extern void __start_context (void) attribute_hidden;
   greg_t *sp;
   unsigned int idx_uc_link;
   va_list ap;
-- 
2.13.5

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

* Re: [PATCH 3/3] x86-64: Mark internal symbols with attribute_hidden [BZ #18822]
  2017-08-18 16:29 [PATCH 3/3] x86-64: Mark internal symbols with attribute_hidden [BZ #18822] H.J. Lu
@ 2017-08-21 12:38 ` Florian Weimer
  2017-08-21 12:57   ` H.J. Lu
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2017-08-21 12:38 UTC (permalink / raw)
  To: H.J. Lu, GNU C Library

On 08/18/2017 06:28 PM, H.J. Lu wrote:

> -extern long int __syscall_clock_gettime (clockid_t, struct timespec *);
> +extern long int __syscall_clock_gettime (clockid_t, struct timespec *)
> +  attribute_hidden;

Should this be

  __typeof__ (clock_gettime) __syscall_clock_gettime attribute_hidden;

for added type safety?

>  static inline void
> diff --git a/sysdeps/unix/sysv/linux/x86_64/makecontext.c b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
> index 59fb77a8c1..e198a2215a 100644
> --- a/sysdeps/unix/sysv/linux/x86_64/makecontext.c
> +++ b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
> @@ -51,7 +51,7 @@
>  void
>  __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
>  {
> -  extern void __start_context (void);
> +  extern void __start_context (void) attribute_hidden;

This is okay.  The definition is in assembler code, so a separate header
would not add type safety.

Thanks,
Florian

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

* Re: [PATCH 3/3] x86-64: Mark internal symbols with attribute_hidden [BZ #18822]
  2017-08-21 12:38 ` Florian Weimer
@ 2017-08-21 12:57   ` H.J. Lu
  0 siblings, 0 replies; 3+ messages in thread
From: H.J. Lu @ 2017-08-21 12:57 UTC (permalink / raw)
  To: Florian Weimer; +Cc: GNU C Library

[-- Attachment #1: Type: text/plain, Size: 1064 bytes --]

On Mon, Aug 21, 2017 at 5:38 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 08/18/2017 06:28 PM, H.J. Lu wrote:
>
>> -extern long int __syscall_clock_gettime (clockid_t, struct timespec *);
>> +extern long int __syscall_clock_gettime (clockid_t, struct timespec *)
>> +  attribute_hidden;
>
> Should this be
>
>   __typeof__ (clock_gettime) __syscall_clock_gettime attribute_hidden;
>
> for added type safety?
>
>>  static inline void
>> diff --git a/sysdeps/unix/sysv/linux/x86_64/makecontext.c b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
>> index 59fb77a8c1..e198a2215a 100644
>> --- a/sysdeps/unix/sysv/linux/x86_64/makecontext.c
>> +++ b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
>> @@ -51,7 +51,7 @@
>>  void
>>  __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
>>  {
>> -  extern void __start_context (void);
>> +  extern void __start_context (void) attribute_hidden;
>
> This is okay.  The definition is in assembler code, so a separate header
> would not add type safety.
>

This is what I am checking in.

Thanks.


-- 
H.J.

[-- Attachment #2: 0001-x86-64-Mark-internal-symbols-with-attribute_hidden-B.patch --]
[-- Type: text/x-patch, Size: 1795 bytes --]

From 1653eb9bb7687a1930920902ea07bf4608770dbc Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Fri, 18 Aug 2017 09:23:31 -0700
Subject: [PATCH] x86-64: Mark internal symbols with attribute_hidden [BZ
 #18822]

Since __syscall_clock_gettime and __start_context are internal symbols
for Linux/x86-64, mark them with attribute_hidden.

	[BZ #18822]
	* sysdeps/unix/sysv/linux/x86_64/init-first.c
	(__syscall_clock_gettime): Add attribute_hidden.
	* sysdeps/unix/sysv/linux/x86_64/makecontext.c
	(__start_context): Likewise.
---
 sysdeps/unix/sysv/linux/x86_64/init-first.c  | 2 +-
 sysdeps/unix/sysv/linux/x86_64/makecontext.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c
index f1c46cb5bc..b187239ba0 100644
--- a/sysdeps/unix/sysv/linux/x86_64/init-first.c
+++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c
@@ -27,7 +27,7 @@ long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
 long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
   attribute_hidden;
 
-extern long int __syscall_clock_gettime (clockid_t, struct timespec *);
+extern __typeof (clock_gettime) __syscall_clock_gettime attribute_hidden;
 
 
 static inline void
diff --git a/sysdeps/unix/sysv/linux/x86_64/makecontext.c b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
index 59fb77a8c1..e198a2215a 100644
--- a/sysdeps/unix/sysv/linux/x86_64/makecontext.c
+++ b/sysdeps/unix/sysv/linux/x86_64/makecontext.c
@@ -51,7 +51,7 @@
 void
 __makecontext (ucontext_t *ucp, void (*func) (void), int argc, ...)
 {
-  extern void __start_context (void);
+  extern void __start_context (void) attribute_hidden;
   greg_t *sp;
   unsigned int idx_uc_link;
   va_list ap;
-- 
2.13.5


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

end of thread, other threads:[~2017-08-21 12:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-18 16:29 [PATCH 3/3] x86-64: Mark internal symbols with attribute_hidden [BZ #18822] H.J. Lu
2017-08-21 12:38 ` Florian Weimer
2017-08-21 12:57   ` H.J. Lu

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).