From patchwork Sun May 22 19:36:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fangrui Song X-Patchwork-Id: 1634350 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=M8uJ5+lG; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4L5rM4375Dz9sG3 for ; Mon, 23 May 2022 05:37:04 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7DA2738293F3 for ; Sun, 22 May 2022 19:37:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7DA2738293F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1653248220; bh=jxaFP17dKmwlv3yEZGsf6Jhyr3qVE3WjoibErGFXQaM=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=M8uJ5+lGsIlKIVOVSq32PauimynZmlpfmyzuKf1RLo0fiAVnzTuibE7tKoeJZtti4 88B0bxqUTcXlTuABZY7d9pzGYa5Ls8l84BNfl1fW9Aa91VGQ4iHtiYFq+PxQ9YypjF OQJ1kXAeIfOeh5AIuJfAZwmy8g1vQZ8FWeHineWQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by sourceware.org (Postfix) with ESMTPS id 8108A382A6F9 for ; Sun, 22 May 2022 19:36:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8108A382A6F9 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-2f8398e99dcso112199837b3.9 for ; Sun, 22 May 2022 12:36:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=jxaFP17dKmwlv3yEZGsf6Jhyr3qVE3WjoibErGFXQaM=; b=PNs99/ws7r0H5ssw9kJ8ZcsapmG3jnveFlxce7eRfZKUyR/IgIyraJSO/lTPZ1irxi i+ejeUQLf9TBFVFYFM/L9Yvk9CEL3EKN0UfsWCb5Y/cYpbIpodAxmEqRuuFhNED8eC8e hcWsAshfK5Wl9QhrNdsVOUm2LHVj0Op26PX8KnGridxJF+oZ+Zp5B3aDXikzHeWDGysq zEt/dPgqWFDd/BtFDeIWjwH4TqN2tDxgC7Eh5FYK5XXOWfJysf6S08YrGJ33cODXYXHy PkiXb0tCUykntJju4STGv7pYgmAr03LK+wg/7uf86pVZ90qEH/N5VICygUhanZq3XdT7 Pgiw== X-Gm-Message-State: AOAM531Dydw7fXxnF6eKOSlz5w03h0b293ip/YfD2Sea4NqWu+41vQLo BR8FTyc1YLk4QeTSOQMlUIdBOmZHG2RoD7csZFmlg28XhZk7x2qQ3V0FwRAw26LzzgficSdV29H YlwhHu+pRH3DC7rZJiP/tH4cES8FCSb/tDp1H1+TKRsgKuuxcJdIeTxuLHCp7x/M5c1jv X-Google-Smtp-Source: ABdhPJyvJUDrewXNCgpDxDgPk5sY9WDJ+DlkLOlkPWi1YiBzThbYXBw/TTXBqHfSWc9nK5rcScCS+gE9325H X-Received: from maskray1.svl.corp.google.com ([2620:15c:2ce:200:2d1f:7f25:dd1a:a985]) (user=maskray job=sendgmr) by 2002:a25:9081:0:b0:64d:d424:a811 with SMTP id t1-20020a259081000000b0064dd424a811mr18549593ybl.298.1653248205849; Sun, 22 May 2022 12:36:45 -0700 (PDT) Date: Sun, 22 May 2022 12:36:42 -0700 Message-Id: <20220522193642.3598646-1-maskray@google.com> Mime-Version: 1.0 Subject: [PATCH] dlfcn: Move RTLD_DEFAULT/RTLD_NEXT outside __USE_GNU To: libc-alpha@sourceware.org X-Spam-Status: No, score=-19.5 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, 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, USER_IN_DEF_DKIM_WL 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.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Fangrui Song via Libc-alpha From: Fangrui Song Reply-To: Fangrui Song Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" RTLD_DEFAULT and RTLD_NEXT appear in IEEE Std 1003.1-2004. (RTLD_NEXT even appears in the 1997 SUS version 2.) Many systems (e.g. FreeBSD, musl) just define the two macros unconditionally. Let's do the same, as if the state before commit 70b2845f71c1fb6bd5ec3ef325974b6a90cdb45c. Reviewed-by: Florian Weimer Tested-by: Florian Weimer --- dlfcn/dlfcn.h | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/dlfcn/dlfcn.h b/dlfcn/dlfcn.h index a3af6051d4..6be06241d1 100644 --- a/dlfcn/dlfcn.h +++ b/dlfcn/dlfcn.h @@ -30,6 +30,14 @@ #ifdef __USE_GNU #include +/* Type for namespace indices. */ +typedef long int Lmid_t; + +/* Special namespace ID values. */ +# define LM_ID_BASE 0 /* Initial namespace. */ +# define LM_ID_NEWLM -1 /* For dlmopen: request new namespace. */ +#endif + /* If the first argument of `dlsym' or `dlvsym' is set to RTLD_NEXT the run-time address of the symbol called NAME in the next shared object is returned. The "next" relation is defined by the order @@ -41,16 +49,6 @@ is returned. */ # define RTLD_DEFAULT ((void *) 0) - -/* Type for namespace indices. */ -typedef long int Lmid_t; - -/* Special namespace ID values. */ -# define LM_ID_BASE 0 /* Initial namespace. */ -# define LM_ID_NEWLM -1 /* For dlmopen: request new namespace. */ -#endif - - __BEGIN_DECLS /* Open the shared object FILE and map it in; return a handle that can be