bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ihex output from ld (2.13)erroneous?


From: Nick Clifton
Subject: Re: ihex output from ld (2.13)erroneous?
Date: 14 Apr 2003 18:16:08 +0100

Hi Peter,

> There seems to be a problem when making ld produce ihex output files.

Thank you for bringing this to our attention.  Unfortunately you have
not really given us enough information to study this problem.  For
example - what is the command line you used to link and create the
ihex file in one operation ?  What are the values for DDRB and PORTB
in your example program ?  How do the working and non-working ihex
files differ ?

I suspect that the problem will be improperly resolved relocs.  For
example when I tried to use the test program you supplied I found that
the value for the first instruction in the program was different when
the ihex file was created directly from the linker and from when it
was linked as an ELF file and the objcopy'ed into an ihex file.

The direct from linker version had 0x1F 0xE3 as the first instruction,
whereas the converted ELF file had 0xCF 0xE5.  Looking at the
disassembly of the object file, it seems that this first instruction
is:

  0:   c0 e0           ldi     r28, 0x00       ; 0
                        0: R_AVR_LO8_LDI        __stack

So this implies that the R_AVR_LO8_LDI reloc has not been processed
correctly when creating an ihex output file.  Looking at the code in
elf32-avr.c it seems that none of the relocs in the
elf_avr_howto_table[] are correctly set up.  (They do not check for
overflow, their bitmasks are wrong, etc).

Maybe Denis or Marek, the AVR maintainers, can look into this ?

Cheers
        Nick

PS.  Denis/Marek - Peter's original email is here:

   http://sources.redhat.com/ml/bug-binutils/2003-q2/msg00073.html





reply via email to

[Prev in Thread] Current Thread [Next in Thread]