Andrew:
  Is this a full list? I find some missing .S files in MdePkg, such as 
BaseCpuLib/X64/CpuSleep.S, BaseMemoryLibSse2/X64/ScanMem8.S.

Thanks
Liming
From: Andrew Fish [mailto:af...@apple.com]
Sent: Friday, November 07, 2014 3:15 AM
To: edk2-devel@lists.sourceforge.net
Subject: [edk2] MdePkg patches to fix Xcode dead stripping issues.

For an assembly function to be stripped by the Xcode linker the .S file must 
contain the .subsections_via_symbols directive. The edk2 abstracts this away 
via ASM_FUNCTION_REMOVE_IF_UNREFERENCED.

If the .S does not contain a ASM_FUNCTION_REMOVE_IF_UNREFERENCED, then when 
this library is included those assemble functions always end up in the final 
image even if they are not called. If there are unreferenced intermediate 
symbols that do not start with L, that are not accessed then the the code from 
that label to the next label will be removed. Thus multiple assembly functions 
can be in a single file and each one gets dead stripped independent.

The patch should be low risk as ASM_FUNCTION_REMOVE_IF_UNREFERENCED is mapped 
to nothing on assemblers other than Xcode.

Thanks,

Andrew Fish

------------------------------------------------------------------------------
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to