Christophe Leroy
2f293651ec
livepatch: Fix build failure on 32 bits processors
Trying to build livepatch on powerpc/32 results in:
kernel/livepatch/core.c: In function 'klp_resolve_symbols':
kernel/livepatch/core.c:221:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
221 | sym = (Elf64_Sym *)sechdrs[symndx].sh_addr + ELF_R_SYM(relas[i].r_info);
| ^
kernel/livepatch/core.c:221:21: error: assignment to 'Elf32_Sym *' {aka 'struct elf32_sym *'} from incompatible pointer type 'Elf64_Sym *' {aka 'struct elf64_sym *'} [-Werror=incompatible-pointer-types]
221 | sym = (Elf64_Sym *)sechdrs[symndx].sh_addr + ELF_R_SYM(relas[i].r_info);
| ^
kernel/livepatch/core.c: In function 'klp_apply_section_relocs':
kernel/livepatch/core.c:312:35: error: passing argument 1 of 'klp_resolve_symbols' from incompatible pointer type [-Werror=incompatible-pointer-types]
312 | ret = klp_resolve_symbols(sechdrs, strtab, symndx, sec, sec_objname);
| ^~~~~~~
| |
| Elf32_Shdr * {aka struct elf32_shdr *}
kernel/livepatch/core.c:193:44: note: expected 'Elf64_Shdr *' {aka 'struct elf64_shdr *'} but argument is of type 'Elf32_Shdr *' {aka 'struct elf32_shdr *'}
193 | static int klp_resolve_symbols(Elf64_Shdr *sechdrs, const char *strtab,
| ~~~~~~~~~~~~^~~~~~~
Fix it by using the right types instead of forcing 64 bits types.
Fixes: 7c8e2bdd5f ("livepatch: Apply vmlinux-specific KLP relocations early")
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Acked-by: Petr Mladek <pmladek@suse.com>
Acked-by: Joe Lawrence <joe.lawrence@redhat.com>
Acked-by: Miroslav Benes <mbenes@suse.cz>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/5288e11b018a762ea3351cc8fb2d4f15093a4457.1640017960.git.christophe.leroy@csgroup.eu
2022-02-07 21:03:10 +11:00
..
2022-01-23 17:52:42 +02:00
2022-01-18 12:09:57 +01:00
2022-01-20 08:52:55 +02:00
2022-01-16 15:53:00 +02:00
2022-01-26 15:06:06 +01:00
2022-01-17 05:49:30 +02:00
2022-01-22 08:33:37 +02:00
2022-01-11 09:51:26 -08:00
2022-02-07 21:03:10 +11:00
2022-01-22 08:33:37 +02:00
2022-01-25 18:34:08 +01:00
2022-01-22 08:33:36 +02:00
2022-01-26 13:04:05 -08:00
2022-01-30 13:09:00 +02:00
2022-01-23 06:20:44 +02:00
2022-01-27 19:15:49 -05:00
2021-12-14 17:39:42 -05:00
2022-01-11 13:08:21 -08:00
2022-01-11 13:08:21 -08:00
2021-12-25 12:20:55 -08:00
2022-01-20 08:52:55 +02:00
2022-01-08 12:43:57 -06:00
2022-01-17 05:49:30 +02:00
2022-01-22 08:33:34 +02:00
2022-01-16 10:08:13 +02:00
2021-12-13 12:04:45 -06:00
2022-01-22 08:33:36 +02:00
2022-01-20 10:41:01 +02:00
2022-01-11 18:45:02 -08:00
2022-01-13 07:17:47 -08:00
2022-01-11 18:45:02 -08:00
2022-01-17 07:32:51 +02:00
2021-12-29 10:37:33 +01:00
2022-01-20 08:52:55 +02:00
2021-12-28 11:26:18 +01:00
2022-01-08 12:43:57 -06:00
2022-01-08 12:43:57 -06:00
2022-01-22 08:33:37 +02:00
2021-12-07 16:36:17 -08:00
2022-01-17 05:49:30 +02:00
2022-01-22 08:33:35 +02:00
2022-01-15 16:30:30 +02:00
2022-01-20 10:41:01 +02:00
2022-01-22 08:33:37 +02:00
2021-12-07 16:36:17 -08:00
2022-01-08 12:43:57 -06:00
2022-01-26 18:34:11 -06:00
2022-01-22 08:33:34 +02:00
2022-01-10 07:54:04 -10:00