| # Copyright Microsoft and CHERIoT Contributors. | |
| # SPDX-License-Identifier: MIT | |
| SECTIONS | |
| { | |
| . = 0; | |
| .compartment_export_table : ALIGN(8) | |
| { | |
| # Space for the compartment's PCC and GDC | |
| . = . + 16; | |
| # And no compartment error handler. See the | |
| # compartment_export_table section in sdk/compartment.ldscript | |
| # and errorHandler in the sdk/core/switcher | |
| LONG(-1); | |
| # Array of compartment exports | |
| *(.compartment_exports); | |
| } | |
| # Lay out the code. We ensure that the three capabilities that are used | |
| # for scanning memory are provided. | |
| .text : | |
| { | |
| HIDDEN(__compartment_pcc_start = .); | |
| *(.text .text.*); | |
| *(.data.rel.ro); | |
| *(.rodata .rodata.*); | |
| } | |
| # Lay out all of the globals. | |
| .data : | |
| { | |
| *(.data .data.*); | |
| *(.sdata .sdata.*); | |
| *(.bss .bss.*); | |
| *(.sbss .sbss.*); | |
| } | |
| # Throw some stuff away that we don't need. | |
| /DISCARD/ : | |
| { | |
| *(.comment); | |
| } | |
| } |