From: blaisorblade_spam@yahoo.it
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, blaisorblade_spam@yahoo.it
Subject: [patch 1/2] kbuild - Single_Linking_Step-uml-hook
Date: Mon, 30 Aug 2004 21:48:35 +0200 [thread overview]
Message-ID: <20040830194835.DB80E7D85@zion.localdomain> (raw)
Please note that this patch, even if UML-related, should be immediately
discussed for merging in mainline, if possible.
Patch purpose:
This patch adds the kbuild hooks needed to avoid the linking kludge which leaves
kbuild link vmlinux and then link it with libc inside linux. This kludge has the
big problem of making kallsyms break, since the kallsyms pass is done on a
completely different binary than the running one.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade_spam@yahoo.it>
---
uml-linux-2.6.8.1-paolo/Makefile | 25 ++++++++++++++++++-------
1 files changed, 18 insertions(+), 7 deletions(-)
diff -puN Makefile~Single_Linking_Step-uml-hook Makefile
--- uml-linux-2.6.8.1/Makefile~Single_Linking_Step-uml-hook 2004-08-30 16:39:08.919429000 +0200
+++ uml-linux-2.6.8.1-paolo/Makefile 2004-08-30 16:39:08.922428544 +0200
@@ -507,20 +507,30 @@ libs-y := $(libs-y1) $(libs-y2)
# we cannot yet know if we will need to relink vmlinux.
# So we descend into init/ inside the rule for vmlinux again.
head-y += $(HEAD)
-vmlinux-objs := $(head-y) $(init-y) $(core-y) $(libs-y) $(drivers-y) $(net-y)
+# If an arch (like UML) uses its own linking command for vmlinux, supply
+# it everything to avoid it forgetting some objects.
+vmlinux-init-objs := $(head-y) $(init-y)
+vmlinux-main-objs := $(core-y) $(libs-y) $(drivers-y) $(net-y)
+vmlinux-special-objs = $(filter .tmp_kallsyms%,$^)
+# List of dependencies for vmlinux
+vmlinux-objs := $(vmlinux-init-objs) $(vmlinux-main-objs)
quiet_cmd_vmlinux__ = LD $@
+#Allow UML to use gcc to link vmlinux.
+#The command below is parametrized enough that you will never change it;
+#but if you still want to change it, update every arch accordingly
+#(at least UML, maybe other ones will use it, too).
+ifeq ($(cmd_vmlinux__),)
define cmd_vmlinux__
- $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) $(head-y) $(init-y) \
+ $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
+ $(vmlinux-init-objs) \
--start-group \
- $(core-y) \
- $(libs-y) \
- $(drivers-y) \
- $(net-y) \
+ $(vmlinux-main-objs) \
--end-group \
- $(filter .tmp_kallsyms%,$^) \
+ $(vmlinux-special-objs) \
-o $@
endef
+endif
# set -e makes the rule exit immediately on error
@@ -541,6 +551,7 @@ endef
do_system_map = $(NM) $(1) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > $(2)
LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s
+CFLAGS_vmlinux += -Wl,-T,arch/$(ARCH)/kernel/vmlinux.lds.s
# Generate section listing all symbols and add it into vmlinux
# It's a three stage process:
_
reply other threads:[~2004-08-30 19:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040830194835.DB80E7D85@zion.localdomain \
--to=blaisorblade_spam@yahoo.it \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®