28.01.2015 Views

Exception Handling ABI for the ARM Architecture

Exception Handling ABI for the ARM Architecture

Exception Handling ABI for the ARM Architecture

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Exception</strong> handling <strong>ABI</strong> <strong>for</strong> <strong>the</strong> <strong>ARM</strong> architecture<br />

O<strong>the</strong>r helper functions are private to <strong>the</strong> language implementation. When an object built with that implementation<br />

is distributed <strong>for</strong> possible linking with objects built by o<strong>the</strong>r implementations, its private (implementation-specific)<br />

helper functions must be distributed with it.<br />

3.1.1 The linker must match <strong>the</strong> run-time support code<br />

All this suggests <strong>the</strong> following principle, which we adopt in relation to exception processing.<br />

<br />

In a static link step involving relocatable objects generated by different producers, <strong>the</strong> static linker and <strong>the</strong> runtime<br />

support code must be from <strong>the</strong> same tool chain.<br />

(Aside: This allows a static linker <strong>for</strong> a standalone execution environment to encode fully linked exception tables<br />

in any way acceptable to <strong>the</strong> matching run-time system. End aside).<br />

3.2 The ELF model<br />

3.2.1 Relocatable ELF<br />

A design principle underlying ELF [AAELF] can be caricatured as smart <strong>for</strong>mat, dumb linker. That’s not to say that<br />

intelligent linking is precluded, or that <strong>the</strong> linking process is trivial, but to emphasize that <strong>the</strong> way a collection of<br />

relocatable objects should be processed should be explicit in those objects, with no hidden contract between<br />

object producers and <strong>the</strong> static linker.<br />

3.2.2 Executable ELF<br />

The execution environment determines <strong>the</strong> <strong>for</strong>mat of an executable or shared object. Historically, ELF as an<br />

execution <strong>for</strong>mat has been associated with Unix System V-based execution environments (such as <strong>ARM</strong> Linux).<br />

3.2.3 Principles of usage<br />

This suggests <strong>the</strong> following principles, which we adopt in relation to exception processing.<br />

<br />

<br />

At <strong>the</strong> interface between relocatable object producers and static linkers we give priority to ease of producing<br />

complete, precise exception table descriptions that can be processed straight<strong>for</strong>wardly by static linkers.<br />

At <strong>the</strong> interface between a fully linked executable (or shared object) and its execution environment, a postprocessor<br />

should be able to generate <strong>the</strong> environment-specific encoding of <strong>the</strong> exception table from <strong>the</strong><br />

generic <strong>for</strong>m.<br />

(Aside: In practice, we expect such post-processing to be integrated into plat<strong>for</strong>m-specific linkers. End aside).<br />

<strong>ARM</strong> IHI 0038A Copyright © 2002-2005, 2007 <strong>ARM</strong> Limited. All rights reserved. Page 10 of 50

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!