about summary refs log tree commit diff
path: root/elf/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'elf/Makefile')
-rw-r--r--elf/Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 5fe73e7171..093fc09369 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -87,6 +87,11 @@ $(objpfx)librtld.os: $(objpfx)dl-allobjs.os $(common-objpfx)libc_pic.a
 
 # Do we need a linker script?
 rtld-ldscript-in := $(firstword $(wildcard $(+sysdep_dirs:%=%/rtld-ldscript.in)))
+
+ifeq ($(versioning),yes)
+RTLD-VERSIONS = -Wl,--version-script=$(libc-map)
+endif
+
 ifneq (,$(rtld-ldscript-in))
 LDFLAGS-rtld = -T $(objpfx)rtld-ldscript
 
@@ -103,8 +108,6 @@ $(objpfx)rtld-ldscript: $(rtld-ldscript-in) $(rtld-parms)
 $(objpfx)ld.so: $(objpfx)librtld.os $(objpfx)rtld-ldscript
 	$(rtld-link) -Wl,-soname=$(rtld-installed-name)
 
-RTLD-VERSIONS=$(addprefix -Wl,--version-script=,$(libc-map))
-
 define rtld-link
 $(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
 	  -Wl,-rpath=$(default-rpath) $(LDFLAGS-rtld) \