http://llvm.org/bugs/show_bug.cgi?id=19666
Bug ID: 19666
Summary: COFF: Checksum value is always set to zero
Product: libraries
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Object
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
consider:
__declspec(naked) void fun() {
__asm add DWORD PTR [eax], eax
__asm add BYTE PTR [eax], al
}
if you compile with /O2, MSVC will give you an object file with:
COMDAT; sym= "void __cdecl fun(void)" (?fun@@YAXXZ)
16 byte align
Execute Read
RAW DATA #3
00000000: 01 00 00 00 ....
Section length 4, #relocs 0, #linenums 0, checksum B8BC6765,
selection 1 (pick no duplicates)
008 00000000 SECT3 notype () External | ?fun@@YAXXZ (void __cdecl
fun(void))
This seems to be the following CRC:
>>> hex(crcmod.mkCrcFun(0x104C11DB7, initCrc=0x00000000, rev=True,
>>> xorOut=0x00000000)("\01\00\00\00"))
'0xb8bc6765L'
It appears that they are willing to perform COMDAT folding so long as the CRC
values correspond and manually check any collisions.
They don't seem to re-CRC the data to verify that the contents are valid. This
means that ICF will fire even if all CRCs are zero.
However, it will have to consider far more collisions if we don't vary the
checksum we place in the object file.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs