-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/addr2line: prints ? instead of function name and source file info for windows pe executables #7899
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
Labels
Milestone
Comments
Looking at the source, cmd/addr2line is assuming that Go pe executable will have .gosymtab and .gopclntab pe sections. But we have never output these. I really don't know what to do here. I don't want to start rewriting cmd/ld code now. Perhaps there is a symbol in our symbol table that can point me to .gosymtab and .gopclntab. But I looked hard and I don't see it. Perhaps I can add these symbols, but I don't know how. Looking for suggestions. Thank you. Alex |
The .gosymtab and .gopclntab sections are created, for all object file formats, by dodata in ld/data.c. They are attached to the symbols symtab/esymtab and pclntab/epclntab. As far as I can tell, the .gosymtab section is empty. I think that addr2line now gets the symbol table from .gopclntab (see go12Funcs in pkg/debug/gosym/pclntab.go). The .gopclntab data is filled in by pclntab in ld/pcln.c. I don't know why .gopclntab shows up in ELF files but not in PE files. |
"pe section" != "cmd/ld Section" "pe section" == "cmd/ld Segment" Go pe file have ".text" and ".data" pe sections. (it has others, but they aren't related to this discussion - dwarf sections and "dll imports" section). .gopclntab Section is not pe section, but is part of ".text" pe section. There is nothing in Go pe file that identify .gopclntab Section inside of ".text" pe section. I can see .gosymtab is empty and not used (just like you say), so we only need to worry about .gopclntab. I started looking for a symbol that points to .gopclntab Section (address and length), but I cannot find any. I can see pclntab/epclntab symbols, but these live in bss (part of ".data" pe section), and I don't see how they can be useful. Alex |
The "pclntab" symbol is set to point to the .gopclntab section in the function address in ld/data.c. It does work on ELF. The "epclntab" symbol is the end of the section. Those symbols show up in the ELF symbol table with the correct values. I guess the question is why that does not happen for PE. I don't know the answer. |
CL https://golang.org/cl/97920044 mentions this issue. |
CL https://golang.org/cl/96960043 mentions this issue. |
This issue was updated by revision cf78f96. LGTM=iant R=golang-codereviews, rsc, iant CC=golang-codereviews https://golang.org/cl/97920044 |
This issue was closed.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: