Browse Source

apply hidden visibility to sigreturn code fragments

these were overlooked in the declarations overhaul work because they
are not properly declared, and the current framework even allows their
declared types to vary by arch. at some point this should be cleaned
up, but I'm not sure what the right way would be.
Rich Felker 6 years ago
parent
commit
b6e59cd925

+ 3 - 1
arch/mips/ksigaction.h

@@ -1,3 +1,5 @@
+#include <features.h>
+
 struct k_sigaction {
 struct k_sigaction {
 	unsigned flags;
 	unsigned flags;
 	void (*handler)(int);
 	void (*handler)(int);
@@ -8,4 +10,4 @@ struct k_sigaction {
 	void (*restorer)();
 	void (*restorer)();
 };
 };
 
 
-void __restore(), __restore_rt();
+hidden void __restore(), __restore_rt();

+ 3 - 1
arch/mips64/ksigaction.h

@@ -1,3 +1,5 @@
+#include <features.h>
+
 struct k_sigaction {
 struct k_sigaction {
 	unsigned flags;
 	unsigned flags;
 	void (*handler)(int);
 	void (*handler)(int);
@@ -5,4 +7,4 @@ struct k_sigaction {
 	void (*restorer)();
 	void (*restorer)();
 };
 };
 
 
-void __restore(), __restore_rt();
+hidden void __restore(), __restore_rt();

+ 3 - 1
arch/mipsn32/ksigaction.h

@@ -1,3 +1,5 @@
+#include <features.h>
+
 struct k_sigaction {
 struct k_sigaction {
 	unsigned flags;
 	unsigned flags;
 	void (*handler)(int);
 	void (*handler)(int);
@@ -5,4 +7,4 @@ struct k_sigaction {
 	void (*restorer)();
 	void (*restorer)();
 };
 };
 
 
-void __restore(), __restore_rt();
+hidden void __restore(), __restore_rt();

+ 3 - 1
arch/sh/ksigaction.h

@@ -1,3 +1,5 @@
+#include <features.h>
+
 struct k_sigaction {
 struct k_sigaction {
 	void (*handler)(int);
 	void (*handler)(int);
 	unsigned long flags;
 	unsigned long flags;
@@ -5,4 +7,4 @@ struct k_sigaction {
 	unsigned mask[2];
 	unsigned mask[2];
 };
 };
 
 
-extern unsigned char __restore[], __restore_rt[];
+extern hidden unsigned char __restore[], __restore_rt[];

+ 3 - 1
arch/x32/ksigaction.h

@@ -1,3 +1,5 @@
+#include <features.h>
+
 struct k_sigaction {
 struct k_sigaction {
 	void (*handler)(int);
 	void (*handler)(int);
 	unsigned long flags;
 	unsigned long flags;
@@ -5,5 +7,5 @@ struct k_sigaction {
 	unsigned mask[2];
 	unsigned mask[2];
 };
 };
 
 
-void __restore_rt();
+hidden void __restore_rt();
 #define __restore __restore_rt
 #define __restore __restore_rt

+ 3 - 1
arch/x86_64/ksigaction.h

@@ -1,3 +1,5 @@
+#include <features.h>
+
 struct k_sigaction {
 struct k_sigaction {
 	void (*handler)(int);
 	void (*handler)(int);
 	unsigned long flags;
 	unsigned long flags;
@@ -5,5 +7,5 @@ struct k_sigaction {
 	unsigned mask[2];
 	unsigned mask[2];
 };
 };
 
 
-void __restore_rt();
+hidden void __restore_rt();
 #define __restore __restore_rt
 #define __restore __restore_rt

+ 3 - 1
src/internal/ksigaction.h

@@ -1,3 +1,5 @@
+#include <features.h>
+
 /* This is the structure used for the rt_sigaction syscall on most archs,
 /* This is the structure used for the rt_sigaction syscall on most archs,
  * but it can be overridden by a file with the same name in the top-level
  * but it can be overridden by a file with the same name in the top-level
  * arch dir for a given arch, if necessary. */
  * arch dir for a given arch, if necessary. */
@@ -8,4 +10,4 @@ struct k_sigaction {
 	unsigned mask[2];
 	unsigned mask[2];
 };
 };
 
 
-void __restore(), __restore_rt();
+hidden void __restore(), __restore_rt();

+ 2 - 0
src/signal/aarch64/restore.s

@@ -1,7 +1,9 @@
 .global __restore
 .global __restore
+.hidden __restore
 .type __restore,%function
 .type __restore,%function
 __restore:
 __restore:
 .global __restore_rt
 .global __restore_rt
+.hidden __restore_rt
 .type __restore_rt,%function
 .type __restore_rt,%function
 __restore_rt:
 __restore_rt:
 	mov x8,#139 // SYS_rt_sigreturn
 	mov x8,#139 // SYS_rt_sigreturn

+ 2 - 0
src/signal/arm/restore.s

@@ -1,12 +1,14 @@
 .syntax unified
 .syntax unified
 
 
 .global __restore
 .global __restore
+.hidden __restore
 .type __restore,%function
 .type __restore,%function
 __restore:
 __restore:
 	mov r7,#119
 	mov r7,#119
 	swi 0x0
 	swi 0x0
 
 
 .global __restore_rt
 .global __restore_rt
+.hidden __restore_rt
 .type __restore_rt,%function
 .type __restore_rt,%function
 __restore_rt:
 __restore_rt:
 	mov r7,#173
 	mov r7,#173

+ 2 - 0
src/signal/i386/restore.s

@@ -1,4 +1,5 @@
 .global __restore
 .global __restore
+.hidden __restore
 .type __restore,@function
 .type __restore,@function
 __restore:
 __restore:
 	popl %eax
 	popl %eax
@@ -6,6 +7,7 @@ __restore:
 	int $0x80
 	int $0x80
 
 
 .global __restore_rt
 .global __restore_rt
+.hidden __restore_rt
 .type __restore_rt,@function
 .type __restore_rt,@function
 __restore_rt:
 __restore_rt:
 	movl $173, %eax
 	movl $173, %eax

+ 2 - 0
src/signal/microblaze/restore.s

@@ -1,10 +1,12 @@
 .global __restore
 .global __restore
+.hidden __restore
 .type __restore,@function
 .type __restore,@function
 __restore:
 __restore:
 	ori     r12, r0, 119
 	ori     r12, r0, 119
 	brki    r14, 0x8
 	brki    r14, 0x8
 
 
 .global __restore_rt
 .global __restore_rt
+.hidden __restore_rt
 .type __restore_rt,@function
 .type __restore_rt,@function
 __restore_rt:
 __restore_rt:
 	ori     r12, r0, 173
 	ori     r12, r0, 173

+ 2 - 0
src/signal/mips/restore.s

@@ -1,12 +1,14 @@
 .set noreorder
 .set noreorder
 
 
 .global __restore_rt
 .global __restore_rt
+.hidden __restore_rt
 .type   __restore_rt,@function
 .type   __restore_rt,@function
 __restore_rt:
 __restore_rt:
 	li $2, 4193
 	li $2, 4193
 	syscall
 	syscall
 
 
 .global __restore
 .global __restore
+.hidden __restore
 .type   __restore,@function
 .type   __restore,@function
 __restore:
 __restore:
 	li $2, 4119
 	li $2, 4119

+ 2 - 0
src/signal/mips64/restore.s

@@ -1,6 +1,8 @@
 .set	noreorder
 .set	noreorder
 .global	__restore_rt
 .global	__restore_rt
 .global	__restore
 .global	__restore
+.hidden __restore_rt
+.hidden __restore
 .type	__restore_rt,@function
 .type	__restore_rt,@function
 .type	__restore,@function
 .type	__restore,@function
 __restore_rt:
 __restore_rt:

+ 2 - 0
src/signal/mipsn32/restore.s

@@ -1,6 +1,8 @@
 .set	noreorder
 .set	noreorder
 .global	__restore_rt
 .global	__restore_rt
 .global	__restore
 .global	__restore
+.hidden __restore_rt
+.hidden __restore
 .type	__restore_rt,@function
 .type	__restore_rt,@function
 .type	__restore,@function
 .type	__restore,@function
 __restore_rt:
 __restore_rt:

+ 2 - 0
src/signal/powerpc/restore.s

@@ -1,10 +1,12 @@
 	.global __restore
 	.global __restore
+	.hidden __restore
 	.type __restore,%function
 	.type __restore,%function
 __restore:
 __restore:
 	li      0, 119 #__NR_sigreturn
 	li      0, 119 #__NR_sigreturn
 	sc
 	sc
 
 
 	.global __restore_rt
 	.global __restore_rt
+	.hidden __restore_rt
 	.type __restore_rt,%function
 	.type __restore_rt,%function
 __restore_rt:
 __restore_rt:
 	li      0, 172 # __NR_rt_sigreturn
 	li      0, 172 # __NR_rt_sigreturn

+ 2 - 0
src/signal/powerpc64/restore.s

@@ -1,10 +1,12 @@
 	.global __restore
 	.global __restore
+	.hidden __restore
 	.type __restore,%function
 	.type __restore,%function
 __restore:
 __restore:
 	li      0, 119 #__NR_sigreturn
 	li      0, 119 #__NR_sigreturn
 	sc
 	sc
 
 
 	.global __restore_rt
 	.global __restore_rt
+	.hidden __restore_rt
 	.type __restore_rt,%function
 	.type __restore_rt,%function
 __restore_rt:
 __restore_rt:
 	li      0, 172 # __NR_rt_sigreturn
 	li      0, 172 # __NR_rt_sigreturn

+ 4 - 2
src/signal/restore.c

@@ -1,10 +1,12 @@
+#include <features.h>
+
 /* These functions will not work, but suffice for targets where the
 /* These functions will not work, but suffice for targets where the
  * kernel sigaction structure does not actually use sa_restorer. */
  * kernel sigaction structure does not actually use sa_restorer. */
 
 
-void __restore()
+hidden void __restore()
 {
 {
 }
 }
 
 
-void __restore_rt()
+hidden void __restore_rt()
 {
 {
 }
 }

+ 2 - 0
src/signal/s390x/restore.s

@@ -1,9 +1,11 @@
 	.global __restore
 	.global __restore
+	.hidden __restore
 	.type __restore,%function
 	.type __restore,%function
 __restore:
 __restore:
 	svc 119 #__NR_sigreturn
 	svc 119 #__NR_sigreturn
 
 
 	.global __restore_rt
 	.global __restore_rt
+	.hidden __restore_rt
 	.type __restore_rt,%function
 	.type __restore_rt,%function
 __restore_rt:
 __restore_rt:
 	svc 173 # __NR_rt_sigreturn
 	svc 173 # __NR_rt_sigreturn

+ 2 - 0
src/signal/sh/restore.s

@@ -1,4 +1,5 @@
 .global __restore
 .global __restore
+.hidden __restore
 __restore:
 __restore:
 	mov   #119, r3  !__NR_sigreturn
 	mov   #119, r3  !__NR_sigreturn
 	trapa #31
 	trapa #31
@@ -10,6 +11,7 @@ __restore:
 	or    r0, r0
 	or    r0, r0
 
 
 .global __restore_rt
 .global __restore_rt
+.hidden __restore_rt
 __restore_rt:
 __restore_rt:
 	mov   #100, r3  !__NR_rt_sigreturn
 	mov   #100, r3  !__NR_rt_sigreturn
 	add   #73, r3
 	add   #73, r3

+ 1 - 0
src/signal/x32/restore.s

@@ -1,5 +1,6 @@
 	nop
 	nop
 .global __restore_rt
 .global __restore_rt
+.hidden __restore_rt
 .type __restore_rt,@function
 .type __restore_rt,@function
 __restore_rt:
 __restore_rt:
 	mov $0x40000201, %rax /* SYS_rt_sigreturn */
 	mov $0x40000201, %rax /* SYS_rt_sigreturn */

+ 1 - 0
src/signal/x86_64/restore.s

@@ -1,5 +1,6 @@
 	nop
 	nop
 .global __restore_rt
 .global __restore_rt
+.hidden __restore_rt
 .type __restore_rt,@function
 .type __restore_rt,@function
 __restore_rt:
 __restore_rt:
 	mov $15, %rax
 	mov $15, %rax