diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-04-26 13:12:47 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-27 00:35:24 -0400 |
commit | 51b26ada79b605ed709ddcedbb6012e8f8e0ebed (patch) | |
tree | b6b9a353cf32db8debe602b9bf23625bc26388a0 /arch | |
parent | 0a3ec21fcd311b26ab0f249d62960e127bc20ca8 (diff) |
x86: unify arch/x86/boot/compressed/vmlinux_*.lds
Look at the:
diff -u arch/x86/boot/compressed/vmlinux_*.lds
output and realize that they're basially exactly the same except for
trivial naming differences, and the fact that the 64-bit version has a
"pgtable" thing.
So unify them.
There's some trivial cleanup there (make the output format a Kconfig thing
rather than doing #ifdef's for it, and unify both 32-bit and 64-bit BSS
end to "_ebss", where 32-bit used to use the traditional "_end"), but
other than that it's really very mindless and straigt conversion.
For example, I think we should aim to remove "startup_32" vs "startup_64",
and just call it "startup", and get rid of one more difference. I didn't
do that.
Also, notice the comment in the unified vmlinux.lds.S talks about
"head_64" and "startup_32" which is an odd and incorrect mix, but that was
actually what the old 64-bit only lds file had, so the confusion isn't
new, and now that mixing is arguably more accurate thanks to the
vmlinux.lds.S file being shared between the two cases ;)
[ Impact: cleanup, unification ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/Kconfig | 5 | ||||
-rw-r--r-- | arch/x86/boot/compressed/Makefile | 2 | ||||
-rw-r--r-- | arch/x86/boot/compressed/head_32.S | 8 | ||||
-rw-r--r-- | arch/x86/boot/compressed/vmlinux.lds.S (renamed from arch/x86/boot/compressed/vmlinux_64.lds) | 11 | ||||
-rw-r--r-- | arch/x86/boot/compressed/vmlinux_32.lds | 43 |
5 files changed, 20 insertions, 49 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index bc25b9f5e4cd..039c3f04aac5 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -47,6 +47,11 @@ config X86 | |||
47 | select HAVE_KERNEL_BZIP2 | 47 | select HAVE_KERNEL_BZIP2 |
48 | select HAVE_KERNEL_LZMA | 48 | select HAVE_KERNEL_LZMA |
49 | 49 | ||
50 | config OUTPUT_FORMAT | ||
51 | string | ||
52 | default "elf32-i386" if X86_32 | ||
53 | default "elf64-x86-64" if X86_64 | ||
54 | |||
50 | config ARCH_DEFCONFIG | 55 | config ARCH_DEFCONFIG |
51 | string | 56 | string |
52 | default "arch/x86/configs/i386_defconfig" if X86_32 | 57 | default "arch/x86/configs/i386_defconfig" if X86_32 |
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 65551c9f8571..0f4b5e2abd3f 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile | |||
@@ -19,7 +19,7 @@ KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__ | |||
19 | LDFLAGS := -m elf_$(UTS_MACHINE) | 19 | LDFLAGS := -m elf_$(UTS_MACHINE) |
20 | LDFLAGS_vmlinux := -T | 20 | LDFLAGS_vmlinux := -T |
21 | 21 | ||
22 | $(obj)/vmlinux: $(src)/vmlinux_$(BITS).lds $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/piggy.o FORCE | 22 | $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/piggy.o FORCE |
23 | $(call if_changed,ld) | 23 | $(call if_changed,ld) |
24 | @: | 24 | @: |
25 | 25 | ||
diff --git a/arch/x86/boot/compressed/head_32.S b/arch/x86/boot/compressed/head_32.S index 3a8a866fb2e2..85bd3285706d 100644 --- a/arch/x86/boot/compressed/head_32.S +++ b/arch/x86/boot/compressed/head_32.S | |||
@@ -88,9 +88,9 @@ ENTRY(startup_32) | |||
88 | * where decompression in place becomes safe. | 88 | * where decompression in place becomes safe. |
89 | */ | 89 | */ |
90 | pushl %esi | 90 | pushl %esi |
91 | leal _end(%ebp), %esi | 91 | leal _ebss(%ebp), %esi |
92 | leal _end(%ebx), %edi | 92 | leal _ebss(%ebx), %edi |
93 | movl $(_end - startup_32), %ecx | 93 | movl $(_ebss - startup_32), %ecx |
94 | std | 94 | std |
95 | rep | 95 | rep |
96 | movsb | 96 | movsb |
@@ -121,7 +121,7 @@ relocated: | |||
121 | */ | 121 | */ |
122 | xorl %eax,%eax | 122 | xorl %eax,%eax |
123 | leal _edata(%ebx),%edi | 123 | leal _edata(%ebx),%edi |
124 | leal _end(%ebx), %ecx | 124 | leal _ebss(%ebx), %ecx |
125 | subl %edi,%ecx | 125 | subl %edi,%ecx |
126 | cld | 126 | cld |
127 | rep | 127 | rep |
diff --git a/arch/x86/boot/compressed/vmlinux_64.lds b/arch/x86/boot/compressed/vmlinux.lds.S index bef1ac891bce..ffcb19134bf7 100644 --- a/arch/x86/boot/compressed/vmlinux_64.lds +++ b/arch/x86/boot/compressed/vmlinux.lds.S | |||
@@ -1,6 +1,13 @@ | |||
1 | OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") | 1 | OUTPUT_FORMAT(CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT, CONFIG_OUTPUT_FORMAT) |
2 | |||
3 | #ifdef CONFIG_X86_64 | ||
2 | OUTPUT_ARCH(i386:x86-64) | 4 | OUTPUT_ARCH(i386:x86-64) |
3 | ENTRY(startup_64) | 5 | ENTRY(startup_64) |
6 | #else | ||
7 | OUTPUT_ARCH(i386) | ||
8 | ENTRY(startup_32) | ||
9 | #endif | ||
10 | |||
4 | SECTIONS | 11 | SECTIONS |
5 | { | 12 | { |
6 | /* Be careful parts of head_64.S assume startup_32 is at | 13 | /* Be careful parts of head_64.S assume startup_32 is at |
@@ -38,11 +45,13 @@ SECTIONS | |||
38 | *(.bss) | 45 | *(.bss) |
39 | *(.bss.*) | 46 | *(.bss.*) |
40 | *(COMMON) | 47 | *(COMMON) |
48 | #ifdef CONFIG_X86_64 | ||
41 | . = ALIGN(8); | 49 | . = ALIGN(8); |
42 | _end_before_pgt = . ; | 50 | _end_before_pgt = . ; |
43 | . = ALIGN(4096); | 51 | . = ALIGN(4096); |
44 | pgtable = . ; | 52 | pgtable = . ; |
45 | . = . + 4096 * 6; | 53 | . = . + 4096 * 6; |
54 | #endif | ||
46 | _ebss = .; | 55 | _ebss = .; |
47 | } | 56 | } |
48 | } | 57 | } |
diff --git a/arch/x86/boot/compressed/vmlinux_32.lds b/arch/x86/boot/compressed/vmlinux_32.lds deleted file mode 100644 index bb3c48379c40..000000000000 --- a/arch/x86/boot/compressed/vmlinux_32.lds +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") | ||
2 | OUTPUT_ARCH(i386) | ||
3 | ENTRY(startup_32) | ||
4 | SECTIONS | ||
5 | { | ||
6 | /* Be careful parts of head_32.S assume startup_32 is at | ||
7 | * address 0. | ||
8 | */ | ||
9 | . = 0; | ||
10 | .text.head : { | ||
11 | _head = . ; | ||
12 | *(.text.head) | ||
13 | _ehead = . ; | ||
14 | } | ||
15 | .rodata.compressed : { | ||
16 | *(.rodata.compressed) | ||
17 | } | ||
18 | .text : { | ||
19 | _text = .; /* Text */ | ||
20 | *(.text) | ||
21 | *(.text.*) | ||
22 | _etext = . ; | ||
23 | } | ||
24 | .rodata : { | ||
25 | _rodata = . ; | ||
26 | *(.rodata) /* read-only data */ | ||
27 | *(.rodata.*) | ||
28 | _erodata = . ; | ||
29 | } | ||
30 | .data : { | ||
31 | _data = . ; | ||
32 | *(.data) | ||
33 | *(.data.*) | ||
34 | _edata = . ; | ||
35 | } | ||
36 | .bss : { | ||
37 | _bss = . ; | ||
38 | *(.bss) | ||
39 | *(.bss.*) | ||
40 | *(COMMON) | ||
41 | _end = . ; | ||
42 | } | ||
43 | } | ||