Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6193037pxb; Mon, 8 Nov 2021 04:48:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvJt3tIQfz2k+yaYPCiS7PF/jAnIJiCA8/TJMBWzJ15njZ9LBrX7bCw4o11IadhzkARAbj X-Received: by 2002:a17:906:5d1:: with SMTP id t17mr28662923ejt.51.1636375691591; Mon, 08 Nov 2021 04:48:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636375691; cv=none; d=google.com; s=arc-20160816; b=tF7zLiE1Ccume8OcXxCEKbybzBaWZd8+FnzBTKAFcxck6m1WzazntlddL+ZMfGe/vr rBwYeS3QsLAabfGQBqwFGZcnUWZP5cQqgpj0SXPZkPwZL+WofIw5bjVBpM6KjdwCyYdz WQplqX6xAY+/Y0K1KiqScbODvzpzx6+5arXOKLpSAKm6OI1qcxRPED79zs9emYFwrJqr 2s6sENhHAE0JiGvC8dSGjOEGDX1IAs0k4Hoj2cg92S7778QckB17Xfirx5yYbppsZDeU duWxklZ2ujhSo9NLzam61qbNsFT+GyY/Shh4jgAwYTxkkU5iSxOYMh5Of/c96knmONPP CoFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zigEgwMAEavRVLp+BJtAfXNpYofMF3JDQX/JpOBUL4w=; b=VeplyUNX5Ew5F7t7ARdG2i9fENxrWoyLq2sqNThnEI3BcUN1YXXJ2EbYimhm6K4mNc Pi8+KQASXdOH1q2JNf7g/hlq7OGUn70CUkcWi1DCiuS/pjZgWXvw4JiZJmDbC3jtZL7x xSZaa02CYA+zbO8JFxjNTh/1AbRqYm1dEE9wAPT3b8uleV2FCQvbQgGOG3WFYO1GqMEj qC7qb8rayOjQXvp72tMaY/uAyeOlgi6XDT96zHN9Iw32dSgNcIGMnzRc45opxpZnAqiv 2glisbbxums3CmkHB5lRH/iMX1jCLpdKRR89NKJf5pkiSCA5Yl0nzeIXoK1khvOMUykF Fafg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="WLLKV/YR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si33672384edb.538.2021.11.08.04.47.48; Mon, 08 Nov 2021 04:48:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="WLLKV/YR"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237655AbhKHJtx (ORCPT + 99 others); Mon, 8 Nov 2021 04:49:53 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]:34590 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232818AbhKHJtw (ORCPT ); Mon, 8 Nov 2021 04:49:52 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 46FD91FD4B; Mon, 8 Nov 2021 09:47:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1636364827; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zigEgwMAEavRVLp+BJtAfXNpYofMF3JDQX/JpOBUL4w=; b=WLLKV/YRu4/8Yv2L2sy9mY69NGD5Xm49FdpVe16AL4LOEP8J4o2s/u8FBeNwgL5mH1i7bj taui7ghqRshCvhcpTfGwsygDhsx+MkX6w85OO7fMP9IdsakUPjweCptxJuxYYhrdt+fILV vRqLwTKcGR/Eywyn0otcoPztY1Iypsg= Received: from suse.cz (unknown [10.100.224.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id F254EA3B81; Mon, 8 Nov 2021 09:47:06 +0000 (UTC) Date: Mon, 8 Nov 2021 10:47:06 +0100 From: Petr Mladek To: Christophe Leroy Cc: Josh Poimboeuf , Jiri Kosina , Miroslav Benes , Joe Lawrence , Steven Rostedt , Ingo Molnar , "Naveen N . Rao" , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, live-patching@vger.kernel.org Subject: Re: [PATCH v1 1/5] livepatch: Fix build failure on 32 bits processors Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 2021-10-28 14:24:01, Christophe Leroy wrote: > 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 Makes sense. I haven't tested it but it looks correct ;-) Acked-by: Petr Mladek Best Regards, Petr