This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Linking against armlink produced ELF for armv6-m (thumb only) CPU
- From: Matthew Gretton-Dann <matthew dot gretton-dann at arm dot com>
- To: Gus Sabina <gussabina at yahoo dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Tue, 12 Jul 2011 10:43:25 +0100
- Subject: Re: Linking against armlink produced ELF for armv6-m (thumb only) CPU
- References: <4C5FEFEB.4070004@finwe.fi> <1281357579.15516.9.camel@e102319-lin.cambridge.arm.com> <4C6021C8.8090306@finwe.fi> <1281432433.7027.39.camel@e102319-lin.cambridge.arm.com> <31998893.post@talk.nabble.com> <4E145FEA.5040305@arm.com> <1310448299.35910.YahooMailRC@web34301.mail.mud.yahoo.com>
[Re-including binutils@sourceware.org on cc-list].
On 12/07/11 06:24, Gus Sabina wrote:
Hello Matthew:
Thanks for your response. Actually, I didn't not include any
.ARM.attributes section at all but I'm still getting the "Conflicting
CPU architectures 0/11" error.
What target was gas configured for? To find this out do:
.../as --version
.ARM.attributes sections are only supported for EABI targets
(arm*-*-*eabi) and not for the older ELF targets (for instance
arm-none-elf).
As you seem to be trying to link against objects which have been
assembled targeting the EABI you should ensure your assembler is using
an EABI target.
Let me explain what I'm doing. I 'm creating a tool which goal is to
create some "pattern" which should be located somewhere in memory (where
the linker decides it). I'm not using a compiler so I'm creating the
object file directly. So, I'm creating all sections (.emb_text including
the pattern). The problem is that when I link my object file with the
embedded system project, I'm getting the above error... It still works
but I would really like to get rid of this error...
My question is, should I include an .ARM.attributes to avoid this, and
if so, which would be the most appropriate?
When targeting EABI targets gas will automatically generate an
.ARM.attributes section. It will 'guess' the values to put in this
section from the command-line options you specify (in particular -mcpu,
-mfpu, -march). You can also specify other attributes by using the
.eabi_attribute directive (see
http://sourceware.org/binutils/docs-2.21/as/ARM-Directives.html#ARM-Directives
for documentation).
A fuller description of attributes is available in the ARM EABI
documentation here:
http://infocenter.arm.com/help/topic/com.arm.doc.ihi0045c/index.html
I can't tell you which directives to use. The general guidance is that
they should reflect your intentions as to what CPUs you expect the code
to be run on.
I'm attaching an example of the object file I'm creating so you can
inspect it.
I would really appreciate if you can help me with this issue...
I hope the above helps.
Thanks,
Matt
--
Matthew Gretton-Dann
Principal Engineer, PD Software - Tools, ARM Ltd