-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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] Linux/ARM bring-up (3/n) #97104
Conversation
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsSome smoke tests pass:
To do:
|
67eed4a
to
57fb79c
Compare
We can place this into .bss section. I don't remember why I made it a separate section. |
Generally speaking I think it's a good idea, at least for the improved LLDB debugging experience. I'd still like to understand the errors I am seeing though. |
I was wrong about the offset in dehydrated data being off by 4. It's actually off by 0x10000 in the linked executable. It uses the MOVW/MOVT instructions to load the address which each loads a 16-bit word. I'm following through with the investigation, but I am not fully ruling out a linker bug (*). (*) Already found one related to the thumb bit (lowest bit) in MOVW/MOVT. For that one it's quite obvious how it happens and why no one hit it before - other compilers don't produce inline addend with Thumb bit. This one seems like a tougher nut to crack. |
I traced back another issue to the off-by-0x10000 relocation into the BSS sections. This time with frozen objects. :-/ |
I'm now >90% sure that there's a bug in LLD with handling of the MOVW/MOVT relocations. I built the |
I found the issue that causes the data corruption. |
…intptr_t)&RhpThrowHwEx))
…ent both in addend and in symbol value)
…by RhpCallFilterFunclet
I presume that the reason is to keep match the layout of the hydrated and dehydrated data in the node without interleaving of other things put into the BSS section. It makes sense to do that while producing the object file. We can tweak the final linked output to merge the sections but it's not really a big difference in the end. The concern I previously had about LLDB debugging experience was caused by the MOVT relocation issue, not the different section name. |
…n DWARF. We would fail to lookup methods at their first instruction otherwise.
…into the ELF relocations
09461c9
to
90028c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
* Mask thumb bit when setting IP in a context (eg. palContext->SetIp((uintptr_t)&RhpThrowHwEx)) * Set ExInfo.m_pExContext in RhpThrowHwEx * Remove REGDISPLAY.GetAddrOfIP and it's only usage * Resolve ARM relocations (also workarounds LLD bug with thumb bit present both in addend and in symbol value) * Remove REGDISPLAY.pIP/SetAddrOfIP * Make most of the assembly code PIE compatible * NativeAOT: Enable DFEATURE_64BIT_ALIGNMENT on linux-arm * Enable NativeAOT linux-arm build * Enable DWARF exception handling for linux-arm * Fix UnwindFuncletInvokeThunk to skip over r2 register saved on stack by RhpCallFilterFunclet * Fix signature of P/Invoke native code in SafeHandleTest to match the managed one * Implement missing StackFrameIterator::InternalInit code for ARM * Fix thumb bit masking in InInterfaceDispatchHelper * Workaround: Ensure the Thumb bit is set when looking up method info in DWARF. We would fail to lookup methods at their first instruction otherwise. * Correctly convert the addend for IMAGE_REL_BASED_THUMB_MOV32[_PCREL] into the ELF relocations * Simplify CMake condition * Simplify NativeAotSupported conditions * Fix typo * Fix IMAGE_REL_BASED_THUMB_MOV32 conversion to ELF
Some smoke tests pass:
To do:
UnitTests
andDynamicGenerics
smoke tests (uncatchable in QEMU debugger)