Skip to content

Link statically to GrowableFunctionTable#131017

Open
huoyaoyuan wants to merge 3 commits into
dotnet:mainfrom
huoyaoyuan:pre-win10
Open

Link statically to GrowableFunctionTable#131017
huoyaoyuan wants to merge 3 commits into
dotnet:mainfrom
huoyaoyuan:pre-win10

Conversation

@huoyaoyuan

Copy link
Copy Markdown
Member

RtlAddGrowableFunctionTable and related APIs were introduced in Windows 8.

The functions are present in the WindowsAPI allow list of NativeAOT, so I think linking ntdll is acceptible here.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Jul 18, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 4 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

@MichalPetryka

Copy link
Copy Markdown
Contributor

Does it work under UWP?

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.

Pull request overview

This PR changes CoreCLR’s Windows x64 unwind-info publishing to call the Win8+ growable function table APIs (RtlAddGrowableFunctionTable, RtlGrowFunctionTable, RtlDeleteGrowableFunctionTable) directly, and adds ntdll.lib to the Windows link set to resolve those symbols at link/load time.

Changes:

  • Replaces runtime GetProcAddress-based discovery of growable function table APIs with direct calls to Rtl*GrowableFunctionTable.
  • Removes UnwindInfoTable::Initialize() and its startup invocation.
  • Links coreclr against ntdll.lib on Windows builds.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/coreclr/vm/codeman.h Removes UnwindInfoTable::Initialize() declaration; updates related comments.
src/coreclr/vm/codeman.cpp Drops dynamic function-pointer initialization and calls Rtl*GrowableFunctionTable directly.
src/coreclr/vm/ceemain.cpp Removes the startup call to UnwindInfoTable::Initialize().
src/coreclr/dlls/mscoree/coreclr/CMakeLists.txt Adds ntdll.lib to the Windows link libraries list.

Comment thread src/coreclr/vm/codeman.cpp
Comment thread src/coreclr/vm/codeman.h
Comment on lines 595 to 597
// On Windows x64, publish OS UnwindInfo (accessed from RUNTIME_FUNCTION
// structures) to support the ability unwind the stack. Unfortunately the pre-Win8
// APIs defined a callback API for publishing this data dynamically that ETW does
// not use (and really can't because the walk happens in the kernel). In Win8
// structures) to support the ability unwind the stack. In Win8 and above
// new APIs were defined that allow incremental publishing via a table.

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.

Could you please apply this feedback?

@jkotas

jkotas commented Jul 19, 2026

Copy link
Copy Markdown
Member

Does it work under UWP?

The original UWP with restricted APIs is not a thing we worry about anymore for CoreCLR. We use a lot of APIs that are marked as "desktop apps only".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-VM-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants