git: af9115870670 - main - ldconfig: use libexec/rtld-elf/rtld_paths.h

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Wed, 24 Nov 2021 23:56:23 UTC
The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=af9115870670f508c11b3d173bcff5116d8ef320

commit af9115870670f508c11b3d173bcff5116d8ef320
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2021-11-19 03:45:31 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2021-11-24 23:55:04 +0000

    ldconfig: use libexec/rtld-elf/rtld_paths.h
    
    instead of duplicating definitions using slighly different macro names.
    
    Reviewed by:    emaste
    Tested by:      jbeich
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Differential revision:  https://reviews.freebsd.org/D33058
---
 sbin/ldconfig/Makefile   | 1 +
 sbin/ldconfig/ldconfig.c | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/sbin/ldconfig/Makefile b/sbin/ldconfig/Makefile
index 2ead668578f6..070c2c3d6901 100644
--- a/sbin/ldconfig/Makefile
+++ b/sbin/ldconfig/Makefile
@@ -3,6 +3,7 @@
 PACKAGE=runtime
 PROG=	ldconfig
 SRCS=	elfhints.c ldconfig.c
+CFLAGS+= -I${SRCTOP}/libexec/rtld-elf
 MAN=	ldconfig.8
 
 .include <bsd.prog.mk>
diff --git a/sbin/ldconfig/ldconfig.c b/sbin/ldconfig/ldconfig.c
index 777895936834..288c22813121 100644
--- a/sbin/ldconfig/ldconfig.c
+++ b/sbin/ldconfig/ldconfig.c
@@ -48,6 +48,7 @@
 #include <unistd.h>
 
 #include "ldconfig.h"
+#include "rtld_paths.h"
 
 #define	_PATH_LD32_HINTS	"/var/run/ld32.so.hints"
 #define	_PATH_ELF32_HINTS	"/var/run/ld-elf32.so.hints"
@@ -84,7 +85,7 @@ main(int argc, char **argv)
 	}
 
 	if (is_soft)
-		hints_file = _PATH_ELFSOFT_HINTS;
+		hints_file = _PATH_SOFT_ELF_HINTS;
 	else if (is_32)
 		hints_file = _PATH_ELF32_HINTS;
 	else