[PATCH] D32991: [ELF] Initial migration of AVR target

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 10:32:10 PDT 2017


ruiu added a comment.

As to builtin functions for AVR that GCC has but Clang doesn't, you might want to add that to Clang, but that is not directly related to LLD. So I'll defer that question to someone more familiar with Clang. If you need to use GCC to generate object files to test LLD, just use GCC.



================
Comment at: ELF/InputFiles.cpp:806-807
     return EM_X86_64;
+  case Triple::avr:
+    return EM_AVR;
   default:
----------------
Move above `Triple::mips`.


================
Comment at: ELF/Target.cpp:2049-2050
+  switch (Type) {
+  default:
+    return R_ABS;
+  }
----------------
Return R_ABS only for R_AVR_32 and report an error for any other relocation for now, as you are not actually handling anything other than R_AVR_32.

See X86_64TargetInfo<ELFT>::getRelExp.


================
Comment at: ELF/Target.cpp:2070-2071
+    break;
+  case R_AVR_CALL:
+    break;
+  default:
----------------
It doesn't seem correct. If you are not handling R_AVR_CALL now, please remove. If you want, please add actual code to handle R_AVR_CALL.


================
Comment at: test/ELF/basic-avr.s:1
+# RUN: llvm-mc -filetype=obj -triple=avr-unknown-linux %s -o %t1.o
+# RUN: ld.lld %t1.o -o %t.exe
----------------
This assembly file doesn't contain anything other than comment. Add at least one instruction like this.

  main:
    jmp main


================
Comment at: test/ELF/basic-avr.s:4-5
+# RUN: llvm-objdump -d %t.exe | FileCheck %s
+# RUN: llvm-readobj -file-headers -sections -program-headers -symbols %t.exe \
+# RUN:   | FileCheck %s
+
----------------
I don't think you need this. Just check the output of objdump -d.


================
Comment at: test/ELF/basic-avr.s:7
+
+# REQUIRES: avr
+
----------------
Move this to beginning of this file.


================
Comment at: test/ELF/basic-avr.s:12
+#CHECK-NEXT:   11000:       08 95   ret
+#
+#CHECK-NEXT: loop:
----------------
Remove



================
Comment at: test/ELF/basic-avr.s:15
+#CHECK-NEXT:   11002:       08 95   ret
+#
+#CHECK-NEXT: main:
----------------
Remove


Repository:
  rL LLVM

https://reviews.llvm.org/D32991





More information about the llvm-commits mailing list