Skip to content

Assert pointer relocs are aligned - #113069

Merged
MichalStrehovsky merged 3 commits into
dotnet:mainfrom
MichalStrehovsky:pointerrelocs
Jul 17, 2025
Merged

MichalStrehovsky merged 3 commits into
dotnet:mainfrom
MichalStrehovsky:pointerrelocs

Conversation

@MichalStrehovsky

@MichalStrehovsky MichalStrehovsky commented Mar 3, 2025 •

Copy link
Copy Markdown
Member

This is a prerequisite for disabling data dehydration on Windows by default. Straddling pointers are not a big deal with dehydration, but straddling a page boundary with a reloc on Windows is a (perf) problem.

Cc @dotnet/ilc-contrib

Copilot AI review requested due to automatic review settings March 3, 2025 11:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This pull request introduces debug assertions to ensure pointer relocations are properly aligned during object emission.

  • Adds a DEBUG-only block to iterate over relocations and check for pointer relocation alignment
  • Verifies the node content's alignment against the target pointer size

Reviewed Changes

File Description
src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/ObjectWriter.cs Introduces debug assertions ensuring pointer relocs and node alignment are verified

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comment thread src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/ObjectWriter.cs Outdated
Comment thread src/coreclr/tools/aot/ILCompiler.Compiler/Compiler/ObjectWriter/ObjectWriter.cs Outdated
@MichalStrehovsky

Copy link
Copy Markdown
Member Author

/azp run runtime-nativeaot-outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

/azp run runtime-nativeaot-outerloop

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

@dotnet/ilc-contrib could someone have a look? This is just a new assert. The Pri1 test failures are all #117654 that was fixed

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

/ba-g test failures are #117654 that was fixed

@MichalStrehovsky
MichalStrehovsky merged commit f858ecf into dotnet:main Jul 17, 2025
@MichalStrehovsky
MichalStrehovsky deleted the pointerrelocs branch July 17, 2025 05:13
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants