[PATCH] D78741: [LLD][ELF][AVR] Implement the missing relocation types

Ayke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 11 09:56:05 PDT 2020


aykevl marked 3 inline comments as done.
aykevl added inline comments.


================
Comment at: lld/test/ELF/avr-reloc.s:4
+# RUN: ld.lld %t.o --defsym=a=0x12345678 --defsym=b=30 -o %t
+# RUN: llvm-objdump -d %t | FileCheck %s
+# RUN: llvm-objdump -s %t | FileCheck --check-prefix=HEX %s
----------------
MaskRay wrote:
> You may want `--print-imm-hex` to print immediates in hexadecimal.
I tried, but it doesn't seem to make a difference in the output. However I agree the assembly would be easier to read if it were hexadecimal (because of the hexadecimal input).


================
Comment at: lld/test/ELF/avr-reloc.s:17
+# CHECK-NEXT:  ldi     r20, 255
+ldi r20, lo8(a)
+ldi r20, hi8(a)
----------------
MaskRay wrote:
> Might be worth adding comments about the exact relocation type used, e.g.
> 
> `ldi r20, lo8(a)  # R_AVR_LO8_LDI...`
Good idea, I'll change this.


================
Comment at: lld/test/ELF/avr-reloc.s:80
+# HEX-LABEL: section .DATA:
+# HEX-NEXT:  1e1e000f 00785634 12
+.byte b
----------------
MaskRay wrote:
> `{{.*}} 1e1e000f 00785634 12`
> 
> The address of .DATA is insignificant and should be omitted.
What do you mean? The address is not included in the test.

This is the full output:

```
Contents of section .DATA:
 110e4 1e1e000f 00785634 12                 .....xV4.
```

I believe `110e4` is the address (not included in the test) while `1e1e000f 00785634 12` is the contents of the section (in hex).

Or do you mean I should check for the presence of an address using `{{.*}}`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78741/new/

https://reviews.llvm.org/D78741





More information about the llvm-commits mailing list