aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-scripts/overlay-size.t
blob: 68c09861b63455c93767d35b92506fd8bd187976 (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
MEMORY
{
  TEXTMEM (ARX) : ORIGIN = 0x10000, LENGTH = 32K
  DATAMEM (AW)  : ORIGIN = 0x20000, LENGTH = 32K
  LOADMEM (AW)  : ORIGIN = 0x30000, LENGTH = 32K
}

/* Map should be:

           SIZE    VMA    LMA
   .bss1     10  20000  20000
   .bss2     30  20000  20010
   .bss3     20  20000  20040
   .mbss    230  20030  20060

   .mtext    20  10000  30000
   .text1    80  10020  30020
   .text2    40  10020  300a0
   .text3    20  10020  300e0

   .data1    30  20260  30100
   .data2    40  20260  30130
   .data3    50  20260  30170  */

SECTIONS
{
  OVERLAY : 
    {
      .bss1 { *(.bss1) }
      .bss2 { *(.bss2) }
      .bss3 { *(.bss3) }
    } > DATAMEM

  end_of_bss_overlays = . ;
    
  .mtext : { *(.mtext) } > TEXTMEM AT > LOADMEM

  .mbss : AT (__load_stop_bss3)
    {
      *(.mbss)
      . += 0x200;
    } > DATAMEM

  OVERLAY :
    {
      .text1 { *(.text1) }
      .text2 { *(.text2) }
      .text3 { *(.text3) }
    } > TEXTMEM AT > LOADMEM

  end_of_text_overlays = . ;

  OVERLAY :
    {
      .data1 { *(.data1) }
      .data2 { *(.data2) }
      .data3 { *(.data3) }
    } > DATAMEM AT > LOADMEM

  end_of_data_overlays = . ;
  
  . = 0x8000;
  /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) }
}