aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-generic/vmlinux.lds.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-generic/vmlinux.lds.h')
-rw-r--r--include/asm-generic/vmlinux.lds.h43
1 files changed, 26 insertions, 17 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 6bdba10fef4a..6ad76bf5fb40 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -30,9 +30,7 @@
30 * EXCEPTION_TABLE(...) 30 * EXCEPTION_TABLE(...)
31 * NOTES 31 * NOTES
32 * 32 *
33 * __bss_start = .; 33 * BSS_SECTION(0, 0, 0)
34 * BSS_SECTION(0, 0)
35 * __bss_stop = .;
36 * _end = .; 34 * _end = .;
37 * 35 *
38 * /DISCARD/ : { 36 * /DISCARD/ : {
@@ -191,7 +189,7 @@
191 . = ALIGN(align); \ 189 . = ALIGN(align); \
192 *(.data.cacheline_aligned) 190 *(.data.cacheline_aligned)
193 191
194#define INIT_TASK(align) \ 192#define INIT_TASK_DATA(align) \
195 . = ALIGN(align); \ 193 . = ALIGN(align); \
196 *(.data.init_task) 194 *(.data.init_task)
197 195
@@ -434,18 +432,28 @@
434/* 432/*
435 * Init task 433 * Init task
436 */ 434 */
437#define INIT_TASK_DATA(align) \ 435#define INIT_TASK_DATA_SECTION(align) \
438 . = ALIGN(align); \ 436 . = ALIGN(align); \
439 .data.init_task : { \ 437 .data.init_task : { \
440 INIT_TASK \ 438 INIT_TASK_DATA(align) \
441 } 439 }
442 440
441#ifdef CONFIG_CONSTRUCTORS
442#define KERNEL_CTORS() . = ALIGN(8); \
443 VMLINUX_SYMBOL(__ctors_start) = .; \
444 *(.ctors) \
445 VMLINUX_SYMBOL(__ctors_end) = .;
446#else
447#define KERNEL_CTORS()
448#endif
449
443/* init and exit section handling */ 450/* init and exit section handling */
444#define INIT_DATA \ 451#define INIT_DATA \
445 *(.init.data) \ 452 *(.init.data) \
446 DEV_DISCARD(init.data) \ 453 DEV_DISCARD(init.data) \
447 CPU_DISCARD(init.data) \ 454 CPU_DISCARD(init.data) \
448 MEM_DISCARD(init.data) \ 455 MEM_DISCARD(init.data) \
456 KERNEL_CTORS() \
449 *(.init.rodata) \ 457 *(.init.rodata) \
450 DEV_DISCARD(init.rodata) \ 458 DEV_DISCARD(init.rodata) \
451 CPU_DISCARD(init.rodata) \ 459 CPU_DISCARD(init.rodata) \
@@ -479,7 +487,8 @@
479 * bss (Block Started by Symbol) - uninitialized data 487 * bss (Block Started by Symbol) - uninitialized data
480 * zeroed during startup 488 * zeroed during startup
481 */ 489 */
482#define SBSS \ 490#define SBSS(sbss_align) \
491 . = ALIGN(sbss_align); \
483 .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \ 492 .sbss : AT(ADDR(.sbss) - LOAD_OFFSET) { \
484 *(.sbss) \ 493 *(.sbss) \
485 *(.scommon) \ 494 *(.scommon) \
@@ -488,12 +497,10 @@
488#define BSS(bss_align) \ 497#define BSS(bss_align) \
489 . = ALIGN(bss_align); \ 498 . = ALIGN(bss_align); \
490 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \ 499 .bss : AT(ADDR(.bss) - LOAD_OFFSET) { \
491 VMLINUX_SYMBOL(__bss_start) = .; \
492 *(.bss.page_aligned) \ 500 *(.bss.page_aligned) \
493 *(.dynbss) \ 501 *(.dynbss) \
494 *(.bss) \ 502 *(.bss) \
495 *(COMMON) \ 503 *(COMMON) \
496 VMLINUX_SYMBOL(__bss_stop) = .; \
497 } 504 }
498 505
499/* 506/*
@@ -616,7 +623,7 @@
616 *(.init.ramfs) \ 623 *(.init.ramfs) \
617 VMLINUX_SYMBOL(__initramfs_end) = .; 624 VMLINUX_SYMBOL(__initramfs_end) = .;
618#else 625#else
619#define INITRAMFS 626#define INIT_RAM_FS
620#endif 627#endif
621 628
622/** 629/**
@@ -695,15 +702,15 @@
695 * matches the requirment of PAGE_ALIGNED_DATA. 702 * matches the requirment of PAGE_ALIGNED_DATA.
696 * 703 *
697 * use 0 as page_align if page_aligned data is not used */ 704 * use 0 as page_align if page_aligned data is not used */
698#define RW_DATA_SECTION(cacheline, nosave, pagealigned, inittask) \ 705#define RW_DATA_SECTION(cacheline, pagealigned, inittask) \
699 . = ALIGN(PAGE_SIZE); \ 706 . = ALIGN(PAGE_SIZE); \
700 .data : AT(ADDR(.data) - LOAD_OFFSET) { \ 707 .data : AT(ADDR(.data) - LOAD_OFFSET) { \
701 INIT_TASK(inittask) \ 708 INIT_TASK_DATA(inittask) \
702 CACHELINE_ALIGNED_DATA(cacheline) \ 709 CACHELINE_ALIGNED_DATA(cacheline) \
703 READ_MOSTLY_DATA(cacheline) \ 710 READ_MOSTLY_DATA(cacheline) \
704 DATA_DATA \ 711 DATA_DATA \
705 CONSTRUCTORS \ 712 CONSTRUCTORS \
706 NOSAVE_DATA(nosave) \ 713 NOSAVE_DATA \
707 PAGE_ALIGNED_DATA(pagealigned) \ 714 PAGE_ALIGNED_DATA(pagealigned) \
708 } 715 }
709 716
@@ -725,8 +732,10 @@
725 INIT_RAM_FS \ 732 INIT_RAM_FS \
726 } 733 }
727 734
728#define BSS_SECTION(sbss_align, bss_align) \ 735#define BSS_SECTION(sbss_align, bss_align, stop_align) \
729 SBSS \ 736 . = ALIGN(sbss_align); \
737 VMLINUX_SYMBOL(__bss_start) = .; \
738 SBSS(sbss_align) \
730 BSS(bss_align) \ 739 BSS(bss_align) \
731 . = ALIGN(4); 740 . = ALIGN(stop_align); \
732 741 VMLINUX_SYMBOL(__bss_stop) = .;