summaryrefslogtreecommitdiff
path: root/usr/src/lib/libproc/sparc/Pisadep.c
diff options
context:
space:
mode:
authorEdward Pilatowicz <Edward.Pilatowicz@Sun.COM>2009-07-29 10:29:28 -0700
committerEdward Pilatowicz <Edward.Pilatowicz@Sun.COM>2009-07-29 10:29:28 -0700
commitd9452f237f843c1321abb5810d2f9ee6cbeae43c (patch)
treedfcdd5236a225b33960c91dc69b82c7e8f76cd1c /usr/src/lib/libproc/sparc/Pisadep.c
parent88bb18d257c743ee382a1694604771c6b7dee061 (diff)
downloadillumos-gate-d9452f237f843c1321abb5810d2f9ee6cbeae43c.tar.gz
6863263 libproc doesn't access in-core elf data correctly
Diffstat (limited to 'usr/src/lib/libproc/sparc/Pisadep.c')
-rw-r--r--usr/src/lib/libproc/sparc/Pisadep.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/usr/src/lib/libproc/sparc/Pisadep.c b/usr/src/lib/libproc/sparc/Pisadep.c
index 2edf8c024e..9bdb2703ce 100644
--- a/usr/src/lib/libproc/sparc/Pisadep.c
+++ b/usr/src/lib/libproc/sparc/Pisadep.c
@@ -19,16 +19,15 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/stack.h>
#include <sys/regset.h>
#include <sys/frame.h>
#include <sys/sysmacros.h>
+#include <sys/machelf.h>
#include <stdlib.h>
#include <unistd.h>
@@ -40,9 +39,6 @@
#include "Pstack.h"
#include "Pisadep.h"
-#define M_PLT_NRSV 4 /* reserved PLT entries */
-#define M_PLT_ENTSIZE 12 /* size of each PLT entry */
-
#define SYSCALL32 0x91d02008 /* 32-bit syscall (ta 8) instruction */
#ifndef WINDOWSIZE32
@@ -67,7 +63,7 @@ Ppltdest(struct ps_prochandle *P, uintptr_t pltaddr)
}
i = (pltaddr - fp->file_plt_base -
- M_PLT_NRSV * M_PLT_ENTSIZE) / M_PLT_ENTSIZE;
+ M_PLT_XNumber * M32_PLT_ENTSIZE) / M32_PLT_ENTSIZE;
r_addr = fp->file_jmp_rel + i * sizeof (Elf32_Rela);
@@ -328,8 +324,8 @@ uintptr_t
Psyscall_setup(struct ps_prochandle *P, int nargs, int sysindex, uintptr_t sp)
{
sp -= (nargs > 6)?
- WINDOWSIZE32 + sizeof (int32_t) * (1 + nargs) :
- WINDOWSIZE32 + sizeof (int32_t) * (1 + 6);
+ WINDOWSIZE32 + sizeof (int32_t) * (1 + nargs) :
+ WINDOWSIZE32 + sizeof (int32_t) * (1 + 6);
sp = PSTACK_ALIGN32(sp);
P->status.pr_lwp.pr_reg[R_G1] = sysindex;