summaryrefslogtreecommitdiff
path: root/libelf/gelf_xlate.c
diff options
context:
space:
mode:
Diffstat (limited to 'libelf/gelf_xlate.c')
-rw-r--r--libelf/gelf_xlate.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/libelf/gelf_xlate.c b/libelf/gelf_xlate.c
index f50181925f216..11618a4537afa 100644
--- a/libelf/gelf_xlate.c
+++ b/libelf/gelf_xlate.c
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2006,2008 Joseph Koshy
+ * Copyright (c) 2006,2008,2018 Joseph Koshy
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,30 +30,34 @@
#include "_libelf.h"
-ELFTC_VCSID("$Id: gelf_xlate.c 3174 2015-03-27 17:13:41Z emaste $");
+ELFTC_VCSID("$Id: gelf_xlate.c 3632 2018-10-10 21:12:43Z jkoshy $");
Elf_Data *
elf32_xlatetof(Elf_Data *dst, const Elf_Data *src, unsigned int encoding)
{
- return _libelf_xlate(dst, src, encoding, ELFCLASS32, ELF_TOFILE);
+ return _libelf_xlate(dst, src, encoding, ELFCLASS32, EM_NONE,
+ ELF_TOFILE);
}
Elf_Data *
elf64_xlatetof(Elf_Data *dst, const Elf_Data *src, unsigned int encoding)
{
- return _libelf_xlate(dst, src, encoding, ELFCLASS64, ELF_TOFILE);
+ return _libelf_xlate(dst, src, encoding, ELFCLASS64, EM_NONE,
+ ELF_TOFILE);
}
Elf_Data *
elf32_xlatetom(Elf_Data *dst, const Elf_Data *src, unsigned int encoding)
{
- return _libelf_xlate(dst, src, encoding, ELFCLASS32, ELF_TOMEMORY);
+ return _libelf_xlate(dst, src, encoding, ELFCLASS32, EM_NONE,
+ ELF_TOMEMORY);
}
Elf_Data *
elf64_xlatetom(Elf_Data *dst, const Elf_Data *src, unsigned int encoding)
{
- return _libelf_xlate(dst, src, encoding, ELFCLASS64, ELF_TOMEMORY);
+ return _libelf_xlate(dst, src, encoding, ELFCLASS64, EM_NONE,
+ ELF_TOMEMORY);
}
Elf_Data *
@@ -62,7 +66,7 @@ gelf_xlatetom(Elf *e, Elf_Data *dst, const Elf_Data *src,
{
if (e != NULL)
return (_libelf_xlate(dst, src, encoding, e->e_class,
- ELF_TOMEMORY));
+ _libelf_elfmachine(e), ELF_TOMEMORY));
LIBELF_SET_ERROR(ARGUMENT, 0);
return (NULL);
}
@@ -73,7 +77,7 @@ gelf_xlatetof(Elf *e, Elf_Data *dst, const Elf_Data *src,
{
if (e != NULL)
return (_libelf_xlate(dst, src, encoding, e->e_class,
- ELF_TOFILE));
+ _libelf_elfmachine(e), ELF_TOFILE));
LIBELF_SET_ERROR(ARGUMENT, 0);
return (NULL);
}