]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Scripts/GccBase.lds
BaseTools GCC: avoid the use of COMMON symbols
[mirror_edk2.git] / BaseTools / Scripts / GccBase.lds
CommitLineData
efe690ca
AB
1/** @file\r
2\r
3 Unified linker script for GCC based builds\r
4\r
5 Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
6 Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>\r
7\r
8 This program and the accompanying materials are licensed and made available under\r
9 the terms and conditions of the BSD License that accompanies this distribution.\r
10 The full text of the license may be found at\r
11 http://opensource.org/licenses/bsd-license.php.\r
12\r
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
15\r
16**/\r
17\r
18SECTIONS {\r
19\r
20 /*\r
21 * The PE/COFF binary consists of DOS and PE/COFF headers, and a sequence of\r
22 * section headers adding up to PECOFF_HEADER_SIZE bytes (which differs\r
23 * between 32-bit and 64-bit builds). The actual start of the .text section\r
24 * will be rounded up based on its actual alignment.\r
25 */\r
26 . = PECOFF_HEADER_SIZE;\r
27\r
28 .text : ALIGN(CONSTANT(COMMONPAGESIZE)) {\r
29 *(.text .text.* .stub .gnu.linkonce.t.*)\r
30 *(.rodata .rodata.* .gnu.linkonce.r.*)\r
31 *(.got .got.*)\r
233bd25b
AB
32\r
33 /*\r
34 * The contents of AutoGen.c files are constant from the POV of the program,\r
35 * but most of its contents end up in .data or .bss by default since few of\r
36 * the variable definitions that get emitted are declared as CONST.\r
37 */\r
38 *:AutoGen.obj(.data .data.* .bss .bss.*)\r
efe690ca
AB
39 }\r
40\r
41 /*\r
42 * The alignment of the .data section should be less than or equal to the\r
43 * alignment of the .text section. This ensures that the relative offset\r
44 * between these sections is the same in the ELF and the PE/COFF versions of\r
45 * this binary.\r
46 */\r
56948ba1 47 .data ALIGN(ALIGNOF(.text)) : ALIGN(CONSTANT(COMMONPAGESIZE)) {\r
efe690ca 48 *(.data .data.* .gnu.linkonce.d.*)\r
214a3b79 49 *(.bss .bss.*)\r
efe690ca
AB
50 }\r
51\r
52 .eh_frame ALIGN(CONSTANT(COMMONPAGESIZE)) : {\r
53 KEEP (*(.eh_frame))\r
54 }\r
55\r
56 .rela ALIGN(CONSTANT(COMMONPAGESIZE)) : {\r
57 *(.rela .rela.*)\r
58 }\r
59\r
60 /DISCARD/ : {\r
61 *(.note.GNU-stack)\r
62 *(.gnu_debuglink)\r
63 *(.interp)\r
64 *(.dynsym)\r
65 *(.dynstr)\r
66 *(.dynamic)\r
67 *(.hash)\r
68 *(.comment)\r
214a3b79 69 *(COMMON)\r
efe690ca
AB
70 }\r
71}\r