From: Andreas Schwab Date: Thu, 15 Jun 2017 12:14:50 +0000 (+0200) Subject: Support EM_PPC machine flags X-Git-Tag: elfutils-0.170~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d65648473d1bfc779e16cd3cbf140a8ba0fed16c;p=thirdparty%2Felfutils.git Support EM_PPC machine flags This fixes the elflint self test when the compiler is configured for PIE default. Signed-off-by: Andreas Schwab --- diff --git a/backends/ChangeLog b/backends/ChangeLog index f0d29f62e..c5f61e85a 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,8 @@ +2017-06-15 Andreas Schwab + + * ppc_symbol.c (ppc_machine_flag_check): New function. + * ppc_init.c (ppc_init): Hook it. + 2017-05-30 Mark Wielaard * ppc64_unwind.c: New file. diff --git a/backends/ppc_init.c b/backends/ppc_init.c index c3e3ca360..aea9f2d74 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 1273c1d29..4b32003ac 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)))