[NativeAOT] ObjWriter: Fix over-alignment of .eh_frame entries#96817
[NativeAOT] ObjWriter: Fix over-alignment of .eh_frame entries#96817MichalStrehovsky merged 2 commits intodotnet:mainfrom
Conversation
|
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsRef: #95876 (comment) The DWARF specification requires the CIE/FDE entries in the
|
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/Dwarf/DwarfEhFrame.cs
Outdated
Show resolved
Hide resolved
|
Unfortunately this missed preview 1 by few hours (#97336), @carlossanlop any chance we can include this change in P1? ilc-in-c# is a new feature, it will be tested more thoroughly by masses once P1 is announced. |
|
Not sure if we still have time, let me ask Tactics what the build status is. @MichalStrehovsky @agocke while we confirm there's still runway, can you please take a look and let me know if you'd like to backport this change to release/9.0-preview1? |
|
This is a fix for relatively minor perf regression. I do not think it is needed in Preview 1. |
|
Agreed with @jkotas, it was a non-critical suggestion (if we still had time). :) |
|
Since we are still taking some more changes, we have time to get this backported. Let's do it. |
|
/backport to release/9.0-preview1 |
|
Started backporting to release/9.0-preview1: https://github.com/dotnet/runtime/actions/runs/7643752342 |
Ref: #95876 (comment)
Ref: https://github.com/dotnet/llvm-project/blob/d8bacb4031b1d1e290ab2792e8378560419ee0de/llvm/lib/MC/MCDwarf.cpp#L1759-L1764
The DWARF specification requires the CIE/FDE entries in the
.eh_framesections to be aligned to pointer size. However, I incorrectly implemented it as the platform target pointer size, while it's supposed to be the DWARF pointer size specified in thepointer encodingfield. Since we use 4-byte relative pointers on all platforms this means the alignment is supposed to be on the 4-byte boundary, not on the 8-byte boundary.Tested on https://github.com/aspnet/Benchmarks/tree/main/src/BenchmarksApps/BasicMinimalApi where we now produce the same size of
.eh_framesection as the legacy ObjWriter. Prior to the fix the additional alignment contributed 53,736 bytes to the section size (out of roughly ~1MiB).