[edk2-devel] question about MSFT compiler/link option

Liming Gao liming.gao at intel.com
Tue Aug 4 15:20:53 UTC 2020


If this global variable is used by code, it will be linked into the final EFI image. You can check whether the generate map file includes it. 

> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of Tiger Liu(BJ-RD)
> Sent: Tuesday, August 4, 2020 5:34 PM
> To: devel at edk2.groups.io
> Subject: [edk2-devel] question about MSFT compiler/link option
> 
> Hi, Experts:
> I have a question about MSFT compiler/link option.
> 
> I wrote a PEIM, which had a large global data array definition in a C file.
> Such as:
> PRI_DATA_STRUCT  PdataStructTable[] = {
> {01,           0x75,    0xF0,     0x0,     0x0,     0x0 },
> {02,           0x77,    0xF0,     0x0,     0x0,     0x0 },
> {03,           0x79,    0xF0,     0x0,     0x0,     0x0 },
> {04,           0x7B,    0xF0,     0x0,     0x0,     0x0 },
> {05,           0x7D,    0xF0,     0x0,     0x0,     0x0 },
> {06,           0x7F,    0xF0,     0x0,     0x0,     0x0 },
> ......
> };
> 
> This global data array is very large, about 20KB.
> 
> But I found the PEIM's compiled size is about 5KB, it seems not include this global data array in the efi binary statically.
> Even the release version PEIM's size is larger than debug version.
> 
> I found when compiling release version, the link option has : /MERGE:.rdata=.data
> It seems release binary included the global data array in the final efi image.
> 
> So, my question is:
> Will the global data array be in linked into the final efi binary image when compiling debug version?
> 
> Thanks
> 
> 
> 保密声明:
> 本邮件含有保密或专有信息,仅供指定收件人使用。严禁对本邮件或其内容做任何未经授权的查阅、使用、复制或转发。
> CONFIDENTIAL NOTE:
> This email contains confidential or legally privileged information and is for the sole use of its intended recipient. Any unauthorized
> review, use, copying or forwarding of this email or the content of this email is strictly prohibited.
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#63702): https://edk2.groups.io/g/devel/message/63702
Mute This Topic: https://groups.io/mt/75983724/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-





More information about the edk2-devel-archive mailing list