summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authormatt <matt@NetBSD.org>1998-08-21 01:03:48 +0000
committermatt <matt@NetBSD.org>1998-08-21 01:03:48 +0000
commitfb6da63fa6864e8618505ad3d4f7db2eb018c2c5 (patch)
tree4e88071f03806b82769c5c0524fd0ca63c1e40b8 /libexec
parentf1a6a0936f02bf5fca551052913ad6975a80f44f (diff)
More changes for shareable libraries and PIC code
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.aout_so/arch/vax/md.c26
-rw-r--r--libexec/ld.aout_so/arch/vax/md.h11
-rw-r--r--libexec/ld.aout_so/arch/vax/mdprologue.S4
3 files changed, 21 insertions, 20 deletions
diff --git a/libexec/ld.aout_so/arch/vax/md.c b/libexec/ld.aout_so/arch/vax/md.c
index 14b09b86a98..d24f898ef80 100644
--- a/libexec/ld.aout_so/arch/vax/md.c
+++ b/libexec/ld.aout_so/arch/vax/md.c
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.5 1998/08/20 15:12:02 matt Exp $ */
+/* $NetBSD: md.c,v 1.6 1998/08/21 01:03:48 matt Exp $ */
/*
* Copyright (c) 1993 Paul Kranenburg
@@ -133,8 +133,8 @@ long index;
sp->mask = 0; /* save no registers */
sp->opcode = JSB_PCREL;
- sp->addr[0] = fudge & 0xffff;
- sp->addr[1] = fudge >> 16;
+ sp->offset[0] = fudge & 0xffff;
+ sp->offset[1] = fudge >> 16;
sp->reloc_index = index;
}
@@ -155,8 +155,8 @@ u_long addr;
sp->mask = *(u_short *) addr; /* store the procedure entry mask */
sp->opcode = JMP_PCREL; /* jmp to procedure + 2 */
- sp->addr[0] = (fudge + 2) & 0xffff; /* skipping entry mask */
- sp->addr[1] = (fudge + 2) >> 16;
+ sp->offset[0] = (fudge + 2) & 0xffff; /* skipping entry mask */
+ sp->offset[1] = (fudge + 2) >> 16;
#if 0
sp->reloc_index = 0;
#endif
@@ -176,10 +176,10 @@ int type;
* Fix relocation address to point to the correct
* location within this jmpslot.
*/
- r->r_address += sizeof(sp->opcode);
+ r->r_address += sizeof(sp->mask);
/* Relocation size */
- r->r_length = 2;
+ r->r_length = 2; /* 4 bytes */
/* Set relocation type */
r->r_jmptable = 1;
@@ -201,7 +201,7 @@ int type;
r->r_relative = 1;
/* Relocation size */
- r->r_length = 2;
+ r->r_length = 2; /* 4 bytes */
}
/*
@@ -212,7 +212,7 @@ md_make_cpyreloc(rp, r)
struct relocation_info *rp, *r;
{
/* Relocation size */
- r->r_length = 2;
+ r->r_length = 2; /* 4 bytes */
r->r_copy = 1;
}
@@ -223,7 +223,7 @@ long where;
long *savep;
{
*savep = *(long *)where;
- *(char *)where = TRAP; /* !!! fixit !!! */
+ *(char *)where = BPT; /* !!! fixit !!! */
}
#ifndef RTLD
@@ -245,15 +245,15 @@ int magic, flags;
if (oldmagic || magic == QMAGIC)
hp->a_midmag = magic;
else
- N_SETMAGIC((*hp), magic, MID_I386, flags);
+ N_SETMAGIC((*hp), magic, MID_VAX, flags);
#endif
#ifdef FreeBSD
if (oldmagic)
hp->a_midmag = magic;
else if (netzmagic)
- N_SETMAGIC_NET((*hp), magic, MID_I386, flags);
+ N_SETMAGIC_NET((*hp), magic, MID_VAX, flags);
else
- N_SETMAGIC((*hp), magic, MID_I386, flags);
+ N_SETMAGIC((*hp), magic, MID_VAX, flags);
#endif
/* TEXT_START depends on the value of outheader.a_entry. */
diff --git a/libexec/ld.aout_so/arch/vax/md.h b/libexec/ld.aout_so/arch/vax/md.h
index 3b03d6da34d..3d8cf3d1992 100644
--- a/libexec/ld.aout_so/arch/vax/md.h
+++ b/libexec/ld.aout_so/arch/vax/md.h
@@ -1,4 +1,4 @@
-/* $NetBSD: md.h,v 1.3 1998/08/18 18:46:17 matt Exp $ */
+/* $NetBSD: md.h,v 1.4 1998/08/21 01:03:48 matt Exp $ */
/*
* Copyright (c) 1993 Paul Kranenburg
@@ -85,8 +85,8 @@
#define TEXT_START(ex) (N_TXTADDR(ex) + N_ADJUST(ex))
#define DATA_START(ex) (N_DATADDR(ex) + N_ADJUST(ex))
-#define RELOC_STATICS_THROUGH_GOT_P(r) (0)
-#define JMPSLOT_NEEDS_RELOC (0)
+#define RELOC_STATICS_THROUGH_GOT_P(r) (1)
+#define JMPSLOT_NEEDS_RELOC (1)
#define md_got_reloc(r) (0)
@@ -98,15 +98,16 @@ typedef long got_t;
/*
* .word ^M<reg-mask>
- * pushl #reloc_index
* jmp L^addr
*/
typedef struct jmpslot {
u_short mask;
u_short opcode;
- u_short addr[2];
+ u_short offset[2];
#define JMPSLOT_RELOC_MASK 0xffff
+ u_short addr[2];
u_short reloc_index;
+ u_short filler;
} jmpslot_t;
/*
diff --git a/libexec/ld.aout_so/arch/vax/mdprologue.S b/libexec/ld.aout_so/arch/vax/mdprologue.S
index afc2a2eb7e9..9d7d8230373 100644
--- a/libexec/ld.aout_so/arch/vax/mdprologue.S
+++ b/libexec/ld.aout_so/arch/vax/mdprologue.S
@@ -1,4 +1,4 @@
-/* $NetBSD: mdprologue.S,v 1.4 1998/08/20 15:12:03 matt Exp $ */
+/* $NetBSD: mdprologue.S,v 1.5 1998/08/21 01:03:49 matt Exp $ */
/*
* Copyright (c) 1998 Matt Thomas <matt@3am-software.com>
@@ -49,7 +49,7 @@ _rtl: /* crt0 calls us here */
* Add the 1st entry in the GOT (e.g. __DYNAMIC) to the base
* address of ld.so and pushd that onto the stack.
*/
- addl3 _GLOBAL_OFFSET_TABLE_,(r0),-(sp)
+ addl3 __GLOBAL_OFFSET_TABLE_,(r0),-(sp)
pushl r0 /* 2nd arg == crtp */
pushl (ap) /* 1st arg == version */
calls $3,_rtld /* _rtld(version, crtp, DYNAMIC) */