[Top][All Lists]

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

Re: [Bug ld/2378] Incorrect opcode in __do_clear_bss if bss has more tha

From: Nick Clifton
Subject: Re: [Bug ld/2378] Incorrect opcode in __do_clear_bss if bss has more than 15 bytes
Date: Tue, 28 Feb 2006 12:07:50 +0000
User-agent: Mozilla Thunderbird 1.0.7-1.4.1 (X11/20050929)

Hi Ken,

    avr-as a.S -o a.o
    avr-ld -m avr4 -Tdata 0x800100 -o a.elf  a.o
    avr-objdump -d a.elf > a.lst
    avr-ld -m avr4 -Tdata 0x800100 -o a.hex --oformat=ihex  a.o

The list file shows both opcodes correctly, "a0 31".  But in the hex file
the first one is wrong, "B031", while the second one is correct, "A031".

The difference is that avr-ld had to do a relocation for the first one.
Running "avr-objdump -r a.o" shows one record with type R_AVR_LO8_LDI
relocation, value __bss_end.

R_AVR_LO8_LDI is performed in binutils-2.16.1/bfd/elf32-avr.c.  It works
correctly for the default ELF format, but fails for the IHEX format.

This is progress, but I'm still stumped.

It is quite common that LD is unable to correctly translate binary file formats and link at the same time. Quite a few targets suffer from this problem. The simplest workaround is to perform the link first and then use objcopy to perform the binary translation. ie:

  avr-ld -m avr4 -Tdata 0x800100 -o a.elf a.o
  avr-objcopy --output-target ihex a.elf a.ihex


reply via email to

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