This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [arm] Don't "adjust" EABI relocations
- From: Paul Brook <paul at codesourcery dot com>
- To: binutils at sources dot redhat dot com
- Cc: Richard Earnshaw <rearnsha at arm dot com>
- Date: Wed, 1 Dec 2004 17:32:06 +0000
- Subject: Re: [arm] Don't "adjust" EABI relocations
- Organization: CodeSourcery
- References: <200411301552.39145.paul@codesourcery.com> <20041130174118.GA22074@nevyn.them.org> <1101895601.29185.11.camel@pc960.cambridge.arm.com>
On Wednesday 01 December 2004 10:06, Richard Earnshaw wrote:
> On Tue, 2004-11-30 at 17:41, Daniel Jacobowitz wrote:
> > It's the default nowadays, because every use is guarded by these two
> > things: "the command line argument was not specified" and "the osabi is
> > 0". We never produce objects with an OSABI of 0; we use ELF_OSABI_ARM
> > (spelling?) instead, which is 'a'.
>
> If we are still setting the OSABI field in EABI conforming objects, then
> that is a bug.
Attached patch fixes this.
Tested with cross to arm-none-{elf,eabi}
Ok?
Paul
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.
Index: elf32-arm.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-arm.c,v
retrieving revision 1.12
diff -u -p -r1.12 elf32-arm.c
--- elf32-arm.c 30 Nov 2004 17:45:53 -0000 1.12
+++ elf32-arm.c 1 Dec 2004 17:18:09 -0000
@@ -3428,6 +3428,10 @@ elf32_arm_copy_private_bfd_data (bfd *ib
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 * ab
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)