]>
Commit | Line | Data |
---|---|---|
c1aa3bab LG |
1 | /** @file\r |
2 | \r | |
e1636fe1 | 3 | Unified linker script for CLANG based builds\r |
c1aa3bab | 4 | \r |
e1636fe1 | 5 | Copyright (c) 2010 - 2021, Intel Corporation. All rights reserved.<BR>\r |
c1aa3bab LG |
6 | Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>\r |
7 | (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r | |
8 | \r | |
9 | SPDX-License-Identifier: BSD-2-Clause-Patent\r | |
10 | \r | |
11 | **/\r | |
12 | \r | |
13 | SECTIONS {\r | |
14 | \r | |
15 | /*\r | |
16 | * The PE/COFF binary consists of DOS and PE/COFF headers, and a sequence of\r | |
17 | * section headers adding up to PECOFF_HEADER_SIZE bytes (which differs\r | |
18 | * between 32-bit and 64-bit builds). The actual start of the .text section\r | |
19 | * will be rounded up based on its actual alignment.\r | |
20 | */\r | |
21 | . = PECOFF_HEADER_SIZE;\r | |
22 | \r | |
23 | .text : ALIGN(CONSTANT(MAXPAGESIZE)) {\r | |
24 | *(.text .text.* .stub .gnu.linkonce.t.*)\r | |
25 | *(.rodata .rodata.* .gnu.linkonce.r.*)\r | |
26 | *(.got .got.*)\r | |
27 | \r | |
28 | /*\r | |
29 | * The contents of AutoGen.c files are mostly constant from the POV of the\r | |
30 | * program, but most of it ends up in .data or .bss by default since few of\r | |
31 | * the variable definitions that get emitted are declared as CONST.\r | |
32 | * Unfortunately, we cannot pull it into the .text section entirely, since\r | |
33 | * patchable PCDs are also emitted here, but we can at least move all of the\r | |
34 | * emitted GUIDs here.\r | |
35 | */\r | |
36 | *:AutoGen.obj(.data.g*Guid)\r | |
37 | }\r | |
38 | \r | |
39 | /*\r | |
40 | * The alignment of the .data section should be less than or equal to the\r | |
41 | * alignment of the .text section. This ensures that the relative offset\r | |
42 | * between these sections is the same in the ELF and the PE/COFF versions of\r | |
43 | * this binary.\r | |
44 | */\r | |
45 | .data ALIGN(ALIGNOF(.text)) : ALIGN(CONSTANT(MAXPAGESIZE)) {\r | |
46 | *(.data .data.* .gnu.linkonce.d.*)\r | |
47 | *(.bss .bss.*)\r | |
48 | }\r | |
49 | \r | |
50 | .eh_frame ALIGN(CONSTANT(MAXPAGESIZE)) : {\r | |
51 | KEEP (*(.eh_frame))\r | |
52 | }\r | |
53 | \r | |
54 | .rela (INFO) : {\r | |
55 | *(.rela .rela.*)\r | |
56 | }\r | |
57 | \r | |
58 | .hii : ALIGN(CONSTANT(MAXPAGESIZE)) {\r | |
59 | KEEP (*(.hii))\r | |
60 | }\r | |
61 | \r | |
62 | /*\r | |
63 | * Retain the GNU build id but in a non-allocatable section so GenFw\r | |
64 | * does not copy it into the PE/COFF image.\r | |
65 | */\r | |
66 | .build-id (INFO) : { *(.note.gnu.build-id) }\r | |
67 | \r | |
68 | /DISCARD/ : {\r | |
69 | *(.note.GNU-stack)\r | |
70 | *(.gnu_debuglink)\r | |
71 | *(.interp)\r | |
72 | *(.dynsym)\r | |
73 | *(.dynstr)\r | |
c1aa3bab LG |
74 | *(.hash .gnu.hash)\r |
75 | *(.comment)\r | |
76 | *(COMMON)\r | |
77 | }\r | |
78 | }\r |