Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp636386rdb; Fri, 26 Jan 2024 06:27:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEVBoUwB6e7oh4ooOHcMDSWdGpyyAIKZSMDJtrADQ/3GYX2AMZM+vXJtDmf+M74/XQy7XkX X-Received: by 2002:a17:906:234d:b0:a31:90e8:cb1b with SMTP id m13-20020a170906234d00b00a3190e8cb1bmr873999eja.2.1706279238691; Fri, 26 Jan 2024 06:27:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706279238; cv=pass; d=google.com; s=arc-20160816; b=S6IYawXX3lK/XBydZ1vU9qfSbSyCC5gWw67RRvXJFTIyLgsOLylbkYO4k2UlgtmVMO cvyn3eNKb7pWJ/7E2x+aKarGz8IX2aH8AQzWPQfSx69RWFMZqxYggAr9w061oAhEpdtB 3sDUZTgxGQjdP8XAjoqVovPd9qns4MTE2VWm9q9IrlpaVm8YIpQxsVLZrIphdvVFEqpb muuiBdsEJsAfbZ0quanm/+9sY53rgpD2a5STkh0RMewIIJ5Cpk7ZAdRyg4sWwkF7sbVe uB7Ossbt1Qa9syJG6zLvUfQpQhRE1NvXwV2cEQvz3w2m/KMoMSYOlDxXcHx77kvAyBnd uCpw== 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=3GhpWbT+DVuI2XMrWa4VPJXyw8jKGYBNrbmYWNZwPFA=; fh=1pO/fnqlbA1DlSshLp2Kp23nBXobkeZ558bQEuNU3Z8=; b=tzpBXSrt+QQpve/RHFzZ7yq/qq9YpjRae8GRLF+Vf+1flKF7sfnorqQ2/zJhLI28e/ HomFo9BDyttAZlaHyvedBU6yCVbQk1x/kkD+D1xRj5R2YrsbOtMjiyBxszOXGUL18yy2 LmEflLNSCZtQae1alvcdpkAvP584lE4UWfoSAsm5/Uvxs2Aba6X6zWA/F1Q2OduYHggD 0L07PQVIu2LHalkhbxv3tnjtNl2lckMdYnA4kCQlXlZ6z+XBYx/xDMvUZ5RFKEieEtHM /26Op9VlJ4PwR/pzK77SoDApKO/MvGNt3HvAZGNndfrng0iJ6uVuMzx38TCyVG08axA0 CpPg== 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-40177-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40177-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 s24-20020a1709060c1800b00a34e02932d6si512291ejf.261.2024.01.26.06.27.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 06:27:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40177-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-40177-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40177-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 D247B1F26B3F for ; Fri, 26 Jan 2024 14:27:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F294B1C2AF; Fri, 26 Jan 2024 14:25:31 +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 1BBE61D556 for ; Fri, 26 Jan 2024 14:25:27 +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=1706279131; cv=none; b=dQgKhnijdb9k0hWuIZSgZvIXsF8/sg/5Vmycr3l9KUlgFdSkJmEr1Hot+LTec+rUeZIz1TzW3TRRKIw3rQrVW+dLR/OFof1R74badSBh3Lr/FyV2R0rVrOx9rW+8b0IMLRrUHTAHLCWj/bP0gt0lfOYOWS9vY982TfDXWujFSVY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706279131; c=relaxed/simple; bh=sbhZ/NdHAucnYQnxUho3gN2gMhD/hGaKGFKuXYzPsA8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uM5y9RNOHrGHKmpcybsVOio5KThJpKKOo+vdm1ev56h2+PvL6p+n56oSwKChtQB/s6XtiFWdfrTrMsoqY3zmW/fUGwnJttRiwFWf0ZHbJZl0igQzEp5sSqWLYUmzcoMQs7+TK4iHYs4EFvTk1wU4J7lTAy1Lrct3kJNmdnEoMiM= 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") ; Fri, 26 Jan 2024 14:25:25 +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/1] tools/nolibc/string: export strlen() Date: Fri, 26 Jan 2024 15:24:11 +0100 Message-ID: <20240126142411.22972-2-rodrigo@sdfg.com.ar> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240126142411.22972-1-rodrigo@sdfg.com.ar> References: <20240126142411.22972-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 -c test.c -o test.o cc test.o -fno-asynchronous-unwind-tables -fno-ident -s -Os -nostdlib -lgcc -static -o test /usr/bin/ld: test.o: in function `main': test.c:(.text.startup+0x32): 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