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

cmd/link: type references in debug_info sometimes inconsistent #27614

Closed
aarzilli opened this issue Sep 11, 2018 · 2 comments
Closed

cmd/link: type references in debug_info sometimes inconsistent #27614

aarzilli opened this issue Sep 11, 2018 · 2 comments

Comments

@aarzilli
Copy link
Contributor

@goperhbot, please add label Debugging

Given this code:

type astruct struct { ... }

the linker produces two DIEs: (1) a DW_TAG_structure_type DIE and (2) a
DW_TAG_typedef_type DIE having (1) as its type attribute.

All subsequent references to 'typename' should use the
DW_TAG_typedef_type DIE, not the DW_TAG_structure_type. Mostly this is
true but sometimes one reference will use the DW_TAG_structure_type
directly.

For example in https://play.golang.org/p/7wzwauGH2kT with 0f72e79 we have main.bvar0 pointing to the DW_TAG_structure_type of main.bstruct but main.bvar1 and main.bvar2 pointing to the DW_TAG_typedef_type. And *main.astruct using the DW_TAG_structure_type but main.globalvar using the typedef.

The bug depends on the order in which the linker scans the type, global variable and function symbols so different versions of the linker may produce slightly different results.

@aarzilli
Copy link
Contributor Author

@gopherbot, please add label Debugging

@gopherbot
Copy link

Change https://golang.org/cl/134555 mentions this issue: cmd/link: fix DWARF refs so that they always point to the typedef entry

@golang golang locked and limited conversation to collaborators Sep 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants