summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2017-08-15 00:26:03 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2017-08-15 00:26:03 +0000
commit4e6cba724daec579d41e36fd9eb29a6f672ec19e (patch)
tree75739771526f1454bf72b509242e6472d77f48c1 /libexec
parentb0b67bfcee839475d3e424a3feac37c16027427f (diff)
Align text locations to 16 (instead of 4) to match modern recommendations
(generally associated with hardwired BTC limitations). And then fill those alignments with 0xcc (int 3) to match our trapsled model. Resulting binaries show no sequential nop's. ok mlarkin kettenis mortimer
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.so/amd64/ldasm.S8
-rw-r--r--libexec/ld.so/i386/ldasm.S12
2 files changed, 10 insertions, 10 deletions
diff --git a/libexec/ld.so/amd64/ldasm.S b/libexec/ld.so/amd64/ldasm.S
index 3407f0b0472..3a8085aa572 100644
--- a/libexec/ld.so/amd64/ldasm.S
+++ b/libexec/ld.so/amd64/ldasm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldasm.S,v 1.26 2017/01/24 07:48:37 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.27 2017/08/15 00:26:02 deraadt Exp $ */
/*
* Copyright (c) 2002,2004 Dale Rahn
@@ -34,7 +34,7 @@
#include <machine/asm.h>
.text
- .align 4
+ .align 16,0xcc
.globl _dl_start
.type _dl_start,@function
_dl_start:
@@ -73,7 +73,7 @@ _dl_start:
#define DL_SYSCALL2(n,c) \
.global __CONCAT(_dl_,n) ;\
.type __CONCAT(_dl_,n), @function ;\
- .align 4 ;\
+ .align 16,0xcc ;\
__CONCAT(_dl_,n): ;\
movl $(__CONCAT(SYS_,c)), %eax ;\
movq %rcx, %r10 ;\
@@ -109,7 +109,7 @@ DL_SYSCALL(thrkill)
ret
- .align 4
+ .align 16,0xcc
.global _dl_bind_start
.type _dl_bind_start,@function
_dl_bind_start:
diff --git a/libexec/ld.so/i386/ldasm.S b/libexec/ld.so/i386/ldasm.S
index 7505b25bcd9..ae8d57ed86c 100644
--- a/libexec/ld.so/i386/ldasm.S
+++ b/libexec/ld.so/i386/ldasm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldasm.S,v 1.29 2017/01/24 07:48:37 guenther Exp $ */
+/* $OpenBSD: ldasm.S,v 1.30 2017/08/15 00:26:02 deraadt Exp $ */
/*
* Copyright (c) 2002 Dale Rahn
@@ -33,7 +33,7 @@
#include <machine/asm.h>
.text
- .align 4
+ .align 16,0xcc
.globl _dl_start
.type _dl_start,@function
_dl_start:
@@ -89,7 +89,7 @@ _dl_start:
#define DL_SYSCALL(n) DL_SYSCALL2(n,n)
#define DL_SYSCALL2(n,c) \
.section ".text" ;\
- .align 4 ;\
+ .align 16,0xcc ;\
.global __CONCAT(_dl_,n) ;\
.type __CONCAT(_dl_,n),@function ;\
__CONCAT(_dl_,n): ;\
@@ -100,7 +100,7 @@ __CONCAT(_dl_,n): ;\
#define DL_SYSCALL(n) DL_SYSCALL2(n,n)
#define DL_SYSCALL2(n,c) \
.section ".text" ;\
- .align 4 ;\
+ .align 16,0xcc ;\
.global __CONCAT(_dl_,n) ;\
.type __CONCAT(_dl_,n),@function ;\
__CONCAT(_dl_,n): ;\
@@ -111,7 +111,7 @@ __CONCAT(_dl_,n): ;\
DL_SYSCALL(close)
.section ".text"
- .align 4
+ .align 16,0xcc
.global _dl_exit
.type _dl_exit,@function
_dl_exit:
@@ -145,7 +145,7 @@ DL_SYSCALL(thrkill)
ret
- .align 4
+ .align 16,0xcc
.global _dl_bind_start
.type _dl_bind_start,@function
_dl_bind_start: