Page MenuHomePhabricator

[ARM64][Windows] Create COMDAT symbols for sections containing constants

Authored by ssijaric on Jul 21 2018, 7:09 PM.



As of SVN r334523, eligible constants are put in COMDAT sections in COFF on ARM64 Windows. We need to create an appropriate COMDAT symbol, just as on X86. Otherwise, the MS linker complains with something like

fatal error LNK1143: invalid or corrupt file: no symbol for COMDAT section 0x4

and the dumpbin output shows that there is no COMDAT symbol in the section


.rdata name
     0 physical address
     0 virtual address
     8 size of raw data
  6EA0 file pointer to raw data (00006EA0 to 00006EA7)
     0 file pointer to relocation table
     0 file pointer to line numbers
     0 number of relocations
     0 number of line numbers

40401040 flags

Initialized Data
COMDAT (no symbol)
8 byte align
Read Only


00000000: .......

Diff Detail


Event Timeline

ssijaric created this revision.Jul 21 2018, 7:09 PM

Funny coincidence that you post this now, I also just investigated the same issue, from a different point of view. Interestingly enough, LLD hasn't warned about it, otherwise I would have noticed much sooner.

But I'd suggest fixing this differently; since the code causing this is now in arch independent TargetLoweringObjectFileCOFF, we should also move this to an arch independent superclass, see D49644.

I'm also trying to fix this for ARM64 mingw, see D49637.


This new file shouldn't have executable mode

ssijaric abandoned this revision.Jul 22 2018, 3:13 PM

Abandoning, as this will be fixed in D49644.