Deleted Added
full compact
reloc.c (219339) reloc.c (219340)
1/* $NetBSD: mdreloc.c,v 1.5 2001/04/25 12:24:51 kleink Exp $ */
2
3/*-
4 * Copyright (c) 2000 Eduardo Horvath.
5 * Copyright (c) 1999 The NetBSD Foundation, Inc.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation

--- 24 unchanged lines hidden (view full) ---

33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40#include <sys/cdefs.h>
1/* $NetBSD: mdreloc.c,v 1.5 2001/04/25 12:24:51 kleink Exp $ */
2
3/*-
4 * Copyright (c) 2000 Eduardo Horvath.
5 * Copyright (c) 1999 The NetBSD Foundation, Inc.
6 * All rights reserved.
7 *
8 * This code is derived from software contributed to The NetBSD Foundation

--- 24 unchanged lines hidden (view full) ---

33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40#include <sys/cdefs.h>
41__FBSDID("$FreeBSD: head/libexec/rtld-elf/sparc64/reloc.c 219339 2011-03-06 13:25:46Z marius $");
41__FBSDID("$FreeBSD: head/libexec/rtld-elf/sparc64/reloc.c 219340 2011-03-06 15:20:11Z marius $");
42
43#include <sys/param.h>
44#include <sys/mman.h>
45
46#include <errno.h>
47#include <stdio.h>
48#include <stdlib.h>
49#include <string.h>

--- 300 unchanged lines hidden (view full) ---

350
351 /* Add in the symbol's absolute address. */
352 value += (Elf_Addr)(defobj->relocbase + def->st_value);
353 }
354
355 if (type == R_SPARC_OLO10)
356 value = (value & 0x3ff) + ELF64_R_TYPE_DATA(rela->r_info);
357
42
43#include <sys/param.h>
44#include <sys/mman.h>
45
46#include <errno.h>
47#include <stdio.h>
48#include <stdlib.h>
49#include <string.h>

--- 300 unchanged lines hidden (view full) ---

350
351 /* Add in the symbol's absolute address. */
352 value += (Elf_Addr)(defobj->relocbase + def->st_value);
353 }
354
355 if (type == R_SPARC_OLO10)
356 value = (value & 0x3ff) + ELF64_R_TYPE_DATA(rela->r_info);
357
358 if (type == R_SPARC_HIX22)
359 value ^= 0xffffffffffffffff;
360
358 if (RELOC_PC_RELATIVE(type))
359 value -= (Elf_Addr)where;
360
361 if (RELOC_BASE_RELATIVE(type)) {
362 /*
363 * Note that even though sparcs use `Elf_rela' exclusively
364 * we still need the implicit memory addend in relocations
365 * referring to GOT entries. Undoubtedly, someone f*cked

--- 394 unchanged lines hidden ---
361 if (RELOC_PC_RELATIVE(type))
362 value -= (Elf_Addr)where;
363
364 if (RELOC_BASE_RELATIVE(type)) {
365 /*
366 * Note that even though sparcs use `Elf_rela' exclusively
367 * we still need the implicit memory addend in relocations
368 * referring to GOT entries. Undoubtedly, someone f*cked

--- 394 unchanged lines hidden ---