Index: gdb/rs6000-tdep.c =================================================================== RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v retrieving revision 1.328 diff -u -p -r1.328 rs6000-tdep.c --- gdb/rs6000-tdep.c 22 Feb 2009 01:02:19 -0000 1.328 +++ gdb/rs6000-tdep.c 22 May 2009 19:15:42 -0000 @@ -3371,6 +3371,43 @@ rs6000_gdbarch_init (struct gdbarch_info wordsize = 4; } +#ifdef HAVE_ELF + if (soft_float_flag == AUTO_BOOLEAN_AUTO && from_elf_exec) + { + switch (bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_GNU, + Tag_GNU_Power_ABI_FP)) + { + case 1: + soft_float_flag = AUTO_BOOLEAN_FALSE; + break; + case 2: + soft_float_flag = AUTO_BOOLEAN_TRUE; + break; + default: + break; + } + } + + if (vector_abi == POWERPC_VEC_AUTO && from_elf_exec) + { + switch (bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_GNU, + Tag_GNU_Power_ABI_Vector)) + { + case 1: + vector_abi = POWERPC_VEC_GENERIC; + break; + case 2: + vector_abi = POWERPC_VEC_ALTIVEC; + break; + case 3: + vector_abi = POWERPC_VEC_SPE; + break; + default: + break; + } + } +#endif + /* Get the architecture and machine from the BFD. */ arch = info.bfd_arch_info->arch; mach = info.bfd_arch_info->mach; @@ -3383,16 +3420,14 @@ rs6000_gdbarch_init (struct gdbarch_info which version of it) can execute it. In our case we just look for the existance of the section. */ - if (info.abfd) - { - sect = bfd_get_section_by_name (info.abfd, ".PPC.EMB.apuinfo"); - if (sect) - { - arch = info.bfd_arch_info->arch; - mach = bfd_mach_ppc_e500; - bfd_default_set_arch_mach (&abfd, arch, mach); - info.bfd_arch_info = bfd_get_arch_info (&abfd); - } + if (vector_abi == POWERPC_VEC_SPE + || (info.abfd + && bfd_get_section_by_name (info.abfd, ".PPC.EMB.apuinfo") != NULL)) + { + mach = bfd_mach_ppc_e500; + arch = info.bfd_arch_info->arch; + bfd_default_set_arch_mach (&abfd, arch, mach); + info.bfd_arch_info = bfd_get_arch_info (&abfd); } /* Find a default target description which describes our register @@ -3629,43 +3664,6 @@ rs6000_gdbarch_init (struct gdbarch_info return NULL; } -#ifdef HAVE_ELF - if (soft_float_flag == AUTO_BOOLEAN_AUTO && from_elf_exec) - { - switch (bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_GNU, - Tag_GNU_Power_ABI_FP)) - { - case 1: - soft_float_flag = AUTO_BOOLEAN_FALSE; - break; - case 2: - soft_float_flag = AUTO_BOOLEAN_TRUE; - break; - default: - break; - } - } - - if (vector_abi == POWERPC_VEC_AUTO && from_elf_exec) - { - switch (bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_GNU, - Tag_GNU_Power_ABI_Vector)) - { - case 1: - vector_abi = POWERPC_VEC_GENERIC; - break; - case 2: - vector_abi = POWERPC_VEC_ALTIVEC; - break; - case 3: - vector_abi = POWERPC_VEC_SPE; - break; - default: - break; - } - } -#endif - if (soft_float_flag == AUTO_BOOLEAN_TRUE) soft_float = 1; else if (soft_float_flag == AUTO_BOOLEAN_FALSE)