From nobody Thu Oct 21 00:10:54 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E1D9C1806CD8; Thu, 21 Oct 2021 00:10:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HZSYp4k7Bz3GTy; Thu, 21 Oct 2021 00:10:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 82D1B116B9; Thu, 21 Oct 2021 00:10:54 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 19L0Ase7024847; Thu, 21 Oct 2021 00:10:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 19L0Asb2024846; Thu, 21 Oct 2021 00:10:54 GMT (envelope-from git) Date: Thu, 21 Oct 2021 00:10:54 GMT Message-Id: <202110210010.19L0Asb2024846@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 33dba3bb0ec2 - main - rtld-elf/paths.h: Make it usable outside rtld List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 33dba3bb0ec2a0f0a401bed145cc0ef95f37a5c3 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=33dba3bb0ec2a0f0a401bed145cc0ef95f37a5c3 commit 33dba3bb0ec2a0f0a401bed145cc0ef95f37a5c3 Author: Konstantin Belousov AuthorDate: 2021-10-12 15:50:49 +0000 Commit: Konstantin Belousov CommitDate: 2021-10-21 00:08:54 +0000 rtld-elf/paths.h: Make it usable outside rtld but still for tightly coupled things like ldd(1) Rename paths.h to rtld_paths.h. Add guard for rtld-specific externs declarations. Add _COMPAT32_BASENAME_RTLD and _COMPAT32_PATH_RTLD. Reviewed by: arichardson, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D32464 --- libexec/rtld-elf/arm/reloc.c | 2 +- libexec/rtld-elf/libmap.c | 2 +- libexec/rtld-elf/rtld.c | 2 +- libexec/rtld-elf/rtld_malloc.c | 2 +- libexec/rtld-elf/{paths.h => rtld_paths.h} | 18 ++++++++++++++---- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c index 4e551b0948ad..b6eafa59b299 100644 --- a/libexec/rtld-elf/arm/reloc.c +++ b/libexec/rtld-elf/arm/reloc.c @@ -16,7 +16,7 @@ __FBSDID("$FreeBSD$"); #include "debug.h" #include "rtld.h" -#include "paths.h" +#include "rtld_paths.h" #ifdef __ARM_FP /* diff --git a/libexec/rtld-elf/libmap.c b/libexec/rtld-elf/libmap.c index e4388d14b951..854c73f39ef7 100644 --- a/libexec/rtld-elf/libmap.c +++ b/libexec/rtld-elf/libmap.c @@ -16,7 +16,7 @@ #include "debug.h" #include "rtld.h" #include "libmap.h" -#include "paths.h" +#include "rtld_paths.h" #include "rtld_libc.h" TAILQ_HEAD(lm_list, lm); diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index d598bb044f8e..8b1f84c6901a 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include "debug.h" #include "rtld.h" #include "libmap.h" -#include "paths.h" +#include "rtld_paths.h" #include "rtld_tls.h" #include "rtld_printf.h" #include "rtld_malloc.h" diff --git a/libexec/rtld-elf/rtld_malloc.c b/libexec/rtld-elf/rtld_malloc.c index 63fa6f5e2ee7..d08254b67d9f 100644 --- a/libexec/rtld-elf/rtld_malloc.c +++ b/libexec/rtld-elf/rtld_malloc.c @@ -55,7 +55,7 @@ static char *rcsid = "$FreeBSD$"; #include #include "rtld.h" #include "rtld_printf.h" -#include "paths.h" +#include "rtld_paths.h" /* * Pre-allocate mmap'ed pages diff --git a/libexec/rtld-elf/paths.h b/libexec/rtld-elf/rtld_paths.h similarity index 88% rename from libexec/rtld-elf/paths.h rename to libexec/rtld-elf/rtld_paths.h index 75f3b1d47dd4..4ce423ce6dbb 100644 --- a/libexec/rtld-elf/paths.h +++ b/libexec/rtld-elf/rtld_paths.h @@ -26,15 +26,19 @@ * $FreeBSD$ */ -#ifndef PATHS_H -#define PATHS_H +#ifndef _RTLD_PATHS_H +#define _RTLD_PATHS_H #undef _PATH_ELF_HINTS +#ifndef _COMPAT32_BASENAME_RTLD +#define _COMPAT32_BASENAME_RTLD "ld-elf32.so.1" +#endif + #ifdef COMPAT_32BIT #define _PATH_ELF_HINTS "/var/run/ld-elf32.so.hints" #define _PATH_LIBMAP_CONF "/etc/libmap32.conf" -#define _BASENAME_RTLD "ld-elf32.so.1" +#define _BASENAME_RTLD _COMPAT32_BASENAME_RTLD #define STANDARD_LIBRARY_PATH "/lib32:/usr/lib32" #define LD_ "LD_32_" #endif @@ -55,6 +59,10 @@ #define _PATH_RTLD "/libexec/" _BASENAME_RTLD #endif +#ifndef _COMPAT32_PATH_RTLD +#define _COMPAT32_PATH_RTLD "/libexec/" _COMPAT32_BASENAME_RTLD +#endif + #ifndef STANDARD_LIBRARY_PATH #define STANDARD_LIBRARY_PATH "/lib/casper:/lib:/usr/lib" #endif @@ -69,10 +77,12 @@ #define SOFT_STANDARD_LIBRARY_PATH "/usr/libsoft" #define LD_SOFT_ "LD_SOFT_" +#ifdef IN_RTLD extern const char *ld_elf_hints_default; extern const char *ld_path_libmap_conf; extern const char *ld_path_rtld; extern const char *ld_standard_library_path; extern const char *ld_env_prefix; +#endif -#endif /* PATHS_H */ +#endif /* _RTLD_PATHS_H */