2017-04-14 16:48:24 +00:00
|
|
|
From 649d991ca7737dd227f2a1ca4f30247daf6a7b4b Mon Sep 17 00:00:00 2001
|
2014-01-27 13:50:57 +00:00
|
|
|
From: Roland McGrath <roland@redhat.com>
|
|
|
|
Date: Mon, 6 Oct 2008 23:03:03 -0700
|
|
|
|
Subject: [PATCH] kbuild: AFTER_LINK
|
|
|
|
|
|
|
|
If the make variable AFTER_LINK is set, it is a command line to run
|
|
|
|
after each final link. This includes vmlinux itself and vDSO images.
|
|
|
|
|
2017-04-14 16:48:24 +00:00
|
|
|
Bugzilla: N/A
|
|
|
|
Upstream-status: ??
|
|
|
|
|
2014-01-27 13:50:57 +00:00
|
|
|
Signed-off-by: Roland McGrath <roland@redhat.com>
|
2017-04-14 16:48:24 +00:00
|
|
|
---
|
|
|
|
arch/arm64/kernel/vdso/Makefile | 3 ++-
|
|
|
|
arch/powerpc/kernel/vdso32/Makefile | 3 ++-
|
|
|
|
arch/powerpc/kernel/vdso64/Makefile | 3 ++-
|
|
|
|
arch/s390/kernel/vdso32/Makefile | 3 ++-
|
|
|
|
arch/s390/kernel/vdso64/Makefile | 3 ++-
|
|
|
|
arch/x86/entry/vdso/Makefile | 5 +++--
|
|
|
|
scripts/link-vmlinux.sh | 4 ++++
|
|
|
|
7 files changed, 17 insertions(+), 7 deletions(-)
|
2014-01-27 13:50:57 +00:00
|
|
|
|
2017-04-14 16:48:24 +00:00
|
|
|
diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
|
|
|
|
index 62c84f7..f44236a 100644
|
|
|
|
--- a/arch/arm64/kernel/vdso/Makefile
|
|
|
|
+++ b/arch/arm64/kernel/vdso/Makefile
|
|
|
|
@@ -54,7 +54,8 @@ $(obj-vdso): %.o: %.S FORCE
|
|
|
|
|
|
|
|
# Actual build commands
|
|
|
|
quiet_cmd_vdsold = VDSOL $@
|
|
|
|
- cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $^ -o $@
|
|
|
|
+ cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $^ -o $@ \
|
|
|
|
+ $(if $(AFTER_LINK),;$(AFTER_LINK))
|
|
|
|
quiet_cmd_vdsoas = VDSOA $@
|
|
|
|
cmd_vdsoas = $(CC) $(a_flags) -c -o $@ $<
|
|
|
|
|
2014-01-27 13:50:57 +00:00
|
|
|
diff --git a/arch/powerpc/kernel/vdso32/Makefile b/arch/powerpc/kernel/vdso32/Makefile
|
2017-04-14 16:48:24 +00:00
|
|
|
index 78a7449..c9592c0 100644
|
2014-01-27 13:50:57 +00:00
|
|
|
--- a/arch/powerpc/kernel/vdso32/Makefile
|
|
|
|
+++ b/arch/powerpc/kernel/vdso32/Makefile
|
2017-04-14 16:48:24 +00:00
|
|
|
@@ -44,7 +44,8 @@ $(obj-vdso32): %.o: %.S FORCE
|
2014-01-27 13:50:57 +00:00
|
|
|
|
|
|
|
# actual build commands
|
|
|
|
quiet_cmd_vdso32ld = VDSO32L $@
|
2016-11-11 13:28:22 +00:00
|
|
|
- cmd_vdso32ld = $(CROSS32CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^)
|
|
|
|
+ cmd_vdso32ld = $(CROSS32CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) \
|
2014-01-27 13:50:57 +00:00
|
|
|
+ $(if $(AFTER_LINK),; $(AFTER_LINK))
|
|
|
|
quiet_cmd_vdso32as = VDSO32A $@
|
|
|
|
cmd_vdso32as = $(CROSS32CC) $(a_flags) -c -o $@ $<
|
|
|
|
|
|
|
|
diff --git a/arch/powerpc/kernel/vdso64/Makefile b/arch/powerpc/kernel/vdso64/Makefile
|
2017-04-14 16:48:24 +00:00
|
|
|
index 31107bf..96aded3 100644
|
2014-01-27 13:50:57 +00:00
|
|
|
--- a/arch/powerpc/kernel/vdso64/Makefile
|
|
|
|
+++ b/arch/powerpc/kernel/vdso64/Makefile
|
2017-04-14 16:48:24 +00:00
|
|
|
@@ -33,7 +33,8 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
|
2014-01-27 13:50:57 +00:00
|
|
|
|
|
|
|
# actual build commands
|
|
|
|
quiet_cmd_vdso64ld = VDSO64L $@
|
2016-11-11 13:28:22 +00:00
|
|
|
- cmd_vdso64ld = $(CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^)
|
|
|
|
+ cmd_vdso64ld = $(CC) $(c_flags) -o $@ -Wl,-T$(filter %.lds,$^) $(filter %.o,$^) \
|
2017-04-14 16:48:24 +00:00
|
|
|
+ $(if $(AFTER_LINK),; $(AFTER_LINK))
|
2014-01-27 13:50:57 +00:00
|
|
|
|
2017-04-14 16:48:24 +00:00
|
|
|
# install commands for the unstripped file
|
|
|
|
quiet_cmd_vdso_install = INSTALL $@
|
2014-01-27 13:50:57 +00:00
|
|
|
diff --git a/arch/s390/kernel/vdso32/Makefile b/arch/s390/kernel/vdso32/Makefile
|
2017-04-14 16:48:24 +00:00
|
|
|
index 6cc9478..94fb536 100644
|
2014-01-27 13:50:57 +00:00
|
|
|
--- a/arch/s390/kernel/vdso32/Makefile
|
|
|
|
+++ b/arch/s390/kernel/vdso32/Makefile
|
2017-04-14 16:48:24 +00:00
|
|
|
@@ -46,7 +46,8 @@ $(obj-vdso32): %.o: %.S
|
2014-01-27 13:50:57 +00:00
|
|
|
|
|
|
|
# actual build commands
|
|
|
|
quiet_cmd_vdso32ld = VDSO32L $@
|
|
|
|
- cmd_vdso32ld = $(CC) $(c_flags) -Wl,-T $^ -o $@
|
|
|
|
+ cmd_vdso32ld = $(CC) $(c_flags) -Wl,-T $^ -o $@ \
|
|
|
|
+ $(if $(AFTER_LINK),; $(AFTER_LINK))
|
|
|
|
quiet_cmd_vdso32as = VDSO32A $@
|
|
|
|
cmd_vdso32as = $(CC) $(a_flags) -c -o $@ $<
|
|
|
|
|
|
|
|
diff --git a/arch/s390/kernel/vdso64/Makefile b/arch/s390/kernel/vdso64/Makefile
|
2017-04-14 16:48:24 +00:00
|
|
|
index 2d54c18..a0e3e9d 100644
|
2014-01-27 13:50:57 +00:00
|
|
|
--- a/arch/s390/kernel/vdso64/Makefile
|
|
|
|
+++ b/arch/s390/kernel/vdso64/Makefile
|
2017-04-14 16:48:24 +00:00
|
|
|
@@ -46,7 +46,8 @@ $(obj-vdso64): %.o: %.S
|
2014-01-27 13:50:57 +00:00
|
|
|
|
|
|
|
# actual build commands
|
|
|
|
quiet_cmd_vdso64ld = VDSO64L $@
|
|
|
|
- cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $^ -o $@
|
|
|
|
+ cmd_vdso64ld = $(CC) $(c_flags) -Wl,-T $^ -o $@ \
|
|
|
|
+ $(if $(AFTER_LINK),; $(AFTER_LINK))
|
|
|
|
quiet_cmd_vdso64as = VDSO64A $@
|
|
|
|
cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $<
|
|
|
|
|
2016-01-04 11:54:07 +00:00
|
|
|
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
|
2017-04-14 16:48:24 +00:00
|
|
|
index d540966..eeb47b6 100644
|
2016-01-04 11:54:07 +00:00
|
|
|
--- a/arch/x86/entry/vdso/Makefile
|
|
|
|
+++ b/arch/x86/entry/vdso/Makefile
|
2017-04-14 16:48:24 +00:00
|
|
|
@@ -167,8 +167,9 @@ $(obj)/vdso32.so.dbg: FORCE \
|
2014-01-27 13:50:57 +00:00
|
|
|
quiet_cmd_vdso = VDSO $@
|
|
|
|
cmd_vdso = $(CC) -nostdlib -o $@ \
|
|
|
|
$(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
|
|
|
|
- -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) && \
|
|
|
|
- sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
|
|
|
|
+ -Wl,-T,$(filter %.lds,$^) $(filter %.o,$^) \
|
|
|
|
+ $(if $(AFTER_LINK),; $(AFTER_LINK)) && \
|
|
|
|
+ sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
|
|
|
|
|
2016-01-04 11:54:07 +00:00
|
|
|
VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=both) \
|
2014-10-16 13:22:55 +00:00
|
|
|
$(call cc-ldoption, -Wl$(comma)--build-id) -Wl,-Bsymbolic $(LTO_CFLAGS)
|
2014-01-27 13:50:57 +00:00
|
|
|
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
|
2017-04-14 16:48:24 +00:00
|
|
|
index f742c65..526eee4 100755
|
2014-01-27 13:50:57 +00:00
|
|
|
--- a/scripts/link-vmlinux.sh
|
|
|
|
+++ b/scripts/link-vmlinux.sh
|
2017-04-14 16:48:24 +00:00
|
|
|
@@ -111,6 +111,10 @@ vmlinux_link()
|
|
|
|
-lutil -lrt -lpthread
|
2014-01-27 13:50:57 +00:00
|
|
|
rm -f linux
|
|
|
|
fi
|
|
|
|
+ if [ -n "${AFTER_LINK}" ]; then
|
|
|
|
+ /usr/lib/rpm/debugedit -b ${RPM_BUILD_DIR} -d /usr/src/debug -i ${2} \
|
|
|
|
+ > ${2}.id
|
|
|
|
+ fi
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2017-04-14 16:48:24 +00:00
|
|
|
2.7.4
|
2014-01-27 13:50:57 +00:00
|
|
|
|