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/Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/elf/Makefile b/elf/Makefile
index e89bf7bf9c..a77460d1de 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -61,9 +61,15 @@ $(objpfx)librtld.so: $(rtld-routines:%=$(objpfx)%.so) \
 	$(LINK.o) -nostdlib -nostartfiles -r -o $@ \
 		  '-Wl,-(' $^ -lgcc '-Wl,-)'
 
-$(objpfx)ld.so $(objpfx)ld-linux.so.1: $(objpfx)librtld.so
-	$(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
-		  -Wl,-rpath=$(default-rpath) $^
+$(objpfx)ld.so: $(objpfx)librtld.so
+	$(rtld-link) -Wl,-soname=$(rtld-installed-name)
+$(objpfx)ld-linux.so.1: $(objpfx)librtld.so
+	$(rtld-link) -Wl,-soname=ld-linux.so.1
+
+define rtld-link
+$(LINK.o) -nostdlib -nostartfiles -shared -o $@ \
+	  -Wl,-rpath=$(default-rpath) $^
+endef
 
 # The Linux-compatible dynamic linker shared object is just the same
 # with one object file of compatibility initialization code added.