From: deraadt Date: Thu, 29 Jun 2017 17:17:28 +0000 (+0000) Subject: Put asm-generated strings into .rodata X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=32d5845f2ec15f9ba5b5cac47916cc8f5b0feb36;p=openbsd Put asm-generated strings into .rodata ok millert --- diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S index c8a4b133d9d..e8e90c619ca 100644 --- a/sys/arch/amd64/amd64/locore.S +++ b/sys/arch/amd64/amd64/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.85 2017/05/31 19:18:18 deraadt Exp $ */ +/* $OpenBSD: locore.S,v 1.86 2017/06/29 17:17:28 deraadt Exp $ */ /* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */ /* @@ -472,12 +472,15 @@ ENTRY(cpu_idle_leave) #ifdef DIAGNOSTIC NENTRY(switch_pmcpu_set) - movabsq $1f,%rdi + movabsq $switch_active,%rdi call _C_LABEL(panic) /* NOTREACHED */ -1: .asciz "activate already active pmap" -#endif /* DIAGNOSTIC */ + .section .rodata +switch_active: + .asciz "activate already active pmap" + .text +#endif /* DIAGNOSTIC */ /* * savectx(struct pcb *pcb); * Update pcb, saving current processor state. @@ -583,7 +586,7 @@ IDTVEC(syscall) #ifdef DIAGNOSTIC .Lsyscall_spl_not_lowered: - movabsq $4f, %rdi + movabsq $spl_lowered, %rdi movl TF_RAX(%rsp),%esi movl TF_RDI(%rsp),%edx movl %ebx,%ecx @@ -595,9 +598,12 @@ IDTVEC(syscall) #endif /* DDB */ movl $IPL_NONE,CPUVAR(ILEVEL) jmp .Lsyscall_check_asts -4: .asciz "WARNING: SPL NOT LOWERED ON SYSCALL %d %d EXIT %x %x\n" -#endif + .section .rodata +spl_lowered: + .asciz "WARNING: SPL NOT LOWERED ON SYSCALL %d %d EXIT %x %x\n" + .text +#endif NENTRY(proc_trampoline) #ifdef MULTIPROCESSOR diff --git a/sys/arch/amd64/amd64/mutex.S b/sys/arch/amd64/amd64/mutex.S index e31c2198a36..f864c41d534 100644 --- a/sys/arch/amd64/amd64/mutex.S +++ b/sys/arch/amd64/amd64/mutex.S @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.S,v 1.12 2017/04/20 13:57:29 visa Exp $ */ +/* $OpenBSD: mutex.S,v 1.13 2017/06/29 17:17:28 deraadt Exp $ */ /* * Copyright (c) 2004 Artur Grabowski @@ -84,9 +84,13 @@ ENTRY(__mtx_enter) jz 1b jmp 3b #ifdef DIAGNOSTIC -4: movq $5f, %rdi +4: movq $mtx_lockingself, %rdi call _C_LABEL(panic) -5: .asciz "mtx_enter: locking against myself" + + .section .rodata +mtx_lockingself: + .asciz "mtx_enter: locking against myself" + .text #endif ENTRY(__mtx_enter_try) @@ -127,9 +131,13 @@ ENTRY(__mtx_enter_try) ret #ifdef DIAGNOSTIC -3: movq $4f, %rdi +3: movq $mtx_lockingtry, %rdi call _C_LABEL(panic) -4: .asciz "mtx_enter_try: locking against myself" + + .section .rodata +mtx_lockingtry: + .asciz "mtx_enter_try: locking against myself" + .text #endif @@ -152,7 +160,11 @@ ENTRY(__mtx_leave) ret #ifdef DIAGNOSTIC -2: movq $3f, %rdi +2: movq $mtx_leave_held, %rdi call _C_LABEL(panic) -3: .asciz "mtx_leave: lock not held" + + .section .rodata +mtx_leave_held: + .asciz "mtx_leave: lock not held" + .text #endif diff --git a/sys/arch/amd64/amd64/vector.S b/sys/arch/amd64/amd64/vector.S index d2f4f4bebf9..a886bc61fb8 100644 --- a/sys/arch/amd64/amd64/vector.S +++ b/sys/arch/amd64/amd64/vector.S @@ -1,4 +1,4 @@ -/* $OpenBSD: vector.S,v 1.48 2017/05/30 12:41:55 mlarkin Exp $ */ +/* $OpenBSD: vector.S,v 1.49 2017/06/29 17:17:28 deraadt Exp $ */ /* $NetBSD: vector.S,v 1.5 2004/06/28 09:13:11 fvdl Exp $ */ /* @@ -286,7 +286,7 @@ calltrap: jne 3f INTRFASTEXIT 3: sti - movabsq $4f,%rdi + movabsq $spl_lowered,%rdi movl CPUVAR(ILEVEL),%esi movl %ebx,%edx xorq %rax,%rax @@ -296,7 +296,11 @@ calltrap: #endif /* DDB */ movl %ebx,CPUVAR(ILEVEL) jmp 2b -4: .asciz "WARNING: SPL NOT LOWERED ON TRAP EXIT %x %x\n" + + .section .rodata +spl_lowered: + .asciz "WARNING: SPL NOT LOWERED ON TRAP EXIT %x %x\n" + .text #endif /* DIAGNOSTIC */ diff --git a/sys/arch/i386/i386/in_cksum.s b/sys/arch/i386/i386/in_cksum.s index 3d52acca80b..6e6e9825a46 100644 --- a/sys/arch/i386/i386/in_cksum.s +++ b/sys/arch/i386/i386/in_cksum.s @@ -1,4 +1,4 @@ -/* $OpenBSD: in_cksum.s,v 1.8 2008/06/26 05:42:10 ray Exp $ */ +/* $OpenBSD: in_cksum.s,v 1.9 2017/06/29 17:17:28 deraadt Exp $ */ /* $NetBSD: in_cksum.S,v 1.2 2003/08/07 16:27:54 agc Exp $ */ /*- @@ -355,9 +355,11 @@ ENTRY(in_cksum) ret .Lout_of_mbufs: - pushl $1f + pushl $cksum_ood call _C_LABEL(printf) leal 4(%esp), %esp jmp .Lreturn -1: + + .section .rodata +cksum_ood: .asciz "cksum: out of data\n" diff --git a/sys/arch/i386/i386/locore.s b/sys/arch/i386/i386/locore.s index 21b47049093..540610bd385 100644 --- a/sys/arch/i386/i386/locore.s +++ b/sys/arch/i386/i386/locore.s @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.s,v 1.175 2017/05/31 19:18:18 deraadt Exp $ */ +/* $OpenBSD: locore.s,v 1.176 2017/06/29 17:17:28 deraadt Exp $ */ /* $NetBSD: locore.s,v 1.145 1996/05/03 19:41:19 christos Exp $ */ /*- @@ -1087,7 +1087,7 @@ calltrap: jne 3f INTRFASTEXIT 3: sti - pushl $4f + pushl $spl_lowered call _C_LABEL(printf) addl $4,%esp #if defined(DDB) && 0 @@ -1095,9 +1095,13 @@ calltrap: #endif /* DDB */ movl %ebx,CPL jmp 2b -4: .asciz "WARNING: SPL NOT LOWERED ON TRAP EXIT\n" + + .section .rodata +spl_lowered: + .asciz "WARNING: SPL NOT LOWERED ON TRAP EXIT\n" #endif /* DIAGNOSTIC */ + .text #if !defined(GPROF) && defined(DDBPROF) .Lprobe_fixup: /* Restore all register unwinding the stack. */ diff --git a/sys/arch/i386/i386/mutex.S b/sys/arch/i386/i386/mutex.S index afa3446ca71..c00fee7332a 100644 --- a/sys/arch/i386/i386/mutex.S +++ b/sys/arch/i386/i386/mutex.S @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.S,v 1.11 2017/04/20 13:57:29 visa Exp $ */ +/* $OpenBSD: mutex.S,v 1.12 2017/06/29 17:17:28 deraadt Exp $ */ /* * Copyright (c) 2004 Artur Grabowski @@ -88,9 +88,13 @@ ENTRY(__mtx_enter) jz 1b jmp 4b #ifdef DIAGNOSTIC -5: pushl $6f +5: pushl $mtx_lockingself call _C_LABEL(panic) -6: .asciz "mtx_enter: locking against myself" + + .section .rodata +mtx_lockingself: + .asciz "mtx_enter: locking against myself" + .text #endif ENTRY(__mtx_enter_try) @@ -135,9 +139,13 @@ ENTRY(__mtx_enter_try) ret #ifdef DIAGNOSTIC -4: pushl $5f +4: pushl $mtx_lockingtry call _C_LABEL(panic) -5: .asciz "mtx_enter_try: locking against myself" + + .section .rodata +mtx_lockingtry: + .asciz "mtx_enter_try: locking against myself" + .text #endif @@ -161,7 +169,11 @@ ENTRY(__mtx_leave) ret #ifdef DIAGNOSTIC -1: pushl $2f +1: pushl $mtx_leave_held call _C_LABEL(panic) -2: .asciz "mtx_leave: lock not held" + + .section .rodata +mtx_leave_held: + .asciz "mtx_leave: lock not held" + .text #endif