https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104238
--- Comment #4 from Todor Buyukliev <tbuyukliev at vmware dot com> --- > When gcc is emitting the DW_AT_const_value, it doesn't know if it is signed > or unsigned, CONST_INT it uses is always signed. good, so this is as designed. > That sleb128 value is certainly not too large, it fits into 64-bit signed > value it fits, because it was truncated to fit the 64-bit variable readelf uses internally. the bytes in memory are 8080808080808080807f, so in the decoded form bits 64 to 70 inclusive (counting from 1) are 1. the leb128 encoding doesn't have a way to say how many bits the value has, and this means that it's as wide as the highest non-zero bit, 70 in this case (counting from 1).