cmd/compile: generated DWARF triggers objdump warning for large uint64 const #39048
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What did you do?
The Go compiler is emitting DWARF information for certain constants that is causing warnings from 'objdump --dwarf', details below. This is a comparatively minor problem (since as far as I can tell the debugging experience is not impacted) but the warning makes it a pain to read objdump output while looking for other problems (as a Go developer, not a Go user).
Code:
Symptoms:
What did you expect to see?
clean objdump output with no warnings
What did you see instead?
LEB value too large warnings.
DWARF output excerpt:
where the type in question is listed as
I think what's happening here is that the abbrev entry looks like this:
Note the DW_FORM_sdata payload -- this is a signed value. I am assuming that objdump is interpreting this combination as something along the lines of "take this signed value and put it into an 8-byte signed container" (at which point it decides it can't fit).
A possible workaround would be to use a different abbrev with FORM_udata instead.
It's also arguable that we should instead file a binutils bug and ask them to change the objdump behavior -- you can make case that the Go DWARF is ok and it should be getting the "signedness" from the destination type and not the form (just depends on how you interpret things).
The text was updated successfully, but these errors were encountered: