diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index deac60727e48f9f1bed3c82caf6021e799ec94ea..10950559b223b906ee73093f7da1fab1bc34db37 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -109,7 +109,7 @@ subdir-ym	:= $(addprefix $(obj)/,$(subdir-ym))
 # Finds the multi-part object the current object will be linked into.
 # If the object belongs to two or more multi-part objects, list them all.
 modname-multi = $(sort $(foreach m,$(multi-obj-ym),\
-		$(if $(filter $*.o, $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))),$(m:.o=))))
+		$(if $(filter $*.o, $(call suffix-search, $m, .o, -objs -y -m)),$(m:.o=))))
 
 __modname = $(if $(modname-multi),$(modname-multi),$(basetarget))