]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Support EM_PPC machine flags
authorAndreas Schwab <schwab@linux-m68k.org>
Thu, 15 Jun 2017 12:14:50 +0000 (14:14 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 15 Jun 2017 17:40:32 +0000 (19:40 +0200)
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
backends/ppc_init.c
backends/ppc_symbol.c

index f0d29f62e8132a07f7523deda34d20f568180898..c5f61e85a35b51d483dec1a9fc5edb1479f99cc5 100644 (file)
@@ -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.
index c3e3ca360745616f471636160245cdbc958fe698..aea9f2d7404b1d4dc2581fe9d5a3227924e64a68 100644 (file)
@@ -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);
index 1273c1d299cf0fe4606a5ce130d779c4079b2172..4b32003accb09ee6cd0efa01bdf63f50a4aadc5f 100644 (file)
@@ -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)))