]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg/UfsPassThru: Fix wrong GLOBAL_REMOVE_IF_UNREFERENCED usage
authorFeng Tian <feng.tian@intel.com>
Tue, 28 Jul 2015 02:47:52 +0000 (02:47 +0000)
committererictian <erictian@Edk2>
Tue, 28 Jul 2015 02:47:52 +0000 (02:47 +0000)
GLOBAL_REMOVE_IF_UNREFERENCED means __declspec(selectany) for MS tool
chain IA32/X64 build.

According to MSDN, "selectany" would tell the compiler that the declared
global data item (variable or object) is a pick-any COMDAT (a packaged
function). At link time, if multiple definitions of a COMDAT are seen,
the linker picks one and discards the rest.

So we have to remove GLOBAL_REMOVE_IF_UNREFERENCED key word from two global
variable's extern definitions of .h file as we have used this keyword in
.c file, otherwise the MS tool chain would pick the definitions in .h file
and treat it as uninitialized data to generate full-0 content for these two
global variables.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18088 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Bus/Ufs/UfsPassThruDxe/UfsPassThru.h

index 3d8e3510bd77b06792b1545d81c408539044a3ac..ce8066f71e84867bb77e96e6a038043b18ef30fb 100644 (file)
@@ -719,8 +719,8 @@ UfsExecNopCmds (
   IN  UFS_PASS_THRU_PRIVATE_DATA       *Private\r
   );\r
 \r
-extern GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME_PROTOCOL  gUfsPassThruComponentName;\r
-extern GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL gUfsPassThruComponentName2;\r
-extern EFI_DRIVER_BINDING_PROTOCOL   gUfsPassThruDriverBinding;\r
+extern EFI_COMPONENT_NAME_PROTOCOL  gUfsPassThruComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL gUfsPassThruComponentName2;\r
+extern EFI_DRIVER_BINDING_PROTOCOL  gUfsPassThruDriverBinding;\r
 \r
 #endif\r