-
Notifications
You must be signed in to change notification settings - Fork 18k
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
proposal: cmd/link: create an information section with eface type struct addresses #48840
Comments
#48765 PR contains an experimental implementation of this functionality. |
Note that #48532 is probably going to need a similar (but probably more invasive) fix. |
What do you mean by "eface type structures"? Currently a value of empty interface type is a pair of pointers. The first pointer points to the Those type structures can already be identified in an executable by looking for the Do you need something more than that? If so, what? |
This proposal has been added to the active column of the proposals project |
Thank you for your reply! I looked closely at the cmd/link part and found out that every type is placed inside runtime.types. Indeed, all the types stored in runtime2.eface structure can be found there. |
This proposal has been declined as retracted. |
Unlike iface, which has itab structure and we could get to type struct (runtime/type.go), eface doesn't have one and the code (compiled with pic) gets type address directly, using lea instructions on x86.
Example :
lea 0x100050(%rip), %rax # 200500 <type.*+0x1234>
To handle it I propose to create an information section (debug type, that could be stripped) with an array of eface type structures, so it could be easily found in a binary file.
This information is required for further handling of Golang executables by post-link-optimizer tools like Bolt to make it possible to read actual information about eface types and account it during further basic blocks reordering.
Golang support for Bolt was announced here: facebookarchive/BOLT#154 (comment)
Currently, we are close to upstream Golang support in Bolt, but it requires changes described in this proposal.
The text was updated successfully, but these errors were encountered: