diff options
author | ab196087 <none@none> | 2007-10-05 09:04:23 -0700 |
---|---|---|
committer | ab196087 <none@none> | 2007-10-05 09:04:23 -0700 |
commit | f3324781c875e2f9865c291e43f86ee710b0c145 (patch) | |
tree | e40126b8346b53e3502d08b7e962e34e44e77fb4 /usr/src/uts/sparc | |
parent | 8259acd8641e32a891a4ad20a6479c529bb052c3 (diff) | |
download | illumos-gate-f3324781c875e2f9865c291e43f86ee710b0c145.tar.gz |
6610591 do_reloc() should not require unused arguments
Diffstat (limited to 'usr/src/uts/sparc')
-rw-r--r-- | usr/src/uts/sparc/krtld/doreloc.c | 27 | ||||
-rw-r--r-- | usr/src/uts/sparc/krtld/kobj_reloc.c | 27 |
2 files changed, 36 insertions, 18 deletions
diff --git a/usr/src/uts/sparc/krtld/doreloc.c b/usr/src/uts/sparc/krtld/doreloc.c index 94f2b6c6d3..ff9864ae84 100644 --- a/usr/src/uts/sparc/krtld/doreloc.c +++ b/usr/src/uts/sparc/krtld/doreloc.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -344,10 +344,20 @@ const Rel_entry reloc_table[R_SPARC_NUM] = { * Upon successful completion of do_reloc() *value will be set to the * 'bit-shifted' value that will be or'ed into memory. */ -/* ARGSUSED5 */ +#if defined(_KERNEL) +#define lml 0 /* Needed by arglist of REL_ERR_* macros */ int -do_reloc(uchar_t rtype, uchar_t *off, Xword *value, const char *sym, +do_reloc_krtld(uchar_t rtype, uchar_t *off, Xword *value, const char *sym, + const char *file) +#elif defined(DO_RELOC_LIBLD) +int +do_reloc_ld(uchar_t rtype, uchar_t *off, Xword *value, const char *sym, + const char *file, int bswap, void *lml) +#else +int +do_reloc_rtld(uchar_t rtype, uchar_t *off, Xword *value, const char *sym, const char *file, void *lml) +#endif { Xword uvalue = 0; Xword basevalue, sigbit_mask, sigfit_mask; @@ -356,6 +366,17 @@ do_reloc(uchar_t rtype, uchar_t *off, Xword *value, const char *sym, int field_size, re_flags; const Rel_entry * rep; +#if defined(DO_RELOC_LIBLD) + /* + * We do not support building the sparc linker as a cross linker + * at this time. + */ + if (bswap) { + REL_ERR_NOSWAP(lml, file, sym, rtype); + return (0); + } +#endif + rep = &reloc_table[rtype]; bshift = rep->re_bshift; field_size = rep->re_fsize; diff --git a/usr/src/uts/sparc/krtld/kobj_reloc.c b/usr/src/uts/sparc/krtld/kobj_reloc.c index fd3846a383..eda18f35a1 100644 --- a/usr/src/uts/sparc/krtld/kobj_reloc.c +++ b/usr/src/uts/sparc/krtld/kobj_reloc.c @@ -20,7 +20,7 @@ */ /* - * Copyright 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright 2007 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -173,7 +173,7 @@ do_relocate( #ifdef KOBJ_DEBUG if (kobj_debug & D_RELOCATIONS) { _kobj_printf(ops, "krtld:\ttype\t\t\toffset\t addend" - " symbol\n"); + " symbol\n"); _kobj_printf(ops, "krtld:\t\t\t\t\t value\n"); } #endif @@ -191,9 +191,9 @@ do_relocate( for (i = 0; i < mp->hdr.e_shnum; i++, shp++) { if (shp->sh_addr == baseaddr) { if ((shp->sh_flags & SHF_ALLOC) && - !(shp->sh_flags & SHF_WRITE)) + !(shp->sh_flags & SHF_WRITE)) destination = (Addr)mp->destination + - (baseaddr - (Addr)mp->text); + (baseaddr - (Addr)mp->text); break; } } @@ -256,7 +256,7 @@ do_relocate( * value is base address of this object */ symref = (Sym *) - (mp->symtbl+(stndx * mp->symhdr->sh_entsize)); + (mp->symtbl+(stndx * mp->symhdr->sh_entsize)); if (ELF_ST_BIND(symref->st_info) == STB_LOCAL) { /* *** this is different for .o and .so */ value = symref->st_value; @@ -276,11 +276,8 @@ do_relocate( if (symref->st_shndx == SHN_UNDEF && tnf_reloc_resolve(mp->strings + - symref->st_name, &symref->st_value, - &addend, - off, - &probelist, - &taglist) != 0) { + symref->st_name, &symref->st_value, + &addend, off, &probelist, &taglist) != 0) { if (ELF_ST_BIND(symref->st_info) != STB_WEAK) { _kobj_printf(ops, @@ -304,7 +301,7 @@ do_relocate( value += addend; if (IS_EXTOFFSET(rtype)) { value += - (Word) ELF_R_TYPE_DATA(((Rela *)reladdr)->r_info); + (Word) ELF_R_TYPE_DATA(((Rela *)reladdr)->r_info); } /* @@ -324,9 +321,9 @@ do_relocate( _kobj_printf(ops, " 0x%8llx\n", value); } #endif - if (do_reloc(rtype, (unsigned char *)off, (Xword *)&value, + if (do_reloc_krtld(rtype, (unsigned char *)off, (Xword *)&value, (const char *)mp->strings + symref->st_name, - mp->filename, 0) == 0) + mp->filename) == 0) err = 1; } /* end of while loop */ @@ -349,7 +346,7 @@ do_relocations(struct module *mp) /* do the relocations */ for (shn = 1; shn < mp->hdr.e_shnum; shn++) { rshp = (Shdr *) - (mp->shdrs + shn * mp->hdr.e_shentsize); + (mp->shdrs + shn * mp->hdr.e_shentsize); if (rshp->sh_type == SHT_REL) { _kobj_printf(ops, "%s can't process type SHT_REL\n", mp->filename); @@ -381,7 +378,7 @@ do_relocations(struct module *mp) #ifdef KOBJ_DEBUG if (kobj_debug & D_RELOCATIONS) { _kobj_printf(ops, "krtld: relocating: file=%s ", - mp->filename); + mp->filename); _kobj_printf(ops, " section=%d\n", shn); } #endif |