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

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 23:08:34 PDT 2017


ruiu added a comment.

Leslie,

The new ELF linker is completely different from the old one, and the new one is by far simpler than before. It should be much much easier to add a new architecture to the linker. So, in many cases it doesn't make sense or irrelevant to try to find a mapping from the old linker infrastructure to the new one to figure out what to do. Most boilerplates are no longer needed, and you can't find any correlation between old and new code in many situations. Rather, you want to read Target.cpp of the new LLD to understand how each target is handled and mimic other architectures.

What you are doing in this patch seems correct. Good work!

I believe with this change, you can actually link an executable as long as input object files contain nothing other than R_AVR_32 relocations. Did you try that? If not, please try. If it doesn't work, why? You want to create a new feature incrementally, and attempting to create an executable at this moment is a solid step towards a goal.

(By the way, you are saying that I'm a mentor. Are you a GSoC participant? I'm just wondering.)



================
Comment at: include/lld/Core/Reference.h:55
   // Which architecture the kind value is for.
-  enum class KindArch { all, AArch64, ARM, x86, x86_64};
+  enum class KindArch { all, AArch64, ARM, AVR, x86, x86_64};
 
----------------
Revert this change -- this is not used by the ELF linker anymore. Basically you don't need to edit no files outside lld/ELF directory.


Repository:
  rL LLVM

https://reviews.llvm.org/D32991





More information about the llvm-commits mailing list