From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 05FA33858D28 for ; Mon, 8 Apr 2024 16:57:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 05FA33858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 05FA33858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::630 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712595429; cv=none; b=VBw1wEG5KGHSTVGNEnClsiXd+cuReDI05RgGOqT7yTSEygoh6ekZ/roGk/tmr3z874t+kNCpfwDd1hM5yCEwYGAnFUWaWETjkmhPRTp9OOuyZKnpBnSakn9lpbFvCklZD+ZNuvCWqOBjec94cVnG452xCrBTRtCFmJUbztdfUl0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712595429; c=relaxed/simple; bh=xBOCEwlZjfS6GRd+Q8uKJN6cql3Z1Xltpep2DBRK51g=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=nzcZ9t6WXExNMeMlHJNl6bKrf9HYC2HSvHfYhKoREH+wo9VqC6aJIBoo5F/LTlo53EihlNK2l5HEsWHKEN+khaYAt5WtIEJGiuZvICZfEcmu0HQ1rLms6SZvZ0DXHDdUV2fqSo2MFI1rHSyRaDDdfTX0FrXkK+ILiZFcphXaumc= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1e3f17c6491so13845255ad.2 for ; Mon, 08 Apr 2024 09:57:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712595426; x=1713200226; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=+b8lSxgWb8j4U+NDjMooJ1gLJzzAgTgitPdKCWvP4/g=; b=UT3dGVHUB5RiDym/+pQUiBuVBT1cSEs5xugPO3dy+EWCZ7EO6/Hp1Wxr4CHZRo5jWM UuRvQfNORc3INdtuYrtCGFR3wtFLvL4m6r9XTK3WpmKC1PGeaxHhfobJjqO1WFLAHV+F wxqSFvPe4Cmy4oOM5KYB447YZcHKzmwENNzHmOaQf2Z99x5GTySnCmFzdjNaV7KtIA2a NCvfW1R1p2Ke1bRv9MILz2P91Qpqm91uBR3yT5DMqWdNUHvPSpPv9BqymS4vSFC6Piah REpiE573w3FwpL5lFltm8zD3XWjdRy9yQ8IPQDKH4uz2h0ESP3JMWRam5i8SJ9cUL605 Xpmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712595426; x=1713200226; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=+b8lSxgWb8j4U+NDjMooJ1gLJzzAgTgitPdKCWvP4/g=; b=NCPgctpyFT9/nFuKun9bLntIsBpNyYOhy+Uw+tD21Ev8yaj1mfUALGDtZZKboDcNW0 YOaNkMJ27djJGCsFj8os0EwjiAuyxMgOG1eG6jkKM05W8YyfCp/5+14G0obgDl8NhLCz SOBWY0tSe+Kn3fLiocKX9597YFOXQOQ4ycJ/93iHLJZCFqeMkPBIFG1F28qCA0rccgwv iRqLpKBo2VE38Al/g0JM0u+0q0SrgoEnv78nxKnYq/ayVsco7Qv/OdFEqSLFMufXLe28 xsHuOHME+QOFIxDfpK0jqmgZQ0SULxN3NlYYK0QuaLLq5+oh9GZHwh151IYmEag0BQfR ed+w== X-Gm-Message-State: AOJu0YyP+smcqeLMXeEVErGSG7Mg0WMfP9CoIlAHnt6iWU1z4htentQs mputX4dLQyKCoeKa7kCEeAMgY9ntGtLfyjcKAZ7sCNh1C9iXL85JARn/7N5XTMGgfwVF0q8aacH q X-Google-Smtp-Source: AGHT+IFO/I3bSWSLNkK8sZUzFOrXwLF9Mrm+n48zGbGuT6LeM/yf6KUiO8AjgmcKj+npDwJrhVHfVg== X-Received: by 2002:a17:902:f542:b0:1e4:4045:481b with SMTP id h2-20020a170902f54200b001e44045481bmr2486642plf.29.1712595425951; Mon, 08 Apr 2024 09:57:05 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c0:3e7e:c5ca:dd5b:a5af:8027? ([2804:1b3:a7c0:3e7e:c5ca:dd5b:a5af:8027]) by smtp.gmail.com with ESMTPSA id y6-20020a170902ed4600b001e0b5eeee41sm7226642plb.38.2024.04.08.09.57.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Apr 2024 09:57:05 -0700 (PDT) Message-ID: Date: Mon, 8 Apr 2024 13:57:02 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] aarch64: Remove ld.so __tls_get_addr plt usage To: Szabolcs Nagy , =?UTF-8?Q?Cristian_Rodr=C3=ADguez?= , "H.J. Lu" , Florian Weimer Cc: libc-alpha@sourceware.org References: <20240405123550.1748641-1-adhemerval.zanella@linaro.org> Content-Language: en-US From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 08/04/24 04:26, Szabolcs Nagy wrote: > The 04/07/2024 16:29, Cristian Rodríguez wrote: >> On Fri, Apr 5, 2024 at 11:59 AM Szabolcs Nagy wrote: >>> >>> The 04/05/2024 09:35, Adhemerval Zanella wrote: >>>> Use the hidden alias instead. >>>> >>>> Checked on aarch64-linux-gnu. >>> >>> does this change behaviour in case __tls_get_addr is interposed? >> >> Wut ? is that really supported.. I mean.. isn't that symbol prefix >> reserved for the implementation and any assumption about it is either >> ID or UB? > > a behaviour can change even if it's not supported. > i did not try to imply that it should be supported. > > i know sanitizers interpose __tls_get_addr, because > https://sourceware.org/bugzilla/show_bug.cgi?id=16291 > i don't know if that hack works at all now for tlsdesc > (where the ld.so calls __tls_get_addr, not user code) > > my question was if we investigated this issue since it > is useful to document then in the commit msg (or news > entry if this affects users) This change 'breaks' the sanitizer trick to get the dynamic TLS, with this patch I now see: MemorySanitizer-AARCH64 :: dtls_test.c SanitizerCommon-asan-aarch64-Linux :: Linux/resize_tls_dynamic.cpp SanitizerCommon-msan-aarch64-Linux :: Linux/resize_tls_dynamic.cpp SanitizerCommon-tsan-aarch64-Linux :: Linux/resize_tls_dynamic.cpp And it does not fail on x86 only because it uses -mtls=gnu as default (the same tests fail on x86 with -mtls=gnu2). Now that GCC and distributions are aiming to use GNU2/DESC as the default TLS, this hack will also break on x86. So the question is whether we revert 050f7298e1ecc39887c329037575ccd972071255 and document that __tls_get_addr should be interposable, or move with this change and try to come up with a possible solution for BZ#16291. I bringing this because we will have another two ABIs with tlsdesc support (loongarch and riscv).