Does binutils support multi-target at the same time?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Does binutils support multi-target at the same time?

WU Zilong
Hi all,

     Can I build binutils with multi-target? Such as enable both
arm-elf and arm-coff at the same? So I can convert .o file from
arm-elf or arm-coff to each other freely? Or there are any other good
ideas ...

     Thanks,

     Andy
Reply | Threaded
Open this post in threaded view
|

Re: Does binutils support multi-target at the same time?

Paul Brook
On Saturday 26 November 2005 16:48, WU Zilong wrote:
> Hi all,
>
>      Can I build binutils with multi-target? Such as enable both
> arm-elf and arm-coff at the same?

./configure --enable-targets=whatever
The assembler still only targets one arch but the rest of binutils can work
with multiple formats[*].

> So I can convert .o file from arm-elf or arm-coff to each other freely?

Not really. You can try objcopy, but chances are it won't work. ELF and coff
are sufficiently different I'd be surprised if you can convert between the
two in any vaguely reliable way.

Paul

[*] I haven't done exhaustive checks, but I think this is true.
Reply | Threaded
Open this post in threaded view
|

Re: Does binutils support multi-target at the same time?

Hans-Peter Nilsson-2
On Sat, 26 Nov 2005, Paul Brook wrote:
> On Saturday 26 November 2005 16:48, WU Zilong wrote:
> >      Can I build binutils with multi-target? Such as enable both
> > arm-elf and arm-coff at the same?
>
> ./configure --enable-targets=whatever
> The assembler still only targets one arch but the rest of binutils can work
> with multiple formats[*].

For some architectures, GAS can target multiple formats, though
ARM is currently not one of them.  See MIPS, i386 and
CRIS gas configury bits, grep for "multi".  At assembler
invocation time, the option "--em=objformat" controls which
"emulation" objects are generated for.

brgds, H-P
PS. It works too, at least for CRIS.
Reply | Threaded
Open this post in threaded view
|

Re: Does binutils support multi-target at the same time?

WU Zilong
Thanks, you means we can not convert coff to elf with arm target
freely, then is there any good ideas to do this?

Thanks,

On 11/27/05, Hans-Peter Nilsson <[hidden email]> wrote:

> On Sat, 26 Nov 2005, Paul Brook wrote:
> > On Saturday 26 November 2005 16:48, WU Zilong wrote:
> > >      Can I build binutils with multi-target? Such as enable both
> > > arm-elf and arm-coff at the same?
> >
> > ./configure --enable-targets=whatever
> > The assembler still only targets one arch but the rest of binutils can work
> > with multiple formats[*].
>
> For some architectures, GAS can target multiple formats, though
> ARM is currently not one of them.  See MIPS, i386 and
> CRIS gas configury bits, grep for "multi".  At assembler
> invocation time, the option "--em=objformat" controls which
> "emulation" objects are generated for.
>
> brgds, H-P
> PS. It works too, at least for CRIS.
>
Reply | Threaded
Open this post in threaded view
|

Re: Does binutils support multi-target at the same time?

Hans-Peter Nilsson-2
On Sun, 27 Nov 2005, WU Zilong wrote:

> Thanks, you means we can not convert coff to elf with arm target
> freely, then is there any good ideas to do this?

I'm not sure I understand your question.  Support for output in
multiple formats in the assembler, which was what I replied to,
has nothing to do with *converting* between e.g. coff and elf.

You can use the GNU binutils "objcopy" utility to convert
between formats.  (I think this only works for files without
relocations, i.e.  not intermediate object files.)  You can use
the GNU linker to link together (intermediate) object files in
different formats.

brgds, H-P
Reply | Threaded
Open this post in threaded view
|

Re: Does binutils support multi-target at the same time?

WU Zilong
Yes, I wish to convert arm-wince-pe targeted object code to elf object
format so that I can use it under arm linux ... (the object file is
pure algorithm module and does not call any external functions). From
your reply I think it is possible to use binutils to convert it,
right?

Thanks for you help.



On 11/27/05, Hans-Peter Nilsson <[hidden email]> wrote:

> On Sun, 27 Nov 2005, WU Zilong wrote:
>
> > Thanks, you means we can not convert coff to elf with arm target
> > freely, then is there any good ideas to do this?
>
> I'm not sure I understand your question.  Support for output in
> multiple formats in the assembler, which was what I replied to,
> has nothing to do with *converting* between e.g. coff and elf.
>
> You can use the GNU binutils "objcopy" utility to convert
> between formats.  (I think this only works for files without
> relocations, i.e.  not intermediate object files.)  You can use
> the GNU linker to link together (intermediate) object files in
> different formats.
>
> brgds, H-P
>
Reply | Threaded
Open this post in threaded view
|

Re: Does binutils support multi-target at the same time?

Hans-Peter Nilsson-2
On Mon, 28 Nov 2005, WU Zilong wrote:
> Yes, I wish to convert arm-wince-pe targeted object code to elf object
> format so that I can use it under arm linux ... (the object file is
> pure algorithm module and does not call any external functions). From
> your reply I think it is possible to use binutils to convert it,
> right?

I see nobody with specific knowledge about arm-wince-pe
answered, but I have no more information than what I already
said: "you can use the GNU binutils "objcopy" utility to convert
between formats" (object files perhaps only those without
relocations), "you can use the GNU linker to link together
(intermediate) object files in different formats".  Why not try
and see?

brgds, H-P