Hi LLVM developers,
According to http://www.atmel.com/images/Atmel-0856-AVR-Instruction-Set-Manual.pdf
1 1 1 0 K K K K d d d d K K K K LDI Rd,K
basic-avr.o was generated by avr-gcc:
$ avr-gcc -mmcu=atmega328p -o basic-avr.o -c basic-avr.s
then link with avr-ld
$ avr-objdump -d basic-avr-avr-ld basic-avr-avr-ld: file format elf32-avr Disassembly of section .text: 00000000 <__ctors_end>: 0: 0e 94 05 00 call 0xa ; 0xa <foo> 4: 1a e0 ldi r17, 0x0A ; 10 6: 20 e0 ldi r18, 0x00 ; 0 8: 3a e0 ldi r19, 0x0A ; 10 0000000a <foo>: a: 0c 94 05 00 jmp 0xa ; 0xa <foo> 0000000e <bar>: e: 0e 94 05 00 call 0xa ; 0xa <foo>
is same with LLD:
$ avr-objdump -d basic-avr-lld basic-avr-lld: file format elf32-avr Disassembly of section .text: 00000000 <main>: 0: 0e 94 05 00 call 0xa ; 0xa <foo> 4: 1a e0 ldi r17, 0x0A ; 10 6: 20 e0 ldi r18, 0x00 ; 0 8: 3a e0 ldi r19, 0x0A ; 10 0000000a <foo>: a: 0c 94 05 00 jmp 0xa ; 0xa <foo> 0000000e <bar>: e: 0e 94 05 00 call 0xa ; 0xa <foo>
please review my patch, thanks a lot!
PS: do I need to override getImplicitAddend for R_PC type relocation, for example: R_AVR_7_PCREL?
Regards,
Leslie Zhai
s/caculate/calculate