summaryrefslogtreecommitdiffstats
path: root/backends
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2019-06-28 19:21:59 +0200
committerMark Wielaard <mark@klomp.org>2019-07-10 14:08:33 +0200
commitb3233914074cb7eb19ea2fc3c70257679f867f68 (patch)
treeaad365893d911393052714723f050388197170d7 /backends
parent31c8b3f098b0654db8f573b2a15d5b6d07d4d3b0 (diff)
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 'backends')
-rw-r--r--backends/ChangeLog18
-rw-r--r--backends/aarch64_init.c1
-rw-r--r--backends/alpha_init.c1
-rw-r--r--backends/arm_init.c1
-rw-r--r--backends/bpf_init.c1
-rw-r--r--backends/i386_init.c1
-rw-r--r--backends/ia64_init.c1
-rw-r--r--backends/m68k_init.c1
-rw-r--r--backends/ppc64_init.c1
-rw-r--r--backends/ppc_init.c1
-rw-r--r--backends/riscv_init.c1
-rw-r--r--backends/s390_init.c1
-rw-r--r--backends/sh_init.c1
-rw-r--r--backends/sparc_init.c6
-rw-r--r--backends/tilegx_init.c1
-rw-r--r--backends/x86_64_init.c1
16 files changed, 18 insertions, 20 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog
index 6c2b47a9..af1a40e2 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,21 @@
+2019-06-28 Mark Wielaard <mark@klomp.org>
+
+ * aarch64_init.c (aarch64_init.c): Remove eh->name;
+ * alpha_init.c (alpha_init.c): Remove eh->name;
+ * arm_init.c (arm_init.c): Remove eh->name;
+ * bpf_init.c (bpf_init.c): Remove eh->name;
+ * i386_init.c (i386_init.c): Remove eh->name;
+ * ia64_init.c (ia64_init.c): Remove eh->name;
+ * m68k_init.c (m68k_init.c): Remove eh->name;
+ * ppc64_init.c (ppc64_init.c): Remove eh->name;
+ * ppc_init.c (ppc_init.c): Remove eh->name;
+ * riscv_init.c (riscv_init.c): Remove eh->name;
+ * s390_init.c (s390_init.c): Remove eh->name;
+ * sh_init.c (sh_init.c): Remove eh->name;
+ * sparc_init.c (sparc_init.c): Remove eh->name;
+ * tilegx_init.c (tilegx_init.c): Remove eh->name;
+ * x86_64_init.c (x86_64_init.c): Remove eh->name;
+
2019-04-14 Mark Wielaard <mark@klomp.org>
* riscv_cfi.c: Fix BACKEND define.
diff --git a/backends/aarch64_init.c b/backends/aarch64_init.c
index fad923fa..95268ae0 100644
--- a/backends/aarch64_init.c
+++ b/backends/aarch64_init.c
@@ -49,7 +49,6 @@ aarch64_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- eh->name = "AARCH64";
aarch64_init_reloc (eh);
HOOK (eh, register_info);
HOOK (eh, core_note);
diff --git a/backends/alpha_init.c b/backends/alpha_init.c
index 25c5b32f..f66f40c5 100644
--- a/backends/alpha_init.c
+++ b/backends/alpha_init.c
@@ -50,7 +50,6 @@ alpha_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- eh->name = "Alpha";
alpha_init_reloc (eh);
HOOK (eh, dynamic_tag_name);
HOOK (eh, dynamic_tag_check);
diff --git a/backends/arm_init.c b/backends/arm_init.c
index f2b1b11e..af023f02 100644
--- a/backends/arm_init.c
+++ b/backends/arm_init.c
@@ -50,7 +50,6 @@ arm_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- eh->name = "ARM";
arm_init_reloc (eh);
HOOK (eh, segment_type_name);
HOOK (eh, section_type_name);
diff --git a/backends/bpf_init.c b/backends/bpf_init.c
index a046e069..d407d378 100644
--- a/backends/bpf_init.c
+++ b/backends/bpf_init.c
@@ -49,7 +49,6 @@ bpf_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- eh->name = "BPF";
bpf_init_reloc (eh);
HOOK (eh, register_info);
HOOK (eh, disasm);
diff --git a/backends/i386_init.c b/backends/i386_init.c
index fc1587a9..67428b53 100644
--- a/backends/i386_init.c
+++ b/backends/i386_init.c
@@ -49,7 +49,6 @@ i386_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- eh->name = "Intel 80386";
i386_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, gotpc_reloc_check);
diff --git a/backends/ia64_init.c b/backends/ia64_init.c
index 7241d7b8..2d1f43f2 100644
--- a/backends/ia64_init.c
+++ b/backends/ia64_init.c
@@ -49,7 +49,6 @@ ia64_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- eh->name = "Intel IA-64";
ia64_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, segment_type_name);
diff --git a/backends/m68k_init.c b/backends/m68k_init.c
index 8cae710b..05d544c1 100644
--- a/backends/m68k_init.c
+++ b/backends/m68k_init.c
@@ -48,7 +48,6 @@ m68k_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- eh->name = "M68K";
m68k_init_reloc (eh);
HOOK (eh, gotpc_reloc_check);
HOOK (eh, reloc_simple_type);
diff --git a/backends/ppc64_init.c b/backends/ppc64_init.c
index 3db5e766..c2e7043b 100644
--- a/backends/ppc64_init.c
+++ b/backends/ppc64_init.c
@@ -52,7 +52,6 @@ ppc64_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- eh->name = "PowerPC 64-bit";
ppc64_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, dynamic_tag_name);
diff --git a/backends/ppc_init.c b/backends/ppc_init.c
index aea9f2d7..eb286c25 100644
--- a/backends/ppc_init.c
+++ b/backends/ppc_init.c
@@ -50,7 +50,6 @@ ppc_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- eh->name = "PowerPC";
ppc_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, machine_flag_check);
diff --git a/backends/riscv_init.c b/backends/riscv_init.c
index 3398c104..9aaec9ce 100644
--- a/backends/riscv_init.c
+++ b/backends/riscv_init.c
@@ -54,7 +54,6 @@ riscv_init (Elf *elf,
return NULL;
/* We handle it. */
- eh->name = "RISC-V";
riscv_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, register_info);
diff --git a/backends/s390_init.c b/backends/s390_init.c
index 0004aeea..b4f3e7f8 100644
--- a/backends/s390_init.c
+++ b/backends/s390_init.c
@@ -51,7 +51,6 @@ s390_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- eh->name = "IBM S/390";
s390_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, check_special_symbol);
diff --git a/backends/sh_init.c b/backends/sh_init.c
index 5526aca1..24f4d4a4 100644
--- a/backends/sh_init.c
+++ b/backends/sh_init.c
@@ -50,7 +50,6 @@ sh_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- eh->name = "Hitachi SH";
sh_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, gotpc_reloc_check);
diff --git a/backends/sparc_init.c b/backends/sparc_init.c
index 8e946fb2..6daff114 100644
--- a/backends/sparc_init.c
+++ b/backends/sparc_init.c
@@ -55,12 +55,6 @@ sparc_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- if (machine == EM_SPARCV9)
- eh->name = "SPARC v9";
- else if (machine == EM_SPARC32PLUS)
- eh->name = "SPARC v8+";
- else
- eh->name = "SPARC";
sparc_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, machine_flag_check);
diff --git a/backends/tilegx_init.c b/backends/tilegx_init.c
index 162ed362..66df9318 100644
--- a/backends/tilegx_init.c
+++ b/backends/tilegx_init.c
@@ -48,7 +48,6 @@ tilegx_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- eh->name = "TILE-Gx";
tilegx_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, return_value_location);
diff --git a/backends/x86_64_init.c b/backends/x86_64_init.c
index 49f6c6c7..8abafb7f 100644
--- a/backends/x86_64_init.c
+++ b/backends/x86_64_init.c
@@ -52,7 +52,6 @@ x86_64_init (Elf *elf __attribute__ ((unused)),
return NULL;
/* We handle it. */
- eh->name = "AMD x86-64";
x86_64_init_reloc (eh);
HOOK (eh, reloc_simple_type);
HOOK (eh, section_type_name);