]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Scripts/GccBase.lds
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Scripts / GccBase.lds
index 0f0210e407035934d17806576c9eab61e4bb90f0..a9dd2138d4b5a8a601ded1d9ab8e860f91fcb425 100644 (file)
@@ -4,14 +4,9 @@
 \r
   Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
   Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>\r
+  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
 \r
-  This program and the accompanying materials are licensed and made available under\r
-  the terms and conditions of the BSD License that accompanies this distribution.\r
-  The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+  SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -29,6 +24,16 @@ SECTIONS {
     *(.text .text.* .stub .gnu.linkonce.t.*)\r
     *(.rodata .rodata.* .gnu.linkonce.r.*)\r
     *(.got .got.*)\r
+\r
+    /*\r
+     * The contents of AutoGen.c files are mostly constant from the POV of the\r
+     * program, but most of it ends up in .data or .bss by default since few of\r
+     * the variable definitions that get emitted are declared as CONST.\r
+     * Unfortunately, we cannot pull it into the .text section entirely, since\r
+     * patchable PCDs are also emitted here, but we can at least move all of the\r
+     * emitted GUIDs here.\r
+     */\r
+    *:AutoGen.obj(.data.g*Guid)\r
   }\r
 \r
   /*\r
@@ -37,19 +42,29 @@ SECTIONS {
    * between these sections is the same in the ELF and the PE/COFF versions of\r
    * this binary.\r
    */\r
-  .data : ALIGN(CONSTANT(COMMONPAGESIZE)) {\r
+  .data ALIGN(ALIGNOF(.text)) : ALIGN(CONSTANT(COMMONPAGESIZE)) {\r
     *(.data .data.* .gnu.linkonce.d.*)\r
-    *(.bss .bss.* *COM*)\r
+    *(.bss .bss.*)\r
   }\r
 \r
   .eh_frame ALIGN(CONSTANT(COMMONPAGESIZE)) : {\r
     KEEP (*(.eh_frame))\r
   }\r
 \r
-  .rela ALIGN(CONSTANT(COMMONPAGESIZE)) : {\r
+  .rela (INFO) : {\r
     *(.rela .rela.*)\r
   }\r
 \r
+  .hii : ALIGN(CONSTANT(COMMONPAGESIZE)) {\r
+    KEEP (*(.hii))\r
+  }\r
+\r
+  /*\r
+   * Retain the GNU build id but in a non-allocatable section so GenFw\r
+   * does not copy it into the PE/COFF image.\r
+   */\r
+  .build-id (INFO) : { *(.note.gnu.build-id) }\r
+\r
   /DISCARD/ : {\r
     *(.note.GNU-stack)\r
     *(.gnu_debuglink)\r
@@ -57,7 +72,8 @@ SECTIONS {
     *(.dynsym)\r
     *(.dynstr)\r
     *(.dynamic)\r
-    *(.hash)\r
+    *(.hash .gnu.hash)\r
     *(.comment)\r
+    *(COMMON)\r
   }\r
 }\r