1 diff --git a/elf/Makefile b/elf/Makefile
2 index 5d666b1b..a5017e9c 100644
5 @@ -669,14 +669,14 @@ $(objpfx)sln: $(sln-modules:%=$(objpfx)%.o)
7 $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
9 -SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
10 -CFLAGS-ldconfig.c += $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
11 +PREFIX-FLAGS := -D'PREFIX="$(prefix)"'
12 +CFLAGS-ldconfig.c += $(PREFIX-FLAGS) -D'LIBDIR="$(libdir)"' \
13 -D'SLIBDIR="$(slibdir)"'
14 libof-ldconfig = ldconfig
15 -CFLAGS-dl-cache.c += $(SYSCONF-FLAGS)
16 -CFLAGS-cache.c += $(SYSCONF-FLAGS)
17 -CFLAGS-rtld.c += $(SYSCONF-FLAGS)
18 -CFLAGS-dl-usage.c += $(SYSCONF-FLAGS) \
19 +CFLAGS-dl-cache.c += $(PREFIX-FLAGS)
20 +CFLAGS-cache.c += $(PREFIX-FLAGS)
21 +CFLAGS-rtld.c += $(PREFIX-FLAGS)
22 +CFLAGS-dl-usage.c += $(PREFIX-FLAGS) \
23 -D'RTLD="$(rtlddir)/$(rtld-installed-name)"'
25 cpp-srcs-left := $(all-rtld-routines:=.os)
26 diff --git a/elf/dl-diagnostics.c b/elf/dl-diagnostics.c
27 index bef224b3..8e166b12 100644
28 --- a/elf/dl-diagnostics.c
29 +++ b/elf/dl-diagnostics.c
30 @@ -205,7 +205,7 @@ print_paths (void)
32 _dl_diagnostics_print_labeled_string ("path.prefix", PREFIX);
33 _dl_diagnostics_print_labeled_string ("path.rtld", RTLD);
34 - _dl_diagnostics_print_labeled_string ("path.sysconfdir", SYSCONFDIR);
35 + _dl_diagnostics_print_labeled_string ("path.sysconfdir", PREFIX "/etc");
37 unsigned int index = 0;
38 static const char *system_dirs = SYSTEM_DIRS "\0";
39 diff --git a/elf/ldconfig.c b/elf/ldconfig.c
40 index 28ed637a..6f07b79a 100644
44 #define TLS_HWCAP_BIT 63
47 -# define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
48 +# define LD_SO_CONF PREFIX "/etc/ld.so.conf"
51 /* Get libc version number. */
52 diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h
53 index 964d50a4..2224d651 100644
54 --- a/sysdeps/generic/dl-cache.h
55 +++ b/sysdeps/generic/dl-cache.h
60 -# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
61 +# define LD_SO_CACHE PREFIX "/etc/ld.so.cache"
64 #ifndef add_system_dir