From patchwork Tue Jun 27 16:32:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 13294806 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F661EB64DD for ; Tue, 27 Jun 2023 16:32:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232596AbjF0Qct (ORCPT ); Tue, 27 Jun 2023 12:32:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232474AbjF0QcP (ORCPT ); Tue, 27 Jun 2023 12:32:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F7DB30F1; Tue, 27 Jun 2023 09:32:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 34FAB611DD; Tue, 27 Jun 2023 16:32:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53554C433C8; Tue, 27 Jun 2023 16:32:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687883531; bh=2XOJKw8mrpi06UFry4/LUM2tzNn7wRfcGUBNgfFSFmI=; h=From:To:Cc:Subject:Date:From; b=VqSjMt23XiELwozolSyczKHov0K7Jjhf10PnhFijN89uhd6LQZUFTqFf/tw814fs4 6YuK7UbYt253RSOE3lxE1cRK4UBw/VK1PM0XENiDn8tts6IK3cQbbKG1OV1Ot1mJWo TtYusktLdpz9/N2zLAtdhfA3KAHUM0ZO+4UYSFt/CMzU8TX11XOlbQONG/RNrlI90u 3P58NqaqyyH9/MLe1mgH52sxlQ1HDdM/OPdnOHt4aSAqGtoEJPiZDIXaf05QiMgAQl VUWWjF52RHicN5LWP55utWNGoTzPTcTylO0vE/Apn7oN9j/u7obGDaG0e53awAhayZ ph33Yz8qCRMXw== From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Masahiro Yamada , Tetsuo Handa , Nathan Chancellor , Nick Desaulniers , Nicolas Schier Subject: [PATCH] modpost: define more R_ARM_* for old distributions Date: Wed, 28 Jun 2023 01:32:05 +0900 Message-Id: <20230627163205.2082246-1-masahiroy@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org On CentOS 7, the following build error occurs. scripts/mod/modpost.c: In function 'addend_arm_rel': scripts/mod/modpost.c:1312:7: error: 'R_ARM_MOVW_ABS_NC' undeclared (first use in this function); did you mean 'R_ARM_THM_ABS5'? case R_ARM_MOVW_ABS_NC: ^~~~~~~~~~~~~~~~~ R_ARM_THM_ABS5 scripts/mod/modpost.c:1312:7: note: each undeclared identifier is reported only once for each function it appears in scripts/mod/modpost.c:1313:7: error: 'R_ARM_MOVT_ABS' undeclared (first use in this function); did you mean 'R_ARM_THM_ABS5'? case R_ARM_MOVT_ABS: ^~~~~~~~~~~~~~ R_ARM_THM_ABS5 scripts/mod/modpost.c:1326:7: error: 'R_ARM_THM_MOVW_ABS_NC' undeclared (first use in this function); did you mean 'R_ARM_THM_ABS5'? case R_ARM_THM_MOVW_ABS_NC: ^~~~~~~~~~~~~~~~~~~~~ R_ARM_THM_ABS5 scripts/mod/modpost.c:1327:7: error: 'R_ARM_THM_MOVT_ABS' undeclared (first use in this function); did you mean 'R_ARM_THM_ABS5'? case R_ARM_THM_MOVT_ABS: ^~~~~~~~~~~~~~~~~~ R_ARM_THM_ABS5 Fixes: 12ca2c67d742 ("modpost: detect section mismatch for R_ARM_{MOVW_ABS_NC,MOVT_ABS}") Fixes: cd1824fb7a37 ("modpost: detect section mismatch for R_ARM_THM_{MOVW_ABS_NC,MOVT_ABS}") Reported-by: Tetsuo Handa Signed-off-by: Masahiro Yamada --- scripts/mod/modpost.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 73f4f5588b67..603a4f9587a4 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1286,6 +1286,23 @@ static int addend_386_rel(uint32_t *location, Elf_Rela *r) #ifndef R_ARM_THM_JUMP24 #define R_ARM_THM_JUMP24 30 #endif + +#ifndef R_ARM_MOVW_ABS_NC +#define R_ARM_MOVW_ABS_NC 43 +#endif + +#ifndef R_ARM_MOVT_ABS +#define R_ARM_MOVT_ABS 44 +#endif + +#ifndef R_ARM_THM_MOVW_ABS_NC +#define R_ARM_THM_MOVW_ABS_NC 47 +#endif + +#ifndef R_ARM_THM_MOVT_ABS +#define R_ARM_THM_MOVT_ABS 48 +#endif + #ifndef R_ARM_THM_JUMP19 #define R_ARM_THM_JUMP19 51 #endif