[1/3] Mark __libc_multiple_libcs with attribute_hidden [BZ #18822]

Message ID 20170818203021.GA15188@gmail.com
State New, archived
Headers

Commit Message

Lu, Hongjiu Aug. 18, 2017, 8:30 p.m. UTC
  Since __libc_multiple_libcs is defined as hidden symbol in init-first.c,
it should be marked with attribute_hidden.

OK for master?

H.J.
---
	[BZ #18822]
	* csu/libc-start.c (__libc_multiple_libcs): Add attribute_hidden.
	* elf/dl-open.c (__libc_multiple_libcs): Likewise.
---
 csu/libc-start.c | 2 +-
 elf/dl-open.c    | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
  

Comments

Florian Weimer Aug. 20, 2017, 7:54 a.m. UTC | #1
* H. J. Lu:

> 	[BZ #18822]
> 	* csu/libc-start.c (__libc_multiple_libcs): Add attribute_hidden.
> 	* elf/dl-open.c (__libc_multiple_libcs): Likewise.

Please put a hidden declaration into a header file instead.
  

Patch

diff --git a/csu/libc-start.c b/csu/libc-start.c
index 6720617188..31a30d7197 100644
--- a/csu/libc-start.c
+++ b/csu/libc-start.c
@@ -27,7 +27,7 @@ 
 
 extern void __libc_init_first (int argc, char **argv, char **envp);
 
-extern int __libc_multiple_libcs;
+extern int __libc_multiple_libcs attribute_hidden;
 
 #include <tls.h>
 #ifndef SHARED
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 2d8948aab1..a0817aa066 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -37,7 +37,8 @@ 
 #include <dl-dst.h>
 
 
-extern int __libc_multiple_libcs;	/* Defined in init-first.c.  */
+/* Defined in init-first.c.  */
+extern int __libc_multiple_libcs attribute_hidden;
 
 /* We must be careful not to leave us in an inconsistent state.  Thus we
    catch any error and re-raise it after cleaning up.  */