summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-06-16 17:53:26 +0000
committerRui Ueyama <ruiu@google.com>2017-06-16 17:53:26 +0000
commitc9fefaac676c33d4f3fa0acc061abbda9e0781e6 (patch)
tree621248e0217516392fd6cd4a1f69abb35aa606b6
parent35530d71296c63916e6bbdb347e87459535f9df4 (diff)
downloadbcm5719-llvm-c9fefaac676c33d4f3fa0acc061abbda9e0781e6.tar.gz
bcm5719-llvm-c9fefaac676c33d4f3fa0acc061abbda9e0781e6.zip
Add comments for AVR support.
AVR support is somewhat exotic as generated ELF executables are not directly consumed but objcopy'ed to write it to on-chip flush memory. This comment describes it for those why a full-fledged ELF linker is used to link programs for the 8-bit microcontroller. llvm-svn: 305567
-rw-r--r--lld/ELF/Arch/AVR.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/lld/ELF/Arch/AVR.cpp b/lld/ELF/Arch/AVR.cpp
index ebc7616e0b3..86343a6faa1 100644
--- a/lld/ELF/Arch/AVR.cpp
+++ b/lld/ELF/Arch/AVR.cpp
@@ -6,6 +6,25 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+//
+// AVR is a Harvard-architecture 8-bit micrcontroller designed for small
+// baremetal programs. All AVR-family processors have 32 8-bit registers.
+// The tiniest AVR has 32 byte RAM and 1 KiB program memory, and the largest
+// one supports up to 2^24 data address space and 2^22 code address space.
+//
+// Since it is a baremetal programming, there's usually no loader to load
+// ELF files on AVRs. You are expected to link your program against address
+// 0 and pull out a .text section from the result using objcopy, so that you
+// can write the linked code to on-chip flush memory. You can do that with
+// the following commands:
+//
+// ld.lld -Ttext=0 -o foo foo.o
+// objcopy -O binary --only-section=.text foo output.bin
+//
+// Note that the current AVR support is very preliminary so you can't
+// link any useful program yet, though.
+//
+//===----------------------------------------------------------------------===//
#include "Error.h"
#include "InputFiles.h"
OpenPOWER on IntegriCloud