public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Support EM_PPC machine flags
@ 2017-06-15 21:05 Andreas Schwab
  0 siblings, 0 replies; only message in thread
From: Andreas Schwab @ 2017-06-15 21:05 UTC (permalink / raw)
  To: elfutils-devel

This fixes the elflint self test when the compiler is configured for PIE
default.

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
---
 backends/ChangeLog    |  5 +++++
 backends/ppc_init.c   |  1 +
 backends/ppc_symbol.c | 10 ++++++++++
 3 files changed, 16 insertions(+)

diff --git a/backends/ChangeLog b/backends/ChangeLog
index f0d29f62e8..c5f61e85a3 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-15  Andreas Schwab  <schwab@linux-m68k.org>
+
+	* ppc_symbol.c (ppc_machine_flag_check): New function.
+	* ppc_init.c (ppc_init): Hook it.
+
 2017-05-30  Mark Wielaard  <mark@klomp.org>
 
 	* ppc64_unwind.c: New file.
diff --git a/backends/ppc_init.c b/backends/ppc_init.c
index c3e3ca3607..aea9f2d740 100644
--- a/backends/ppc_init.c
+++ b/backends/ppc_init.c
@@ -53,6 +53,7 @@ ppc_init (Elf *elf __attribute__ ((unused)),
   eh->name = "PowerPC";
   ppc_init_reloc (eh);
   HOOK (eh, reloc_simple_type);
+  HOOK (eh, machine_flag_check);
   HOOK (eh, dynamic_tag_name);
   HOOK (eh, dynamic_tag_check);
   HOOK (eh, check_special_symbol);
diff --git a/backends/ppc_symbol.c b/backends/ppc_symbol.c
index 1273c1d299..4b32003acc 100644
--- a/backends/ppc_symbol.c
+++ b/backends/ppc_symbol.c
@@ -57,6 +57,16 @@ ppc_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
 }
 
 
+/* Check whether machine flags are valid.  */
+bool
+ppc_machine_flag_check (GElf_Word flags)
+{
+  return ((flags &~ (EF_PPC_EMB
+		     | EF_PPC_RELOCATABLE
+		     | EF_PPC_RELOCATABLE_LIB)) == 0);
+}
+
+
 const char *
 ppc_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
 		      size_t len __attribute__ ((unused)))
-- 
2.13.1

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-06-15 12:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15 21:05 [PATCH] Support EM_PPC machine flags Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).