-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add support for emitting Mach-O R2R images #121186
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
base: main
Are you sure you want to change the base?
Conversation
…PE writer, don't do that for other formats where we don't have the PE Optional Header.
… little different).
…y only one valid way to write the symbol range
179146b to
9a08c72
Compare
|
/azp run runtime-ioslike |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-ioslike |
|
Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command. |
|
/azp run runtime-ioslike |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-ioslike |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run runtime-ioslike |
|
Azure Pipelines successfully started running 1 pipeline(s). |
| private protected override void EmitSymbolRangeDefinition(string rangeNodeName, string startSymbolName, string endSymbolName) | ||
| { | ||
| // Mach has a few characteristics that make range symbols more difficult to emit: | ||
| // - Emitting two symbols in the same location is not well supported by the Apple linker. |
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.
For my own education - do you refer here to start and end symbols?
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.
I've been told that the apple linker has issues when you define two symbols at the same address.
To emit our symbol range concept (where the begin and end of a range are both pointing at existing symbols), the common implementation would emit a start symbol definition at the same symbol as the first symbol in the range.
As a result, we have a custom implementation for MachO (which is actually really nice with the subtractor relocs so we can truly represent the symbol range within the Mach format).
| if (!_definedSymbols.TryGetValue(startNodeName, out var startSymbol) | ||
| || !_definedSymbols.TryGetValue(endNodeName, out var endSymbol)) | ||
| { | ||
| throw new InvalidOperationException("The symbols defined by a symbol range must be emitted into the same object."); |
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.
I have seen string.Format(SR.Error..., format) used in one of the files before
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.
We use string.Format for user-facing errors. This would be a bug in ILC, so we aren't using the localized formatting as any time a user sees this would be a bug.
|
/azp run runtime-ioslike |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Adds support in crossgen2 for emitting Mach-O objects.
Does not yet do the runtime support as that depends on #120777