Unwind table location

Jason Merrill jason at cygnus.com
Sun Jan 30 19:03:49 UTC 2000


Working through this for my benefit:

I think we all agree that we want to avoid runtime relocations for the EH
info.  To accomplish that, relocs must be relative, either self-relative
(easy to handle) or relative to some other location we know about.  The
only other location I can think of is the GP.

As I understand it, on ia64 (as on hppa) there is no guarantee that the
text and data segments will be at a fixed offset from each other, so it is
not feasible to use GP-relative offsets to refer to code locations.  I'm
guessing that .rdata is allocated with .data.  Or to be more general, that
all sections with the CODE attribute are allocated in one group, and those
with the DATA attribute are in another, such that self-relative references
work within a group but not between them.  Is this accurate?

Therefore, the EH info that refers to absolute code locations (i.e. the
start and end of the procedure fragment) must be in a CODE section.

The LSDA starts with a pointer to the beginning of the landing pad;
conceivably this could be made relative to the fragment start, allowing the
LSDA to go into data, but I see no reason to prefer that.

In the case of non-contiguous text segments (such as for embedded systems,
as Jim suggested yesterday), it seems to makes sense to have separate
tables for each.  A system that requires something like this could define
its own means of accessing the different tables, though we still need to
define how that works for the normal case.

So I think the status quo (i.e. living in text) makes sense for the unwind
table and info block.

The type tables are a somewhat different matter, because they only refer to
type_info nodes, which live in data.  The current document says that these
references are GP-relative, but that assumes that all type_infos live in
the same DSO, which is not the case under the current scheme; the
references must be fixed up by the dynamic loader, which means the type
table can't live in text.

Furthermore, moving the type table into data allows us to share it between
multiple text segments.

Given this, I would like to move the type table into data and make the
reference from the LSDA to the type table GP-relative rather than
self-relative.

Jason




More information about the cxx-abi-dev mailing list