Lines Matching +full:- +full:8 +full:g

1 // SPDX-License-Identifier: GPL-2.0-or-later
32 unsigned long r_sym = ELF64_R_SYM (rela->r_info); in process_reloc_for_got()
33 unsigned long r_type = ELF64_R_TYPE (rela->r_info); in process_reloc_for_got()
34 Elf64_Sxword r_addend = rela->r_addend; in process_reloc_for_got()
35 struct got_entry *g; in process_reloc_for_got() local
40 for (g = chains + r_sym; g ; g = g->next) in process_reloc_for_got()
41 if (g->r_addend == r_addend) { in process_reloc_for_got()
42 if (g->got_offset == 0) { in process_reloc_for_got()
43 g->got_offset = *poffset; in process_reloc_for_got()
44 *poffset += 8; in process_reloc_for_got()
49 g = kmalloc (sizeof (*g), GFP_KERNEL); in process_reloc_for_got()
50 g->next = chains[r_sym].next; in process_reloc_for_got()
51 g->r_addend = r_addend; in process_reloc_for_got()
52 g->got_offset = *poffset; in process_reloc_for_got()
53 *poffset += 8; in process_reloc_for_got()
54 chains[r_sym].next = g; in process_reloc_for_got()
58 42 valid relocation types, and a 32-bit field. Co-opt the in process_reloc_for_got()
60 rela->r_info |= g->got_offset << 8; in process_reloc_for_got()
72 esechdrs = sechdrs + hdr->e_shnum; in module_frob_arch_sections()
79 if (s->sh_type == SHT_SYMTAB) in module_frob_arch_sections()
81 else if (!strcmp(".got", secstrings + s->sh_name)) { in module_frob_arch_sections()
83 me->arch.gotsecindex = s - sechdrs; in module_frob_arch_sections()
87 printk(KERN_ERR "module %s: no symbol table\n", me->name); in module_frob_arch_sections()
88 return -ENOEXEC; in module_frob_arch_sections()
91 printk(KERN_ERR "module %s: no got section\n", me->name); in module_frob_arch_sections()
92 return -ENOEXEC; in module_frob_arch_sections()
95 nsyms = symtab->sh_size / sizeof(Elf64_Sym); in module_frob_arch_sections()
100 me->name); in module_frob_arch_sections()
101 return -ENOMEM; in module_frob_arch_sections()
104 got->sh_size = 0; in module_frob_arch_sections()
105 got->sh_addralign = 8; in module_frob_arch_sections()
106 got->sh_type = SHT_NOBITS; in module_frob_arch_sections()
111 if (s->sh_type == SHT_RELA) { in module_frob_arch_sections()
112 nrela = s->sh_size / sizeof(Elf64_Rela); in module_frob_arch_sections()
113 rela = (void *)hdr + s->sh_offset; in module_frob_arch_sections()
116 &got->sh_size); in module_frob_arch_sections()
121 struct got_entry *g, *n; in module_frob_arch_sections() local
122 for (g = chains[i].next; g ; g = n) { in module_frob_arch_sections()
123 n = g->next; in module_frob_arch_sections()
124 kfree(g); in module_frob_arch_sections()
151 gp = (u64)me->core_layout.base + me->core_layout.size - 0x8000; in apply_relocate_add()
152 got = sechdrs[me->arch.gotsecindex].sh_addr; in apply_relocate_add()
157 unsigned long r_got_offset = r_type >> 8; in apply_relocate_add()
167 value = sym->st_value + rela[i].r_addend; in apply_relocate_add()
181 value -= gp; in apply_relocate_add()
188 lo = hi - gp; in apply_relocate_add()
197 value = gp - (u64)location; in apply_relocate_add()
199 hi = (int)(value - lo); in apply_relocate_add()
209 if (sym->st_shndx == SHN_UNDEF) in apply_relocate_add()
211 if ((sym->st_other & STO_ALPHA_STD_GPLOAD) == in apply_relocate_add()
214 value += 8; in apply_relocate_add()
217 value -= (u64)location + 4; in apply_relocate_add()
230 value -= (u64)location; in apply_relocate_add()
236 value -= (u64)location; in apply_relocate_add()
240 value = (long)(value - gp + 0x8000) >> 16; in apply_relocate_add()
246 value -= gp; in apply_relocate_add()
250 value -= gp; in apply_relocate_add()
257 me->name, r_type); in apply_relocate_add()
258 return -ENOEXEC; in apply_relocate_add()
260 if (ELF64_ST_TYPE (sym->st_info) == STT_SECTION) in apply_relocate_add()
263 me->name, r_type, sym->st_shndx); in apply_relocate_add()
267 me->name, r_type, strtab + sym->st_name); in apply_relocate_add()
268 return -ENOEXEC; in apply_relocate_add()