[Dwarf-Discuss] compilation unit base address related questions
Tue May 26 19:10:36 GMT 2009
A CU is not required to have a DW_AT_low_pc attribute (3.1.1, page 41):
"The base address of a compilation unit is defined as the value of the
DW_AT_low_pc attribute, if present; otherwise, it is undefined. If the base
address is undefined, then any DWARF entry or structure defined in terms of
the base address of that compilation unit is not valid."
In a discontiguous case, the compiler will usually make its location lists
or range lists use "base address entries" as appropriate in the list encoding.
The CU base address is only required when a location list or range list has
entries not preceded by a base address entry.
That covers the CU base address question. You then cited that the CU has
no DW_AT_ranges attribute. That is completely irrelevant to the question
of a CU base address. Indeed, the CU in your example ought to have a
DW_AT_ranges attribute and it is some old GCC bug that it has none.
More information about the Dwarf-discuss