* elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): Detect (ctor)
authorAlexandre Oliva <aoliva@redhat.com>
Wed, 9 Apr 2003 02:55:40 +0000 (02:55 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Wed, 9 Apr 2003 02:55:40 +0000 (02:55 +0000)
pointer size from ABI, not arch_bits_per_address.

bfd/ChangeLog
bfd/elf32-mips.c

index 434e5463ba4a0304373a8462437d6f9e4c1e2836..075f69bd7e425335a18580801ad7dc3446039932 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-08  Alexandre Oliva  <aoliva@redhat.com>
+
+       * elf32-mips.c (bfd_elf32_bfd_reloc_type_lookup): Detect (ctor)
+       pointer size from ABI, not arch_bits_per_address.
+
 2003-04-07  Kevin Buettner  <kevinb@redhat.com>
 
        * elfn32-mips.c (elf32_mips_grok_prstatus): Adjust core file related
index 1399f0031287e52d0d722c21b7b1af68be67b3f2..adf057b40d242a71ed5b3ba5fd93b3635ed8d7fc 100644 (file)
@@ -1440,11 +1440,12 @@ bfd_elf32_bfd_reloc_type_lookup (abfd, code)
     case BFD_RELOC_CTOR:
       /* We need to handle BFD_RELOC_CTOR specially.
         Select the right relocation (R_MIPS_32 or R_MIPS_64) based on the
-        size of addresses on this architecture.  */
-      if (bfd_arch_bits_per_address (abfd) == 32)
-       return &howto_table[(int) R_MIPS_32];
-      else
+        size of addresses of the ABI.  */
+      if ((elf_elfheader (abfd)->e_flags & (E_MIPS_ABI_O64
+                                           | E_MIPS_ABI_EABI64)) != 0)
        return &elf_mips_ctor64_howto;
+      else
+       return &howto_table[(int) R_MIPS_32];
 
     case BFD_RELOC_MIPS16_JMP:
       return &elf_mips16_jump_howto;