From: Paul Brook Date: Thu, 1 Apr 2004 12:32:35 +0000 (+0000) Subject: This time the version of the patch that works. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=93204d3a0b545e3d60aab40f933fcb3bdf929b81;p=binutils-gdb.git This time the version of the patch that works. * 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. --- diff --git a/bfd/elf32-arm.h b/bfd/elf32-arm.h index b9e3debd606..d3f8d1f0ea5 100644 --- a/bfd/elf32-arm.h +++ b/bfd/elf32-arm.h @@ -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; }