aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md27
1 files changed, 26 insertions, 1 deletions
diff --git a/README.md b/README.md
index 6744d1e..948b01e 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,30 @@
# elfinfo - Extract info from ELF files
+Elfinfo shows you some nice stats about your ELF file, useful for microcontroller binaries if you want to keep an eye
+on how much flash and data you're using.
+
+Given this LD script (only significant parts shown, the rest is ignored):
+
+ MEMORY
+ {
+ flash(r) : ORIGIN = 0x00180000, LENGTH = 32K
+ data(rw) : ORIGIN = 0x00200000, LENGTH = 4K
+ /* Place IDT at the bottom of SRAM, 52 gate wide */
+ esram_idt (rw) : ORIGIN = 0x00280000, LENGTH = 0x1A0
+ esram(rw) : ORIGIN = 0x002801A0, LENGTH = 8K - 1K - 0x1A0
+ stack(rw) : ORIGIN = 0x00281C00, LENGTH = 1K
+ }
+
+this is a possible output:
+
+ Memory areas
+ Name Flags Start End Size Used
+ flash --- 00180000 00188000 32k 28%
+ data --- 00200000 00201000 4k 0%
+ esram_idt --- 00280000 002801a0 416 0%
+ esram --- 002801a0 00281c00 6k 3%
+ stack --- 00281c00 00282000 1k 0%
+
# Building
This code currently depend on experimental patches for Antlr4's C++ runtime which has to be build first. This should
@@ -18,6 +43,6 @@ This will build and install Antlr4 into $HOME/opt/antlr-cpp.
To build this code follow a similar approach:
mkdir build
- cmake .. -DAntlr4_DIR=$HOME/opt/antlr-cpp/lib/cmake/Antlr4
+ cmake .. -DAntlr4_DIR=$HOME/opt/antlr-cpp/lib/cmake/Antlr4 -DCMAKE_INSTALL_PREFIX=$HOME/opt/elfinfo
make
make install