Lines Matching full:location

28 	void *location;  member
38 int (*reloc_handler)(struct module *me, void *location, Elf_Addr v);
39 int (*accumulate_handler)(struct module *me, void *location,
56 static int riscv_insn_rmw(void *location, u32 keep, u32 set) in riscv_insn_rmw() argument
58 __le16 *parcel = location; in riscv_insn_rmw()
69 static int riscv_insn_rvc_rmw(void *location, u16 keep, u16 set) in riscv_insn_rvc_rmw() argument
71 __le16 *parcel = location; in riscv_insn_rvc_rmw()
81 static int apply_r_riscv_32_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_32_rela() argument
88 *(u32 *)location = v; in apply_r_riscv_32_rela()
92 static int apply_r_riscv_64_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_64_rela() argument
94 *(u64 *)location = v; in apply_r_riscv_64_rela()
98 static int apply_r_riscv_branch_rela(struct module *me, void *location, in apply_r_riscv_branch_rela() argument
101 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_branch_rela()
107 return riscv_insn_rmw(location, 0x1fff07f, imm12 | imm11 | imm10_5 | imm4_1); in apply_r_riscv_branch_rela()
110 static int apply_r_riscv_jal_rela(struct module *me, void *location, in apply_r_riscv_jal_rela() argument
113 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_jal_rela()
119 return riscv_insn_rmw(location, 0xfff, imm20 | imm19_12 | imm11 | imm10_1); in apply_r_riscv_jal_rela()
122 static int apply_r_riscv_rvc_branch_rela(struct module *me, void *location, in apply_r_riscv_rvc_branch_rela() argument
125 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_rvc_branch_rela()
132 return riscv_insn_rvc_rmw(location, 0xe383, in apply_r_riscv_rvc_branch_rela()
136 static int apply_r_riscv_rvc_jump_rela(struct module *me, void *location, in apply_r_riscv_rvc_jump_rela() argument
139 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_rvc_jump_rela()
149 return riscv_insn_rvc_rmw(location, 0xe003, in apply_r_riscv_rvc_jump_rela()
153 static int apply_r_riscv_pcrel_hi20_rela(struct module *me, void *location, in apply_r_riscv_pcrel_hi20_rela() argument
156 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_pcrel_hi20_rela()
161 me->name, (long long)v, location); in apply_r_riscv_pcrel_hi20_rela()
165 return riscv_insn_rmw(location, 0xfff, (offset + 0x800) & 0xfffff000); in apply_r_riscv_pcrel_hi20_rela()
168 static int apply_r_riscv_pcrel_lo12_i_rela(struct module *me, void *location, in apply_r_riscv_pcrel_lo12_i_rela() argument
175 return riscv_insn_rmw(location, 0xfffff, (v & 0xfff) << 20); in apply_r_riscv_pcrel_lo12_i_rela()
178 static int apply_r_riscv_pcrel_lo12_s_rela(struct module *me, void *location, in apply_r_riscv_pcrel_lo12_s_rela() argument
188 return riscv_insn_rmw(location, 0x1fff07f, imm11_5 | imm4_0); in apply_r_riscv_pcrel_lo12_s_rela()
191 static int apply_r_riscv_hi20_rela(struct module *me, void *location, in apply_r_riscv_hi20_rela() argument
197 me->name, (long long)v, location); in apply_r_riscv_hi20_rela()
201 return riscv_insn_rmw(location, 0xfff, ((s32)v + 0x800) & 0xfffff000); in apply_r_riscv_hi20_rela()
204 static int apply_r_riscv_lo12_i_rela(struct module *me, void *location, in apply_r_riscv_lo12_i_rela() argument
211 return riscv_insn_rmw(location, 0xfffff, (lo12 & 0xfff) << 20); in apply_r_riscv_lo12_i_rela()
214 static int apply_r_riscv_lo12_s_rela(struct module *me, void *location, in apply_r_riscv_lo12_s_rela() argument
223 return riscv_insn_rmw(location, 0x1fff07f, imm11_5 | imm4_0); in apply_r_riscv_lo12_s_rela()
226 static int apply_r_riscv_got_hi20_rela(struct module *me, void *location, in apply_r_riscv_got_hi20_rela() argument
229 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_got_hi20_rela()
233 offset = (void *)module_emit_got_entry(me, v) - location; in apply_r_riscv_got_hi20_rela()
237 me->name, (long long)v, location); in apply_r_riscv_got_hi20_rela()
241 return riscv_insn_rmw(location, 0xfff, (offset + 0x800) & 0xfffff000); in apply_r_riscv_got_hi20_rela()
244 static int apply_r_riscv_call_plt_rela(struct module *me, void *location, in apply_r_riscv_call_plt_rela() argument
247 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_call_plt_rela()
253 offset = (void *)module_emit_plt_entry(me, v) - location; in apply_r_riscv_call_plt_rela()
257 me->name, (long long)v, location); in apply_r_riscv_call_plt_rela()
264 riscv_insn_rmw(location, 0xfff, hi20); in apply_r_riscv_call_plt_rela()
265 return riscv_insn_rmw(location + 4, 0xfffff, lo12 << 20); in apply_r_riscv_call_plt_rela()
268 static int apply_r_riscv_call_rela(struct module *me, void *location, in apply_r_riscv_call_rela() argument
271 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_call_rela()
277 me->name, (long long)v, location); in apply_r_riscv_call_rela()
283 riscv_insn_rmw(location, 0xfff, hi20); in apply_r_riscv_call_rela()
284 return riscv_insn_rmw(location + 4, 0xfffff, lo12 << 20); in apply_r_riscv_call_rela()
287 static int apply_r_riscv_relax_rela(struct module *me, void *location, in apply_r_riscv_relax_rela() argument
293 static int apply_r_riscv_align_rela(struct module *me, void *location, in apply_r_riscv_align_rela() argument
298 me->name, location); in apply_r_riscv_align_rela()
302 static int apply_r_riscv_add8_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_add8_rela() argument
304 *(u8 *)location += (u8)v; in apply_r_riscv_add8_rela()
308 static int apply_r_riscv_add16_rela(struct module *me, void *location, in apply_r_riscv_add16_rela() argument
311 *(u16 *)location += (u16)v; in apply_r_riscv_add16_rela()
315 static int apply_r_riscv_add32_rela(struct module *me, void *location, in apply_r_riscv_add32_rela() argument
318 *(u32 *)location += (u32)v; in apply_r_riscv_add32_rela()
322 static int apply_r_riscv_add64_rela(struct module *me, void *location, in apply_r_riscv_add64_rela() argument
325 *(u64 *)location += (u64)v; in apply_r_riscv_add64_rela()
329 static int apply_r_riscv_sub8_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_sub8_rela() argument
331 *(u8 *)location -= (u8)v; in apply_r_riscv_sub8_rela()
335 static int apply_r_riscv_sub16_rela(struct module *me, void *location, in apply_r_riscv_sub16_rela() argument
338 *(u16 *)location -= (u16)v; in apply_r_riscv_sub16_rela()
342 static int apply_r_riscv_sub32_rela(struct module *me, void *location, in apply_r_riscv_sub32_rela() argument
345 *(u32 *)location -= (u32)v; in apply_r_riscv_sub32_rela()
349 static int apply_r_riscv_sub64_rela(struct module *me, void *location, in apply_r_riscv_sub64_rela() argument
352 *(u64 *)location -= (u64)v; in apply_r_riscv_sub64_rela()
356 static int dynamic_linking_not_supported(struct module *me, void *location, in dynamic_linking_not_supported() argument
360 me->name, location); in dynamic_linking_not_supported()
364 static int tls_not_supported(struct module *me, void *location, Elf_Addr v) in tls_not_supported() argument
367 me->name, location); in tls_not_supported()
371 static int apply_r_riscv_sub6_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_sub6_rela() argument
373 u8 *byte = location; in apply_r_riscv_sub6_rela()
380 static int apply_r_riscv_set6_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_set6_rela() argument
382 u8 *byte = location; in apply_r_riscv_set6_rela()
389 static int apply_r_riscv_set8_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_set8_rela() argument
391 *(u8 *)location = (u8)v; in apply_r_riscv_set8_rela()
395 static int apply_r_riscv_set16_rela(struct module *me, void *location, in apply_r_riscv_set16_rela() argument
398 *(u16 *)location = (u16)v; in apply_r_riscv_set16_rela()
402 static int apply_r_riscv_set32_rela(struct module *me, void *location, in apply_r_riscv_set32_rela() argument
405 *(u32 *)location = (u32)v; in apply_r_riscv_set32_rela()
409 static int apply_r_riscv_32_pcrel_rela(struct module *me, void *location, in apply_r_riscv_32_pcrel_rela() argument
412 *(u32 *)location = v - (uintptr_t)location; in apply_r_riscv_32_pcrel_rela()
416 static int apply_r_riscv_plt32_rela(struct module *me, void *location, in apply_r_riscv_plt32_rela() argument
419 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_plt32_rela()
424 offset = (void *)module_emit_plt_entry(me, v) - location; in apply_r_riscv_plt32_rela()
427 me->name, (long long)v, location); in apply_r_riscv_plt32_rela()
432 *(u32 *)location = (u32)offset; in apply_r_riscv_plt32_rela()
436 static int apply_r_riscv_set_uleb128(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_set_uleb128() argument
438 *(long *)location = v; in apply_r_riscv_set_uleb128()
442 static int apply_r_riscv_sub_uleb128(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_sub_uleb128() argument
444 *(long *)location -= v; in apply_r_riscv_sub_uleb128()
448 static int apply_6_bit_accumulation(struct module *me, void *location, long buffer) in apply_6_bit_accumulation() argument
450 u8 *byte = location; in apply_6_bit_accumulation()
463 static int apply_8_bit_accumulation(struct module *me, void *location, long buffer) in apply_8_bit_accumulation() argument
470 *(u8 *)location = (u8)buffer; in apply_8_bit_accumulation()
474 static int apply_16_bit_accumulation(struct module *me, void *location, long buffer) in apply_16_bit_accumulation() argument
481 *(u16 *)location = (u16)buffer; in apply_16_bit_accumulation()
485 static int apply_32_bit_accumulation(struct module *me, void *location, long buffer) in apply_32_bit_accumulation() argument
492 *(u32 *)location = (u32)buffer; in apply_32_bit_accumulation()
496 static int apply_64_bit_accumulation(struct module *me, void *location, long buffer) in apply_64_bit_accumulation() argument
498 *(u64 *)location = (u64)buffer; in apply_64_bit_accumulation()
502 static int apply_uleb128_accumulation(struct module *me, void *location, long buffer) in apply_uleb128_accumulation() argument
508 u8 *p = location; in apply_uleb128_accumulation()
606 * Each bucket may have more than one relocation location. All in process_accumulated_relocations()
607 * relocations for a location are stored in a list in a bucket. in process_accumulated_relocations()
610 * provided location to check for overflow. This also allows ULEB128 to in process_accumulated_relocations()
612 * location. The final value is stored into location using the handler in process_accumulated_relocations()
617 * - Groups of relocations in each bucket by location address in process_accumulated_relocations()
618 * - Each relocation entry for a location address in process_accumulated_relocations()
627 void *location; in process_accumulated_relocations() local
635 location = rel_head_iter->location; in process_accumulated_relocations()
646 me, location, buffer); in process_accumulated_relocations()
656 void *location, in add_relocation_to_accumulate() argument
676 hash = hash_min((uintptr_t)location, hashtable_bits); in add_relocation_to_accumulate()
682 * provided location in add_relocation_to_accumulate()
688 if (rel_head_iter->location == location) { in add_relocation_to_accumulate()
696 * If there has not yet been any relocations at the provided location, in add_relocation_to_accumulate()
697 * create a relocation_head for that location and populate it with this in add_relocation_to_accumulate()
718 rel_head->location = location; in add_relocation_to_accumulate()
782 int (*handler)(struct module *me, void *location, Elf_Addr v); in apply_relocate_add()
784 void *location; in apply_relocate_add() local
807 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
892 res = add_relocation_to_accumulate(me, type, location, in apply_relocate_add()
897 res = handler(me, location, v); in apply_relocate_add()