[go1.20] Updated the linkname to handle new directives #1282
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The linkname directive,
//go:linkname localname [importpath.name]
, now optionally allows one-argument forms. Details found in compiler directives document. There was also aTODO
inlinkname.go
to check for any additional arguments. Theos
package had a new insert-link tonet
that needed to be ignored and handled in the native overrides.parseGoLinknames
method to separate it into:net.newUnixFile
The introduction of the one-argument form (and the new part in the compiler directives document) makes me feel like there will be more insert-style links on the horizon since the one-argument is to "suppresses the usual error for a function that lacks a body." So by having a better way to deal with specific links when needed, we will be able to track new insert-links and var-links better.
If enough insert-links are added we will probably have to start handling them directly instead of ignoring them and handling them in the native overrides. However, that's seems to be outside of the scope of this PR and #1270.