diff options
author | Mark Wielaard <mark@klomp.org> | 2019-06-28 19:21:59 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2019-07-10 14:08:33 +0200 |
commit | b3233914074cb7eb19ea2fc3c70257679f867f68 (patch) | |
tree | aad365893d911393052714723f050388197170d7 /libebl | |
parent | 31c8b3f098b0654db8f573b2a15d5b6d07d4d3b0 (diff) | |
download | elfutils-b3233914074cb7eb19ea2fc3c70257679f867f68.tar.gz |
libdwelf: Add dwelf_elf_e_machine_string and use it in readelf.
To print eh human readable description of the ELF e_machine header field
we used the ebl name. But this is not set for most EM constants. Introduce
a new function dwelf_elf_e_machine_string that does work for all known
EM values. Use that in eu-readelf to print a string representation of the
e_machine value.
Since this was the only usage of ebl->name, remove that from struct ebl.
Also add a testcase that makes sure dwelf_elf_e_machine_string works for
all EM values in the libelf/elf.h header so we will immediately notice
when a new value appears.
Signed-off-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'libebl')
-rw-r--r-- | libebl/ChangeLog | 6 | ||||
-rw-r--r-- | libebl/eblopenbackend.c | 3 | ||||
-rw-r--r-- | libebl/libeblP.h | 3 |
3 files changed, 6 insertions, 6 deletions
diff --git a/libebl/ChangeLog b/libebl/ChangeLog index 8a7d177f..e42cd34b 100644 --- a/libebl/ChangeLog +++ b/libebl/ChangeLog @@ -1,3 +1,9 @@ +2019-06-28 Mark Wielaard <mark@klomp.org> + + * eblopenbackend.c (try_dlopen): Remove result->name check. + (openbackend): Remove result->name assignment. + (struct ebl): Remove name. + 2019-05-30 Mark Wielaard <mark@klomp.org> * eblopenbackend.c (try_dlopen): New function extracted from diff --git a/libebl/eblopenbackend.c b/libebl/eblopenbackend.c index 36a24921..9dd51950 100644 --- a/libebl/eblopenbackend.c +++ b/libebl/eblopenbackend.c @@ -283,7 +283,6 @@ try_dlopen (const char *dsoname, Elf *elf, GElf_Half machine, size_t cnt, result->elf = elf; /* A few entries are mandatory. */ - assert (result->name != NULL); assert (result->destr != NULL); return result; @@ -398,7 +397,6 @@ openbackend (Elf *elf, const char *emulation, GElf_Half machine) Return that information. */ result->dlhandle = NULL; result->elf = elf; - result->name = machines[cnt].prefix; fill_defaults (result); return result; @@ -408,7 +406,6 @@ openbackend (Elf *elf, const char *emulation, GElf_Half machine) result->dlhandle = NULL; result->elf = elf; result->emulation = "<unknown>"; - result->name = "<unknown>"; fill_defaults (result); return result; diff --git a/libebl/libeblP.h b/libebl/libeblP.h index 5b339b31..a5869685 100644 --- a/libebl/libeblP.h +++ b/libebl/libeblP.h @@ -38,9 +38,6 @@ /* Backend handle. */ struct ebl { - /* Machine name. */ - const char *name; - /* Emulation name. */ const char *emulation; |