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; |
| 5 | .rodata : {} |
| 6 | . = ALIGN(0x1000); |
| 7 | .text : {} |
| 8 | . = ALIGN(0x1000); |
Yi Kong | e39a51b | 2019-08-14 00:01:02 -0700 | [diff] [blame^] | 9 | .dynamic : {} |
| 10 | . = ALIGN(0x1000); |
Peter Collingbourne | b39cb3c | 2019-03-01 13:12:49 -0800 | [diff] [blame] | 11 | .data : {} |
Peter Collingbourne | b39cb3c | 2019-03-01 13:12:49 -0800 | [diff] [blame] | 12 | .bss : {} |
| 13 | |
| 14 | # Now create the gap. We need a text segment first to prevent the linker from |
| 15 | # merging .bss with .bss.end_of_gap. |
| 16 | . = ALIGN(0x1000); |
| 17 | .text.text_before_start_of_gap : { |
| 18 | *(.text.text_before_start_of_gap); |
| 19 | } |
| 20 | |
| 21 | # Place end_of_gap at the end of the gap. |
| 22 | . = 0x1000000; |
| 23 | .bss.end_of_gap : { |
| 24 | *(.bss.end_of_gap); |
| 25 | } |
| 26 | } |