diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2012-05-05 04:18:40 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2012-05-05 15:19:33 -0400 |
commit | 95698570510b7be9ab1542a4a908242c05a9b0ed (patch) | |
tree | 800f6e5bf8c45eb6f1ee6cfda4af4d4d62543dba | |
parent | 275eb135cfa2980d4ed1ec24746e05ca42f8418b (diff) |
kbuild: refactor final link of sparc32
sparc32 uses an additional final link to support btfix.
Introduce a new set of exported variables in the top-level Makefile
to make the extra linking step simpler.
sparc32 has hardcoded knowledge of kallsyms support. This fix
include support for EXTRA_KALLSYM_PASS=1.
The ugly part is that it is hardcoded in the arch/sparc/boot
Makefile.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | arch/sparc/Makefile | 11 | ||||
-rw-r--r-- | arch/sparc/boot/Makefile | 14 |
3 files changed, 14 insertions, 16 deletions
@@ -723,6 +723,11 @@ libs-y1 := $(patsubst %/, %/lib.a, $(libs-y)) | |||
723 | libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y)) | 723 | libs-y2 := $(patsubst %/, %/built-in.o, $(libs-y)) |
724 | libs-y := $(libs-y1) $(libs-y2) | 724 | libs-y := $(libs-y1) $(libs-y2) |
725 | 725 | ||
726 | # externally visible symbols | ||
727 | export KBUILD_VMLINUX_INIT := $(head-y) $(init-y) | ||
728 | export KBUILD_VMLINUX_MAIN := $(core-y) $(libs-y) $(drivers-y) $(net-y) | ||
729 | export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds | ||
730 | |||
726 | # Build vmlinux | 731 | # Build vmlinux |
727 | # --------------------------------------------------------------------------- | 732 | # --------------------------------------------------------------------------- |
728 | # vmlinux is built from the objects selected by $(vmlinux-init) and | 733 | # vmlinux is built from the objects selected by $(vmlinux-init) and |
diff --git a/arch/sparc/Makefile b/arch/sparc/Makefile index eddcfb36aafb..3195f77f9c95 100644 --- a/arch/sparc/Makefile +++ b/arch/sparc/Makefile | |||
@@ -72,17 +72,6 @@ libs-y += arch/sparc/lib/ | |||
72 | 72 | ||
73 | drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/ | 73 | drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/ |
74 | 74 | ||
75 | # Export what is needed by arch/sparc/boot/Makefile | ||
76 | export VMLINUX_INIT VMLINUX_MAIN | ||
77 | VMLINUX_INIT := $(head-y) $(init-y) | ||
78 | VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/ | ||
79 | VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y) | ||
80 | VMLINUX_MAIN += $(drivers-y) $(net-y) | ||
81 | |||
82 | ifdef CONFIG_KALLSYMS | ||
83 | export kallsyms.o := .tmp_kallsyms2.o | ||
84 | endif | ||
85 | |||
86 | boot := arch/sparc/boot | 75 | boot := arch/sparc/boot |
87 | 76 | ||
88 | # Default target | 77 | # Default target |
diff --git a/arch/sparc/boot/Makefile b/arch/sparc/boot/Makefile index d56d199c1aa8..78f1994520ff 100644 --- a/arch/sparc/boot/Makefile +++ b/arch/sparc/boot/Makefile | |||
@@ -39,11 +39,15 @@ define rule_image | |||
39 | echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd | 39 | echo 'cmd_$@ := $(cmd_image)' > $(@D)/.$(@F).cmd |
40 | endef | 40 | endef |
41 | 41 | ||
42 | BTOBJS := $(patsubst %/, %/built-in.o, $(VMLINUX_INIT)) | 42 | # Support for kallsyms |
43 | BTLIBS := $(patsubst %/, %/built-in.o, $(VMLINUX_MAIN)) | 43 | kallsyms-$(CONFIG_KALLSYMS) := .tmp_kallsyms2.o |
44 | LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \ | 44 | ifdef KALLSYMS_EXTRA_PASS |
45 | --start-group $(BTLIBS) --end-group \ | 45 | kallsyms-$(CONFIG_KALLSYMS) := .tmp_kallsyms3.o |
46 | $(kallsyms.o) $(obj)/btfix.o | 46 | endif |
47 | |||
48 | LDFLAGS_image := -T $(KBUILD_LDS) $(KBUILD_VMLINUX_INIT) \ | ||
49 | --start-group $(KBUILD_VMLINUX_MAIN) --end-group \ | ||
50 | $(kallsyms-y) $(obj)/btfix.o | ||
47 | 51 | ||
48 | # Link the final image including btfixup'ed symbols. | 52 | # Link the final image including btfixup'ed symbols. |
49 | # This is a replacement for the link done in the top-level Makefile. | 53 | # This is a replacement for the link done in the top-level Makefile. |