summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authormatt <matt@NetBSD.org>1998-10-12 01:33:35 +0000
committermatt <matt@NetBSD.org>1998-10-12 01:33:35 +0000
commitbb27fa210f198675dbae425801d0465dba23bacd (patch)
tree3deed18a9f7661321fce2be80a306881a0db9038 /gnu
parent8bef4312739f0f3d8ccc29e5b887a6fb8e7f2167 (diff)
Get shared libraries a lot closer to working.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/ld/arch/vax/md.c25
-rw-r--r--gnu/usr.bin/ld/arch/vax/md.h10
2 files changed, 13 insertions, 22 deletions
diff --git a/gnu/usr.bin/ld/arch/vax/md.c b/gnu/usr.bin/ld/arch/vax/md.c
index c1b73d704a2..53bd5c651a5 100644
--- a/gnu/usr.bin/ld/arch/vax/md.c
+++ b/gnu/usr.bin/ld/arch/vax/md.c
@@ -1,4 +1,4 @@
-/* $NetBSD: md.c,v 1.8 1998/09/05 13:08:39 pk Exp $ */
+/* $NetBSD: md.c,v 1.9 1998/10/12 01:33:35 matt Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -64,6 +64,8 @@ unsigned char *addr;
case 1:
return get_short(addr);
case 2:
+ if (rp->r_baserel)
+ return 0;
return get_long(addr);
default:
errx(1, "Unsupported relocation size: %x",
@@ -81,12 +83,6 @@ long relocation;
unsigned char *addr;
int relocatable_output;
{
- /*
- *
- */
- if (rp->r_baserel && rp->r_pcrel && !relocatable_output)
- relocation += got_symbol->value - (rp->r_address + 4);
-
switch (RELOC_TARGET_SIZE(rp)) {
case 0:
put_byte(addr, relocation);
@@ -95,6 +91,10 @@ int relocatable_output;
put_short(addr, relocation);
break;
case 2:
+#ifndef RTLD
+ if (rp->r_baserel)
+ relocation += got_symbol->value + get_long(addr);
+#endif
put_long(addr, relocation);
break;
default:
@@ -222,17 +222,6 @@ struct relocation_info *rp, *r;
int type;
got_t *gotp;
{
- /*
- * this is a fixup from text space.
- * consider that addend is really -pc_offset + addend.
- * so remove -pc_offset from addend (which is stored in
- * the got).
- * movl l^datum+4, r0 --> movl @_datum@GOT, r0
- * _datum@GOT: .long 4
- */
- if (rp->r_baserel && rp->r_pcrel)
- *gotp += (rp->r_address + 4);
-
r->r_baserel = 1;
if (type & RELTYPE_RELATIVE)
r->r_relative = 1;
diff --git a/gnu/usr.bin/ld/arch/vax/md.h b/gnu/usr.bin/ld/arch/vax/md.h
index 353b652d036..e8d1cdb13dd 100644
--- a/gnu/usr.bin/ld/arch/vax/md.h
+++ b/gnu/usr.bin/ld/arch/vax/md.h
@@ -1,4 +1,4 @@
-/* $NetBSD: md.h,v 1.6 1998/09/05 13:08:39 pk Exp $ */
+/* $NetBSD: md.h,v 1.7 1998/10/12 01:33:35 matt Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -42,13 +42,13 @@
#define MAX_ALIGNMENT (sizeof (long))
-#ifdef NetBSD
+#ifdef __NetBSD__
#define PAGSIZ __LDPGSZ
#else
#define PAGSIZ 1024
#endif
-#if defined(NetBSD) || defined(CROSS_LINKER)
+#if defined(__NetBSD__) || defined(CROSS_LINKER)
#define N_SET_FLAG(ex,f) (oldmagic || N_GETMAGIC(ex)==QMAGIC ? (0) : \
N_SETMAGIC(ex, \
@@ -59,7 +59,8 @@
#define N_IS_DYNAMIC(ex) ((N_GETFLAG(ex) & EX_DYNAMIC))
#define N_BADMID(ex) \
- (N_GETMID(ex) != 0 && N_GETMID(ex) != MID_MACHINE)
+ (N_GETMID(ex) != 0 && N_GETMID(ex) != MID_MACHINE \
+ && N_GETMID(ex) != MID_VAX1K)
#endif
@@ -113,6 +114,7 @@ typedef struct jmpslot {
u_short reloc_index;
} jmpslot_t;
+#define JMPSLOT_RELOC_MASK 0xffff
/*
* following defines are untested since VAX doesn't support PIC (yet?)
*/