base: Use system libelf instead of ext

The only change needed is to remove EM_SPARC64, which from what I can
tell was removed from elf.h in 1998.

https://sources.debian.org/src/glibc/2.24-11+deb9u1/ChangeLog.8/#L6134

Change-Id: I0dd7e23ea44b19c2ebd9c6eff7cbaedfe69d821b
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33317
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Jason Lowe-Power
2020-08-24 11:24:17 -07:00
committed by Gabe Black
parent 0cf67fb362
commit bbb32ca1ef
4 changed files with 8 additions and 143 deletions

View File

@@ -41,6 +41,7 @@
#include "base/loader/elf_object.hh"
#include <fcntl.h>
#include <gelf.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
@@ -54,7 +55,6 @@
#include "base/logging.hh"
#include "base/trace.hh"
#include "debug/Loader.hh"
#include "gelf.h"
#include "sim/byteswap.hh"
namespace Loader
@@ -221,8 +221,7 @@ ElfObject::determineArch()
auto &edata = ehdr.e_ident[EI_DATA];
// Detect the architecture
if (emach == EM_SPARC64 || (emach == EM_SPARC && eclass == ELFCLASS64) ||
emach == EM_SPARCV9) {
if ((emach == EM_SPARC && eclass == ELFCLASS64) || emach == EM_SPARCV9) {
arch = SPARC64;
} else if (emach == EM_SPARC32PLUS ||
(emach == EM_SPARC && eclass == ELFCLASS32)) {

View File

@@ -41,11 +41,12 @@
#ifndef __BASE_LOADER_ELF_OBJECT_HH__
#define __BASE_LOADER_ELF_OBJECT_HH__
#include <gelf.h>
#include <set>
#include <vector>
#include "base/loader/object_file.hh"
#include "gelf.h"
namespace Loader
{