From patchwork Wed May 6 17:35:51 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 134573 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 14D5E4BA23F0 for ; Wed, 6 May 2026 17:38:38 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 14D5E4BA23F0 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=TSJM3Qe/ X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-dy1-x1331.google.com (mail-dy1-x1331.google.com [IPv6:2607:f8b0:4864:20::1331]) by sourceware.org (Postfix) with ESMTPS id 09E164BA23F2 for ; Wed, 6 May 2026 17:38:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 09E164BA23F2 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 09E164BA23F2 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1331 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778089082; cv=none; b=T32qCMdCav8J5oYAkykPg3XqCgfMFaMbcPaSTA8eqMMMGPbQTkiP2YD3gXbTASwajnlM50zD9EHUJh25XUzQWC4WFnYHBABPt7vOGR/qLZaoEg1FajZkEGrtUON0rqZM7N/o4KtduNd9m1wE49wv2fHIOm5U4Eve9a+4qX0MbGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1778089082; c=relaxed/simple; bh=yziamVEYr4fdm5f6fPAyEMFNk448dJ+aa1t2KCz1gZ0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=aWPKSQra3BUFE2dv3jrhNdcQDqHghUNSb5SUNv6/xQEc/ChwAMMOYUo+4DHUvQGB5BwFLdXO0QGu0TCMzdhPulPWquebc1UZvTihNiOCjdtIXWyyTqbpEytBphztJTgTXjgHCGHmAT3OXvSKsGxIviK51wlMWtDwCrPSMw+zSi0= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=TSJM3Qe/ DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 09E164BA23F2 Received: by mail-dy1-x1331.google.com with SMTP id 5a478bee46e88-2f00a567cfaso825128eec.0 for ; Wed, 06 May 2026 10:38:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1778089081; x=1778693881; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=SiJlX0CW4fFRo9kVWcPwV89O4jGRmcqz56f6QfiNX4w=; b=TSJM3Qe/IQ8dMd2bRZpat0WOJkz+LwHlMp+8s6o8ZA2r+wCtthNfCnOs8vaIfqlzvC STWCPSmxw0hkDbRCH/gmheQEPHfwQwfzTUgfhfqg7s9sRUD8ruDi6cTV0cCX6pPZ6qRn E4a9OSHebOh/v2Rv63FK6OQ0umJbROSpYM/zuvQs9vgxjHDqrujw7zNBIBne1h6djbpP TcRf5UvoyL8qgITsKKt83zUTRZtsFCNjyPQkmBl/VzS36SBo73vHrz0zPESn1+SlIVkE qoOjR+bno3e1r3hcLBls3QWbA1O1BO5i+WCTDcoonrL7SczD0LHmvKby5/a/KgN7uBXW OfNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778089081; x=1778693881; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=SiJlX0CW4fFRo9kVWcPwV89O4jGRmcqz56f6QfiNX4w=; b=hQ8tHXSVTxKg5erWg0A1sxm0aLeZIy5a3mtVUrxYpS8sqcqIz6jJWL+/qov8JfPu49 oaayZBr1nJ0EpY+0GJaw9m+WCjRUHCKCkUoXAa/SIYNMY314Zvr7IV6kY+ckrzQduX1K BA8DVd8UcAK+JbgNJ/9nZpokKMPYu3t5tBhpo9NO3M9SdMv2RdfspSltoYs0Z5F//WGm xGsozN2ntjfhtqOPDqtaqP8EccCFxo6XPy9rQpENfv7++5A6N63KbH5TZHTkpaVl2uIV CQox/nKFtw0hJBqz/NRN4p8cq7n1Dbipu/hCKLrlsBvgcNr5VmmAVDxpCwgb8IslGcD6 lspw== X-Gm-Message-State: AOJu0YwDNVFL0cP+BBiJggLONPiUgLSOctuQz2TOARrJrvkZ56FyY59M GfNSvQs0CdlB+bXO62MSHtY6Fz6JevIR+ROLCSLVKPJXxfp29eWH8geDZhQrqBIKDyaQaXrUy6W 3htI/ X-Gm-Gg: AeBDiev2WrogAYl3jPk4phGUsTebNx3V/0JCG5usq+Z1AE+Vo2q9/jggZjAx4PtvoDd FhhiI0cshoAl3wDhOvCTX3YCbqgh8+4FOaxVd8OkdCa9bdHYe46HLLhqtblrTaeMGjh5LTkasyL vBoN4OK1un8PjxY5qXGNgC4hBqesc0mvkVGrXd2xLS/H8EHedwReSSfrCFFYgP5LcyJvbDQUUvQ AVf+9U4AdovWwBq/kwwnNjwL2CCrFlHhp8K8HpCuwclCud5ElSYInx+hngXVygVbBuUyZ9yKne/ pvX8vTe86DuobRDGePfSbbpuhgBoE9T+6JJhehDq+zdujSUOr+DVa8kvB5aXASmxQv/xKIkR02u UEUoONL3U5C0EphDXmGFiYvULTj74urEMJnmL0qwy0Qxu1/LXU/9y+shVZEbiz7+zsaJ/rq+SmU JwEZdBryM5g7NWWnhT1ET6x95j0bucoqgA2GYVPaGW1M90 X-Received: by 2002:a05:7301:658a:b0:2d2:d5a3:e97c with SMTP id 5a478bee46e88-2f3d079bc75mr3624180eec.12.1778089080329; Wed, 06 May 2026 10:38:00 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c1:364:eaaa:4019:b33c:5884]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2f56f88f4a4sm3992857eec.17.2026.05.06.10.37.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 10:37:59 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: usamoi@outlook.com, Florian Weimer Subject: [PATCH v3] elf: Allow vDSO as a direct dependency (BZ 33335) Date: Wed, 6 May 2026 14:35:51 -0300 Message-ID: <20260506173755.3874810-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, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on 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 When a program explicitly links against the vDSO by name (e.g. -l:linux-vdso.so.1), the dynamic linker exhibits two problems: 1. Symbol resolution always binds to the kernel's implicit vDSO rather than the explicitly provided stub, because _dl_lookup_map returns the already-loaded kernel vDSO when the soname matches. 2. Depending on the link order, startup crashes with an assertion: Inconsistency detected by ld.so: rtld.c: dl_main: Assertion `_dl_rtld_map.l_prev->l_next == _dl_rtld_map.l_next' This happens because the kernel vDSO is inserted early in the link map (right after the interpreter), so reusing it as a DT_NEEDED dependency places it at a search-list position inconsistent with its chain position. When rtld.c later re-inserts the interpreter into the chain at symbol-search order, the adjacency invariant it relies on no longer holds. Both problems stem from the same root cause: _dl_lookup_map matching the kernel vDSO when a DSO asks for it by name. The fix adds lt_vdso as a new value in the l_type enum of struct link_map, replacing the former __RTLD_VDSO mode flag. The kernel-mapped vDSO link map is created with type lt_vdso (via setup-vdso.h), and _dl_lookup_map skips such objects during name resolution. With the implicit vDSO invisible to name resolution, an explicit dependency triggers a fresh filesystem load of the stub at its proper position in the chain, and the rtld reinsertion logic sees a consistent adjacency. The audit allocation in _dl_new_object previously relied on __RTLD_VDSO to allocate DL_NNS audit slots for the vDSO (needed before the audit count is known). This is now handled by checking type == lt_vdso directly. The _dlfo_process_initial function in dl-find_object.c is updated to treat lt_vdso link maps the same as lt_library (implicitly NODELETE), preserving dladdr() behavior on vDSO addresses. The two new tests check: - tst-vdso-1: links against the stub with a normal dependency order (-l:linux-vdso.so.1 before libc). Verifies that the stub's symbol is resolved instead of the kernel vDSO. - tst-vdso-2: uses a special link order (-lc -l:linux-vdso.so.1 -l:ld.so) that reproduces the exact BZ 33335 crash without the fix. The tests are enabled for all Linux architectures that define vdso-name (set by each arch's sysdep Makeconfig). Checked on x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu, powerpc-linux-gnu, and powerpc64-linux-gnu. --- Changes from v2: * Replace __RTLD_VDSO usage by lt_vdso. * Fix _dlfo_process_initial to also considere lt_vdso. * Move vdso-name to arch-specific Makeconfig. Changes from v1: * Use a bit from l_type instead of adding a new member at link_map. * Move tests to sysdeps/unix/sysv/linux/. --- elf/Makefile | 39 +++++++++++++++++++ elf/dl-find_object.c | 5 ++- elf/dl-load.c | 8 +++- elf/dl-object.c | 2 +- elf/setup-vdso.h | 4 +- elf/tst-vdso-1.c | 1 + elf/tst-vdso-2.c | 1 + elf/tst-vdso.c | 34 ++++++++++++++++ include/dlfcn.h | 2 - include/link.h | 3 +- sysdeps/unix/sysv/linux/aarch64/Makeconfig | 1 + sysdeps/unix/sysv/linux/arm/Makeconfig | 1 + sysdeps/unix/sysv/linux/hppa/Makeconfig | 1 + sysdeps/unix/sysv/linux/i386/Makeconfig | 1 + sysdeps/unix/sysv/linux/loongarch/Makeconfig | 1 + sysdeps/unix/sysv/linux/mips/Makeconfig | 1 + .../sysv/linux/powerpc/powerpc32/Makeconfig | 1 + .../sysv/linux/powerpc/powerpc64/Makeconfig | 1 + sysdeps/unix/sysv/linux/riscv/Makeconfig | 1 + sysdeps/unix/sysv/linux/s390/Makeconfig | 1 + .../unix/sysv/linux/sparc/sparc32/Makeconfig | 1 + .../unix/sysv/linux/sparc/sparc64/Makeconfig | 1 + sysdeps/unix/sysv/linux/tst-vdso-lib.c | 24 ++++++++++++ sysdeps/unix/sysv/linux/x86_64/Makeconfig | 1 + 24 files changed, 126 insertions(+), 10 deletions(-) create mode 100644 elf/tst-vdso-1.c create mode 100644 elf/tst-vdso-2.c create mode 100644 elf/tst-vdso.c create mode 100644 sysdeps/unix/sysv/linux/aarch64/Makeconfig create mode 100644 sysdeps/unix/sysv/linux/arm/Makeconfig create mode 100644 sysdeps/unix/sysv/linux/hppa/Makeconfig create mode 100644 sysdeps/unix/sysv/linux/i386/Makeconfig create mode 100644 sysdeps/unix/sysv/linux/loongarch/Makeconfig create mode 100644 sysdeps/unix/sysv/linux/mips/Makeconfig create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/Makeconfig create mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc64/Makeconfig create mode 100644 sysdeps/unix/sysv/linux/riscv/Makeconfig create mode 100644 sysdeps/unix/sysv/linux/s390/Makeconfig create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/Makeconfig create mode 100644 sysdeps/unix/sysv/linux/sparc/sparc64/Makeconfig create mode 100644 sysdeps/unix/sysv/linux/tst-vdso-lib.c create mode 100644 sysdeps/unix/sysv/linux/x86_64/Makeconfig diff --git a/elf/Makefile b/elf/Makefile index c835eb8156d..2f8d91dd08a 100644 --- a/elf/Makefile +++ b/elf/Makefile @@ -1452,6 +1452,14 @@ ifeq ($(run-built-tests),yes) tests-special += $(objpfx)tst-origin.out endif +ifneq (,$(vdso-name)) +tests += tst-vdso-1 + +ifeq ($(run-built-tests),yes) +tests-special += $(objpfx)tst-vdso-2.out +endif +endif + include ../Rules ifeq (yes,$(build-shared)) @@ -3554,3 +3562,34 @@ $(objpfx)tst-dl-debug-exclude.out: tst-dl-debug-exclude.sh \ $(objpfx)tst-recursive-tls > $@; \ $(evaluate-test) endif + +ifneq (,$(vdso-name)) +CFLAGS-tst-vdso-lib.c += $(no-stack-protector) +$(objpfx)tst-vdso-lib.os: ../sysdeps/unix/sysv/linux/tst-vdso-lib.c $(before-compile) + $(compile-command.c) -UMODULE_NAME -DMODULE_NAME=testsuite +$(objpfx)$(vdso-name).so: $(objpfx)tst-vdso-lib.os + $(LINK.o) -nodefaultlibs -Wl,--soname,$(vdso-name).so.1 -shared \ + -o $@ -B$(csu-objpfx) $(LDFLAGS.so) $< +$(objpfx)$(vdso-name).so.1: $(objpfx)$(vdso-name).so + $(make-link) + +# Link tst-vdso-1 with $(vdso-name).so, but without a full path. +LDFLAGS-tst-vdso-1 += -Wl,-rpath,\$$ORIGIN -L$(subst :, -L,$(rpath-link)) +LDLIBS-tst-vdso-1 += -l:$(vdso-name).so +$(objpfx)tst-vdso-1: +nolink-deps += $(objpfx)$(vdso-name).so +$(objpfx)tst-vdso-1: $(objpfx)$(vdso-name).so.1 + +# The tst-vdso-2 requires a special link rule to put the vDSO on the last +# tag in the dynamic section (to trigger the circular dependency as +# described by BZ 33335) +$(objpfx)tst-vdso-2: +nolink-deps += $(objpfx)$(vdso-name).so +$(objpfx)tst-vdso-2: $(objpfx)tst-vdso-2.o $(objpfx)$(vdso-name).so.1 $(libsupport) + $(LINK.o) -nodefaultlibs -o $@ $< \ + $(libsupport) $(static-gnulib) $(common-objpfx)libc_nonshared.a \ + $(link-libc-rpath) \ + -Wl,-rpath,\$$ORIGIN -L$(subst :, -L,$(rpath-link)) \ + -lc -l:$(vdso-name).so \ + -Wl,--dynamic-linker=$(objpfx)ld.so,--no-as-needed $(objpfx)ld.so + +$(objpfx)tst-vdso-2.out: $(objpfx)tst-vdso-2 +endif diff --git a/elf/dl-find_object.c b/elf/dl-find_object.c index 28c04b374ea..3493294e0c1 100644 --- a/elf/dl-find_object.c +++ b/elf/dl-find_object.c @@ -517,8 +517,9 @@ _dlfo_process_initial (void) /* Skip the main map processed above, and proxy maps. */ if (l != main_map && l == l->l_real) { - /* lt_library link maps are implicitly NODELETE. */ - if (l->l_type == lt_library || l->l_nodelete_active) + /* lt_library and lt_vdso link maps are implicitly NODELETE. */ + if (l->l_type == lt_library || l->l_type == lt_vdso + || l->l_nodelete_active) { /* The kernel may have loaded ld.so with gaps. */ if (!l->l_contiguous && is_rtld_link_map (l)) diff --git a/elf/dl-load.c b/elf/dl-load.c index 48575fff06a..7b5782c8744 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -1904,8 +1904,12 @@ _dl_lookup_map (Lmid_t nsid, const char *name) { /* If the requested name matches the soname of a loaded object, use that object. Elide this check for names that have not - yet been opened. */ - if (__glibc_unlikely ((l->l_faked | l->l_removed) != 0)) + yet been opened. + + Also, avoid matching the vDSO; if the DSO requires it, assume it is + provided by a real object (rather than the implicitly loaded one). */ + if (__glibc_unlikely ((l->l_faked | l->l_removed) != 0 + || l->l_type == lt_vdso)) continue; if (!_dl_name_match_p (name, l)) { diff --git a/elf/dl-object.c b/elf/dl-object.c index 8153e5ca28e..e10de4ab0dc 100644 --- a/elf/dl-object.c +++ b/elf/dl-object.c @@ -59,7 +59,7 @@ _dl_new_object (char *realname, const char *libname, int type, { #ifdef SHARED unsigned int naudit; - if (__glibc_unlikely ((mode & (__RTLD_OPENEXEC | __RTLD_VDSO)) != 0)) + if (__glibc_unlikely ((mode & __RTLD_OPENEXEC) != 0 || type == lt_vdso)) { if (mode & __RTLD_OPENEXEC) { diff --git a/elf/setup-vdso.h b/elf/setup-vdso.h index 0dba7072d53..1ecdc635ab7 100644 --- a/elf/setup-vdso.h +++ b/elf/setup-vdso.h @@ -29,8 +29,8 @@ setup_vdso (struct link_map *main_map __attribute__ ((unused)), better be, since it's read-only and so we couldn't relocate it). We just want our data structures to describe it as if we had just mapped and relocated it normally. */ - struct link_map *l = _dl_new_object ((char *) "", "", lt_library, NULL, - __RTLD_VDSO, LM_ID_BASE); + struct link_map *l = _dl_new_object ((char *) "", "", lt_vdso, NULL, + 0, LM_ID_BASE); bool l_addr_set = false; if (__glibc_likely (l != NULL)) { diff --git a/elf/tst-vdso-1.c b/elf/tst-vdso-1.c new file mode 100644 index 00000000000..2dd0855ea2b --- /dev/null +++ b/elf/tst-vdso-1.c @@ -0,0 +1 @@ +#include "tst-vdso.c" diff --git a/elf/tst-vdso-2.c b/elf/tst-vdso-2.c new file mode 100644 index 00000000000..2dd0855ea2b --- /dev/null +++ b/elf/tst-vdso-2.c @@ -0,0 +1 @@ +#include "tst-vdso.c" diff --git a/elf/tst-vdso.c b/elf/tst-vdso.c new file mode 100644 index 00000000000..d79c776a9c8 --- /dev/null +++ b/elf/tst-vdso.c @@ -0,0 +1,34 @@ +/* Check for explicit vDSO dependency (BZ 33335) + Copyright (C) 2026 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include +#include + +extern int __kernel_clock_gettime(clockid_t clk_id, struct timespec *tp); + +static int +do_test (void) +{ + TEST_COMPARE (__kernel_clock_gettime (CLOCK_REALTIME, + &(struct timespec) { 0 }), + 42); + + return 0; +} + +#include diff --git a/include/dlfcn.h b/include/dlfcn.h index a44420fa374..73131f8d3b4 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -14,8 +14,6 @@ rtld_hidden_proto (_dl_find_object) #define __RTLD_AUDIT 0x08000000 #define __RTLD_SECURE 0x04000000 /* Apply additional security checks. */ #define __RTLD_NOIFUNC 0x02000000 /* Suppress calling ifunc functions. */ -#define __RTLD_VDSO 0x01000000 /* Tell _dl_new_object the object is - system-loaded. */ #define __LM_ID_CALLER -2 diff --git a/include/link.h b/include/link.h index 8f851d2212d..fe28f3b3ce1 100644 --- a/include/link.h +++ b/include/link.h @@ -175,7 +175,8 @@ struct link_map { lt_executable, /* The main executable program. */ lt_library, /* Library needed by main executable. */ - lt_loaded /* Extra run-time loaded shared object. */ + lt_loaded, /* Extra run-time loaded shared object. */ + lt_vdso, /* The vDSO object provided by the kernel. */ } l_type:2; unsigned int l_dt_relr_ref:1; /* Nonzero if GLIBC_ABI_DT_RELR is referenced. */ diff --git a/sysdeps/unix/sysv/linux/aarch64/Makeconfig b/sysdeps/unix/sysv/linux/aarch64/Makeconfig new file mode 100644 index 00000000000..3deec2f369f --- /dev/null +++ b/sysdeps/unix/sysv/linux/aarch64/Makeconfig @@ -0,0 +1 @@ +vdso-name := linux-vdso diff --git a/sysdeps/unix/sysv/linux/arm/Makeconfig b/sysdeps/unix/sysv/linux/arm/Makeconfig new file mode 100644 index 00000000000..3deec2f369f --- /dev/null +++ b/sysdeps/unix/sysv/linux/arm/Makeconfig @@ -0,0 +1 @@ +vdso-name := linux-vdso diff --git a/sysdeps/unix/sysv/linux/hppa/Makeconfig b/sysdeps/unix/sysv/linux/hppa/Makeconfig new file mode 100644 index 00000000000..3deec2f369f --- /dev/null +++ b/sysdeps/unix/sysv/linux/hppa/Makeconfig @@ -0,0 +1 @@ +vdso-name := linux-vdso diff --git a/sysdeps/unix/sysv/linux/i386/Makeconfig b/sysdeps/unix/sysv/linux/i386/Makeconfig new file mode 100644 index 00000000000..55ea59b0d85 --- /dev/null +++ b/sysdeps/unix/sysv/linux/i386/Makeconfig @@ -0,0 +1 @@ +vdso-name := linux-gate diff --git a/sysdeps/unix/sysv/linux/loongarch/Makeconfig b/sysdeps/unix/sysv/linux/loongarch/Makeconfig new file mode 100644 index 00000000000..3deec2f369f --- /dev/null +++ b/sysdeps/unix/sysv/linux/loongarch/Makeconfig @@ -0,0 +1 @@ +vdso-name := linux-vdso diff --git a/sysdeps/unix/sysv/linux/mips/Makeconfig b/sysdeps/unix/sysv/linux/mips/Makeconfig new file mode 100644 index 00000000000..3deec2f369f --- /dev/null +++ b/sysdeps/unix/sysv/linux/mips/Makeconfig @@ -0,0 +1 @@ +vdso-name := linux-vdso diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/Makeconfig b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Makeconfig new file mode 100644 index 00000000000..e6101fdfbc8 --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/Makeconfig @@ -0,0 +1 @@ +vdso-name := linux-vdso32 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/Makeconfig b/sysdeps/unix/sysv/linux/powerpc/powerpc64/Makeconfig new file mode 100644 index 00000000000..0c9649e945f --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/Makeconfig @@ -0,0 +1 @@ +vdso-name := linux-vdso64 diff --git a/sysdeps/unix/sysv/linux/riscv/Makeconfig b/sysdeps/unix/sysv/linux/riscv/Makeconfig new file mode 100644 index 00000000000..3deec2f369f --- /dev/null +++ b/sysdeps/unix/sysv/linux/riscv/Makeconfig @@ -0,0 +1 @@ +vdso-name := linux-vdso diff --git a/sysdeps/unix/sysv/linux/s390/Makeconfig b/sysdeps/unix/sysv/linux/s390/Makeconfig new file mode 100644 index 00000000000..0c9649e945f --- /dev/null +++ b/sysdeps/unix/sysv/linux/s390/Makeconfig @@ -0,0 +1 @@ +vdso-name := linux-vdso64 diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/Makeconfig b/sysdeps/unix/sysv/linux/sparc/sparc32/Makeconfig new file mode 100644 index 00000000000..55ea59b0d85 --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/Makeconfig @@ -0,0 +1 @@ +vdso-name := linux-gate diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/Makeconfig b/sysdeps/unix/sysv/linux/sparc/sparc64/Makeconfig new file mode 100644 index 00000000000..3deec2f369f --- /dev/null +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/Makeconfig @@ -0,0 +1 @@ +vdso-name := linux-vdso diff --git a/sysdeps/unix/sysv/linux/tst-vdso-lib.c b/sysdeps/unix/sysv/linux/tst-vdso-lib.c new file mode 100644 index 00000000000..3426d90723b --- /dev/null +++ b/sysdeps/unix/sysv/linux/tst-vdso-lib.c @@ -0,0 +1,24 @@ +/* Check for explicit vDSO dependency (BZ 33335) + Copyright (C) 2026 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + . */ + +#include + +int __kernel_clock_gettime (clockid_t clk_id, struct timespec *tp) +{ + return 42; +} diff --git a/sysdeps/unix/sysv/linux/x86_64/Makeconfig b/sysdeps/unix/sysv/linux/x86_64/Makeconfig new file mode 100644 index 00000000000..3deec2f369f --- /dev/null +++ b/sysdeps/unix/sysv/linux/x86_64/Makeconfig @@ -0,0 +1 @@ +vdso-name := linux-vdso