]> git.ipfire.org Git - thirdparty/linux.git/blobdiff - tools/objtool/special.c
objtool: Get rid of reloc->addend
[thirdparty/linux.git] / tools / objtool / special.c
index 9c8d827f69afb5840765d3a0d6b410e41b6119f8..91b1950f5bd8a526dc21ae3f09eeae3356324a78 100644 (file)
@@ -26,7 +26,7 @@ struct special_entry {
        unsigned char key; /* jump_label key */
 };
 
-struct special_entry entries[] = {
+static const struct special_entry entries[] = {
        {
                .sec = ".altinstructions",
                .group = true,
@@ -62,10 +62,10 @@ static void reloc_to_sec_off(struct reloc *reloc, struct section **sec,
                             unsigned long *off)
 {
        *sec = reloc->sym->sec;
-       *off = reloc->sym->offset + reloc->addend;
+       *off = reloc->sym->offset + reloc_addend(reloc);
 }
 
-static int get_alt_entry(struct elf *elf, struct special_entry *entry,
+static int get_alt_entry(struct elf *elf, const struct special_entry *entry,
                         struct section *sec, int idx,
                         struct special_alt *alt)
 {
@@ -126,7 +126,7 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry,
                                  sec, offset + entry->key);
                        return -1;
                }
-               alt->key_addend = key_reloc->addend;
+               alt->key_addend = reloc_addend(key_reloc);
        }
 
        return 0;
@@ -139,7 +139,7 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry,
  */
 int special_get_alts(struct elf *elf, struct list_head *alts)
 {
-       struct special_entry *entry;
+       const struct special_entry *entry;
        struct section *sec;
        unsigned int nr_entries;
        struct special_alt *alt;