/*************************************************************************** * Project : shakti devt board * Name of the file : link.ld * Created date : * Brief Description of file : linker file * Name of Author : Sathya Narayanan N & Abhinav ramnath * Email ID : sathya281@gmail.com Copyright (C) 2019 IIT Madras. All rights reserved. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . ***************************************************************************/ OUTPUT_ARCH( "riscv" ) /* _STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x14000; */ ENTRY(_start) SECTIONS { . = 0x80000000; .text.init : { *(.text.init) } .text : { *(.text) } .rodata : { __rodata_start = .; *(.rodata) *(.rodata.*) *(.gnu.linkonce.r.*) __rodata_end = .; } .sdata : { __global_pointer$ = . + 0x800; *(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata*) *(.sdata .sdata.* .gnu.linkonce.s.*) } .sbss : { __sbss_start = .; *(.sbss) *(.sbss.*) *(.gnu.linkonce.sb.*) __sbss_end = .; } .data : { . = ALIGN(4); __data_start = .; *(.data) *(.data.*) *(.gnu.linkonce.d.*) __data_end = .; } .bss : { . = ALIGN(4); __bss_start = .; *(.bss) *(.bss.*) *(.gnu.linkonce.b.*) *(COMMON) . = ALIGN(4); __bss_end = .; } .tdata : { _tls_data = .; *(.tdata.begin) *(.tdata) *(.tdata.end) _tls_end = .; } .tbss : { *(.tbss) *(.tbss.end) } . = ALIGN(4); _end = .; . = 0x80000000 + 0x10000000 - 0x20; _free_space = . - _end; _STACK_SIZE = (_free_space * 50) / 100 ; _HEAP_SIZE = _free_space - _STACK_SIZE; .stack : { _stack_end = .; __stack_pointer$ = .; _stack = . - _STACK_SIZE; } . = _stack; .heap : { _heap = . - _HEAP_SIZE; _heap_end = .; } }