1 /* Test linker script for OpenRISC.
3 Copyright (C) 2017-2021 Free Software Foundation, Inc.
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */
20 /* The exception vectors actually start at 0x100, but if you specify
21 that address here, the "--output-target binary" step will start from
22 address 0 with the contents meant for address 0x100. */
23 exception_vectors : ORIGIN = 0 , LENGTH = 8K
24 ram : ORIGIN = 8K, LENGTH = 2M - 8K
31 KEEP(*(.exception_vectors))
53 /* WARNING about section size alignment:
54 The start-up assembly code can only clear BSS section sizes
55 which are aligned to 4 bytes. However, the size of the BSS
56 section may not be aligned, therefore up to 3 bytes more could
57 be zeroed on start-up. This is normally not an issue, as the
58 start of the next section is usually aligned too, so those extra
59 bytes should be just padding. I did try the following trick to
60 align the BSS section size, to no avail:
66 _bss_begin = ADDR(.bss);
67 _bss_end = _bss_begin + SIZEOF(.bss);
69 .stack ALIGN(16) (NOLOAD):
75 ENTRY(_start) /* Otherwise, --gc-sections would throw everything away. */