From 406abf9f7be65d98724b171d7d95413a88636b32 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 10 Apr 2017 08:51:36 -0700 Subject: [PATCH] Place generic ELF target vectors at the end Generic ELF target vectors are included in BFD so that objdump or gdb are be able to examine the file even if we don't recognize the ELF machine type. They should be placed after all other ELF target vectors and used as the last resort so that the ELF target vector with matching machine type is selected if possible. * targets.c (_bfd_target_vector): Move generic ELF target vectors after all other ELF target vectors. --- bfd/targets.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/bfd/targets.c b/bfd/targets.c index 5841e8d..c2df84a 100644 --- a/bfd/targets.c +++ b/bfd/targets.c @@ -1046,17 +1046,6 @@ static const bfd_target * const _bfd_target_vector[] = &dlx_elf32_be_vec, - /* This, and other vectors, may not be used in any *.mt configuration. - But that does not mean they are unnecessary. If configured with - --enable-targets=all, objdump or gdb should be able to examine - the file even if we don't recognize the machine type. */ - &elf32_be_vec, - &elf32_le_vec, -#ifdef BFD64 - &elf64_be_vec, - &elf64_le_vec, -#endif - &epiphany_elf32_vec, &fr30_elf32_vec, @@ -1455,6 +1444,20 @@ static const bfd_target * const _bfd_target_vector[] = &z80_coff_vec, &z8k_coff_vec, + + /* These generic ELF vectors may not be used in any *.mt + configuration. But that does not mean they are unnecessary. + If configured with --enable-targets=all, objdump or gdb + should be able to examine the file even if we don't recognize + the machine type. They should be placed after all other ELF + vectors and used as the last resort so that the ELF vector + with matching machine type is selected if possible. */ + &elf32_be_vec, + &elf32_le_vec, +#ifdef BFD64 + &elf64_be_vec, + &elf64_le_vec, +#endif #endif /* not SELECT_VECS */ /* Always support S-records, for convenience. */ -- 2.9.3