You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every COFF import library has a special object file containing the null import descriptor. This is exactly the same between import libraries, which causes a conflict if using /WHOLEARCHIVE.
The fact that it's exactly the same does however allow for a possible fix: add a COMDAT record to the special .idata$3 section so it behaves as if it's still in a library even if all objects are forced to be included. The downside would be that import libraries generated by this crate would no longer be byte-for-byte the same as LLVM import libraries.
Pseudo code:
// Placed before the `__NULL_IMPORT_DESCRIPTOR` in the COFF symbol tableImageSymbol{name:*b".idata$3",section_number:1,storage_class:IMAGE_SYM_CLASS_STATIC,number_of_aux_symbols:1,
...};ImageAuxSymbolSection{length: mem::size_of::<ImageImportDescriptor>(),selection:IMAGE_COMDAT_SELECT_ANY,
...};
Maybe we could have a flag fo enable/disable usage of COMDAT. That way all tests can keep asserting matches between LLVM and ar_archive_writer, while rustc can use COMDAT.
Every COFF import library has a special object file containing the null import descriptor. This is exactly the same between import libraries, which causes a conflict if using
/WHOLEARCHIVE
.The fact that it's exactly the same does however allow for a possible fix: add a COMDAT record to the special
.idata$3
section so it behaves as if it's still in a library even if all objects are forced to be included. The downside would be that import libraries generated by this crate would no longer be byte-for-byte the same as LLVM import libraries.Pseudo code:
cc @dpaoliello
The text was updated successfully, but these errors were encountered: