This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Setting GNU OSABI on ARM
- From: Will Newton <will dot newton at linaro dot org>
- To: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Wed, 24 Apr 2013 12:30:05 +0100
- Subject: Setting GNU OSABI on ARM
Hi all,
I was wondering if someone could help me figure out why all
architectures except ARM seem to set GNU OSABI when GNU indirect
function symbols are present?
The below patch sets GNU OSABI on ARM and lets us run the generic
ifunc tests (that run on i386, x86_64, sparc and powerpc). Is there
some historical reason why this is a bad idea?
Thanks,
diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
index 9fff630..7b7bc8e 100644
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -14411,10 +14416,12 @@ elf32_arm_post_process_headers (bfd * abfd,
struct bfd_link_info * link_info ATT
i_ehdrp = elf_elfheader (abfd);
- if (EF_ARM_EABI_VERSION (i_ehdrp->e_flags) == EF_ARM_EABI_UNKNOWN)
+ if (elf_tdata (abfd)->has_gnu_symbols)
+ i_ehdrp->e_ident[EI_OSABI] = ELFOSABI_GNU;
+ else 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_OSABI] = ELFOSABI_NONE;
i_ehdrp->e_ident[EI_ABIVERSION] = ARM_ELF_ABI_VERSION;
if (link_info)
--
Will Newton
Toolchain Working Group, Linaro