3 * $FreeBSD: src/gnu/usr.bin/ld/sparc/md-static-funcs.c,v 1.5 1999/08/27 23:36:04 peter Exp $
4 * $DragonFly: src/gnu/usr.bin/ld/sparc/Attic/md-static-funcs.c,v 1.2 2003/06/17 04:25:46 dillon Exp $
6 * Simple SPARC relocations for the benefit of self-relocation of ld.so
7 * avoiding the use of global variables (ie. reloc_bitshift[] et. al.).
8 * Only types supported are RELOC_32 and RELOC_RELATIVE.
10 * This *must* be a static function, so it is not called through a jmpslot.
13 md_relocate_simple(r, relocation, addr)
14 struct relocation_info *r;
18 register unsigned long mask;
19 register unsigned long shift;
31 relocation += (*(long *)addr & mask) << shift;
35 *(long *) (addr) &= ~mask;
36 *(long *) (addr) |= relocation;