]> git.proxmox.com Git - mirror_edk2.git/blame - BaseTools/Scripts/GccBase.lds
BaseTools GCC: align start of .data to .text alignment
[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
32 }\r
33\r
34 /*\r
35 * The alignment of the .data section should be less than or equal to the\r
36 * alignment of the .text section. This ensures that the relative offset\r
37 * between these sections is the same in the ELF and the PE/COFF versions of\r
38 * this binary.\r
39 */\r
56948ba1 40 .data ALIGN(ALIGNOF(.text)) : ALIGN(CONSTANT(COMMONPAGESIZE)) {\r
efe690ca
AB
41 *(.data .data.* .gnu.linkonce.d.*)\r
42 *(.bss .bss.* *COM*)\r
43 }\r
44\r
45 .eh_frame ALIGN(CONSTANT(COMMONPAGESIZE)) : {\r
46 KEEP (*(.eh_frame))\r
47 }\r
48\r
49 .rela ALIGN(CONSTANT(COMMONPAGESIZE)) : {\r
50 *(.rela .rela.*)\r
51 }\r
52\r
53 /DISCARD/ : {\r
54 *(.note.GNU-stack)\r
55 *(.gnu_debuglink)\r
56 *(.interp)\r
57 *(.dynsym)\r
58 *(.dynstr)\r
59 *(.dynamic)\r
60 *(.hash)\r
61 *(.comment)\r
62 }\r
63}\r