diff options
| author | Dmitry Torokhov <[email protected]> | 2023-05-01 15:20:08 -0700 | 
|---|---|---|
| committer | Dmitry Torokhov <[email protected]> | 2023-05-01 15:20:08 -0700 | 
| commit | 9a87ffc99ec8eb8d35eed7c4f816d75f5cc9662e (patch) | |
| tree | d57f3a63479a07b4e0cece029886e76e04feb984 /arch/riscv/kernel/module.c | |
| parent | 5dc63e56a9cf8df0b59c234a505a1653f1bdf885 (diff) | |
| parent | 53bea86b5712c7491bb3dae12e271666df0a308c (diff) | |
Merge branch 'next' into for-linus
Prepare input updates for 6.4 merge window.
Diffstat (limited to 'arch/riscv/kernel/module.c')
| -rw-r--r-- | arch/riscv/kernel/module.c | 31 | 
1 files changed, 16 insertions, 15 deletions
diff --git a/arch/riscv/kernel/module.c b/arch/riscv/kernel/module.c index 91fe16bfaa07..7c651d55fcbd 100644 --- a/arch/riscv/kernel/module.c +++ b/arch/riscv/kernel/module.c @@ -268,6 +268,13 @@ static int apply_r_riscv_align_rela(struct module *me, u32 *location,  	return -EINVAL;  } +static int apply_r_riscv_add16_rela(struct module *me, u32 *location, +				    Elf_Addr v) +{ +	*(u16 *)location += (u16)v; +	return 0; +} +  static int apply_r_riscv_add32_rela(struct module *me, u32 *location,  				    Elf_Addr v)  { @@ -282,6 +289,13 @@ static int apply_r_riscv_add64_rela(struct module *me, u32 *location,  	return 0;  } +static int apply_r_riscv_sub16_rela(struct module *me, u32 *location, +				    Elf_Addr v) +{ +	*(u16 *)location -= (u16)v; +	return 0; +} +  static int apply_r_riscv_sub32_rela(struct module *me, u32 *location,  				    Elf_Addr v)  { @@ -315,8 +329,10 @@ static int (*reloc_handlers_rela[]) (struct module *me, u32 *location,  	[R_RISCV_CALL]			= apply_r_riscv_call_rela,  	[R_RISCV_RELAX]			= apply_r_riscv_relax_rela,  	[R_RISCV_ALIGN]			= apply_r_riscv_align_rela, +	[R_RISCV_ADD16]			= apply_r_riscv_add16_rela,  	[R_RISCV_ADD32]			= apply_r_riscv_add32_rela,  	[R_RISCV_ADD64]			= apply_r_riscv_add64_rela, +	[R_RISCV_SUB16]			= apply_r_riscv_sub16_rela,  	[R_RISCV_SUB32]			= apply_r_riscv_sub32_rela,  	[R_RISCV_SUB64]			= apply_r_riscv_sub64_rela,  }; @@ -429,21 +445,6 @@ void *module_alloc(unsigned long size)  }  #endif -static const Elf_Shdr *find_section(const Elf_Ehdr *hdr, -				    const Elf_Shdr *sechdrs, -				    const char *name) -{ -	const Elf_Shdr *s, *se; -	const char *secstrs = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; - -	for (s = sechdrs, se = sechdrs + hdr->e_shnum; s < se; s++) { -		if (strcmp(name, secstrs + s->sh_name) == 0) -			return s; -	} - -	return NULL; -} -  int module_finalize(const Elf_Ehdr *hdr,  		    const Elf_Shdr *sechdrs,  		    struct module *me)  |