public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix extra PLT reference in libc.so due to __glob64_time64 if build with gcc 7.5 on 32bit.
@ 2021-06-30 14:17 Stefan Liebler
  2021-06-30 14:32 ` Florian Weimer
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Liebler @ 2021-06-30 14:17 UTC (permalink / raw)
  To: libc-alpha; +Cc: adhemerval.zanella, Stefan Liebler

Starting with recent commit 84f7ce84474c1648ce96884f1c91ca7b97ca3fc2
"posix: Add glob64 with 64-bit time_t support", elf/check-localplt
fails due to extra PLT reference __glob64_time64 in __glob64_time64
itself.

This is observable with gcc 7.5 on x86_64 with -m32 or s390x with
-m31.  E.g. if build with gcc 10, gcc is generating a call to
__glob64_time64.localalias.

This patch is adding a hidden version of __glob64_time64 in the
same way as for __globfree64_time64.
---
 include/glob.h                          | 1 +
 posix/glob64-time64.c                   | 1 +
 sysdeps/unix/sysv/linux/glob64-time64.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/include/glob.h b/include/glob.h
index f48c71960d..483d5ba990 100644
--- a/include/glob.h
+++ b/include/glob.h
@@ -31,6 +31,7 @@ typedef struct
 extern int __glob64_time64 (const char *pattern, int flags,
 			    int (*errfunc) (const char *, int),
 			    glob64_time64_t *pglob);
+libc_hidden_proto (__glob64_time64)
 void __globfree64_time64 (glob64_time64_t *pglob);
 libc_hidden_proto (__globfree64_time64)
 # endif
diff --git a/posix/glob64-time64.c b/posix/glob64-time64.c
index b0f8facd84..434d8ddd7b 100644
--- a/posix/glob64-time64.c
+++ b/posix/glob64-time64.c
@@ -43,6 +43,7 @@ __glob64_time64 (const char *pattern, int flags,
   __set_errno (ENOSYS);
   return GLOB_NOSYS;
 }
+libc_hidden_def (__glob64_time64)
 
 stub_warning (glob64)
 
diff --git a/sysdeps/unix/sysv/linux/glob64-time64.c b/sysdeps/unix/sysv/linux/glob64-time64.c
index 260f067fa4..a465f70905 100644
--- a/sysdeps/unix/sysv/linux/glob64-time64.c
+++ b/sysdeps/unix/sysv/linux/glob64-time64.c
@@ -41,4 +41,5 @@
 # define COMPILE_GLOB64	1
 
 # include <posix/glob.c>
+libc_hidden_def (__glob64_time64)
 #endif
-- 
2.23.0


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

* Re: [PATCH] Fix extra PLT reference in libc.so due to __glob64_time64 if build with gcc 7.5 on 32bit.
  2021-06-30 14:17 [PATCH] Fix extra PLT reference in libc.so due to __glob64_time64 if build with gcc 7.5 on 32bit Stefan Liebler
@ 2021-06-30 14:32 ` Florian Weimer
  2021-07-01 14:48   ` Stefan Liebler
  0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2021-06-30 14:32 UTC (permalink / raw)
  To: Stefan Liebler via Libc-alpha; +Cc: Stefan Liebler

* Stefan Liebler via Libc-alpha:

> Starting with recent commit 84f7ce84474c1648ce96884f1c91ca7b97ca3fc2
> "posix: Add glob64 with 64-bit time_t support", elf/check-localplt
> fails due to extra PLT reference __glob64_time64 in __glob64_time64
> itself.
>
> This is observable with gcc 7.5 on x86_64 with -m32 or s390x with
> -m31.  E.g. if build with gcc 10, gcc is generating a call to
> __glob64_time64.localalias.
>
> This patch is adding a hidden version of __glob64_time64 in the
> same way as for __globfree64_time64.
> ---
>  include/glob.h                          | 1 +
>  posix/glob64-time64.c                   | 1 +
>  sysdeps/unix/sysv/linux/glob64-time64.c | 1 +
>  3 files changed, 3 insertions(+)
>
> diff --git a/include/glob.h b/include/glob.h
> index f48c71960d..483d5ba990 100644
> --- a/include/glob.h
> +++ b/include/glob.h
> @@ -31,6 +31,7 @@ typedef struct
>  extern int __glob64_time64 (const char *pattern, int flags,
>  			    int (*errfunc) (const char *, int),
>  			    glob64_time64_t *pglob);
> +libc_hidden_proto (__glob64_time64)
>  void __globfree64_time64 (glob64_time64_t *pglob);
>  libc_hidden_proto (__globfree64_time64)
>  # endif
> diff --git a/posix/glob64-time64.c b/posix/glob64-time64.c
> index b0f8facd84..434d8ddd7b 100644
> --- a/posix/glob64-time64.c
> +++ b/posix/glob64-time64.c
> @@ -43,6 +43,7 @@ __glob64_time64 (const char *pattern, int flags,
>    __set_errno (ENOSYS);
>    return GLOB_NOSYS;
>  }
> +libc_hidden_def (__glob64_time64)
>  
>  stub_warning (glob64)
>  
> diff --git a/sysdeps/unix/sysv/linux/glob64-time64.c b/sysdeps/unix/sysv/linux/glob64-time64.c
> index 260f067fa4..a465f70905 100644
> --- a/sysdeps/unix/sysv/linux/glob64-time64.c
> +++ b/sysdeps/unix/sysv/linux/glob64-time64.c
> @@ -41,4 +41,5 @@
>  # define COMPILE_GLOB64	1
>  
>  # include <posix/glob.c>
> +libc_hidden_def (__glob64_time64)
>  #endif

Patch looks okay to me.

Thanks,
Florian


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

* Re: [PATCH] Fix extra PLT reference in libc.so due to __glob64_time64 if build with gcc 7.5 on 32bit.
  2021-06-30 14:32 ` Florian Weimer
@ 2021-07-01 14:48   ` Stefan Liebler
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Liebler @ 2021-07-01 14:48 UTC (permalink / raw)
  To: Florian Weimer, Stefan Liebler via Libc-alpha

On 30/06/2021 16:32, Florian Weimer wrote:
> * Stefan Liebler via Libc-alpha:
> 
>> Starting with recent commit 84f7ce84474c1648ce96884f1c91ca7b97ca3fc2
>> "posix: Add glob64 with 64-bit time_t support", elf/check-localplt
>> fails due to extra PLT reference __glob64_time64 in __glob64_time64
>> itself.
>>
>> This is observable with gcc 7.5 on x86_64 with -m32 or s390x with
>> -m31.  E.g. if build with gcc 10, gcc is generating a call to
>> __glob64_time64.localalias.
>>
>> This patch is adding a hidden version of __glob64_time64 in the
>> same way as for __globfree64_time64.
>> ---
>>  include/glob.h                          | 1 +
>>  posix/glob64-time64.c                   | 1 +
>>  sysdeps/unix/sysv/linux/glob64-time64.c | 1 +
>>  3 files changed, 3 insertions(+)
>>
>> diff --git a/include/glob.h b/include/glob.h
>> index f48c71960d..483d5ba990 100644
>> --- a/include/glob.h
>> +++ b/include/glob.h
>> @@ -31,6 +31,7 @@ typedef struct
>>  extern int __glob64_time64 (const char *pattern, int flags,
>>  			    int (*errfunc) (const char *, int),
>>  			    glob64_time64_t *pglob);
>> +libc_hidden_proto (__glob64_time64)
>>  void __globfree64_time64 (glob64_time64_t *pglob);
>>  libc_hidden_proto (__globfree64_time64)
>>  # endif
>> diff --git a/posix/glob64-time64.c b/posix/glob64-time64.c
>> index b0f8facd84..434d8ddd7b 100644
>> --- a/posix/glob64-time64.c
>> +++ b/posix/glob64-time64.c
>> @@ -43,6 +43,7 @@ __glob64_time64 (const char *pattern, int flags,
>>    __set_errno (ENOSYS);
>>    return GLOB_NOSYS;
>>  }
>> +libc_hidden_def (__glob64_time64)
>>  
>>  stub_warning (glob64)
>>  
>> diff --git a/sysdeps/unix/sysv/linux/glob64-time64.c b/sysdeps/unix/sysv/linux/glob64-time64.c
>> index 260f067fa4..a465f70905 100644
>> --- a/sysdeps/unix/sysv/linux/glob64-time64.c
>> +++ b/sysdeps/unix/sysv/linux/glob64-time64.c
>> @@ -41,4 +41,5 @@
>>  # define COMPILE_GLOB64	1
>>  
>>  # include <posix/glob.c>
>> +libc_hidden_def (__glob64_time64)
>>  #endif
> 
> Patch looks okay to me.
> 
> Thanks,
> Florian
> 

Committed.

Thanks,
Stefan

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30 14:17 [PATCH] Fix extra PLT reference in libc.so due to __glob64_time64 if build with gcc 7.5 on 32bit Stefan Liebler
2021-06-30 14:32 ` Florian Weimer
2021-07-01 14:48   ` Stefan Liebler

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