aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-arm.c
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2004-12-02 15:05:34 +0000
committerPaul Brook <paul@codesourcery.com>2004-12-02 15:05:34 +0000
commit94a3258fc5a462a13091e7d77bc6e930c39ee890 (patch)
tree8bc91cabc41194a8017590c3b0bcad7929f7f99a /bfd/elf32-arm.c
parentb8658a2fb4f53372e41733758cc190bc2ad54801 (diff)
downloadgdb-94a3258fc5a462a13091e7d77bc6e930c39ee890.zip
gdb-94a3258fc5a462a13091e7d77bc6e930c39ee890.tar.gz
gdb-94a3258fc5a462a13091e7d77bc6e930c39ee890.tar.bz2
2004-12-01 Paul Brook <paul@codesourcery.com>
* elf32-arm.c (elf32_arm_copy_private_bfd_data): Set EI_OSABI. (elf32_arm_post_process_headers): Set EI_OSABI depending on ABI version.
Diffstat (limited to 'bfd/elf32-arm.c')
-rw-r--r--bfd/elf32-arm.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 0b031e0..325d2e8 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -3428,6 +3428,10 @@ elf32_arm_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
elf_elfheader (obfd)->e_flags = in_flags;
elf_flags_init (obfd) = TRUE;
+ /* Also copy the EI_OSABI field. */
+ elf_elfheader (obfd)->e_ident[EI_OSABI] =
+ elf_elfheader (ibfd)->e_ident[EI_OSABI];
+
return TRUE;
}
@@ -5352,7 +5356,10 @@ elf32_arm_post_process_headers (bfd * abfd, struct bfd_link_info * link_info ATT
i_ehdrp = elf_elfheader (abfd);
- i_ehdrp->e_ident[EI_OSABI] = ARM_ELF_OS_ABI_VERSION;
+ if (EF_ARM_EABI_VERSION (i_ehdrp->e_flags) == EF_ARM_EABI_UNKNOWN)
+ i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_ARM;
+ else
+ i_ehdrp->e_ident[EI_OSABI] = 0;
i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION;
if (link_info)