summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wielaard <mjw@redhat.com>2014-07-04 14:30:48 +0200
committerMark Wielaard <mjw@redhat.com>2014-07-04 14:30:48 +0200
commita95c4ad24cf83b2b0273fee73162bf476cebec8f (patch)
treea50510b5ef12ec3ea8a68bf73e38f0e5f818ae17
parent16e2d351bf31d0ce09ce9632ff196cbd973b656b (diff)
downloadelfutils-a95c4ad24cf83b2b0273fee73162bf476cebec8f.tar.gz
Add ppc64le ELFv2 abi support to backends and elflint.
The big endian vs little endian changes are already handled by detecting the EI_DATA data encoding. And the function descriptors are already not used when we see there is no .opd section. This change adds new checks for st_other bits, new relocations and recognizes DT_PPC64_OPT. Signed-off-by: Menanteau Guy <menantea@linux.vnet.ibm.com> Signed-off-by: Mark Wielaard <mjw@redhat.com>
-rw-r--r--backends/ChangeLog11
-rw-r--r--backends/ppc64_init.c1
-rw-r--r--backends/ppc64_reloc.def15
-rw-r--r--backends/ppc64_symbol.c11
-rw-r--r--src/ChangeLog6
-rw-r--r--src/elflint.c3
6 files changed, 45 insertions, 2 deletions
diff --git a/backends/ChangeLog b/backends/ChangeLog
index c590ed6d..d29a80f6 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,14 @@
+2014-07-04 Menanteau Guy <menantea@linux.vnet.ibm.com>
+ Mark Wielaard <mjw@redhat.com>
+
+ * ppc64_init.c (ppc64_init): Hook check_st_other_bits.
+ * ppc64_reloc.def: TLSGD, TLSLD, TOCSAVE, ADDR16_HIGH, ADDR16_HIGHA,
+ TPREL16_HIGH, TPREL16_HIGHA, DTPREL16_HIGH, DTPREL16_HIGHA, JMP_IREL,
+ IRELATIVE, REL16, REL16_LO, REL16_HI and REL16_HA.
+ * ppc64_symbol.c (ppc64_dynamic_tag_name): Recognize DT_PPC64_OPT.
+ (ppc64_dynamic_tag_check): Likewise.
+ (ppc64_check_st_other_bits): New function.
+
2014-07-04 Mark Wielaard <mjw@redhat.com>
* aarch64_retval.c (aarch64_return_value_location): Handle
diff --git a/backends/ppc64_init.c b/backends/ppc64_init.c
index e52231c9..7ea2b236 100644
--- a/backends/ppc64_init.c
+++ b/backends/ppc64_init.c
@@ -61,6 +61,7 @@ ppc64_init (elf, machine, eh, ehlen)
HOOK (eh, machine_flag_check);
HOOK (eh, copy_reloc_p);
HOOK (eh, check_special_symbol);
+ HOOK (eh, check_st_other_bits);
HOOK (eh, bss_plt_p);
HOOK (eh, return_value_location);
HOOK (eh, register_info);
diff --git a/backends/ppc64_reloc.def b/backends/ppc64_reloc.def
index 6366f46e..3a693cf6 100644
--- a/backends/ppc64_reloc.def
+++ b/backends/ppc64_reloc.def
@@ -132,6 +132,21 @@ RELOC_TYPE (DTPREL16_HIGHER, REL)
RELOC_TYPE (DTPREL16_HIGHERA, REL)
RELOC_TYPE (DTPREL16_HIGHEST, REL)
RELOC_TYPE (DTPREL16_HIGHESTA, REL)
+RELOC_TYPE (TLSGD, REL)
+RELOC_TYPE (TLSLD, REL)
+RELOC_TYPE (TOCSAVE, REL)
+RELOC_TYPE (ADDR16_HIGH, REL)
+RELOC_TYPE (ADDR16_HIGHA, REL)
+RELOC_TYPE (TPREL16_HIGH, REL)
+RELOC_TYPE (TPREL16_HIGHA, REL)
+RELOC_TYPE (DTPREL16_HIGH, REL)
+RELOC_TYPE (DTPREL16_HIGHA, REL)
+RELOC_TYPE (JMP_IREL, REL)
+RELOC_TYPE (IRELATIVE, REL)
+RELOC_TYPE (REL16, REL)
+RELOC_TYPE (REL16_LO, REL)
+RELOC_TYPE (REL16_HI, REL)
+RELOC_TYPE (REL16_HA, REL)
/* Notes from Alan Modra:
diff --git a/backends/ppc64_symbol.c b/backends/ppc64_symbol.c
index 212d4145..5a020d8d 100644
--- a/backends/ppc64_symbol.c
+++ b/backends/ppc64_symbol.c
@@ -72,6 +72,8 @@ ppc64_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
return "PPC64_OPD";
case DT_PPC64_OPDSZ:
return "PPC64_OPDSZ";
+ case DT_PPC64_OPT:
+ return "PPC64_OPT";
default:
break;
}
@@ -84,7 +86,8 @@ ppc64_dynamic_tag_check (int64_t tag)
{
return (tag == DT_PPC64_GLINK
|| tag == DT_PPC64_OPD
- || tag == DT_PPC64_OPDSZ);
+ || tag == DT_PPC64_OPDSZ
+ || tag == DT_PPC64_OPT);
}
@@ -120,3 +123,9 @@ ppc64_machine_flag_check (GElf_Word flags)
{
return flags == 0 || flags == 1 || flags == 2;
}
+
+bool
+ppc64_check_st_other_bits (unsigned char st_other)
+{
+ return (PPC64_LOCAL_ENTRY_OFFSET (st_other) != 0);
+}
diff --git a/src/ChangeLog b/src/ChangeLog
index 30234237..2d6965bf 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2014-07-04 Menanteau Guy <menantea@linux.vnet.ibm.com>
+ Mark Wielaard <mjw@redhat.com>
+
+ * elflint (check_symtab): Add ".TOC." to the list of possibly
+ dangling symbols because of sourceware PR13621.
+
2014-06-14 Mark Wielaard <mjw@redhat.com>
* elflint (check_symtab): Use ebl_func_addr_mask on st_value.
diff --git a/src/elflint.c b/src/elflint.c
index 5568c65c..d6a47748 100644
--- a/src/elflint.c
+++ b/src/elflint.c
@@ -799,7 +799,8 @@ section [%2d] '%s': symbol %zu: function in COMMON section is nonsense\n"),
&& strcmp (name, "__fini_array_end") != 0
&& strcmp (name, "__bss_start") != 0
&& strcmp (name, "__bss_start__") != 0
- && strcmp (name, "__TMC_END__") != 0))
+ && strcmp (name, "__TMC_END__") != 0
+ && strcmp (name, ".TOC.") != 0))
ERROR (gettext ("\
section [%2d] '%s': symbol %zu: st_value out of bounds\n"),
idx, section_name (ebl, idx), cnt);