aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2016-07-16 22:59:28 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2016-07-16 22:59:28 +0200
commit62e8183d33ae159b9e984d2ef5b4a83656d56a16 (patch)
tree49eda06698ad2a11ad661386e6b1524a4ec11aba /README.md
parent4675ec55f6bdb8f826cc94a9585ff9229c277983 (diff)
downloadelfinfo-62e8183d33ae159b9e984d2ef5b4a83656d56a16.tar.gz
elfinfo-62e8183d33ae159b9e984d2ef5b4a83656d56a16.tar.bz2
elfinfo-62e8183d33ae159b9e984d2ef5b4a83656d56a16.tar.xz
elfinfo-62e8183d33ae159b9e984d2ef5b4a83656d56a16.zip
o Working version that can take the data from the LD script. Only tested with the Intel Quark D2000 LD script.
lexer: Allowing capital X in hex numbers too.
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