From patchwork Thu Sep 5 13:49:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 97176 X-Patchwork-Delegate: fweimer@redhat.com Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 977FB384AB60 for ; Thu, 5 Sep 2024 13:50:37 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by sourceware.org (Postfix) with ESMTPS id 86B243865C22 for ; Thu, 5 Sep 2024 13:49:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 86B243865C22 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 86B243865C22 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::336 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725544192; cv=none; b=O0+gzgUHQXMk6gYjlXClpOg8etKiPn8krsbnqb68H7eexdcLMiMGOicqYz42o8BaO+bofJzsi4Cp04K7Pg6UJj/oA0vbv5nZvX3AC5fCpkKukxvk7sSCeOHLyblI8IQ8wJjvsMDNjNklkqcYiGVsPOySA8rvTba0MIq2RCTuWpE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725544192; c=relaxed/simple; bh=df2rlalOFo9Sjset8cNQoL3agQ+DmkCGA+ZKXjAlelE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=L1hUv3BMP1xFzok4s7BAEMNpTeZNyabcbFrUrMUg7oy+CyapQ/c0eH9qWg6puNp2ujrQDY6k5/zGsB/r5vYVr5NFJRDG0Tls8mJOY+R2pAmeZ6u69wX59nTUrwevKC/1N6LU7EEm7km9OtvMUvTeKZVbKufBEGRwPvwF7GbdzJs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-428e0d18666so6522635e9.3 for ; Thu, 05 Sep 2024 06:49:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725544188; x=1726148988; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=ajJFOR8b5Hr5EC/YB0K5ZWSRS4gBdE3ClAWdY5kzIfU=; b=ER3ddr+p/qN/Av6bHTRwRh+Ia5vZqn4SMj/91S0QmOPwUdmdY9uC3+mc5NMZTmy6ox ifV03CHCDSaxWULoZKPbLFap00PcerPTwNinxBTttKYaAOpcjJQnYROODb3AWcet1ZBf RFgcINmmF30Najnq3PmMO6GYwEhT0GgYXNs1Il+c6bxmfHNRc9mdqFy+APabtlVLklgh Gm/acU1WRLrsxex69atB26lEdOvI4AhNBrUm/HV87+A2RjcCqEZqhfHfR8feDz8l1XrU VKF4M5+sbAtBpXCZxO/9iUPcLpuU5KTtuzUXZwuDDPrZ7Zmb9OzcTDeigqqRgbkPnhil XFdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725544188; x=1726148988; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ajJFOR8b5Hr5EC/YB0K5ZWSRS4gBdE3ClAWdY5kzIfU=; b=eGIllmUVbAwR+4CUWSWglnRGDCS4KLzMBaxqYVmLWP3J7EOS8whlodEPFyjixW1Q6e tTlZzRSB4ohn/HPg36MsO2KJkhqEjDV+gAjkr3U0/QCLfoDSERDNU7rWoKardZQYuQtB P5LW/2/G7cG5vrFultfA8AuQGjEl6Z7/rwpRutr9hnhmikbMQJUL5N3U/r8yunzG4UDO 3XE9ZJ1yj+j6Hylue9DdWQEzFFwTF2YZvx63XLnXzz2A+iDDhrjZg4hABpSc/nJ58pq3 d1wfdNzT6LyfA1fzlfOBuwEZMqhhzzNao082bwGavpk1W0xZ0TSYqQXuuz3ujFRpqBE7 QZ5g== X-Gm-Message-State: AOJu0YxsT+gs1xIP5lTyFdBOuujstt1buSU64aOcqZibbKbaoigcx8xh NwCeuJ7IYdGtt7+H7k38YbIrjO97G9fvfXqykZzxgdoT84hVsY3a7MNq9qyAEME9q2AyiU5RIcC LvASS/w== X-Google-Smtp-Source: AGHT+IGAqxiLLsHi/Qh3J9SycUhC9ipKSNH+RNtnnnZpQf39viLeC6lpDz6phzNzQlrifw3Z67pimQ== X-Received: by 2002:a05:600c:138e:b0:428:c0a:27ea with SMTP id 5b1f17b1804b1-42bbb205ac6mr152147535e9.12.1725544187460; Thu, 05 Sep 2024 06:49:47 -0700 (PDT) Received: from ubuntu-vm.. (51-148-40-55.dsl.zen.co.uk. [51.148.40.55]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-42bb6df795asm233621585e9.21.2024.09.05.06.49.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 06:49:46 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [PATCH v2] linux: Use GLRO(dl_vdso_gettimeofday) on gettimeofday Date: Thu, 5 Sep 2024 13:49:36 +0000 Message-ID: <20240905134942.2463850-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org The BZ#24967 fix (1bdda52fe92fd01b424c) missed the gettimeofday for architectures that define USE_IFUNC_GETTIMEOFDAY. Although it is not an issue, since there is no pointer mangling, there is also no need to call dl_vdso_vsym since the vDSO setup was already done by the loader. Checked on x86_64-linux-gnu and i686-linux-gnu. --- Change from v1: * Fixed build on some architectures due a missing INIT_ARCH. --- sysdeps/unix/sysv/linux/gettimeofday.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sysdeps/unix/sysv/linux/gettimeofday.c b/sysdeps/unix/sysv/linux/gettimeofday.c index 7ab147c614..afee658e7b 100644 --- a/sysdeps/unix/sysv/linux/gettimeofday.c +++ b/sysdeps/unix/sysv/linux/gettimeofday.c @@ -36,12 +36,11 @@ __gettimeofday_syscall (struct timeval *restrict tv, void *restrict tz) return INLINE_SYSCALL_CALL (gettimeofday, tv, tz); } -# undef INIT_ARCH -# define INIT_ARCH() \ - void *vdso_gettimeofday = dl_vdso_vsym (HAVE_GETTIMEOFDAY_VSYSCALL) +# define INIT_ARCH() libc_ifunc (__gettimeofday, - vdso_gettimeofday ? VDSO_IFUNC_RET (vdso_gettimeofday) - : (void *) __gettimeofday_syscall) + GLRO(dl_vdso_gettimeofday) != NULL + ? VDSO_IFUNC_RET (GLRO(dl_vdso_gettimeofday)) + : (void *) __gettimeofday_syscall) # else int