From 7413fbbb3ad3e91c48015fe94b6f4ac63be21936 Mon Sep 17 00:00:00 2001 From: Philip Guenther Date: Sun, 6 Dec 2015 23:36:13 +0000 Subject: Simplify the relocation code for the ld.so bootstrap and static pie: track just the dynamic tags are needed instead of reusing the generic elf_object_t structure. testing and feedback from miod@ ok kettenis@ --- libexec/ld.so/amd64/archdep.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'libexec/ld.so/amd64') diff --git a/libexec/ld.so/amd64/archdep.h b/libexec/ld.so/amd64/archdep.h index 93651a4134a..96b8e3d8642 100644 --- a/libexec/ld.so/amd64/archdep.h +++ b/libexec/ld.so/amd64/archdep.h @@ -1,4 +1,4 @@ -/* $OpenBSD: archdep.h,v 1.6 2014/12/22 03:51:08 kurt Exp $ */ +/* $OpenBSD: archdep.h,v 1.7 2015/12/06 23:36:12 guenther Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -29,6 +29,8 @@ #ifndef _X86_64_ARCHDEP_H_ #define _X86_64_ARCHDEP_H_ +#define RELOC_TAG DT_RELA + #define DL_MALLOC_ALIGN 8 /* Arch constraint or otherwise */ #define MACHID EM_AMD64 /* ELF e_machine ID value checked */ @@ -52,14 +54,7 @@ _dl_mmap(void *addr, unsigned int len, unsigned int prot, static inline void -RELOC_REL(Elf64_Rel *r, const Elf64_Sym *s, Elf64_Addr *p, unsigned long v) -{ - /* AMD64 is a rela architecture */ -} - -static inline void -RELOC_RELA(Elf64_Rela *r, const Elf64_Sym *s, Elf64_Addr *p, unsigned long v, - Elf_Addr *pltgot) +RELOC_DYN(Elf64_Rela *r, const Elf64_Sym *s, Elf64_Addr *p, unsigned long v) { if (ELF64_R_TYPE(r->r_info) == R_X86_64_RELATIVE) { *p = v + r->r_addend; -- cgit v1.2.3