Skip to content
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

Emit GC info into a COMDAT section #83371

Merged
merged 4 commits into from
Apr 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,7 @@ public void PublishUnwindInfo(ObjectNode node)

byte[] blobSymbolName = _sb.Append(_currentNodeZeroTerminatedName).ToUtf8String().UnderlyingArray;

ObjectNodeSection section = ObjectNodeSection.XDataSection;
if (ShouldShareSymbol(node))
section = GetSharedSection(section, _sb.ToString());
ObjectNodeSection section = GetSharedSection(ObjectNodeSection.XDataSection, _sb.ToString());
Copy link
Member

Choose a reason for hiding this comment

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

It looks like LLVM defines a number of different SelectionKinds for COMDAT sections, but I can't see where define any. The LLVM ones look like this:

any
exactMatch
largest
noDuplicates
sameSize

Copy link
Member

Choose a reason for hiding this comment

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

Reason I'm asking is because it sounds like we would probably only want "any" or "noDuplicates"

Copy link
Member Author

Choose a reason for hiding this comment

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

It appears to do the right thing on Windows, but I haven't checked Linux (hoped I would see it in the CI results).

If it doesn't work on Linux, it's likely because of #77491. I'd back out the non-Windows portion of this change and file a bug to reap this benefit outside Windows in 8.0 (it would be more work than just a one-liner that I randomly tried).

SwitchSection(_nativeObjectWriter, section.Name, GetCustomSectionAttributes(section), section.ComdatName);

EmitAlignment(4);
Expand Down