Merge tag 'powerpc-6.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[linux-block.git] / tools / objtool / include / objtool / elf.h
index bca719b2104b8a958395b0c2766755b966a53f1e..bb60fd42b46f48553eb9013d0e5e9477717f6fac 100644 (file)
@@ -145,6 +145,14 @@ static inline bool has_multiple_files(struct elf *elf)
        return elf->num_files > 1;
 }
 
+static inline int elf_class_addrsize(struct elf *elf)
+{
+       if (elf->ehdr.e_ident[EI_CLASS] == ELFCLASS32)
+               return sizeof(u32);
+       else
+               return sizeof(u64);
+}
+
 struct elf *elf_open_read(const char *name, int flags);
 struct section *elf_create_section(struct elf *elf, const char *name, unsigned int sh_flags, size_t entsize, int nr);