]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/blobdiff - tools/objtool/include/objtool/elf.h
x86,objtool: Create .return_sites
[mirror_ubuntu-jammy-kernel.git] / tools / objtool / include / objtool / elf.h
index 45e5ede363b07a1d684c40520d9a16913bba2e39..6cdfa401b00092a5bd0574bc793f71487afea8df 100644 (file)
@@ -38,7 +38,6 @@ struct section {
        Elf_Data *data;
        char *name;
        int idx;
-       unsigned int len;
        bool changed, text, rodata, noinstr;
 };
 
@@ -55,8 +54,12 @@ struct symbol {
        unsigned long offset;
        unsigned int len;
        struct symbol *pfunc, *cfunc, *alias;
-       bool uaccess_safe;
-       bool static_call_tramp;
+       u8 uaccess_safe      : 1;
+       u8 static_call_tramp : 1;
+       u8 retpoline_thunk   : 1;
+       u8 return_thunk      : 1;
+       u8 fentry            : 1;
+       u8 kcov              : 1;
 };
 
 struct reloc {
@@ -70,7 +73,7 @@ struct reloc {
        struct symbol *sym;
        unsigned long offset;
        unsigned int type;
-       int addend;
+       s64 addend;
        int idx;
        bool jump_table_start;
 };
@@ -83,12 +86,20 @@ struct elf {
        int fd;
        bool changed;
        char *name;
+       unsigned int text_size;
        struct list_head sections;
-       DECLARE_HASHTABLE(symbol_hash, ELF_HASH_BITS);
-       DECLARE_HASHTABLE(symbol_name_hash, ELF_HASH_BITS);
-       DECLARE_HASHTABLE(section_hash, ELF_HASH_BITS);
-       DECLARE_HASHTABLE(section_name_hash, ELF_HASH_BITS);
-       DECLARE_HASHTABLE(reloc_hash, ELF_HASH_BITS);
+
+       int symbol_bits;
+       int symbol_name_bits;
+       int section_bits;
+       int section_name_bits;
+       int reloc_bits;
+
+       struct hlist_head *symbol_hash;
+       struct hlist_head *symbol_name_hash;
+       struct hlist_head *section_hash;
+       struct hlist_head *section_name_hash;
+       struct hlist_head *reloc_hash;
 };
 
 #define OFFSET_STRIDE_BITS     4
@@ -124,7 +135,7 @@ 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);
 
 int elf_add_reloc(struct elf *elf, struct section *sec, unsigned long offset,
-                 unsigned int type, struct symbol *sym, int addend);
+                 unsigned int type, struct symbol *sym, s64 addend);
 int elf_add_reloc_to_insn(struct elf *elf, struct section *sec,
                          unsigned long offset, unsigned int type,
                          struct section *insn_sec, unsigned long insn_off);
@@ -133,7 +144,6 @@ int elf_write_insn(struct elf *elf, struct section *sec,
                   unsigned long offset, unsigned int len,
                   const char *insn);
 int elf_write_reloc(struct elf *elf, struct reloc *reloc);
-struct symbol *elf_create_undef_symbol(struct elf *elf, const char *name);
 int elf_write(struct elf *elf);
 void elf_close(struct elf *elf);