aboutsummaryrefslogtreecommitdiff
path: root/util/cbfstool/elfparsing.h
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2014-03-05 13:57:30 -0600
committerAaron Durbin <adurbin@google.com>2014-03-14 21:51:14 +0100
commitccb5ad8d3c8eeb992c2ede12c24c5fabc36aad95 (patch)
tree9321674076c71728896117c66fd90accb19d78a8 /util/cbfstool/elfparsing.h
parentd0f61659238c3ed79fecf841c58cabedbf936ac8 (diff)
cbfstool: add relocation parsing to ELF parser
Optionally parse the relocation entries found within an ELF file. Change-Id: I343647f104901eb8a6a997ddf44aa5d36c31b44b Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/5374 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.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/util/cbfstool/elfparsing.h b/util/cbfstool/elfparsing.h
index 4ad46b3928..2827748c06 100644
--- a/util/cbfstool/elfparsing.h
+++ b/util/cbfstool/elfparsing.h
@@ -26,10 +26,20 @@ struct parsed_elf {
Elf64_Ehdr ehdr;
Elf64_Phdr *phdr;
Elf64_Shdr *shdr;
+ /*
+ * The relocs array contains pointers to arrays of relocation
+ * structures. Each index into the relocs array corresponds to its
+ * corresponding section index. i.e. if a section i is of type SHT_REL
+ * or SHT_RELA then the corresponding index into the relocs array will
+ * contain the associated relocations. Otherwise thee entry will be
+ * NULL.
+ */
+ Elf64_Rela **relocs;
};
#define ELF_PARSE_PHDR (1 << 0)
#define ELF_PARSE_SHDR (1 << 1)
+#define ELF_PARSE_RELOC (1 << 2)
#define ELF_PARSE_ALL (-1)