[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/2378] Incorrect opcode in __do_clear_bss if bss has more than 15
nickc at redhat dot com
[Bug ld/2378] Incorrect opcode in __do_clear_bss if bss has more than 15 bytes
28 Feb 2006 11:57:50 -0000
------- Additional Comments From nickc at redhat dot com 2006-02-28 11:57
Subject: Re: Incorrect opcode in __do_clear_bss if bss has more
than 15 bytes
> 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
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug ld/2378] Incorrect opcode in __do_clear_bss if bss has more than 15 bytes,
nickc at redhat dot com <=