Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp412755rdb; Mon, 29 Jan 2024 06:15:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IGQCDqjtLGk/xONUZvhWUjsPvrky+X4Ff/Go5HsUN80Fb/Zdf+RQd5wWxJTk9s43sw7qRGl X-Received: by 2002:a17:906:4ad0:b0:a35:3718:997c with SMTP id u16-20020a1709064ad000b00a353718997cmr5818441ejt.28.1706537754440; Mon, 29 Jan 2024 06:15:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706537754; cv=pass; d=google.com; s=arc-20160816; b=eXM7jfAittZ4c81SHZhvoEyr+waumsv7ZQ+8pDFCHZJ8G07ATx9vv6gKnvIwi69JLE XdWnnx5L7gP6r+gT7+QrB7Tv8qx02SkZU/PCwotvpkxZONzvJtH5Dwwt0M8o00oOUBSM ++rpYTxOQt39Uh2RK0gOMDRLb8EUbg0fQA68ACYXBkfzlQGT0Ht7AlIFUx7Xor7UQxLR WLMCGxbwZH0ZfUOHlRreMiomWqgvGAlRW83+5SnrFGTXXnQgx1PFSyQWSXmIlsgEefp6 IEU6yWG7xtGmeJWRoR7QPYWOJU7jqLhx/SZ0E9RJVIRxUexHaojO/PwX6EyietV6Cnzt LvMQ== 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; bh=HmbJMSA+rDrUIPzrZfECGQfunbWYzs60GG/4g7pvyeo=; fh=1pO/fnqlbA1DlSshLp2Kp23nBXobkeZ558bQEuNU3Z8=; b=awykDpTOGxLaBdVQu4HNb6kAtZb2jesb7Q8Z8hXbO1b6XkZla7GnwvuYC+mIq0rGya EvVnSPgB8U0IZCZ79wZ+BdzpKg6epHqjTK72Mx7D2HG/uMHEyJK9wEdAMTQr/3eJYT8o bmEjwn05CbcBKbzI1fLdq6kDSqKQnfLKWP+v+xzxsokGoHSKNDgOpXVtAoFsVLsuuaYS rj69dkdcpWGP2PCku7TjAOYiCdmyur5HXNnq5lfGlCMav/CTViiXiRWRn4lV+i6aTpM9 9o0bPxSb2oep52ip5DLX5f7ic0czsfR9feBX2TN//MSPTtFcpDSOlimcH3wMn2oNu/cL UxMA== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sdfg.com.ar); spf=pass (google.com: domain of linux-kernel+bounces-42866-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42866-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id kb26-20020a1709070f9a00b00a26e29352b9si3410100ejc.301.2024.01.29.06.15.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 06:15:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-42866-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sdfg.com.ar); spf=pass (google.com: domain of linux-kernel+bounces-42866-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-42866-linux.lists.archive=gmail.com@vger.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 323201F2104E for ; Mon, 29 Jan 2024 14:15:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E5DF65BBE; Mon, 29 Jan 2024 14:15:46 +0000 (UTC) Received: from alerce.blitiri.com.ar (alerce.blitiri.com.ar [49.12.208.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A815965BA3 for ; Mon, 29 Jan 2024 14:15:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=49.12.208.134 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706537745; cv=none; b=dWun18TdkVANlsQmrttlaZnfhqt8+C5ie9OcMSPUoi1slDF/3Pj4E0O2Pi5+MYNCFuoq5jzLwbrhSUArs4DGo4u8lY/CA97c/VRYIDFkSE78WwIiwnMOd8NOHNrRtJ/xKXjkGqmSpKppgkfPJ3Y/z2nH4TxApwnC8AvaNSQ3z2Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706537745; c=relaxed/simple; bh=yW/KTPvl1LdQSw2p4A5TjI0BdCEzeZVKTkHAyd72DpQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lmyex+tYlzMUwABkBdUm/+QEPSB9z8ZLp3WXLv/c9HIiulODjw6IjhsCs8Mg3ooo7blhzfibQZsuP5M22tyTH5lgM3uJ+Mw0aCAfLoe3mrqUTsMloYl1uNcW4ALTzQdZdYyd8df2vKGJswI9dx/8zOZZeL1/+u16DIM/xUeGQNQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sdfg.com.ar; spf=pass smtp.mailfrom=sdfg.com.ar; arc=none smtp.client-ip=49.12.208.134 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sdfg.com.ar Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sdfg.com.ar Received: from localhost.localdomain by sdfg.com.ar (chasquid) with ESMTPSA tls TLS_AES_128_GCM_SHA256 (over submission, TLS-1.3, envelope from "rodrigo@sdfg.com.ar") ; Mon, 29 Jan 2024 14:15:35 +0000 From: Rodrigo Campos To: Willy Tarreau , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Cc: linux-kernel@vger.kernel.org, Rodrigo Campos Subject: [PATCH 1/4] tools/nolibc/string: export strlen() Date: Mon, 29 Jan 2024 15:15:13 +0100 Message-ID: <20240129141516.198636-2-rodrigo@sdfg.com.ar> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240129141516.198636-1-rodrigo@sdfg.com.ar> References: <20240129141516.198636-1-rodrigo@sdfg.com.ar> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit As with commit 8d304a374023, "tools/nolibc/string: export memset() and memmove()", gcc -Os without -ffreestanding may fail to compile with: cc -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib -lgcc -static -o test test.c /usr/bin/ld: /tmp/cccIasKL.o: in function `main': test.c:(.text.startup+0x1e): undefined reference to `strlen' collect2: error: ld returned 1 exit status As on the aforementioned commit, this patch adds a section to export this function so compilation works on those cases too. Signed-off-by: Rodrigo Campos --- tools/include/nolibc/string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/include/nolibc/string.h b/tools/include/nolibc/string.h index a01c69dd495f..ed15c22b1b2a 100644 --- a/tools/include/nolibc/string.h +++ b/tools/include/nolibc/string.h @@ -123,7 +123,7 @@ char *strcpy(char *dst, const char *src) * thus itself, hence the asm() statement below that's meant to disable this * confusing practice. */ -static __attribute__((unused)) +__attribute__((weak,unused,section(".text.nolibc_strlen"))) size_t strlen(const char *str) { size_t len; -- 2.43.0