[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/2539] avr-as generates wrong opcode for call/jmp with lables
From: |
nickc at redhat dot com |
Subject: |
[Bug gas/2539] avr-as generates wrong opcode for call/jmp with lables |
Date: |
13 Apr 2006 09:15:39 -0000 |
------- Additional Comments From nickc at redhat dot com 2006-04-13 09:15
-------
Hi Mack,
This is not a bug, but a feature. The AVR assembler has chosen to use a reloc
with the JMP instruction, so the actual address is not resolved until link time.
If you disassemble the object file with -Dr instead of -D you will see:
00000000 <main-0x46>:
0: 0c 94 00 00 jmp 0 ; 0x0 <main-0x46>
0: R_AVR_CALL .text+0x46
etc. The reason for this is that the JMP instruction takes an absolute address
as its operand, and this address cannot be known until the linker has assigned a
location to the .text section.
The RJMP and RCALL instructions on the other hand take PC-relative operands, so
their values can be computed by the assembler at assembly time. Hence these two
instructions do not generate relocs.
Cheers
Nick
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
http://sourceware.org/bugzilla/show_bug.cgi?id=2539
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.