This time the version of the patch that works.
authorPaul Brook <paul@codesourcery.com>
Thu, 1 Apr 2004 12:32:35 +0000 (12:32 +0000)
committerPaul Brook <paul@codesourcery.com>
Thu, 1 Apr 2004 12:32:35 +0000 (12:32 +0000)
* bfd/elf32-arm.h (struct elf32_elf_section_map): New.
(struct _arm_elf_section_data): New.
(elf32_arm_section_data): Define.
(struct elf32_arm_link_hash_table): Add byteswap_code.
(elf32_arm_link_hash_table_create): Initialize byteswap_code.
(bfd_elf32_arm_process_before_allocation): Add byteswap_code.
(elf32_arm_post_process_headers): Set EF_ARM_BE8.
(elf32_arm_output_symbol_hook, elf32_arm_new_section_hook,
elf32_arm_compare_mapping, elf32_arm_write_section): New functions.
(bfd_elf32_new_section_hook, elf_backend_write_section,
elf_backend_link_output_symbol_hook): Define.

bfd/elf32-arm.h

index b9e3debd6062fb519a63ae542c09d5adf2fb4502..d3f8d1f0ea5f6f524f79ff1787ed3e10bd82c716 100644 (file)
@@ -4091,9 +4091,12 @@ elf32_arm_post_process_headers (abfd, link_info)
   i_ehdrp->e_ident[EI_OSABI]      = ARM_ELF_OS_ABI_VERSION;
   i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION;
 
-  globals = elf32_arm_hash_table (link_info);
-  if (globals->byteswap_code)
-    i_ehdrp->e_flags |= EF_ARM_BE8;
+  if (link_info)
+    {
+      globals = elf32_arm_hash_table (link_info);
+      if (globals->byteswap_code)
+       i_ehdrp->e_flags |= EF_ARM_BE8;
+    }
 }
 
 static enum elf_reloc_type_class
@@ -4275,7 +4278,7 @@ elf32_arm_write_section (bfd *output_bfd ATTRIBUTE_UNUSED, asection *sec,
        }
       ptr = end;
     }
-  bfd_free (map);
+  free (map);
   return FALSE;
 }