From d3147b1f2c886820d17b8e81b176a76552b14755 Mon Sep 17 00:00:00 2001 From: "mostang.com!davidm" Date: Thu, 12 Dec 2002 09:17:41 +0000 Subject: [PATCH] Encode the address of _U_dyn_info_list in a special (no-op) unwind-table entry, so that a remote-unwinder can find it. (Logical change 1.30) --- src/dyn-local.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) 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");