Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp789527rdb; Sun, 18 Feb 2024 11:51:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUlVA+PyoVfOkRTL8Xwe2IChnuv7JAissGKrZo0wssKPvrHAsryyNXeYFbQ2IihjC/CgCDwAqjRMXuhB63g2mcuvT/1bBh7I1JT0ewI7w== X-Google-Smtp-Source: AGHT+IGibQp14UyP7DWUsRvl2hHj2Q9fuqI9b3Jpe3+IQDyGYBRR9MxxLteDLzMvJUAzX3iuWm4s X-Received: by 2002:a05:6358:2907:b0:178:950d:1175 with SMTP id y7-20020a056358290700b00178950d1175mr14741654rwb.13.1708285913793; Sun, 18 Feb 2024 11:51:53 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708285913; cv=pass; d=google.com; s=arc-20160816; b=deDhHlg1C/rOx88NzWRnt3D179vlht7/hA8JHulL5hUouWf/SmMHDYENAzUyCsXRkd YQE01jOTXnCctv3v8r0867mj+tG7djYIzd9clUvBMItlUG5sF9kywjG/75VFjKiXRNrN VLcmP5meLi2cUz99PPPG/R/E3+FrlroT3/thPkUJsBlNFrR4AVP3bR8fb61D8rKXwfkI lx70KTrF7hxu0RcOeytukHpn0qrSEonXkVeZ2J1i2iiTipIB0UpjQiaUN7g7TJhDi1rt JO8WfZO//+I/EYObZSdCN9LkS607wRCLiimAx8ZkJAkd79mBuHiIXKW0YxwF69TyfOJM ETJA== 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=RmmYAFVrPVuUbOGjKbFlbTuEsa24dKWt7oMe3m/vmhgjS1Vwmo8v7Ilez/+Q/blmYr ANVDV3jaD4CF9inherrz3qQo3V5ccG1EpPAGiCDqOgjDfo9APyDUiJBxj4or7fqzqfBV SF560IiQKrspkfh9R/XfUgOH+FR3x5kKOtII7nxYmbsq/Dj+2Fdb6kN4/f8U6ZMLcco0 YKC4dum1yynbHcNUOgQx6MXPZjyuBjd66qr+ot7MiPvn0hRiY2GOwLsv6Ww0SR6PBdPK gDkJXXEhYBsv5biD5Vy5kliLtffnYRpGXN7yml0RGVR9jbKbTChLQAheV5NZiykmbI4Q pslw==; dara=google.com 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-70558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70558-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y5-20020a17090a1f4500b00296eea36704si3366344pjy.35.2024.02.18.11.51.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Feb 2024 11:51:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-70558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=sdfg.com.ar); spf=pass (google.com: domain of linux-kernel+bounces-70558-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-70558-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 78F88281B81 for ; Sun, 18 Feb 2024 19:51:53 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4299773167; Sun, 18 Feb 2024 19:51:36 +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 8366A6F53E for ; Sun, 18 Feb 2024 19:51:33 +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=1708285895; cv=none; b=UVoghnq1iGkqkB884zZRC3xMY+PrcHV4ZKOyWvAGk/CGlMmzJlMLSuoZSVC4yFWMMKG2bJbmd8FJrNsMbLh2qn6xMV0xNfjVBIgeItFPp7027ST0F5B2mR9yyv/zca7f0OoKglqFSrVZHl0fL2Ky3lfFRWpImkC6iKrn+E+sBnk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708285895; c=relaxed/simple; bh=yW/KTPvl1LdQSw2p4A5TjI0BdCEzeZVKTkHAyd72DpQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fy7oajpEZ+ggijQDl4MUE9/+W8Ir4XcYPGwkCybtYpivfD2quvroAihH7dBHxJjyzctajASarJozLUVQuozLrIR+F9y6iLSOHrtfBa6FmF1fG3TXbEmPAYNB2RjUVE5GO/dHtsrAXKw2zkQGvel4RZ+RVQQyd5AI7IsNoXV0/hg= 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 lindsay.fibertel.com.ar by sdfg.com.ar (chasquid) with ESMTPSA tls TLS_AES_128_GCM_SHA256 (over submission, TLS-1.3, envelope from "rodrigo@sdfg.com.ar") ; Sun, 18 Feb 2024 19:51:31 +0000 From: Rodrigo Campos To: Willy Tarreau , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Cc: linux-kernel@vger.kernel.org, Rodrigo Campos Subject: [PATCH v3 1/4] tools/nolibc/string: export strlen() Date: Sun, 18 Feb 2024 16:51:03 -0300 Message-ID: <20240218195110.1386840-2-rodrigo@sdfg.com.ar> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240218195110.1386840-1-rodrigo@sdfg.com.ar> References: <20240218195110.1386840-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