summaryrefslogtreecommitdiffstats
path: root/src/ppe/sbe/image/link.cmd
blob: 8c75f1c8659ba1f6f60acbdb679e0d8040cf9b1a (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/ppe/sbe/image/link.cmd $                                  */
/*                                                                        */
/* OpenPOWER OnChipController Project                                     */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2015                             */
/* [+] International Business Machines Corp.                              */
/*                                                                        */
/*                                                                        */
/* Licensed under the Apache License, Version 2.0 (the "License");        */
/* you may not use this file except in compliance with the License.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
// Need to do this so that elf32-powerpc is not modified!
#undef powerpc

#ifndef INITIAL_STACK_SIZE
#define INITIAL_STACK_SIZE 256
#endif

OUTPUT_FORMAT(elf32-powerpc);

SECTIONS
{
    . = 0xfff00000;
    _sbe_base_origin = . - 0;
    ////////////////////////////////
    // Header
    ////////////////////////////////
   . = ALIGN(1); _header_origin = .; _header_offset = . - _sbe_base_origin; .header . : { *(.header) } _header_size = . - _header_origin;

    ////////////////////////////////
    // FIXED
    ////////////////////////////////
    . = ALIGN(512); _fixed_origin = .; _fixed_offset = . - _sbe_base_origin; .fixed . : { *(.fixed) }  _fixed_size = . - _fixed_origin;

   ////////////////////////////////
    // FIXED_TOC
    ////////////////////////////////
    . = ALIGN(8); _fixed_toc_origin = .; _fixed_toc_offset = . - _sbe_base_origin; .fixed_toc . : { *(.fixed_toc) } _fixed_toc_size = . - _fixed_toc_origin;

    ////////////////////////////////
    // IPL_TEXT
    ////////////////////////////////
    . = ALIGN(4); _ipl_text_origin = .; _ipl_text_offset = . - _sbe_base_origin; .ipl_text . : { *(.ipl_text) } _ipl_text_size = . - _ipl_text_origin;

    ////////////////////////////////
    // IPL_DATA
    ////////////////////////////////
    . = ALIGN(8); _ipl_data_origin = .; _ipl_data_offset = . - _sbe_base_origin; .ipl_data . : { *(.ipl_data) } _ipl_data_size = . - _ipl_data_origin;

    ////////////////////////////////
    // TEXT
    ////////////////////////////////
    . = ALIGN(4); _text_origin = .; _text_offset = . - _sbe_base_origin; .text . : {. = ALIGN(512); *(.vectors) *(.text) *(.eh_frame) } _text_size = . - _text_origin;

    ////////////////////////////////
    // DATA
    ////////////////////////////////
    . = ALIGN(8); _data_origin = .; _data_offset = . - _sbe_base_origin; .data . : { *(.data) *(.comment) *(.rodata*)} _data_size = . - _data_origin;

   ////////////////////////////////
    // TOC
    ////////////////////////////////
    . = ALIGN(4); _toc_origin = .; _toc_offset = . - _sbe_base_origin; .toc . : { *(.toc) } _toc_size = . - _toc_origin;

   ////////////////////////////////
    // STRING
    ////////////////////////////////
    . = ALIGN(1); _strings_origin = .; _strings_offset = . - _sbe_base_origin; .strings . : { *(.strings) } _strings_size = . - _strings_origin;

//    . = ALIGN(8);
//    _sbe_base_size = . - _sbe_base_origin;
//    _sbe_base_end = . - 0;


    _RODATA_SECTION_BASE = .;


    _SDA2_BASE_ = .;

    _RODATA_SECTION_SIZE = . - _RODATA_SECTION_BASE;

    // SDA sections .sdata and .sbss must be adjacent to each
    // other.  Our SDATA sections are small so we'll use strictly positive
    // offsets. 

    _SDA_BASE_ = .;

    .sbss   . : { *(.sbss)   }
    .sdata   . : { *(.sdata)  }


   _PK_INITIAL_STACK_LIMIT = .;
   . = . + INITIAL_STACK_SIZE;
   _PK_INITIAL_STACK = . - 1;


    . = ALIGN(8);
    _sbe_base_size = . - _sbe_base_origin;
    _sbe_base_end = . - 0;


}
OpenPOWER on IntegriCloud