Skip to content

Commit 7c5fd56

Browse files
Tim Abbottgeertu
authored andcommitted
m68k: Cleanup linker scripts using new linker script macros.
Signed-off-by: Tim Abbott <tabbott@ksplice.com> Tested-by: Andreas Schwab <schwab@linux-m68k.org> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
1 parent 5cdef24 commit 7c5fd56

2 files changed

Lines changed: 20 additions & 95 deletions

File tree

‎arch/m68k/kernel/vmlinux-std.lds‎

Lines changed: 13 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <asm-generic/vmlinux.lds.h>
44
#include <asm/page.h>
5+
#include <asm/thread_info.h>
56

67
OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
78
OUTPUT_ARCH(m68k)
@@ -22,73 +23,37 @@ SECTIONS
2223

2324
_etext = .; /* End of text section */
2425

25-
. = ALIGN(16); /* Exception table */
26-
__start___ex_table = .;
27-
__ex_table : { *(__ex_table) }
28-
__stop___ex_table = .;
26+
EXCEPTION_TABLE(16)
2927

3028
RODATA
3129

32-
.data : { /* Data */
33-
DATA_DATA
34-
CONSTRUCTORS
35-
}
30+
RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE)
3631

37-
. = ALIGN(16);
38-
.data.cacheline_aligned : { *(.data.cacheline_aligned) }
39-
40-
.bss : { *(.bss) } /* BSS */
32+
BSS_SECTION(0, 0, 0)
4133

4234
_edata = .; /* End of data section */
4335

4436
/* will be freed after init */
4537
. = ALIGN(PAGE_SIZE); /* Init code and data */
4638
__init_begin = .;
47-
.init.text : {
48-
_sinittext = .;
49-
INIT_TEXT
50-
_einittext = .;
51-
} :data
52-
.init.data : { INIT_DATA }
53-
. = ALIGN(16);
54-
__setup_start = .;
55-
.init.setup : { *(.init.setup) }
56-
__setup_end = .;
57-
__initcall_start = .;
58-
.initcall.init : {
59-
INITCALLS
60-
}
61-
__initcall_end = .;
62-
__con_initcall_start = .;
63-
.con_initcall.init : { *(.con_initcall.init) }
64-
__con_initcall_end = .;
39+
INIT_TEXT_SECTION(PAGE_SIZE) :data
40+
INIT_DATA_SECTION(16)
6541
.m68k_fixup : {
6642
__start_fixup = .;
6743
*(.m68k_fixup)
6844
__stop_fixup = .;
6945
}
70-
SECURITY_INIT
71-
#ifdef CONFIG_BLK_DEV_INITRD
72-
. = ALIGN(8192);
73-
__initramfs_start = .;
74-
.init.ramfs : { *(.init.ramfs) }
75-
__initramfs_end = .;
76-
#endif
7746
NOTES
78-
. = ALIGN(8192);
79-
__init_end = .;
80-
81-
.data.init_task : { *(.data.init_task) } /* The initial task and kernel stack */
47+
.init_end : {
48+
/* This ALIGN be in a section so that _end is at the end of the
49+
load segment. */
50+
. = ALIGN(PAGE_SIZE);
51+
__init_end = .;
52+
}
8253

8354
_end = . ;
8455

85-
/* Stabs debugging sections. */
86-
.stab 0 : { *(.stab) }
87-
.stabstr 0 : { *(.stabstr) }
88-
.stab.excl 0 : { *(.stab.excl) }
89-
.stab.exclstr 0 : { *(.stab.exclstr) }
90-
.stab.index 0 : { *(.stab.index) }
91-
.stab.indexstr 0 : { *(.stab.indexstr) }
56+
STABS_DEBUG
9257
.comment 0 : { *(.comment) }
9358

9459
/* Sections to be discarded */

‎arch/m68k/kernel/vmlinux-sun3.lds‎

Lines changed: 7 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include <asm-generic/vmlinux.lds.h>
44
#include <asm/page.h>
5+
#include <asm/thread_info.h>
56

67
OUTPUT_FORMAT("elf32-m68k", "elf32-m68k", "elf32-m68k")
78
OUTPUT_ARCH(m68k)
@@ -23,71 +24,30 @@ SECTIONS
2324

2425
_etext = .; /* End of text section */
2526

26-
.data : { /* Data */
27-
DATA_DATA
28-
CONSTRUCTORS
29-
. = ALIGN(16); /* Exception table */
30-
__start___ex_table = .;
31-
*(__ex_table)
32-
__stop___ex_table = .;
33-
} :data
27+
EXCEPTION_TABLE(16) :data
28+
RW_DATA_SECTION(16, PAGE_SIZE, THREAD_SIZE) :data
3429
/* End of data goes *here* so that freeing init code works properly. */
3530
_edata = .;
3631
NOTES
3732

3833
/* will be freed after init */
3934
. = ALIGN(PAGE_SIZE); /* Init code and data */
4035
__init_begin = .;
41-
.init.text : {
42-
_sinittext = .;
43-
INIT_TEXT
44-
_einittext = .;
45-
}
46-
.init.data : { INIT_DATA }
47-
. = ALIGN(16);
48-
__setup_start = .;
49-
.init.setup : { *(.init.setup) }
50-
__setup_end = .;
51-
__initcall_start = .;
52-
.initcall.init : {
53-
INITCALLS
54-
}
55-
__initcall_end = .;
56-
__con_initcall_start = .;
57-
.con_initcall.init : { *(.con_initcall.init) }
58-
__con_initcall_end = .;
36+
INIT_TEXT_SECTION(PAGE_SIZE)
37+
INIT_DATA_SECTION(16)
5938
.m68k_fixup : {
6039
__start_fixup = .;
6140
*(.m68k_fixup)
6241
__stop_fixup = .;
6342
}
64-
SECURITY_INIT
65-
#ifdef CONFIG_BLK_DEV_INITRD
66-
. = ALIGN(PAGE_SIZE);
67-
__initramfs_start = .;
68-
.init.ramfs : { *(.init.ramfs) }
69-
__initramfs_end = .;
70-
#endif
7143
. = ALIGN(PAGE_SIZE);
7244
__init_end = .;
73-
.data.init.task : { *(.data.init_task) }
74-
7545

76-
.bss : { *(.bss) } /* BSS */
46+
BSS_SECTION(0, 0, 0)
7747

7848
_end = . ;
7949

80-
.crap : {
81-
/* Stabs debugging sections. */
82-
*(.stab)
83-
*(.stabstr)
84-
*(.stab.excl)
85-
*(.stab.exclstr)
86-
*(.stab.index)
87-
*(.stab.indexstr)
88-
*(.comment)
89-
*(.note)
90-
}
50+
STABS_DEBUG
9151

9252
/* Sections to be discarded */
9353
DISCARDS

0 commit comments

Comments
 (0)