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: 7c8e2bdd5f0d ("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
2021-11-03 17:21:37 +00:00
2022-01-16 15:53:00 +02:00
2021-12-01 00:06:43 +01:00
2022-01-26 15:06:06 +01:00
2022-01-17 05:49:30 +02:00
2021-12-02 17:25:21 +09: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-05-02 00:43:35 +09:00
2021-10-18 06:17:01 -06:00
2021-05-07 00:26:33 -07:00
2021-10-27 12:32:34 +02:00
2021-12-14 17:39:42 -05:00
2021-11-06 16:43:20 -07:00
2022-01-11 13:08:21 -08:00
2021-11-01 21:17:39 -07:00
2022-01-11 13:08:21 -08:00
2021-11-22 17:52:47 -05:00
2021-08-11 13:11:12 -07:00
2021-09-08 15:32:35 -07:00
2021-08-16 18:55:32 +02:00
2021-11-24 12:20:27 +01:00
2021-12-25 12:20:55 -08:00
2021-10-20 10:45:34 -05:00
2022-01-20 08:52:55 +02:00
2022-01-08 12:43:57 -06:00
2021-11-09 10:02:51 -08:00
2022-01-17 05:49:30 +02:00
2021-06-18 11:43:08 +02:00
2021-05-27 04:01:50 +09:00
2022-01-22 08:33:34 +02:00
2021-10-15 11:25:18 +02:00
2021-07-05 10:46:20 +02:00
2022-01-16 10:08:13 +02:00
2021-08-17 17:50:51 +02:00
2021-11-11 13:09:33 +01:00
2021-11-09 10:02:52 -08:00
2021-12-13 12:04:45 -06:00
2021-11-06 13:30:42 -07:00
2021-09-08 15:32:34 -07:00
2021-05-07 00:26:33 -07: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
2021-09-03 09:58:12 -07:00
2021-08-27 16:30:18 +08:00
2022-01-20 08:52:55 +02:00
2021-12-28 11:26:18 +01:00
2021-09-03 09:58:12 -07:00
2021-10-14 13:29:18 +02:00
2022-01-08 12:43:57 -06:00
2022-01-08 12:43:57 -06:00
2021-11-12 11:53:16 -08:00
2022-01-22 08:33:37 +02:00
2021-09-22 10:24:01 -04:00
2021-12-07 16:36:17 -08:00
2021-09-30 09:37:27 +01:00
2021-09-01 14:52:05 -07:00
2022-01-17 05:49:30 +02:00
2021-10-22 15:32:46 +02:00
2021-08-10 14:57:42 +02:00
2021-12-02 15:07:22 +01:00
2022-01-22 08:33:35 +02:00
2021-11-06 13:30:43 -07:00
2021-07-05 10:46:33 +02:00
2021-03-23 16:01:58 +01:00
2022-01-15 16:30:30 +02:00
2022-01-20 10:41:01 +02:00
2021-06-23 16:41:24 -06:00
2022-01-22 08:33:37 +02:00
2021-04-30 11:20:42 -07:00
2021-12-07 16:36:17 -08:00
2021-08-16 11:39:51 -04:00
2022-01-08 12:43:57 -06:00
2022-01-26 18:34:11 -06:00
2021-05-07 00:26:34 -07:00
2021-05-09 13:07:03 -07:00
2021-09-03 09:58:12 -07:00
2021-09-08 11:50:27 -07:00
2021-07-03 11:41:14 -07:00
2022-01-22 08:33:34 +02:00
2021-08-17 07:49:10 -10:00
2022-01-10 07:54:04 -10:00