From ccb5ad8d3c8eeb992c2ede12c24c5fabc36aad95 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Wed, 5 Mar 2014 13:57:30 -0600 Subject: 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 Reviewed-on: http://review.coreboot.org/5374 Tested-by: build bot (Jenkins) Reviewed-by: Marc Jones --- util/cbfstool/elfparsing.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'util/cbfstool/elfparsing.h') 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) -- cgit v1.2.3