summaryrefslogtreecommitdiff
path: root/util/cbfstool/elfparsing.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2014-03-05 14:33:42 -0600
committerAaron Durbin <adurbin@google.com>2014-03-14 21:51:27 +0100
commitc3e6e14a1227421c3e520a2a62f279bc4408ee3a (patch)
tree3da1ee27bd55664c89f4a5113a08b239b56076c8 /util/cbfstool/elfparsing.h
parentccb5ad8d3c8eeb992c2ede12c24c5fabc36aad95 (diff)
cbfstool: add string table parsing to ELF parser
Optionally parse the string tables within an ELF file. Change-Id: I89f9da50b4fcf1fed7ac44f00c60b495c35555ef Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5375 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones <marc.jones@se-eng.com>
Diffstat (limited to 'util/cbfstool/elfparsing.h')
-rw-r--r--util/cbfstool/elfparsing.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/util/cbfstool/elfparsing.h b/util/cbfstool/elfparsing.h
index 2827748c06..9107c21007 100644
--- a/util/cbfstool/elfparsing.h
+++ b/util/cbfstool/elfparsing.h
@@ -19,8 +19,7 @@
#define ELFPARSING_H
#include "elf.h"
-
-struct buffer;
+#include "common.h"
struct parsed_elf {
Elf64_Ehdr ehdr;
@@ -35,11 +34,19 @@ struct parsed_elf {
* NULL.
*/
Elf64_Rela **relocs;
+ /*
+ * Similarly to the relocs array the strtabs array consists of an
+ * array of pointers where each entry represents a potential struct
+ * buffer pointer. Only setions of type SHT_STRTAB will have a non-NULL
+ * entry.
+ */
+ struct buffer **strtabs;
};
#define ELF_PARSE_PHDR (1 << 0)
#define ELF_PARSE_SHDR (1 << 1)
#define ELF_PARSE_RELOC (1 << 2)
+#define ELF_PARSE_STRTAB (1 << 3)
#define ELF_PARSE_ALL (-1)