This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: New port created but need advice when linking.


Sorry and thanks. LD shows support for both ports, but now I get this
error.

mc9s12x-elf-ld  --defsym _start=0800 -o test.elf xgate.o
mc9s12x-elf-ld: mc9xgate architecture of input file `xgate.o' is
incompatible with mc9s12x output

I did a bit of reading saying it's the archures.c file where they are
grouped and deemed compatible/incompatible.  These lines didn't seem to do
the trick.

My bfd.h file in my build directory reads

"
  bfd_arch_mc9s12x,   /* Motorola S12X */
  bfd_arch_mc9xgate,   /* Motorola S12X Xgate Co Processor*/
#define bfd_mach_mc9s12x       1
#define bfd_mach_mc9xgate      2
"

I also added this to my cpu- file.

const bfd_arch_info_type bfd_mc9xgate_info =
{
    16, /* 16 bits in a word */
    32, /* 16 bits in an address */
    8,  /* 8 bits in a byte */
    bfd_arch_mc9xgate,
    bfd_mach_mc9xgate,
    "mc9xgate",
    "mc9xgate",
    4, /* section alignment power */
    TRUE,
    bfd_default_compatible,
    bfd_default_scan,
    0,
};

const bfd_arch_info_type bfd_mc9s12x_arch =
{
    16, /* 16 bits in a word */
    32, /* 16 bits in an address */
    8,  /* 8 bits in a byte */
    bfd_arch_mc9s12x,
    bfd_mach_mc9s12x,
    "mc9s12x",
    "mc9s12x:mc9xgate",
    4, /* section alignment power */
    TRUE,
    bfd_default_compatible,
    bfd_default_scan,
    &bfd_mc9xgate_info,
};


But I still get


"mc9s12x-elf-ld: mc9xgate architecture of input file `xgate.o' is incompatible with mc9s12x:mc9xgate output"


On 09/07/2010 07:04 AM, Ian Lance Taylor wrote:
Support at Computer Systems Services<support@computer-ss.com> writes:

I might have been a bit vague.  My concern was that I was trying to do
something binutils wasn't intended to do.  When I use the -i option
with ld I get these supported targets.

My main cpu port ->  mc9s12x-elf-ld: supported targets: elf32-mc9s12x
elf32-little elf32-big srec symbolsrec verilog tekhex binary ihex
vs
My xgate cpu port ->  mc9xgate-elf-ld: supported targets:
elf32-mc9xgate elf32-little elf32-big srec symbolsrec verilog tekhex
binary ihex

What I need in the first list is elf32-mc9xgate in addition to the
others. Is that just a matter of tweaking the build parameters/build
scripts so that my main port can process the other object file type?
I'm trying to build one ELF file out of object code from both types of
object files.
Please reply to the mailing list, not just to me. Thanks.

When you configure the binutils for your main cpu port, you need to pass
--enable-targets=XGATETARGETNAME.

Ian


On 08/30/2010 04:44 PM, Ian Lance Taylor wrote:
Support at Computer Systems Services<support@computer-ss.com> writes:


I added the xgate relocations to the main processor port, but when I
call it I get the following error.

"
mc9s12x-elf-ld -m mc9s12xelfb --defsym _start=800 -T memory.x -o
test.elf main.o
mc9s12x-elf-ld: main.o: Relocations in generic ELF (EM: 192)
mc9s12x-elf-ld: main.o: Relocations in generic ELF (EM: 192)
main.o: could not read symbols: File in wrong format
"

This means that ld does not recognize the object format used for main.o.
The first thing to check would be the ELF machine number.

Ian



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]