From 62e8183d33ae159b9e984d2ef5b4a83656d56a16 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sat, 16 Jul 2016 22:59:28 +0200 Subject: 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. --- README.md | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'README.md') 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 -- cgit v1.2.3