vmlinux.lds.h (2b5c0c72ea404d6b554a8284031dd78748314b9e) | vmlinux.lds.h (023bf6f1b8bf58dc4da7f0dc1cf4787b0d5297c1) |
---|---|
1/* 2 * Helper macros to support writing architecture specific 3 * linker scripts. 4 * 5 * A minimal linker scripts has following content: 6 * [This is a sample, architectures may have special requiriements] 7 * 8 * OUTPUT_FORMAT(...) --- 21 unchanged lines hidden (view full) --- 30 * EXCEPTION_TABLE(...) 31 * NOTES 32 * 33 * __bss_start = .; 34 * BSS_SECTION(0, 0) 35 * __bss_stop = .; 36 * _end = .; 37 * | 1/* 2 * Helper macros to support writing architecture specific 3 * linker scripts. 4 * 5 * A minimal linker scripts has following content: 6 * [This is a sample, architectures may have special requiriements] 7 * 8 * OUTPUT_FORMAT(...) --- 21 unchanged lines hidden (view full) --- 30 * EXCEPTION_TABLE(...) 31 * NOTES 32 * 33 * __bss_start = .; 34 * BSS_SECTION(0, 0) 35 * __bss_stop = .; 36 * _end = .; 37 * |
38 * /DISCARD/ : { 39 * EXIT_TEXT 40 * EXIT_DATA 41 * EXIT_CALL 42 * } | |
43 * STABS_DEBUG 44 * DWARF_DEBUG | 38 * STABS_DEBUG 39 * DWARF_DEBUG |
40 * 41 * DISCARDS // must be the last |
|
45 * } 46 * 47 * [__init_begin, __init_end] is the init section that may be freed after init 48 * [_stext, _etext] is the text section 49 * [_sdata, _edata] is the data section 50 * 51 * Some of the included output section have their own set of constants. 52 * Examples are: [__initramfs_start, __initramfs_end] for initramfs and --- 133 unchanged lines hidden (view full) --- 186#define READ_MOSTLY_DATA(align) \ 187 . = ALIGN(align); \ 188 *(.data.read_mostly) 189 190#define CACHELINE_ALIGNED_DATA(align) \ 191 . = ALIGN(align); \ 192 *(.data.cacheline_aligned) 193 | 42 * } 43 * 44 * [__init_begin, __init_end] is the init section that may be freed after init 45 * [_stext, _etext] is the text section 46 * [_sdata, _edata] is the data section 47 * 48 * Some of the included output section have their own set of constants. 49 * Examples are: [__initramfs_start, __initramfs_end] for initramfs and --- 133 unchanged lines hidden (view full) --- 183#define READ_MOSTLY_DATA(align) \ 184 . = ALIGN(align); \ 185 *(.data.read_mostly) 186 187#define CACHELINE_ALIGNED_DATA(align) \ 188 . = ALIGN(align); \ 189 *(.data.cacheline_aligned) 190 |
194#define INIT_TASK_DATA(align) \ | 191#define INIT_TASK(align) \ |
195 . = ALIGN(align); \ 196 *(.data.init_task) 197 198/* 199 * Read only Data 200 */ 201#define RO_DATA_SECTION(align) \ 202 . = ALIGN((align)); \ --- 226 unchanged lines hidden (view full) --- 429 VMLINUX_SYMBOL(__start___ex_table) = .; \ 430 *(__ex_table) \ 431 VMLINUX_SYMBOL(__stop___ex_table) = .; \ 432 } 433 434/* 435 * Init task 436 */ | 192 . = ALIGN(align); \ 193 *(.data.init_task) 194 195/* 196 * Read only Data 197 */ 198#define RO_DATA_SECTION(align) \ 199 . = ALIGN((align)); \ --- 226 unchanged lines hidden (view full) --- 426 VMLINUX_SYMBOL(__start___ex_table) = .; \ 427 *(__ex_table) \ 428 VMLINUX_SYMBOL(__stop___ex_table) = .; \ 429 } 430 431/* 432 * Init task 433 */ |
437#define INIT_TASK_DATA_SECTION(align) \ | 434#define INIT_TASK_DATA(align) \ |
438 . = ALIGN(align); \ 439 .data.init_task : { \ | 435 . = ALIGN(align); \ 436 .data.init_task : { \ |
440 INIT_TASK_DATA(align) \ | 437 INIT_TASK \ |
441 } 442 443#ifdef CONFIG_CONSTRUCTORS 444#define KERNEL_CTORS() . = ALIGN(8); \ 445 VMLINUX_SYMBOL(__ctors_start) = .; \ 446 *(.ctors) \ 447 VMLINUX_SYMBOL(__ctors_end) = .; 448#else --- 175 unchanged lines hidden (view full) --- 624 . = ALIGN(PAGE_SIZE); \ 625 VMLINUX_SYMBOL(__initramfs_start) = .; \ 626 *(.init.ramfs) \ 627 VMLINUX_SYMBOL(__initramfs_end) = .; 628#else 629#define INIT_RAM_FS 630#endif 631 | 438 } 439 440#ifdef CONFIG_CONSTRUCTORS 441#define KERNEL_CTORS() . = ALIGN(8); \ 442 VMLINUX_SYMBOL(__ctors_start) = .; \ 443 *(.ctors) \ 444 VMLINUX_SYMBOL(__ctors_end) = .; 445#else --- 175 unchanged lines hidden (view full) --- 621 . = ALIGN(PAGE_SIZE); \ 622 VMLINUX_SYMBOL(__initramfs_start) = .; \ 623 *(.init.ramfs) \ 624 VMLINUX_SYMBOL(__initramfs_end) = .; 625#else 626#define INIT_RAM_FS 627#endif 628 |
629/* 630 * Default discarded sections. 631 * 632 * Some archs want to discard exit text/data at runtime rather than 633 * link time due to cross-section references such as alt instructions, 634 * bug table, eh_frame, etc. DISCARDS must be the last of output 635 * section definitions so that such archs put those in earlier section 636 * definitions. 637 */ 638#define DISCARDS \ 639 /DISCARD/ : { \ 640 EXIT_TEXT \ 641 EXIT_DATA \ 642 EXIT_CALL \ 643 *(.discard) \ 644 } 645 |
|
632/** 633 * PERCPU_VADDR - define output section for percpu area 634 * @vaddr: explicit base address (optional) 635 * @phdr: destination PHDR (optional) 636 * 637 * Macro which expands to output section for percpu area. If @vaddr 638 * is not blank, it specifies explicit base address and all percpu 639 * symbols will be offset from the given address. If blank, @vaddr --- 60 unchanged lines hidden (view full) --- 700 * typical alignment matches. 701 * A cacheline is typical/always less than a PAGE_SIZE so 702 * the sections that has this restriction (or similar) 703 * is located before the ones requiring PAGE_SIZE alignment. 704 * NOSAVE_DATA starts and ends with a PAGE_SIZE alignment which 705 * matches the requirment of PAGE_ALIGNED_DATA. 706 * 707 * use 0 as page_align if page_aligned data is not used */ | 646/** 647 * PERCPU_VADDR - define output section for percpu area 648 * @vaddr: explicit base address (optional) 649 * @phdr: destination PHDR (optional) 650 * 651 * Macro which expands to output section for percpu area. If @vaddr 652 * is not blank, it specifies explicit base address and all percpu 653 * symbols will be offset from the given address. If blank, @vaddr --- 60 unchanged lines hidden (view full) --- 714 * typical alignment matches. 715 * A cacheline is typical/always less than a PAGE_SIZE so 716 * the sections that has this restriction (or similar) 717 * is located before the ones requiring PAGE_SIZE alignment. 718 * NOSAVE_DATA starts and ends with a PAGE_SIZE alignment which 719 * matches the requirment of PAGE_ALIGNED_DATA. 720 * 721 * use 0 as page_align if page_aligned data is not used */ |
708#define RW_DATA_SECTION(cacheline, pagealigned, inittask) \ | 722#define RW_DATA_SECTION(cacheline, nosave, pagealigned, inittask) \ |
709 . = ALIGN(PAGE_SIZE); \ 710 .data : AT(ADDR(.data) - LOAD_OFFSET) { \ | 723 . = ALIGN(PAGE_SIZE); \ 724 .data : AT(ADDR(.data) - LOAD_OFFSET) { \ |
711 INIT_TASK_DATA(inittask) \ | 725 INIT_TASK(inittask) \ |
712 CACHELINE_ALIGNED_DATA(cacheline) \ 713 READ_MOSTLY_DATA(cacheline) \ 714 DATA_DATA \ 715 CONSTRUCTORS \ | 726 CACHELINE_ALIGNED_DATA(cacheline) \ 727 READ_MOSTLY_DATA(cacheline) \ 728 DATA_DATA \ 729 CONSTRUCTORS \ |
716 NOSAVE_DATA \ | 730 NOSAVE_DATA(nosave) \ |
717 PAGE_ALIGNED_DATA(pagealigned) \ 718 } 719 720#define INIT_TEXT_SECTION(inittext_align) \ 721 . = ALIGN(inittext_align); \ 722 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { \ 723 VMLINUX_SYMBOL(_sinittext) = .; \ 724 INIT_TEXT \ --- 18 unchanged lines hidden --- | 731 PAGE_ALIGNED_DATA(pagealigned) \ 732 } 733 734#define INIT_TEXT_SECTION(inittext_align) \ 735 . = ALIGN(inittext_align); \ 736 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) { \ 737 VMLINUX_SYMBOL(_sinittext) = .; \ 738 INIT_TEXT \ --- 18 unchanged lines hidden --- |