]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Scripts/GccBase.lds
IntelFsp2WrapperPkg: Convert files to CRLF line ending
[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
03630a81 7 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
efe690ca
AB
8\r
9 This program and the accompanying materials are licensed and made available under\r
10 the terms and conditions of the BSD License that accompanies this distribution.\r
11 The full text of the license may be found at\r
12 http://opensource.org/licenses/bsd-license.php.\r
13\r
14 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
15 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
16\r
17**/\r
18\r
19SECTIONS {\r
20\r
21 /*\r
22 * The PE/COFF binary consists of DOS and PE/COFF headers, and a sequence of\r
23 * section headers adding up to PECOFF_HEADER_SIZE bytes (which differs\r
24 * between 32-bit and 64-bit builds). The actual start of the .text section\r
25 * will be rounded up based on its actual alignment.\r
26 */\r
27 . = PECOFF_HEADER_SIZE;\r
28\r
29 .text : ALIGN(CONSTANT(COMMONPAGESIZE)) {\r
30 *(.text .text.* .stub .gnu.linkonce.t.*)\r
31 *(.rodata .rodata.* .gnu.linkonce.r.*)\r
32 *(.got .got.*)\r
233bd25b
AB
33\r
34 /*\r
3cf41b87
AB
35 * The contents of AutoGen.c files are mostly constant from the POV of the\r
36 * program, but most of it ends up in .data or .bss by default since few of\r
233bd25b 37 * the variable definitions that get emitted are declared as CONST.\r
3cf41b87
AB
38 * Unfortunately, we cannot pull it into the .text section entirely, since\r
39 * patchable PCDs are also emitted here, but we can at least move all of the\r
40 * emitted GUIDs here.\r
233bd25b 41 */\r
3cf41b87 42 *:AutoGen.obj(.data.g*Guid)\r
efe690ca
AB
43 }\r
44\r
45 /*\r
46 * The alignment of the .data section should be less than or equal to the\r
47 * alignment of the .text section. This ensures that the relative offset\r
48 * between these sections is the same in the ELF and the PE/COFF versions of\r
49 * this binary.\r
50 */\r
56948ba1 51 .data ALIGN(ALIGNOF(.text)) : ALIGN(CONSTANT(COMMONPAGESIZE)) {\r
efe690ca 52 *(.data .data.* .gnu.linkonce.d.*)\r
214a3b79 53 *(.bss .bss.*)\r
efe690ca
AB
54 }\r
55\r
56 .eh_frame ALIGN(CONSTANT(COMMONPAGESIZE)) : {\r
57 KEEP (*(.eh_frame))\r
58 }\r
59\r
669a7562 60 .rela (INFO) : {\r
efe690ca
AB
61 *(.rela .rela.*)\r
62 }\r
63\r
03630a81
TP
64 .hii : ALIGN(CONSTANT(COMMONPAGESIZE)) {\r
65 KEEP (*(.hii))\r
66 }\r
67\r
7fd5d619
AB
68 /*\r
69 * Retain the GNU build id but in a non-allocatable section so GenFw\r
70 * does not copy it into the PE/COFF image.\r
71 */\r
72 .build-id (INFO) : { *(.note.gnu.build-id) }\r
73\r
efe690ca
AB
74 /DISCARD/ : {\r
75 *(.note.GNU-stack)\r
76 *(.gnu_debuglink)\r
77 *(.interp)\r
78 *(.dynsym)\r
79 *(.dynstr)\r
80 *(.dynamic)\r
81 *(.hash)\r
82 *(.comment)\r
214a3b79 83 *(COMMON)\r
efe690ca
AB
84 }\r
85}\r