2019-01-03 18:45:29 +00:00
|
|
|
From 234f2726089c1b655b0efe975a988ac6fc857b2a 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
|
|
|
---
|
2018-11-11 17:40:18 +00:00
|
|
|
arch/arm64/kernel/vdso/Makefile | 3 ++-
|
|
|
|
arch/x86/entry/vdso/Makefile | 5 +++--
|
|
|
|
scripts/link-vmlinux.sh | 4 ++++
|
|
|
|
3 files changed, 9 insertions(+), 3 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
|
2018-11-11 17:40:18 +00:00
|
|
|
index b215c712d897..e18cd2a3ea53 100644
|
2017-04-14 16:48:24 +00:00
|
|
|
--- a/arch/arm64/kernel/vdso/Makefile
|
|
|
|
+++ b/arch/arm64/kernel/vdso/Makefile
|
2018-11-11 17:40:18 +00:00
|
|
|
@@ -55,7 +55,8 @@ $(obj-vdso): %.o: %.S FORCE
|
2017-04-14 16:48:24 +00:00
|
|
|
|
|
|
|
# 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 $@ $<
|
|
|
|
|
2016-01-04 11:54:07 +00:00
|
|
|
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
|
2019-01-03 18:45:29 +00:00
|
|
|
index c3d7ccd25381..7c03993ea881 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 $@
|
2018-11-11 17:40:18 +00:00
|
|
|
cmd_vdso = $(LD) -nostdlib -o $@ \
|
2014-01-27 13:50:57 +00:00
|
|
|
$(VDSO_LDFLAGS) $(VDSO_LDFLAGS_$(filter %.lds,$(^F))) \
|
2018-11-11 17:40:18 +00:00
|
|
|
- -T $(filter %.lds,$^) $(filter %.o,$^) && \
|
2014-01-27 13:50:57 +00:00
|
|
|
- sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
|
2018-11-11 17:40:18 +00:00
|
|
|
+ -T $(filter %.lds,$^) $(filter %.o,$^) \
|
2014-01-27 13:50:57 +00:00
|
|
|
+ $(if $(AFTER_LINK),; $(AFTER_LINK)) && \
|
|
|
|
+ sh $(srctree)/$(src)/checkundef.sh '$(NM)' '$@'
|
|
|
|
|
2018-11-11 17:40:18 +00:00
|
|
|
VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \
|
2019-01-03 18:45:29 +00:00
|
|
|
$(call ld-option, --build-id) $(call ld-option, --eh-frame-hdr) \
|
2014-01-27 13:50:57 +00:00
|
|
|
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh
|
2018-11-11 17:40:18 +00:00
|
|
|
index c8cf45362bd6..ee9c4d8e1ddf 100755
|
2014-01-27 13:50:57 +00:00
|
|
|
--- a/scripts/link-vmlinux.sh
|
|
|
|
+++ b/scripts/link-vmlinux.sh
|
2018-11-11 17:40:18 +00:00
|
|
|
@@ -112,6 +112,10 @@ vmlinux_link()
|
2017-04-14 16:48:24 +00:00
|
|
|
-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
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2019-01-03 18:45:29 +00:00
|
|
|
2.20.1
|
2014-01-27 13:50:57 +00:00
|
|
|
|