xref: /qemu/tests/tcg/aarch64/system/kernel.ld (revision de11da64)
1ENTRY(__start)
2
3MEMORY {
4    /* On virt machine RAM starts at 1 GiB. */
5
6    /* Align text and rodata to the 1st 2 MiB chunk. */
7    TXT (rx) : ORIGIN = 1 << 30, LENGTH = 2M
8    /* Align r/w data to the 2nd 2 MiB chunk. */
9    DAT (rw) : ORIGIN = (1 << 30) + 2M, LENGTH = 2M
10    /* Align the MTE-enabled page to the 3rd 2 MiB chunk. */
11    TAG (rw) : ORIGIN = (1 << 30) + 4M, LENGTH = 2M
12}
13
14SECTIONS {
15    .text : {
16        *(.text)
17        *(.rodata)
18    } >TXT
19    .data : {
20        *(.data)
21        *(.bss)
22    } >DAT
23    .tag : {
24        /*
25         * Symbol 'mte_page' is used in boot.S to setup the PTE and in the mte.S
26         * test as the address that the MTE instructions operate on.
27         */
28        mte_page = .;
29    } >TAG
30    /DISCARD/ : {
31        *(.ARM.attributes)
32    }
33}
34