Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1630619lqm; Fri, 3 May 2024 01:12:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW6N643RUuwzQuvvZiiJIvFn6kfo69uP/NS1j4+VYM9zrxzX0iQKyX7LF4bE5WyAOO6kHohggFPPkaW7qohKSgo+IU3rZt5FlapAN2A1A== X-Google-Smtp-Source: AGHT+IGwIR6CbVrCB5Ib/5SVxGcFHhMqdqUH8fRSfuupmegFWhv0tOqeGWubKFXdqquV6Ej7bo89 X-Received: by 2002:ac8:588c:0:b0:43a:ee42:3500 with SMTP id t12-20020ac8588c000000b0043aee423500mr1663463qta.20.1714723960344; Fri, 03 May 2024 01:12:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714723960; cv=pass; d=google.com; s=arc-20160816; b=x7tqWSVHxHiG31dEGONRN1GKG+ZiEE5xZF76qScX7JYzrzHhejjQQ3aza6Rpr6V466 8DSwmKEmXgYrUmgCAPsZAhkQ0Eg9NGEO1/eE+MCP/b2P9zlBwdERfx+6FnFw1g1QJcBG 4JfqcU371B15qUgHlG6l44ycqxBbrr+Z/s7t6b6Uirzrxos4IMve5lzanayf4xCdg2aw pr5Ca/3IKTY/0SVthiJ10xVSs9yftbX6MUrs3s2tEGg/PpOwh/ml1ZF+M3HtSOHn+rpi T6onY/MUlk9C7RSR2dsfyAaAesZsz69OME8vGtMe22bKhoWcueBkiq1ymbguASnTnEDM 1E4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2FO4C0K/LksSZVlGKBIpjkCvP11WRcW5rCtpKYOCniE=; fh=KsdebulFSTDgUgDP2OamvZF2uEg8nzoUdEjFl7UPhdc=; b=ho+T8VyCr4SSbM9LbxND/eYtaXAuNNhkJOG1/mnUJ5FOejvCJT2NDisgepzCO2imGh tFR3EGYfzGgVsUIYapykdSMVV492jFSPzsQPhBh6/c3Mr+dIxBKuiPVqbOzjw+n/y352 1m6oTdooDn1G5aTARUp1qY7nDvooVRqLxLNPP6OfOKLJKZFsWdsrMsOi8FaHM85mZEUA ZDEDhuZDTaL8fMcPJZOhpEOOJ7bQL/gWei8uiMIyUhhblSNKjzloQ5CExrfuVP9XKQ97 rpxreCaMqEl6S7p9xiZ684Q1REouAssj/cnz35Ulby2NrrHF+lphB6JYMhEWI5zcwmJe uqgw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jtVet1JO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167354-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167354-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h1-20020ac87d41000000b0043abcd7b299si2831135qtb.612.2024.05.03.01.12.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 01:12:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-167354-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jtVet1JO; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-167354-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-167354-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 18B1F1C21C6A for ; Fri, 3 May 2024 08:12:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0001914A4C4; Fri, 3 May 2024 08:12:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jtVet1JO" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 254A614A0A4; Fri, 3 May 2024 08:12:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714723932; cv=none; b=VqaGo6VhFW1hMkNACQDEzk4SooJQIpbgEWydOmHPTxukUP2C+9j0SWn09SdJj+QmXdp6laW2bkSu3tF9JK5tjK6sEMOM98ntQYTnA6epSDC3r+FtQ4ojCveI9b34SnpI+Wz5LrBZjjCgaO7hLe5aLTf3Pv0uW7WG18mQqCGQGMY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714723932; c=relaxed/simple; bh=f1FeIQOWdt/yunrrvWZvBDe9vGWa364dMqMNXLioroY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ez9YcC5AZ3GMOOkCEWXeqfTr32I6fGS9U7Ciaj1MwI6kISbvFWWsgT1ULJ54N0l36hSRJo46lOTYW4SV63XvaokuxWgTgmONR8OVg71s/19173R4hcy29tSkngzsn2r05W5rZo+lec1wUxQaaQ4fe5q+YDpdttY83F8Q3UCNBxA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jtVet1JO; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7D538C32789; Fri, 3 May 2024 08:12:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714723931; bh=f1FeIQOWdt/yunrrvWZvBDe9vGWa364dMqMNXLioroY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jtVet1JO2GRiPm6pL3oVUZh45K4d0qU6WzlGzKY3fDQ25chmRzC69YIhphOPud0ga gGBRIlTs79nB9SXXnK6XueA9CFvZKnCPOIv7/VcrC9X8BiTE76q0D7LRAurD/1YgRc NQzvKcAvmPqwVO0CuBhc04xFrXQQnM/XPyl7ROYnKFKeHLbQG2ByGXJFCcdrI0kvUK fMFc880MwNL2SHd/mLUzt+90jW8Ni2QLNo6eVWLi5SJjfwueUp1TGPmdvQLJGO1fvp JuMxNK63P51akw64/QDJunXoYxfWRmwHqcxzhgAXLKHKUhVABQhUHdKZ4VekSysIBK 3VDD04J0CQpUw== From: Arnd Bergmann To: linux-alpha@vger.kernel.org Cc: Arnd Bergmann , Richard Henderson , Ivan Kokshaysky , Matt Turner , Alexander Viro , Marc Zyngier , Linus Torvalds , "Paul E. McKenney" , linux-kernel@vger.kernel.org Subject: [PATCH 02/14] alpha: fix modversions for strcpy() et.al. Date: Fri, 3 May 2024 10:11:13 +0200 Message-Id: <20240503081125.67990-3-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240503081125.67990-1-arnd@kernel.org> References: <20240503081125.67990-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Al Viro On alpha str{n,}{cpy,cat}() implementations are playing fun games with shared chunks of code. The problem is, they are using direct branches and need to be next to each other. Currently it's done by building them in separate object files, then using ld -r to link those together. Unfortunately, genksyms machinery has no idea what to do with that - we have generated in arch/alpha/lib/.strcat.S.cmd, but there's nothing to propagate that into .stycpy.S.cmd, so modpost doesn't find anything for those symbols, resulting in WARNING: modpost: EXPORT symbol "strcpy" [vmlinux] version generation failed, symbol will not be versioned. Is "strcpy" prototyped in ? WARNING: modpost: EXPORT symbol "strcat" [vmlinux] version generation failed, symbol will not be versioned. Is "strcat" prototyped in ? WARNING: modpost: EXPORT symbol "strncpy" [vmlinux] version generation failed, symbol will not be versioned. Is "strncpy" prototyped in ? WARNING: modpost: EXPORT symbol "strncat" [vmlinux] version generation failed, symbol will not be versioned. Is "strncat" prototyped in ? spew on modversion-enabled builds (all 4 functions in question are in fact prototyped in asm-prototypes.h) Fixing doesn't require messing with kbuild, thankfully - just build one object (i.e. have sty{n,}cpy.S with includes of relevant *.S instead of playing with ld -r) and that's it. Signed-off-by: Al Viro Signed-off-by: Arnd Bergmann --- arch/alpha/lib/Makefile | 14 -------------- arch/alpha/lib/stycpy.S | 11 +++++++++++ arch/alpha/lib/styncpy.S | 11 +++++++++++ 3 files changed, 22 insertions(+), 14 deletions(-) create mode 100644 arch/alpha/lib/stycpy.S create mode 100644 arch/alpha/lib/styncpy.S diff --git a/arch/alpha/lib/Makefile b/arch/alpha/lib/Makefile index 6a779b9018fd..84046e730e6d 100644 --- a/arch/alpha/lib/Makefile +++ b/arch/alpha/lib/Makefile @@ -44,17 +44,3 @@ AFLAGS___remlu.o = -DREM -DINTSIZE $(addprefix $(obj)/,__divqu.o __remqu.o __divlu.o __remlu.o): \ $(src)/$(ev6-y)divide.S FORCE $(call if_changed_rule,as_o_S) - -# There are direct branches between {str*cpy,str*cat} and stx*cpy. -# Ensure the branches are within range by merging these objects. - -LDFLAGS_stycpy.o := -r -LDFLAGS_styncpy.o := -r - -$(obj)/stycpy.o: $(obj)/strcpy.o $(obj)/$(ev67-y)strcat.o \ - $(obj)/$(ev6-y)stxcpy.o FORCE - $(call if_changed,ld) - -$(obj)/styncpy.o: $(obj)/strncpy.o $(obj)/$(ev67-y)strncat.o \ - $(obj)/$(ev6-y)stxncpy.o FORCE - $(call if_changed,ld) diff --git a/arch/alpha/lib/stycpy.S b/arch/alpha/lib/stycpy.S new file mode 100644 index 000000000000..32ecd9c5f90d --- /dev/null +++ b/arch/alpha/lib/stycpy.S @@ -0,0 +1,11 @@ +#include "strcpy.S" +#ifdef CONFIG_ALPHA_EV67 +#include "ev67-strcat.S" +#else +#include "strcat.S" +#endif +#ifdef CONFIG_ALPHA_EV6 +#include "ev6-stxcpy.S" +#else +#include "stxcpy.S" +#endif diff --git a/arch/alpha/lib/styncpy.S b/arch/alpha/lib/styncpy.S new file mode 100644 index 000000000000..72fc2754eb57 --- /dev/null +++ b/arch/alpha/lib/styncpy.S @@ -0,0 +1,11 @@ +#include "strncpy.S" +#ifdef CONFIG_ALPHA_EV67 +#include "ev67-strncat.S" +#else +#include "strncat.S" +#endif +#ifdef CONFIG_ALPHA_EV6 +#include "ev6-stxncpy.S" +#else +#include "stxncpy.S" +#endif -- 2.39.2