Lines Matching +full:mod +full:- +full:12 +full:b

1 // SPDX-License-Identifier: GPL-2.0-only
40 return val - (u64)place; in do_reloc()
42 return (val & ~0xfff) - ((u64)place & ~0xfff); in do_reloc()
56 * The ELF psABI for AArch64 documents the 16-bit and 32-bit place in reloc_data()
57 * relative and absolute relocations as having a range of [-2^15, 2^16) in reloc_data()
58 * or [-2^31, 2^32), respectively. However, in order to be able to in reloc_data()
62 * interpretation of 32-bit relative references, so let's use that in reloc_data()
73 return -ERANGE; in reloc_data()
77 return -ERANGE; in reloc_data()
80 pr_err("Invalid 16-bit data relocation (%d)\n", op); in reloc_data()
89 return -ERANGE; in reloc_data()
93 return -ERANGE; in reloc_data()
96 pr_err("Invalid 32-bit data relocation (%d)\n", op); in reloc_data()
133 /* >=0: Set the instruction to MOVZ (opcode 10b). */ in reloc_insn_movw()
137 * <0: Set the instruction to MOVN (opcode 00b). in reloc_insn_movw()
151 return -ERANGE; in reloc_insn_movw()
168 imm_mask = (BIT(lsb + len) - 1) >> lsb; in reloc_insn_imm()
179 sval = (s64)(sval & ~(imm_mask >> 1)) >> (len - 1); in reloc_insn_imm()
186 return -ERANGE; in reloc_insn_imm()
191 static int reloc_insn_adrp(struct module *mod, Elf64_Shdr *sechdrs, in reloc_insn_adrp() argument
197 return reloc_insn_imm(RELOC_OP_PAGE, place, val, 12, 21, in reloc_insn_adrp()
206 /* out of range for ADR -> emit a veneer */ in reloc_insn_adrp()
207 val = module_emit_veneer_for_adrp(mod, sechdrs, place, val & ~0xfff); in reloc_insn_adrp()
209 return -ENOEXEC; in reloc_insn_adrp()
242 val = sym->st_value + rel[i].r_addend; in apply_relocate_add()
365 if (ovf && ovf != -ERANGE) in apply_relocate_add()
371 ovf = reloc_insn_imm(RELOC_OP_ABS, loc, val, 0, 12, in apply_relocate_add()
406 if (ovf == -ERANGE) { in apply_relocate_add()
409 return -ENOEXEC; in apply_relocate_add()
417 me->name, ELF64_R_TYPE(rel[i].r_info)); in apply_relocate_add()
418 return -ENOEXEC; in apply_relocate_add()
421 if (overflow_check && ovf == -ERANGE) in apply_relocate_add()
430 me->name, (int)ELF64_R_TYPE(rel[i].r_info), val); in apply_relocate_add()
431 return -ENOEXEC; in apply_relocate_add()
441 struct module *mod) in module_init_ftrace_plt() argument
449 return -ENOEXEC; in module_init_ftrace_plt()
451 plts = (void *)s->sh_addr; in module_init_ftrace_plt()
455 mod->arch.ftrace_trampolines = plts; in module_init_ftrace_plt()
467 apply_alternatives_module((void *)s->sh_addr, s->sh_size); in module_finalize()
472 __pi_scs_patch((void *)s->sh_addr, s->sh_size); in module_finalize()