about summary refs log tree commit diff
path: root/Makerules
diff options
context:
space:
mode:
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules6
1 files changed, 1 insertions, 5 deletions
diff --git a/Makerules b/Makerules
index ff6adcf9d2..5320ff4a9b 100644
--- a/Makerules
+++ b/Makerules
@@ -493,11 +493,7 @@ LDFLAGS-c.so = -nostdlib -nostartfiles
 # Give libc.so an entry point and make it directly runnable itself.
 LDFLAGS-c.so += -e __libc_print_version
 # Use our own special initializer and finalizer files for libc.so.
-ifeq (elf, $(subdir))
-elfobjdir := .
-else
-elfobjdir := $(firstword $(objdir) $(..)elf)
-endif
+elfobjdir := $(firstword $(objdir) $(patsubst ../$(subdir),.,$(..)elf))
 $(common-objpfx)libc.so: $(elfobjdir)/soinit.so \
 			 $(common-objpfx)libc_pic.a \
 			 $(elfobjdir)/sofini.so $(elfobjdir)/ld.so