]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/ArmJunoPkg: use a rodata symbol for ReferenceAcpiTable
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 10 Aug 2015 07:54:55 +0000 (07:54 +0000)
committerabiesheuvel <abiesheuvel@Edk2>
Mon, 10 Aug 2015 07:54:55 +0000 (07:54 +0000)
The ACPI .aslc files contain a ReferenceAcpiTable() function whose
sole purpose is to ensure that the table itself does not get optimized
away. However, when using clang, these dummy functions result in a 4 KB
section alignment requirement, which is silly since everything except
the .data section is discarded later anyway.

So instead, make ReferenceAcpiTable a CONST pointer to VOID*. This way,
we still have a .text section, which is mandatory for the PE/COFF
conversion, but no executable code with small model relocations that
impose additional alignment requirements.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Tested-by: Leif Lindholm <leif.lindholm@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18194 6f19259b-4bc3-4df7-8a09-765794883524

ArmPlatformPkg/ArmJunoPkg/AcpiTables/Facs.aslc
ArmPlatformPkg/ArmJunoPkg/AcpiTables/Fadt.aslc
ArmPlatformPkg/ArmJunoPkg/AcpiTables/Gtdt.aslc
ArmPlatformPkg/ArmJunoPkg/AcpiTables/Madt.aslc

index 9743ddb5ee85836e700b50ade449e577821982f8..137ead77c199ce7cbb09b70d184214d7c8cd435b 100644 (file)
@@ -55,14 +55,8 @@ EFI_ACPI_5_0_FIRMWARE_ACPI_CONTROL_STRUCTURE Facs = {
       EFI_ACPI_RESERVED_BYTE },                           // UINT8   Reserved1[23]\r
 };\r
 \r
-VOID*\r
-ReferenceAcpiTable (\r
-  VOID\r
-  )\r
-{\r
-  //\r
-  // Reference the table being generated to prevent the optimizer from removing the\r
-  // data structure from the executable\r
-  //\r
-  return (VOID*)&Facs;\r
-}\r
+//\r
+// Reference the table being generated to prevent the optimizer from removing the\r
+// data structure from the executable\r
+//\r
+VOID* CONST ReferenceAcpiTable = &Facs;\r
index ef6d786b7c4d2aa411b10fe9b43d181216f6b1f2..eafdecb8aff74a1c5899fcf552d73fce1d0cad2b 100644 (file)
@@ -92,14 +92,8 @@ EFI_ACPI_5_1_FIXED_ACPI_DESCRIPTION_TABLE Fadt = {
   NULL_GAS                                                                  // EFI_ACPI_5_0_GENERIC_ADDRESS_STRUCTURE  SleepStatusReg\r
 };\r
 \r
-VOID*\r
-ReferenceAcpiTable (\r
-  VOID\r
-  )\r
-{\r
-  //\r
-  // Reference the table being generated to prevent the optimizer from removing the\r
-  // data structure from the executable\r
-  //\r
-  return (VOID*)&Fadt;\r
-}\r
+//\r
+// Reference the table being generated to prevent the optimizer from removing the\r
+// data structure from the executable\r
+//\r
+VOID* CONST ReferenceAcpiTable = &Fadt;\r
index 49d6e8e2136cf43e5f51f11ebe52862cc3575786..50057c2641d790ca6480b3ab5559cb346daa7e1f 100644 (file)
   };\r
 #endif\r
 \r
-VOID*\r
-ReferenceAcpiTable (\r
-  VOID\r
-  )\r
-{\r
-  //\r
-  // Reference the table being generated to prevent the optimizer from removing the\r
-  // data structure from the exeutable\r
-  //\r
-  return (VOID*)&Gtdt;\r
-}\r
+//\r
+// Reference the table being generated to prevent the optimizer from removing the\r
+// data structure from the executable\r
+//\r
+VOID* CONST ReferenceAcpiTable = &Gtdt;\r
index f8f50800c0bc150cc876540607da842c976045fe..406bd94f5636e4efe79ee8a291476a2662740c3f 100644 (file)
   };\r
 #endif\r
 \r
-VOID*\r
-ReferenceAcpiTable (\r
-  VOID\r
-  )\r
-{\r
-  //\r
-  // Reference the table being generated to prevent the optimizer from removing the\r
-  // data structure from the executable\r
-  //\r
-  return (VOID*)&Madt;\r
-}\r
+//\r
+// Reference the table being generated to prevent the optimizer from removing the\r
+// data structure from the executable\r
+//\r
+VOID* CONST ReferenceAcpiTable = &Madt;\r