2015-12-09 16:12:01 +00:00
|
|
|
From a9488dbeccf188f0bd83b9d5704892f2c0f97fdc Mon Sep 17 00:00:00 2001
|
2010-09-01 15:33:42 +00:00
|
|
|
From: Roland McGrath <roland@redhat.com>
|
2010-09-03 01:46:22 +00:00
|
|
|
Date: Mon, 6 Oct 2008 23:03:03 -0700
|
|
|
|
Subject: [PATCH] kbuild: AFTER_LINK
|
2010-09-01 15:33:42 +00:00
|
|
|
|
2010-09-03 01:46:22 +00:00
|
|
|
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.
|
|
|
|
|
2014-08-20 17:22:24 +00:00
|
|
|
Bugzilla: N/A
|
|
|
|
Upstream-status: ??
|
|
|
|
|
2010-09-03 01:46:22 +00:00
|
|
|
Signed-off-by: Roland McGrath <roland@redhat.com>
|
2014-04-01 19:44:09 +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 ++-
|
2015-06-26 13:33:38 +00:00
|
|
|
arch/x86/entry/vdso/Makefile | 5 +++--
|
2014-04-01 19:44:09 +00:00
|
|
|
scripts/link-vmlinux.sh | 4 ++++
|
|
|
|
7 files changed, 17 insertions(+), 7 deletions(-)
|
2014-02-08 08:24:55 +00:00
|
|
|
|
2013-10-21 20:39:21 +00:00
|
|
|
diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
|
2015-12-09 16:12:01 +00:00
|
|
|
index b467fd0..feeff5e 100644
|
2013-10-21 20:39:21 +00:00
|
|
|
--- a/arch/arm64/kernel/vdso/Makefile
|
|
|
|
+++ b/arch/arm64/kernel/vdso/Makefile
|
2015-12-09 16:12:01 +00:00
|
|
|
@@ -55,7 +55,8 @@ $(obj-vdso): %.o: %.S FORCE
|
2013-10-21 20:39:21 +00:00
|
|
|
|
|
|
|
# Actual build commands
|
2014-08-05 10:44:35 +00:00
|
|
|
quiet_cmd_vdsold = VDSOL $@
|
2014-02-08 08:24:55 +00:00
|
|
|
- cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $^ -o $@
|
|
|
|
+ cmd_vdsold = $(CC) $(c_flags) -Wl,-n -Wl,-T $^ -o $@ \
|
2014-08-05 10:44:35 +00:00
|
|
|
+ $(if $(AFTER_LINK),;$(AFTER_LINK))
|
|
|
|
quiet_cmd_vdsoas = VDSOA $@
|
2013-10-21 20:39:21 +00:00
|
|
|
cmd_vdsoas = $(CC) $(a_flags) -c -o $@ $<
|
|
|
|
|
2010-07-29 23:46:31 +00:00
|
|
|
diff --git a/arch/powerpc/kernel/vdso32/Makefile b/arch/powerpc/kernel/vdso32/Makefile
|
2015-12-09 16:12:01 +00:00
|
|
|
index 6abffb7..7b103bb 100644
|
2010-07-29 23:46:31 +00:00
|
|
|
--- a/arch/powerpc/kernel/vdso32/Makefile
|
|
|
|
+++ b/arch/powerpc/kernel/vdso32/Makefile
|
2013-10-21 20:39:21 +00:00
|
|
|
@@ -43,7 +43,8 @@ $(obj-vdso32): %.o: %.S
|
2010-07-29 23:46:31 +00:00
|
|
|
|
|
|
|
# actual build commands
|
|
|
|
quiet_cmd_vdso32ld = VDSO32L $@
|
2016-08-12 21:43:15 +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,$^) \
|
2010-07-29 23:46:31 +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
|
2015-12-09 16:12:01 +00:00
|
|
|
index 8c8f2ae..a743ebe 100644
|
2010-07-29 23:46:31 +00:00
|
|
|
--- a/arch/powerpc/kernel/vdso64/Makefile
|
|
|
|
+++ b/arch/powerpc/kernel/vdso64/Makefile
|
|
|
|
@@ -36,7 +36,8 @@ $(obj-vdso64): %.o: %.S
|
|
|
|
|
|
|
|
# actual build commands
|
|
|
|
quiet_cmd_vdso64ld = VDSO64L $@
|
2016-08-12 21:43:15 +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,$^) \
|
2010-07-29 23:46:31 +00:00
|
|
|
+ $(if $(AFTER_LINK),; $(AFTER_LINK))
|
|
|
|
quiet_cmd_vdso64as = VDSO64A $@
|
|
|
|
cmd_vdso64as = $(CC) $(a_flags) -c -o $@ $<
|
|
|
|
|
2010-09-23 16:15:30 +00:00
|
|
|
diff --git a/arch/s390/kernel/vdso32/Makefile b/arch/s390/kernel/vdso32/Makefile
|
2015-12-09 16:12:01 +00:00
|
|
|
index ee8a18e..63e33fa 100644
|
2010-09-23 16:15:30 +00:00
|
|
|
--- a/arch/s390/kernel/vdso32/Makefile
|
|
|
|
+++ b/arch/s390/kernel/vdso32/Makefile
|
2012-05-29 00:34:31 +00:00
|
|
|
@@ -43,7 +43,8 @@ $(obj-vdso32): %.o: %.S
|
2010-09-23 16:15:30 +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
|
2015-12-09 16:12:01 +00:00
|
|
|
index c4b03f9..550450f 100644
|
2010-09-23 16:15:30 +00:00
|
|
|
--- a/arch/s390/kernel/vdso64/Makefile
|
|
|
|
+++ b/arch/s390/kernel/vdso64/Makefile
|
2012-05-29 00:34:31 +00:00
|
|
|
@@ -43,7 +43,8 @@ $(obj-vdso64): %.o: %.S
|
2010-09-23 16:15:30 +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 $@ $<
|
|
|
|
|
2015-06-26 13:33:38 +00:00
|
|
|
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
|
2015-12-09 16:12:01 +00:00
|
|
|
index 265c0ed..fd90c7d 100644
|
2015-06-26 13:33:38 +00:00
|
|
|
--- a/arch/x86/entry/vdso/Makefile
|
|
|
|
+++ b/arch/x86/entry/vdso/Makefile
|
2015-12-09 16:12:01 +00:00
|
|
|
@@ -159,8 +159,9 @@ $(obj)/vdso32.so.dbg: FORCE \
|
2012-05-29 00:34:31 +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)' '$@'
|
|
|
|
|
2015-09-01 19:17:24 +00:00
|
|
|
VDSO_LDFLAGS = -fPIC -shared $(call cc-ldoption, -Wl$(comma)--hash-style=both) \
|
2014-08-05 10:44:35 +00:00
|
|
|
$(call cc-ldoption, -Wl$(comma)--build-id) -Wl,-Bsymbolic $(LTO_CFLAGS)
|
2012-05-29 00:34:31 +00:00
|
|
|
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
|
2015-12-09 16:12:01 +00:00
|
|
|
index dacf71a..72cbefd 100755
|
2012-05-29 00:34:31 +00:00
|
|
|
--- a/scripts/link-vmlinux.sh
|
|
|
|
+++ b/scripts/link-vmlinux.sh
|
|
|
|
@@ -65,6 +65,10 @@ vmlinux_link()
|
2016-01-13 22:27:14 +00:00
|
|
|
-lutil -lrt -lpthread ${1}
|
2012-05-29 00:34:31 +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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-09-01 19:17:24 +00:00
|
|
|
--
|
2015-12-09 16:12:01 +00:00
|
|
|
2.5.0
|
2015-09-01 19:17:24 +00:00
|
|
|
|