diff options
| author | tv <tv@NetBSD.org> | 1999-02-27 03:31:12 +0000 |
|---|---|---|
| committer | tv <tv@NetBSD.org> | 1999-02-27 03:31:12 +0000 |
| commit | 7f2b95a33205aa8a00c3bc11e3f7b7de591b3df7 (patch) | |
| tree | d05781fccc9100afbbbcb7165a5c4b29d74f5cc1 /gnu/usr.bin | |
| parent | 803ae8725f983b0610090addfca04a7c011e49f9 (diff) | |
Add arm32 hacks to ld, and reenable ld on arm32. As is well known, XXX
this needs a real fix.
Diffstat (limited to 'gnu/usr.bin')
| -rw-r--r-- | gnu/usr.bin/Makefile | 5 | ||||
| -rw-r--r-- | gnu/usr.bin/ld/ld/ld.c | 15 | ||||
| -rw-r--r-- | gnu/usr.bin/ld/ld/rrs.c | 14 |
3 files changed, 27 insertions, 7 deletions
diff --git a/gnu/usr.bin/Makefile b/gnu/usr.bin/Makefile index 384784a8cbd..072c31bfad3 100644 --- a/gnu/usr.bin/Makefile +++ b/gnu/usr.bin/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.83 1999/02/19 13:12:17 tv Exp $ +# $NetBSD: Makefile,v 1.84 1999/02/27 03:31:12 tv Exp $ # for OBJECT_FMT .include <bsd.own.mk> @@ -18,7 +18,8 @@ SUBDIR+= gas SUBDIR+= gas.new .endif -.if (${MACHINE_ARCH} == "i386" && ${OBJECT_FMT} != "ELF") || \ +.if (${MACHINE_ARCH} == "arm32") || \ + (${MACHINE_ARCH} == "i386" && ${OBJECT_FMT} != "ELF") || \ (${MACHINE_ARCH} == "m68k") || \ (${MACHINE_ARCH} == "ns32k") || \ (${MACHINE_ARCH} == "sparc" && ${OBJECT_FMT} != "ELF") || \ diff --git a/gnu/usr.bin/ld/ld/ld.c b/gnu/usr.bin/ld/ld/ld.c index 7014e9ac3f1..c239727992b 100644 --- a/gnu/usr.bin/ld/ld/ld.c +++ b/gnu/usr.bin/ld/ld/ld.c @@ -1,4 +1,4 @@ -/* $NetBSD: ld.c,v 1.63 1998/12/30 15:09:04 cjs Exp $ */ +/* $NetBSD: ld.c,v 1.64 1999/02/27 03:31:12 tv Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. * All rights reserved. @@ -88,7 +88,7 @@ #ifndef lint /* from: "@(#)ld.c 6.10 (Berkeley) 5/22/91"; */ -__RCSID("$NetBSD: ld.c,v 1.63 1998/12/30 15:09:04 cjs Exp $"); +__RCSID("$NetBSD: ld.c,v 1.64 1999/02/27 03:31:12 tv Exp $"); #endif /* not lint */ #define GNU_BINUTIL_COMPAT /* forwards compatiblity with binutils 2.x */ @@ -3163,8 +3163,14 @@ perform_relocation(data, data_size, reloc, nreloc, entry, dataseg) relocation = addend + sp->value; #endif } else { +#if defined (__arm32__) && 1 /* XXX MAGIC */ + long temp; + temp = claim_rrs_jmpslot(entry, r, sp, addend); + relocation = addend + temp; +#else relocation = addend + claim_rrs_jmpslot(entry, r, sp, addend); +#endif } } else if (RELOC_BASEREL_P(r)) { @@ -3535,6 +3541,11 @@ copdatrel(entry) symindex = RELOC_SYMBOL(r); sp = entry->symbols[symindex].symbol; +#if defined(__arm32__) && 1 /* XXX MAGIC! */ + if (sp == 0) + continue; +#endif + if (symindex >= entry->header.a_syms) errx(1, "%s: relocation symbolnum out of range", get_file_name(entry)); diff --git a/gnu/usr.bin/ld/ld/rrs.c b/gnu/usr.bin/ld/ld/rrs.c index 2089aa6e17d..ccb7ddf612f 100644 --- a/gnu/usr.bin/ld/ld/rrs.c +++ b/gnu/usr.bin/ld/ld/rrs.c @@ -1,4 +1,4 @@ -/* $NetBSD: rrs.c,v 1.28 1999/01/05 10:02:20 itohy Exp $ */ +/* $NetBSD: rrs.c,v 1.29 1999/02/27 03:31:12 tv Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -306,9 +306,11 @@ claim_rrs_reloc(entry, rp, sp, relocation) { struct relocation_info *r = rrs_next_reloc(); +#if !defined(__arm32__) && 1 /* prints too much on arm32 */ if (rp->r_address < text_start + text_size) warnx("%s: RRS text relocation at %#x for \"%s\"", get_file_name(entry), rp->r_address, sp->name); +#endif #ifdef DEBUG printf("claim_rrs_reloc: %s in %s\n", sp->name, get_file_name(entry)); @@ -464,8 +466,11 @@ printf("claim_rrs_gotslot: %s(%d,%#x) slot offset %#x, addend %#x\n", /* * Reduce to just a base-relative translation. */ - +#if defined(__arm32__) && 1 /* XXX MAGIC! */ + *GOTP(sp->gotslot_offset) = sp->value /*+ addend */; +#else *GOTP(sp->gotslot_offset) = sp->value + addend; +#endif reloc_type = RELTYPE_RELATIVE; } else if ((link_mode & SYMBOLIC) || rrs_section_type == RRS_PARTIAL) { @@ -530,8 +535,11 @@ claim_rrs_internal_gotslot(entry, rp, lsp, addend) long addend; { struct relocation_info *r; - +#if defined(__arm32__) && 1 /* XXX MAGIC! */ + addend = lsp->nzlist.nz_value; +#else addend += lsp->nzlist.nz_value; +#endif if (!RELOC_STATICS_THROUGH_GOT_P(r)) return addend - got_symbol->value; |
