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