aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-rw-r--r--elf/Makefile4
-rw-r--r--elf/ldconfig.c9
2 files changed, 9 insertions, 4 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 6361f252b1..5fbddd587b 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -215,6 +215,10 @@ $(objpfx)ldd: ldd.bash.in $(common-objpfx)soversions.mk \
$(objpfx)sprof: $(libdl)
$(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
+SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
+CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' -D'SLIBDIR="$(slibdir)"'
+CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
+CFLAGS-cache.c = $(SYSCONF-FLAGS)
test-modules = $(addprefix $(objpfx),$(addsuffix .so,$(strip $(modules-names))))
generated += $(addsuffix .so,$(strip $(modules-names)))
diff --git a/elf/ldconfig.c b/elf/ldconfig.c
index 4ee9763c79..99fe8a93d2 100644
--- a/elf/ldconfig.c
+++ b/elf/ldconfig.c
@@ -41,7 +41,7 @@
#include "dl-procinfo.h"
#ifndef LD_SO_CONF
-# define LD_SO_CONF "/etc/ld.so.conf"
+# define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
#endif
/* Get libc version number. */
@@ -152,7 +152,7 @@ static int
is_hwcap (const char *name)
{
int hwcap_idx = _dl_string_hwcap (name);
-
+
if (hwcap_idx != -1 && ((1 << hwcap_idx) & HWCAP_IMPORTANT))
return 1;
return 0;
@@ -802,8 +802,9 @@ main (int argc, char **argv)
if (!opt_only_cline)
{
/* Always add the standard search paths. */
- add_dir ("/lib");
- add_dir ("/usr/lib");
+ add_dir (SLIBDIR);
+ if (strcmp (SLIBDIR, LIBDIR))
+ add_dir (LIBDIR);
parse_conf (config_file);
}