I'm somewhat ambivalent about the API. I don't really like reading a
section offset as if it were an uninterpreted integer. OTOH, it does seem
useful to have a low-level interface for getting such an offset, and at
that level it is close to be an uninterpreted integer. It's unfortunate
that they overloaded a single form instead of going with per-target-section
forms: it means a low-level accessor has no way to validate the datum.
Since these used to use the data forms before DWARF 3, I can't really
decide whether it is a good convenience to let you read them that way,
or it's propagating a bad overloading.
As to the implementation, it can't use __libdw_read_address. It needs to
be __libdw_read_offset or at least something using __libdw_relocate_offset.
Otherwise it won't do the relocation handling the right way whenever we
switch that stuff on.
Thanks,
Roland