]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Scripts/GccBase.lds
BaseTools/BinToPcd: Fix Python 2.7.x compatibility issue
[mirror_edk2.git] / BaseTools / Scripts / GccBase.lds
index 7e4cdde9bfea8405ce4b2b375fda903d9a64b976..a43e0072f2b48692bcd3be275d1301526ea020fb 100644 (file)
@@ -32,11 +32,14 @@ SECTIONS {
     *(.got .got.*)\r
 \r
     /*\r
-     * The contents of AutoGen.c files are constant from the POV of the program,\r
-     * but most of its contents end up in .data or .bss by default since few of\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 .data.* .bss .bss.*)\r
+    *:AutoGen.obj(.data.g*Guid)\r
   }\r
 \r
   /*\r
@@ -54,7 +57,7 @@ SECTIONS {
     KEEP (*(.eh_frame))\r
   }\r
 \r
-  .rela ALIGN(CONSTANT(COMMONPAGESIZE)) : {\r
+  .rela (INFO) : {\r
     *(.rela .rela.*)\r
   }\r
 \r
@@ -62,6 +65,12 @@ SECTIONS {
     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
@@ -69,7 +78,7 @@ SECTIONS {
     *(.dynsym)\r
     *(.dynstr)\r
     *(.dynamic)\r
-    *(.hash)\r
+    *(.hash .gnu.hash)\r
     *(.comment)\r
     *(COMMON)\r
   }\r