about summary refs log tree commit diff
path: root/sysdeps/mips
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-06-08 10:28:38 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-06-08 10:28:52 -0700
commit67c0579669ba1fc265d770252fab31babf887329 (patch)
tree34059924ead164f11bc21fd73ccab758153bd9f7 /sysdeps/mips
parent1c09524e4db3efd797ebcfcd8241bdb78f0b06f0 (diff)
downloadglibc-67c0579669ba1fc265d770252fab31babf887329.tar.gz
glibc-67c0579669ba1fc265d770252fab31babf887329.tar.xz
glibc-67c0579669ba1fc265d770252fab31babf887329.zip
Mark _init and _fini as hidden [BZ #23145]
_init and _fini are special functions provided by glibc for linker to
define DT_INIT and DT_FINI in executable and shared library.  They
should never be put in dynamic symbol table.  This patch marks them as
hidden to remove them from dynamic symbol table.

Tested with build-many-glibcs.py.

	[BZ #23145]
	* elf/Makefile (tests-special): Add $(objpfx)check-initfini.out.
	($(all-built-dso:=.dynsym): New target.
	(common-generated): Add $(all-built-dso:$(common-objpfx)%=%.dynsym).
	($(objpfx)check-initfini.out): New target.
	(generated): Add check-initfini.out.
	* scripts/check-initfini.awk: New file.
	* sysdeps/aarch64/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/alpha/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/arm/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/hppa/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/i386/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/ia64/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/m68k/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/microblaze/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/mips/mips32/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/mips/mips64/n32/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/mips/mips64/n64/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/nios2/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/powerpc/powerpc32/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/powerpc/powerpc64/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/s390/s390-32/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/s390/s390-64/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/sh/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/sparc/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
	* sysdeps/x86_64/crti.S (_init): Mark as hidden.
	(_fini): Likewise.
Diffstat (limited to 'sysdeps/mips')
-rw-r--r--sysdeps/mips/mips32/crti.S2
-rw-r--r--sysdeps/mips/mips64/n32/crti.S2
-rw-r--r--sysdeps/mips/mips64/n64/crti.S2
3 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/mips/mips32/crti.S b/sysdeps/mips/mips32/crti.S
index 139f8bb4ed..b3e1c4e0d5 100644
--- a/sysdeps/mips/mips32/crti.S
+++ b/sysdeps/mips/mips32/crti.S
@@ -65,6 +65,7 @@
 	.section .init,"ax",@progbits
 	.p2align 2
 	.globl _init
+	.hidden	_init
 	.type _init, @function
 _init:
 	.set noreorder
@@ -90,6 +91,7 @@ _init:
 	.section .fini,"ax",@progbits
 	.p2align 2
 	.globl _fini
+	.hidden	_fini
 	.type _fini, @function
 _fini:
 	.set noreorder
diff --git a/sysdeps/mips/mips64/n32/crti.S b/sysdeps/mips/mips64/n32/crti.S
index 23ad90b59b..59a09d5763 100644
--- a/sysdeps/mips/mips64/n32/crti.S
+++ b/sysdeps/mips/mips64/n32/crti.S
@@ -65,6 +65,7 @@
 	.section .init,"ax",@progbits
 	.p2align 2
 	.globl _init
+	.hidden _init
 	.type _init, @function
 _init:
 	addiu $sp,$sp,-16
@@ -90,6 +91,7 @@ _init:
 	.section .fini,"ax",@progbits
 	.p2align 2
 	.globl _fini
+	.hidden _fini
 	.type _fini, @function
 _fini:
 	addiu $sp,$sp,-16
diff --git a/sysdeps/mips/mips64/n64/crti.S b/sysdeps/mips/mips64/n64/crti.S
index 24b47b5cf3..fd468f0467 100644
--- a/sysdeps/mips/mips64/n64/crti.S
+++ b/sysdeps/mips/mips64/n64/crti.S
@@ -65,6 +65,7 @@
 	.section .init,"ax",@progbits
 	.p2align 2
 	.globl _init
+	.hidden _init
 	.type _init, @function
 _init:
 	daddiu $sp,$sp,-16
@@ -90,6 +91,7 @@ _init:
 	.section .fini,"ax",@progbits
 	.p2align 2
 	.globl _fini
+	.hidden _fini
 	.type _fini, @function
 _fini:
 	daddiu $sp,$sp,-16