Lines Matching full:location
27 void *location; member
37 int (*reloc_handler)(struct module *me, void *location, Elf_Addr v);
38 int (*accumulate_handler)(struct module *me, void *location,
55 static int riscv_insn_rmw(void *location, u32 keep, u32 set) in riscv_insn_rmw() argument
57 __le16 *parcel = location; in riscv_insn_rmw()
68 static int riscv_insn_rvc_rmw(void *location, u16 keep, u16 set) in riscv_insn_rvc_rmw() argument
70 __le16 *parcel = location; in riscv_insn_rvc_rmw()
80 static int apply_r_riscv_32_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_32_rela() argument
87 *(u32 *)location = v; in apply_r_riscv_32_rela()
91 static int apply_r_riscv_64_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_64_rela() argument
93 *(u64 *)location = v; in apply_r_riscv_64_rela()
97 static int apply_r_riscv_branch_rela(struct module *me, void *location, in apply_r_riscv_branch_rela() argument
100 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_branch_rela()
106 return riscv_insn_rmw(location, 0x1fff07f, imm12 | imm11 | imm10_5 | imm4_1); in apply_r_riscv_branch_rela()
109 static int apply_r_riscv_jal_rela(struct module *me, void *location, in apply_r_riscv_jal_rela() argument
112 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_jal_rela()
118 return riscv_insn_rmw(location, 0xfff, imm20 | imm19_12 | imm11 | imm10_1); in apply_r_riscv_jal_rela()
121 static int apply_r_riscv_rvc_branch_rela(struct module *me, void *location, in apply_r_riscv_rvc_branch_rela() argument
124 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_rvc_branch_rela()
131 return riscv_insn_rvc_rmw(location, 0xe383, in apply_r_riscv_rvc_branch_rela()
135 static int apply_r_riscv_rvc_jump_rela(struct module *me, void *location, in apply_r_riscv_rvc_jump_rela() argument
138 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_rvc_jump_rela()
148 return riscv_insn_rvc_rmw(location, 0xe003, in apply_r_riscv_rvc_jump_rela()
152 static int apply_r_riscv_pcrel_hi20_rela(struct module *me, void *location, in apply_r_riscv_pcrel_hi20_rela() argument
155 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_pcrel_hi20_rela()
160 me->name, (long long)v, location); in apply_r_riscv_pcrel_hi20_rela()
164 return riscv_insn_rmw(location, 0xfff, (offset + 0x800) & 0xfffff000); in apply_r_riscv_pcrel_hi20_rela()
167 static int apply_r_riscv_pcrel_lo12_i_rela(struct module *me, void *location, in apply_r_riscv_pcrel_lo12_i_rela() argument
174 return riscv_insn_rmw(location, 0xfffff, (v & 0xfff) << 20); in apply_r_riscv_pcrel_lo12_i_rela()
177 static int apply_r_riscv_pcrel_lo12_s_rela(struct module *me, void *location, in apply_r_riscv_pcrel_lo12_s_rela() argument
187 return riscv_insn_rmw(location, 0x1fff07f, imm11_5 | imm4_0); in apply_r_riscv_pcrel_lo12_s_rela()
190 static int apply_r_riscv_hi20_rela(struct module *me, void *location, in apply_r_riscv_hi20_rela() argument
196 me->name, (long long)v, location); in apply_r_riscv_hi20_rela()
200 return riscv_insn_rmw(location, 0xfff, ((s32)v + 0x800) & 0xfffff000); in apply_r_riscv_hi20_rela()
203 static int apply_r_riscv_lo12_i_rela(struct module *me, void *location, in apply_r_riscv_lo12_i_rela() argument
210 return riscv_insn_rmw(location, 0xfffff, (lo12 & 0xfff) << 20); in apply_r_riscv_lo12_i_rela()
213 static int apply_r_riscv_lo12_s_rela(struct module *me, void *location, in apply_r_riscv_lo12_s_rela() argument
222 return riscv_insn_rmw(location, 0x1fff07f, imm11_5 | imm4_0); in apply_r_riscv_lo12_s_rela()
225 static int apply_r_riscv_got_hi20_rela(struct module *me, void *location, in apply_r_riscv_got_hi20_rela() argument
228 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_got_hi20_rela()
232 offset = (void *)module_emit_got_entry(me, v) - location; in apply_r_riscv_got_hi20_rela()
236 me->name, (long long)v, location); in apply_r_riscv_got_hi20_rela()
240 return riscv_insn_rmw(location, 0xfff, (offset + 0x800) & 0xfffff000); in apply_r_riscv_got_hi20_rela()
243 static int apply_r_riscv_call_plt_rela(struct module *me, void *location, in apply_r_riscv_call_plt_rela() argument
246 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_call_plt_rela()
252 offset = (void *)module_emit_plt_entry(me, v) - location; in apply_r_riscv_call_plt_rela()
256 me->name, (long long)v, location); in apply_r_riscv_call_plt_rela()
263 riscv_insn_rmw(location, 0xfff, hi20); in apply_r_riscv_call_plt_rela()
264 return riscv_insn_rmw(location + 4, 0xfffff, lo12 << 20); in apply_r_riscv_call_plt_rela()
267 static int apply_r_riscv_call_rela(struct module *me, void *location, in apply_r_riscv_call_rela() argument
270 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_call_rela()
276 me->name, (long long)v, location); in apply_r_riscv_call_rela()
282 riscv_insn_rmw(location, 0xfff, hi20); in apply_r_riscv_call_rela()
283 return riscv_insn_rmw(location + 4, 0xfffff, lo12 << 20); in apply_r_riscv_call_rela()
286 static int apply_r_riscv_relax_rela(struct module *me, void *location, in apply_r_riscv_relax_rela() argument
292 static int apply_r_riscv_align_rela(struct module *me, void *location, in apply_r_riscv_align_rela() argument
297 me->name, location); in apply_r_riscv_align_rela()
301 static int apply_r_riscv_add8_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_add8_rela() argument
303 *(u8 *)location += (u8)v; in apply_r_riscv_add8_rela()
307 static int apply_r_riscv_add16_rela(struct module *me, void *location, in apply_r_riscv_add16_rela() argument
310 *(u16 *)location += (u16)v; in apply_r_riscv_add16_rela()
314 static int apply_r_riscv_add32_rela(struct module *me, void *location, in apply_r_riscv_add32_rela() argument
317 *(u32 *)location += (u32)v; in apply_r_riscv_add32_rela()
321 static int apply_r_riscv_add64_rela(struct module *me, void *location, in apply_r_riscv_add64_rela() argument
324 *(u64 *)location += (u64)v; in apply_r_riscv_add64_rela()
328 static int apply_r_riscv_sub8_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_sub8_rela() argument
330 *(u8 *)location -= (u8)v; in apply_r_riscv_sub8_rela()
334 static int apply_r_riscv_sub16_rela(struct module *me, void *location, in apply_r_riscv_sub16_rela() argument
337 *(u16 *)location -= (u16)v; in apply_r_riscv_sub16_rela()
341 static int apply_r_riscv_sub32_rela(struct module *me, void *location, in apply_r_riscv_sub32_rela() argument
344 *(u32 *)location -= (u32)v; in apply_r_riscv_sub32_rela()
348 static int apply_r_riscv_sub64_rela(struct module *me, void *location, in apply_r_riscv_sub64_rela() argument
351 *(u64 *)location -= (u64)v; in apply_r_riscv_sub64_rela()
355 static int dynamic_linking_not_supported(struct module *me, void *location, in dynamic_linking_not_supported() argument
359 me->name, location); in dynamic_linking_not_supported()
363 static int tls_not_supported(struct module *me, void *location, Elf_Addr v) in tls_not_supported() argument
366 me->name, location); in tls_not_supported()
370 static int apply_r_riscv_sub6_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_sub6_rela() argument
372 u8 *byte = location; in apply_r_riscv_sub6_rela()
379 static int apply_r_riscv_set6_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_set6_rela() argument
381 u8 *byte = location; in apply_r_riscv_set6_rela()
388 static int apply_r_riscv_set8_rela(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_set8_rela() argument
390 *(u8 *)location = (u8)v; in apply_r_riscv_set8_rela()
394 static int apply_r_riscv_set16_rela(struct module *me, void *location, in apply_r_riscv_set16_rela() argument
397 *(u16 *)location = (u16)v; in apply_r_riscv_set16_rela()
401 static int apply_r_riscv_set32_rela(struct module *me, void *location, in apply_r_riscv_set32_rela() argument
404 *(u32 *)location = (u32)v; in apply_r_riscv_set32_rela()
408 static int apply_r_riscv_32_pcrel_rela(struct module *me, void *location, in apply_r_riscv_32_pcrel_rela() argument
411 *(u32 *)location = v - (uintptr_t)location; in apply_r_riscv_32_pcrel_rela()
415 static int apply_r_riscv_plt32_rela(struct module *me, void *location, in apply_r_riscv_plt32_rela() argument
418 ptrdiff_t offset = (void *)v - location; in apply_r_riscv_plt32_rela()
423 offset = (void *)module_emit_plt_entry(me, v) - location; in apply_r_riscv_plt32_rela()
426 me->name, (long long)v, location); in apply_r_riscv_plt32_rela()
431 *(u32 *)location = (u32)offset; in apply_r_riscv_plt32_rela()
435 static int apply_r_riscv_set_uleb128(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_set_uleb128() argument
437 *(long *)location = v; in apply_r_riscv_set_uleb128()
441 static int apply_r_riscv_sub_uleb128(struct module *me, void *location, Elf_Addr v) in apply_r_riscv_sub_uleb128() argument
443 *(long *)location -= v; in apply_r_riscv_sub_uleb128()
447 static int apply_6_bit_accumulation(struct module *me, void *location, long buffer) in apply_6_bit_accumulation() argument
449 u8 *byte = location; in apply_6_bit_accumulation()
462 static int apply_8_bit_accumulation(struct module *me, void *location, long buffer) in apply_8_bit_accumulation() argument
469 *(u8 *)location = (u8)buffer; in apply_8_bit_accumulation()
473 static int apply_16_bit_accumulation(struct module *me, void *location, long buffer) in apply_16_bit_accumulation() argument
480 *(u16 *)location = (u16)buffer; in apply_16_bit_accumulation()
484 static int apply_32_bit_accumulation(struct module *me, void *location, long buffer) in apply_32_bit_accumulation() argument
491 *(u32 *)location = (u32)buffer; in apply_32_bit_accumulation()
495 static int apply_64_bit_accumulation(struct module *me, void *location, long buffer) in apply_64_bit_accumulation() argument
497 *(u64 *)location = (u64)buffer; in apply_64_bit_accumulation()
501 static int apply_uleb128_accumulation(struct module *me, void *location, long buffer) in apply_uleb128_accumulation() argument
507 u8 *p = location; in apply_uleb128_accumulation()
605 * Each bucket may have more than one relocation location. All in process_accumulated_relocations()
606 * relocations for a location are stored in a list in a bucket. in process_accumulated_relocations()
609 * provided location to check for overflow. This also allows ULEB128 to in process_accumulated_relocations()
611 * location. The final value is stored into location using the handler in process_accumulated_relocations()
616 * - Groups of relocations in each bucket by location address in process_accumulated_relocations()
617 * - Each relocation entry for a location address in process_accumulated_relocations()
626 void *location; in process_accumulated_relocations() local
634 location = rel_head_iter->location; in process_accumulated_relocations()
645 me, location, buffer); in process_accumulated_relocations()
655 void *location, in add_relocation_to_accumulate() argument
675 hash = hash_min((uintptr_t)location, hashtable_bits); in add_relocation_to_accumulate()
681 * provided location in add_relocation_to_accumulate()
687 if (rel_head_iter->location == location) { in add_relocation_to_accumulate()
695 * If there has not yet been any relocations at the provided location, in add_relocation_to_accumulate()
696 * create a relocation_head for that location and populate it with this in add_relocation_to_accumulate()
717 rel_head->location = location; in add_relocation_to_accumulate()
781 int (*handler)(struct module *me, void *location, Elf_Addr v); in apply_relocate_add()
783 void *location; in apply_relocate_add() local
804 location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr in apply_relocate_add()
889 res = add_relocation_to_accumulate(me, type, location, in apply_relocate_add()
894 res = handler(me, location, v); in apply_relocate_add()