summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2020-07-18 16:41:43 +0000
committerkettenis <kettenis@openbsd.org>2020-07-18 16:41:43 +0000
commit92e19e77c60302d16159333846fd39cb8fb1f43f (patch)
tree86e4b1efd96b0eed4631971eb74766c811a88de8 /libexec
parentint64_t and intmax_t are always (signed) long long on OpenBSD. (diff)
downloadwireguard-openbsd-92e19e77c60302d16159333846fd39cb8fb1f43f.tar.xz
wireguard-openbsd-92e19e77c60302d16159333846fd39cb8fb1f43f.zip
Use the same names as the 64-bit PowerPC ELF ABI for the relocations.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ld.so/powerpc64/archdep.h8
-rw-r--r--libexec/ld.so/powerpc64/rtld_machine.c20
2 files changed, 15 insertions, 13 deletions
diff --git a/libexec/ld.so/powerpc64/archdep.h b/libexec/ld.so/powerpc64/archdep.h
index 953c93c77d9..0f38a2402ac 100644
--- a/libexec/ld.so/powerpc64/archdep.h
+++ b/libexec/ld.so/powerpc64/archdep.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: archdep.h,v 1.1 2020/06/25 04:00:58 drahn Exp $ */
+/* $OpenBSD: archdep.h,v 1.2 2020/07/18 16:41:43 kettenis Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -57,9 +57,9 @@ _dl_dcbf(Elf_Addr *addr)
static inline void
RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
{
- if (ELF_R_TYPE(r->r_info) == RELOC_RELATIVE) {
+ if (ELF_R_TYPE(r->r_info) == R_PPC64_RELATIVE) {
*p = v + r->r_addend;
- } else if (ELF_R_TYPE(r->r_info) == RELOC_JMP_SLOT) {
+ } else if (ELF_R_TYPE(r->r_info) == R_PPC64_JMP_SLOT) {
Elf_Addr val = v + s->st_value + r->r_addend -
(Elf_Addr)(p);
if (((val & 0xfe000000) != 0) &&
@@ -71,7 +71,7 @@ RELOC_DYN(Elf_RelA *r, const Elf_Sym *s, Elf_Addr *p, unsigned long v)
val |= 0x48000000;
*p = val;
_dl_dcbf(p);
- } else if (ELF_R_TYPE((r)->r_info) == RELOC_GLOB_DAT) {
+ } else if (ELF_R_TYPE((r)->r_info) == R_PPC64_GLOB_DAT) {
*p = v + s->st_value + r->r_addend;
} else {
_dl_exit(6);
diff --git a/libexec/ld.so/powerpc64/rtld_machine.c b/libexec/ld.so/powerpc64/rtld_machine.c
index 7a862a81916..859b4166db3 100644
--- a/libexec/ld.so/powerpc64/rtld_machine.c
+++ b/libexec/ld.so/powerpc64/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.4 2020/07/16 21:26:18 kettenis Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.5 2020/07/18 16:41:43 kettenis Exp $ */
/*
* Copyright (c) 1999 Dale Rahn
@@ -93,7 +93,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
type = ELF_R_TYPE(relas->r_info);
- if (type == RELOC_JMP_SLOT && rel != DT_JMPREL)
+ if (type == R_PPC64_JMP_SLOT && rel != DT_JMPREL)
continue;
sym = object->dyn.symtab;
@@ -108,7 +108,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
sr = _dl_find_symbol(symn,
SYM_SEARCH_ALL|SYM_WARNNOTFOUND|
- ((type == RELOC_JMP_SLOT) ?
+ ((type == R_PPC64_JMP_SLOT) ?
SYM_PLT:SYM_NOTPLT), sym, object);
if (sr.sym == NULL) {
@@ -122,7 +122,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
}
switch (type) {
- case RELOC_ADDR64: //RELOC_64:
+ case R_PPC64_ADDR64:
if (ELF_ST_BIND(sym->st_info) == STB_LOCAL &&
(ELF_ST_TYPE(sym->st_info) == STT_SECTION ||
ELF_ST_TYPE(sym->st_info) == STT_NOTYPE) ) {
@@ -132,7 +132,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
relas->r_addend;
}
break;
- case RELOC_RELATIVE:
+ case R_PPC64_RELATIVE:
if (ELF_ST_BIND(sym->st_info) == STB_LOCAL &&
(ELF_ST_TYPE(sym->st_info) == STT_SECTION ||
ELF_ST_TYPE(sym->st_info) == STT_NOTYPE) ) {
@@ -147,8 +147,8 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
* slots similarly to how RELOC_GLOB_DAT updates GOT
* slots.
*/
- case RELOC_JMP_SLOT:
- case RELOC_GLOB_DAT:
+ case R_PPC64_JMP_SLOT:
+ case R_PPC64_GLOB_DAT:
*r_addr = prev_ooff + prev_value + relas->r_addend;
break;
#if 0
@@ -207,6 +207,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
}
break;
#endif
+#if 0
case RELOC_REL14_TAKEN:
/* val |= 1 << (31-10) XXX? */
case RELOC_REL14:
@@ -227,7 +228,8 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
_dl_dcbf(r_addr);
}
break;
- case RELOC_COPY:
+#endif
+ case R_PPC64_COPY:
{
struct sym_res sr;
/*
@@ -246,7 +248,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
fails++;
}
break;
- case RELOC_NONE:
+ case R_PPC64_NONE:
break;
default: