Revision: 18137
          http://sourceforge.net/p/edk2/code/18137
Author:   abiesheuvel
Date:     2015-08-03 08:22:50 +0000 (Mon, 03 Aug 2015)
Log Message:
-----------
BaseTools GCC: move AutoGen.obj contents to .text section

All AutoGen.obj files consist of global GUID definitions, fixed
and patchable PCDs and other data that is essentially read-only at
runtime but has not been declared as such for various reasons.

By moving these contents to .text we achieve two things:
- global GUIDs and other data items which must be constant for correct
  program operation can no longer be modified, for instance, when
  running a DXE_RUNTIME_MODULE binary under the OS with the Properties
  Table feature for memory protection enabled;
- the .data section becomes smaller, and may be dropped completely for
  many XIP modules, which reduces wasted FV space if the PE/COFF section
  alignment is large.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Tested-by: Liming Gao <[email protected]>
Tested-by: Leif Lindholm <[email protected]>

Modified Paths:
--------------
    trunk/edk2/BaseTools/Scripts/GccBase.lds

Modified: trunk/edk2/BaseTools/Scripts/GccBase.lds
===================================================================
--- trunk/edk2/BaseTools/Scripts/GccBase.lds    2015-08-03 08:22:39 UTC (rev 
18136)
+++ trunk/edk2/BaseTools/Scripts/GccBase.lds    2015-08-03 08:22:50 UTC (rev 
18137)
@@ -29,6 +29,13 @@
     *(.text .text.* .stub .gnu.linkonce.t.*)
     *(.rodata .rodata.* .gnu.linkonce.r.*)
     *(.got .got.*)
+
+    /*
+     * The contents of AutoGen.c files are constant from the POV of the 
program,
+     * but most of its contents end up in .data or .bss by default since few of
+     * the variable definitions that get emitted are declared as CONST.
+     */
+    *:AutoGen.obj(.data .data.* .bss .bss.*)
   }
 
   /*


------------------------------------------------------------------------------
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to