Peter Collingbourne | b39cb3c | 2019-03-01 13:12:49 -0800 | [diff] [blame] | 1 | SECTIONS { |
Yi Kong | e39a51b | 2019-08-14 00:01:02 -0700 | [diff] [blame] | 2 | # This starts off fairly normal: rodata, text, dynamic, data, bss with |
Peter Collingbourne | b39cb3c | 2019-03-01 13:12:49 -0800 | [diff] [blame] | 3 | # appropriate alignment between them. |
| 4 | . = SIZEOF_HEADERS; |
Stephen Hines | 15027e0 | 2020-07-23 19:35:49 -0700 | [diff] [blame] | 5 | .rodata : {*(.rodata .rodata.*)} |
Vilas Bhat | 8420cf0 | 2024-08-20 01:56:53 +0000 | [diff] [blame] | 6 | . = ALIGN(CONSTANT (MAXPAGESIZE)); |
Stephen Hines | 15027e0 | 2020-07-23 19:35:49 -0700 | [diff] [blame] | 7 | .text : {*(.text .text.*)} |
Vilas Bhat | 8420cf0 | 2024-08-20 01:56:53 +0000 | [diff] [blame] | 8 | . = ALIGN(CONSTANT (MAXPAGESIZE)); |
Stephen Hines | 15027e0 | 2020-07-23 19:35:49 -0700 | [diff] [blame] | 9 | .dynamic : {*(.dynamic)} |
Vilas Bhat | 8420cf0 | 2024-08-20 01:56:53 +0000 | [diff] [blame] | 10 | . = ALIGN(CONSTANT (MAXPAGESIZE)); |
Stephen Hines | 15027e0 | 2020-07-23 19:35:49 -0700 | [diff] [blame] | 11 | .data : {*(.data .data.*)} |
| 12 | .bss : {*(.bss .bss.*)} |
Peter Collingbourne | b39cb3c | 2019-03-01 13:12:49 -0800 | [diff] [blame] | 13 | |
| 14 | # Now create the gap. We need a text segment first to prevent the linker from |
Stephen Hines | 15027e0 | 2020-07-23 19:35:49 -0700 | [diff] [blame] | 15 | # merging .bss with .custom_bss. |
Vilas Bhat | 8420cf0 | 2024-08-20 01:56:53 +0000 | [diff] [blame] | 16 | . = ALIGN(CONSTANT (MAXPAGESIZE)); |
Stephen Hines | 15027e0 | 2020-07-23 19:35:49 -0700 | [diff] [blame] | 17 | .custom_text : { |
| 18 | *(.custom_text); |
Peter Collingbourne | b39cb3c | 2019-03-01 13:12:49 -0800 | [diff] [blame] | 19 | } |
| 20 | |
Stephen Hines | 15027e0 | 2020-07-23 19:35:49 -0700 | [diff] [blame] | 21 | # Place custom_bss at the end of the gap. |
Peter Collingbourne | b39cb3c | 2019-03-01 13:12:49 -0800 | [diff] [blame] | 22 | . = 0x1000000; |
Stephen Hines | 15027e0 | 2020-07-23 19:35:49 -0700 | [diff] [blame] | 23 | .custom_bss : { |
| 24 | *(.custom_bss); |
Peter Collingbourne | b39cb3c | 2019-03-01 13:12:49 -0800 | [diff] [blame] | 25 | } |
| 26 | } |