]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Scripts/GccBase.lds
BaseTools GCC: avoid the use of COMMON symbols
[mirror_edk2.git] / BaseTools / Scripts / GccBase.lds
index 3d99f01db21faadf77a9cd7074cbe402e878a303..32310bc75dcc29ea720461ae90a2e69449521a84 100644 (file)
@@ -29,6 +29,13 @@ 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 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 variable definitions that get emitted are declared as CONST.\r
+     */\r
+    *:AutoGen.obj(.data .data.* .bss .bss.*)\r
   }\r
 \r
   /*\r
@@ -39,7 +46,7 @@ SECTIONS {
    */\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
@@ -59,5 +66,6 @@ SECTIONS {
     *(.dynamic)\r
     *(.hash)\r
     *(.comment)\r
+    *(COMMON)\r
   }\r
 }\r