diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2002-12-09 20:56:35 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2002-12-09 20:56:35 +0000 |
commit | bccbf7c3f76c3a5faa080dadf8c4d64290c5a222 (patch) | |
tree | 8b4b43c22052c8bce8349bfd2f04d5c0b8eafbad /libexec/ld.so/powerpc/ldasm.S | |
parent | fec33656e88c6022a1caad4a833ce9c4caba23ab (diff) |
Build ld.so as a normal shared object, not with special linkage.
mprotect the necessary bit to make this work right. ok deraadt@
Diffstat (limited to 'libexec/ld.so/powerpc/ldasm.S')
-rw-r--r-- | libexec/ld.so/powerpc/ldasm.S | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libexec/ld.so/powerpc/ldasm.S b/libexec/ld.so/powerpc/ldasm.S index 3d6698c069c..bc9ab5e3b2a 100644 --- a/libexec/ld.so/powerpc/ldasm.S +++ b/libexec/ld.so/powerpc/ldasm.S @@ -1,4 +1,4 @@ -/* $OpenBSD: ldasm.S,v 1.8 2002/10/21 16:01:55 drahn Exp $ */ +/* $OpenBSD: ldasm.S,v 1.9 2002/12/09 20:56:34 drahn Exp $ */ /* * Copyright (c) 1999 Dale Rahn @@ -44,6 +44,7 @@ #define AUX_entry 9 #include <machine/asm.h> +#include <sys/syscall.h> ENTRY(_dl_start) mr 19, 1 @@ -79,6 +80,16 @@ ENTRY(_dl_start) * operation that would be below would calulate. */ add 28, 18, 5 + mr 6, 5 # save offset for later use + + /* mprotect GOT-4 for correct execution of blrl instruction */ + li 0, SYS_mprotect + mr 3, 28 + li 4, 4 + li 5, 7 /* (PROT_READ|PROT_WRITE|PROT_EXEC) */ + sc + + mr 5, 6 li 0, 0 dcbf 5, 18 |