diff --git a/src/dyn-local.c b/src/dyn-local.c index 7ab0805b..68974ad3 100644 --- a/src/dyn-local.c +++ b/src/dyn-local.c @@ -29,5 +29,23 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include -unw_dyn_info_list_t _U_dyn_info_list - __attribute__ ((section (".data.unwind_dynamic"))); +/* Note: It might be tempting to use the LSDA to store + _U_dyn_info_list, but that wouldn't work because the + unwind-info is generally mapped read-only. */ + +unw_dyn_info_list_t _U_dyn_info_list; + +/* Now create a special unwind-table entry which makes it easy for an + unwinder to locate the dynamic registration list. The special + entry covers address range [0-0) and is therefore guaranteed to + be the first in the unwind-table. */ +asm ( +" .section \".IA_64.unwind_info\", \"a\"\n" +".info: data8 (1<<48) | 1\n" /* v1, length==1 (8-byte word) */ +" data8 0\n" /* 8 empty .prologue directives (nops) */ +" data8 0\n" /* personality routine (ignored) */ +" data8 @segrel(_U_dyn_info_list)\n" /* lsda */ +"\n" +" .section \".IA_64.unwind\", \"a\"\n" +" data8 0, 0, @segrel(.info)\n" +" .previous\n");