about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2014-11-04 17:39:39 +0000
committerJoseph Myers <joseph@codesourcery.com>2014-11-04 17:39:39 +0000
commit4243cbea6d30ce32b58abd8f1103156f8df617fa (patch)
tree434ef397cb91424e48b123ca704e8176795f2161 /sysdeps
parent2004e7fb76bd6806253436d63ab3bda7e24c9cc1 (diff)
downloadglibc-4243cbea6d30ce32b58abd8f1103156f8df617fa.tar.gz
glibc-4243cbea6d30ce32b58abd8f1103156f8df617fa.tar.xz
glibc-4243cbea6d30ce32b58abd8f1103156f8df617fa.zip
Don't use INTDEF/INTUSE with _dl_argv (bug 14132).
Continuing the removal of the obsolete INTDEF / INTUSE mechanism, this
patch replaces its use for _dl_argv with rtld_hidden_data_def and
rtld_hidden_proto.  Some places in .S files that previously used
_dl_argv_internal or INTUSE(_dl_argv) now use __GI__dl_argv directly
(there are plenty of existing examples of such direct use of __GI_*).

A single place in rtld.c previously used _dl_argv without INTUSE,
apparently accidentally, while the rtld_hidden_proto mechanism avoids
such accidential omissions.  As a consequence, this patch *does*
change the contents of stripped ld.so.  However, the installed
stripped shared libraries are identical to those you get if instead of
this patch you change that single _dl_argv use to use INTUSE, without
any other changes.

Tested for x86_64 (testsuite as well as comparison of installed
stripped shared libraries as described above).

	[BZ #14132]
	* sysdeps/generic/ldsodefs.h (_dl_argv): Use rtld_hidden_proto.
	[IS_IN_rtld] (_dl_argv_internal): Do not declare.
	(rtld_progname): Make macro definition unconditional.
	* elf/rtld.c (_dl_argv): Use rtld_hidden_data_def instead of
	INTDEF.
	(dlmopen_doit): Do not use INTUSE with _dl_argv.
	(dl_main): Likewise.
	* elf/dl-sysdep.c (_dl_sysdep_start): Likewise.
	* sysdeps/alpha/dl-machine.h (RTLD_START): Use __GI__dl_argv
	instead of _dl_argv_internal.
	* sysdeps/powerpc/powerpc32/dl-start.S (_dl_start_user): Use
	__GI__dl_argv instead of INTUSE(_dl_argv).
	* sysdeps/powerpc/powerpc64/dl-machine.h (RTLD_START): Use
	__GI__dl_argv instead of _dl_argv_internal.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/alpha/dl-machine.h6
-rw-r--r--sysdeps/generic/ldsodefs.h10
-rw-r--r--sysdeps/powerpc/powerpc32/dl-start.S2
-rw-r--r--sysdeps/powerpc/powerpc64/dl-machine.h2
4 files changed, 7 insertions, 13 deletions
diff --git a/sysdeps/alpha/dl-machine.h b/sysdeps/alpha/dl-machine.h
index e6537dd6e5..64385ad68a 100644
--- a/sysdeps/alpha/dl-machine.h
+++ b/sysdeps/alpha/dl-machine.h
@@ -184,16 +184,16 @@ $fixup_stack:							\n\
 	/* Adjust the stack pointer to skip _dl_skip_args words.\n\
 	   This involves copying everything down, since the	\n\
 	   stack pointer must always be 16-byte aligned.  */	\n\
-	ldah	$7, _dl_argv_internal($gp) !gprelhigh		\n\
+	ldah	$7, __GI__dl_argv($gp) !gprelhigh		\n\
 	ldq	$2, 0($sp)					\n\
-	ldq	$5, _dl_argv_internal($7) !gprellow		\n\
+	ldq	$5, __GI__dl_argv($7) !gprellow			\n\
 	subq	$31, $1, $6					\n\
 	subq	$2, $1, $2					\n\
 	s8addq	$6, $5, $5					\n\
 	mov	$sp, $4						\n\
 	s8addq	$1, $sp, $3					\n\
 	stq	$2, 0($sp)					\n\
-	stq	$5, _dl_argv_internal($7) !gprellow		\n\
+	stq	$5, __GI__dl_argv($7) !gprellow			\n\
 	/* Copy down argv.  */					\n\
 0:	ldq	$5, 8($3)					\n\
 	addq	$4, 8, $4					\n\
diff --git a/sysdeps/generic/ldsodefs.h b/sysdeps/generic/ldsodefs.h
index e01df84a99..d1c8e2cb9d 100644
--- a/sysdeps/generic/ldsodefs.h
+++ b/sysdeps/generic/ldsodefs.h
@@ -641,6 +641,7 @@ extern char **_dl_argv
      attribute_relro
 #endif
      ;
+rtld_hidden_proto (_dl_argv)
 #ifdef IS_IN_rtld
 extern unsigned int _dl_skip_args attribute_hidden
 # ifndef DL_ARGV_NOT_RELRO
@@ -652,15 +653,8 @@ extern unsigned int _dl_skip_args_internal attribute_hidden
      attribute_relro
 # endif
      ;
-extern char **_dl_argv_internal attribute_hidden
-# ifndef DL_ARGV_NOT_RELRO
-     attribute_relro
-# endif
-     ;
-# define rtld_progname (INTUSE(_dl_argv)[0])
-#else
-# define rtld_progname _dl_argv[0]
 #endif
+#define rtld_progname _dl_argv[0]
 
 /* Flag set at startup and cleared when the last initializer has run.  */
 extern int _dl_starting_up;
diff --git a/sysdeps/powerpc/powerpc32/dl-start.S b/sysdeps/powerpc/powerpc32/dl-start.S
index b2078d4225..be8ce441ac 100644
--- a/sysdeps/powerpc/powerpc32/dl-start.S
+++ b/sysdeps/powerpc/powerpc32/dl-start.S
@@ -54,7 +54,7 @@ _dl_start_user:
 /*  &_dl_argc in 29, &_dl_argv in 27, and _dl_loaded in 28.  */
 	lwz	r28,_rtld_local@got(r31)
 	lwz	r29,_dl_argc@got(r31)
-	lwz	r27,INTUSE(_dl_argv)@got(r31)
+	lwz	r27,__GI__dl_argv@got(r31)
 
 /* Call _dl_init (_dl_loaded, _dl_argc, _dl_argv, _dl_argv+_dl_argc+1). */
 	lwz	r3,0(r28)
diff --git a/sysdeps/powerpc/powerpc64/dl-machine.h b/sysdeps/powerpc/powerpc64/dl-machine.h
index 735a549f54..3007e80f90 100644
--- a/sysdeps/powerpc/powerpc64/dl-machine.h
+++ b/sysdeps/powerpc/powerpc64/dl-machine.h
@@ -169,7 +169,7 @@ DL_STARTING_UP_DEF							\
 ".LC__dl_argc:\n"							\
 "	.tc _dl_argc[TC],_dl_argc\n"					\
 ".LC__dl_argv:\n"							\
-"	.tc _dl_argv_internal[TC],_dl_argv_internal\n"			\
+"	.tc __GI__dl_argv[TC],__GI__dl_argv\n"				\
 ".LC__dl_fini:\n"							\
 "	.tc _dl_fini[TC],_dl_fini\n"					\
 "	.popsection\n"							\