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

aarzilli opened this issue Sep 11, 2018 · 2 comments


None yet
2 participants
Copy link

commented Sep 11, 2018

@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

For example in 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.


This comment has been minimized.

Copy link
Contributor Author

commented Sep 11, 2018

@gopherbot, please add label Debugging

@gopherbot gopherbot added the Debugging label Sep 11, 2018


This comment has been minimized.

Copy link

commented Sep 11, 2018

Change mentions this issue: cmd/link: fix DWARF refs so that they always point to the typedef entry

@gopherbot gopherbot closed this in a0f5d5f Sep 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.