aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/vdso/Makefile16
1 files changed, 13 insertions, 3 deletions
diff --git a/arch/x86/vdso/Makefile b/arch/x86/vdso/Makefile
index 2c1ca98eb612..68a15c4dd6e4 100644
--- a/arch/x86/vdso/Makefile
+++ b/arch/x86/vdso/Makefile
@@ -169,14 +169,24 @@ quiet_cmd_vdso = VDSO $@
169 sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@' 169 sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
170 170
171VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \ 171VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=sysv) \
172 -Wl,-Bsymbolic $(LTO_CFLAGS) 172 $(call cc-ldoption, -Wl$(comma)--build-id) -Wl,-Bsymbolic $(LTO_CFLAGS)
173GCOV_PROFILE := n 173GCOV_PROFILE := n
174 174
175# 175#
176# Install the unstripped copies of vdso*.so. 176# Install the unstripped copies of vdso*.so. If our toolchain supports
177# build-id, install .build-id links as well.
177# 178#
178quiet_cmd_vdso_install = INSTALL $(@:install_%=%) 179quiet_cmd_vdso_install = INSTALL $(@:install_%=%)
179 cmd_vdso_install = cp $< $(MODLIB)/vdso/$(@:install_%=%) 180define cmd_vdso_install
181 cp $< "$(MODLIB)/vdso/$(@:install_%=%)"; \
182 if readelf -n $< |grep -q 'Build ID'; then \
183 buildid=`readelf -n $< |grep 'Build ID' |sed -e 's/^.*Build ID: \(.*\)$$/\1/'`; \
184 first=`echo $$buildid | cut -b-2`; \
185 last=`echo $$buildid | cut -b3-`; \
186 mkdir -p "$(MODLIB)/vdso/.build-id/$$first"; \
187 ln -sf "../../$(@:install_%=%)" "$(MODLIB)/vdso/.build-id/$$first/$$last.debug"; \
188 fi
189endef
180 190
181vdso_img_insttargets := $(vdso_img_sodbg:%.dbg=install_%) 191vdso_img_insttargets := $(vdso_img_sodbg:%.dbg=install_%)
182 192