summaryrefslogtreecommitdiffstats
path: root/utils/hwstub/stub/jz4760b/hwstub.lds
blob: f0460284ca5d2281e87d044dd60bfba6ccf7fccb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include "config.h"
ENTRY(main)
OUTPUT_ARCH(mips)
STARTUP(jz4760b/crt0.o)

MEMORY
{
    /* see crt0.S from an an explanation of why TCSM0 is the best choice */
    TCSM0 : ORIGIN = TCSM0_ORIG, LENGTH = TCSM0_SIZE
}

SECTIONS
{
    .itext :
    {
        relocstart = .;
        oc_codestart = .;
        *(.init.text*)
        *(.text*)
        *(.icode*)
        *(.data*)
        *(.rodata*)
        /* exceptions needs to be on a 0x1000 boundary */
        . = ALIGN(0x1000);
        tcsm0_irqbase = .;
        KEEP(*(.exception.tlb_refill))
        . = tcsm0_irqbase + 0x100;
        KEEP(*(.exception.cache_error))
        . = tcsm0_irqbase + 0x180;
        KEEP(*(.exception.general_exception))
        . = ALIGN(4);
        relocend = .;
    } > TCSM0

    /* tcsm0_irqbase is the address in the 0xf400xxxx address space, but for
     * EBASE, we want to the corresponding k1seg address, that maps to the
     * physical address of TCSM0 */
    irqbase = tcsm0_irqbase - TCSM0_ORIG + TCSM0_UNCACHED_ADDRESS;

    .bss (NOLOAD) :
    {
        bssbegin = .;
        *(.bss)
        . = ALIGN(4);
        bssend = .;
    } > TCSM0

    .stack (NOLOAD) :
    {
        oc_codeend = .;
        oc_stackstart = .;
        . += STACK_SIZE;
        oc_stackend = .;
        oc_bufferstart = .;
    } > TCSM0

    .ocend TCSM0_ORIG + TCSM0_SIZE (NOLOAD) :
    {
        oc_bufferend = .;
    } > TCSM0

    /DISCARD/ :
    {
        *(.note.*)
        *(.reginfo*)
        *(.MIPS*)
    }
}