diff options
author | Matt Helsley <mhelsley@vmware.com> | 2020-05-29 14:01:14 -0700 |
---|---|---|
committer | Josh Poimboeuf <jpoimboe@redhat.com> | 2020-06-02 15:37:04 -0500 |
commit | fb414783b65c880606fbc1463e6849f017e60d46 (patch) | |
tree | 4ef03afe48b53750973bafe70a2f608534cd9647 /tools/objtool/elf.h | |
parent | f1974222634010486c1692e843af0ab11304dd2c (diff) | |
download | linux-fb414783b65c880606fbc1463e6849f017e60d46.tar.gz |
objtool: Add support for relocations without addends
Currently objtool only collects information about relocations with
addends. In recordmcount, which we are about to merge into objtool,
some supported architectures do not use rela relocations.
Signed-off-by: Matt Helsley <mhelsley@vmware.com>
Reviewed-by: Julien Thierry <jthierry@redhat.com>
Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Diffstat (limited to 'tools/objtool/elf.h')
-rw-r--r-- | tools/objtool/elf.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/objtool/elf.h b/tools/objtool/elf.h index 6ad759fd778e..78a2db23b8b6 100644 --- a/tools/objtool/elf.h +++ b/tools/objtool/elf.h @@ -61,7 +61,10 @@ struct symbol { struct reloc { struct list_head list; struct hlist_node hash; - GElf_Rela rela; + union { + GElf_Rela rela; + GElf_Rel rel; + }; struct section *sec; struct symbol *sym; unsigned int type; @@ -116,7 +119,7 @@ static inline u32 reloc_hash(struct reloc *reloc) struct elf *elf_open_read(const char *name, int flags); struct section *elf_create_section(struct elf *elf, const char *name, size_t entsize, int nr); -struct section *elf_create_reloc_section(struct elf *elf, struct section *base); +struct section *elf_create_reloc_section(struct elf *elf, struct section *base, int reltype); void elf_add_reloc(struct elf *elf, struct reloc *reloc); int elf_write(const struct elf *elf); void elf_close(struct elf *elf); |