-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NativeAOT] Broken COMDAT support in ObjWriter #77491
Comments
@filipnavara Thank you for finding and reporting these issues. Do you plan to submit fixes for these issues? |
This particular set of issues is very low priority for me. I don't think the Depending on feedback to #77178 I may reprioritise. Most of the bugs were found when comparing my C# ObjWriter to the output of the LLVM ObjWriter, or when trying to use LLVM ObjWriter with non-default options. |
We run it in the CI with a smoke test so that it doesn't completely bitrot but it hasn't been a big priority: https://github.com/dotnet/runtime/tree/main/src/tests/nativeaot/SmokeTests/MultiModule IIRC it never worked outside Windows. These ObjWriter issues were likely the reason. Multifile needs a bit more work to productize and it's unclear we need it right now (it speeds up compilation, but suppresses a lot of whole program optimizations, which makes it only suitable for debug builds and we have a JIT-based solution for debug builds/inner loop in .NET). |
The tests run in Release mode. I am not even sure whether they are compiled with debug symbols. If the |
The description of the Mach-O mechanism in the original post was inaccurate. Apparently the magic sauce are weak def symbols, which used to have the requirement for
|
@filipnavara off the top of your head, do you know if we ported these bugs over to the managed object writer? |
The COFF bugs were fixed. Mach-O support is still missing. ELF would need to be revisited and rechecked. |
Thanks! Will keep this open then. |
There are multiple bugs in ObjWriter emission of COMDAT sections:
.debug$S
section which is incorrect. For methods emitted in COMDAT sections there should a new associated COMDAT.debug$S
section for each (eg.EmitCVDebugFunctionInfo
should have similar section handling code toEmitWinFrameInfo
).xdata
section withUNWIND_INFO
structures is not emitted as associated COMDAT. This mostly works due to unique symbol prefixes but it's not ideal.RELPTR32
is not expressed as PLT relocation). This results in error in ObjWriter if one tries to use ILCompiler with--multifile
switch.S_COALESCE
feature which serves the same purpose.The text was updated successfully, but these errors were encountered: