diff options
author | Geoffrey Keating <geoffk@apple.com> | 2003-04-01 21:02:25 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2003-04-01 21:02:25 +0000 |
commit | 481a818131a2b5fae84cb3e1ad637edadfde657a (patch) | |
tree | 7dda1a745701280d4bdb9390428df2c2e9f1c033 /gcc | |
parent | 375ffbe6225d1ae36fda78655daf7edc69b0ad66 (diff) | |
download | gcc-481a818131a2b5fae84cb3e1ad637edadfde657a.zip gcc-481a818131a2b5fae84cb3e1ad637edadfde657a.tar.gz gcc-481a818131a2b5fae84cb3e1ad637edadfde657a.tar.bz2 |
unwind-dw2-fde-darwin.c (DESTRUCTOR_MAY_BE_CALLED_LIVE): New.
* unwind-dw2-fde-darwin.c (DESTRUCTOR_MAY_BE_CALLED_LIVE): New.
(live_image_destructor): Reset image to initial state.
(examine_objects): Set DESTRUCTOR_MAY_BE_CALLED_LIVE.
From-SVN: r65145
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/unwind-dw2-fde-darwin.c | 20 |
2 files changed, 21 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9410ca5..a96f1ad 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2003-04-01 Geoffrey Keating <geoffk@apple.com> + + * unwind-dw2-fde-darwin.c (DESTRUCTOR_MAY_BE_CALLED_LIVE): New. + (live_image_destructor): Reset image to initial state. + (examine_objects): Set DESTRUCTOR_MAY_BE_CALLED_LIVE. + 2003-04-01 Eric Botcazou <ebotcazou@libertysurf.fr> * config/sparc/sparc.c (input_operand): Accept bare diff --git a/gcc/unwind-dw2-fde-darwin.c b/gcc/unwind-dw2-fde-darwin.c index 8bd161f..cd979dc 100644 --- a/gcc/unwind-dw2-fde-darwin.c +++ b/gcc/unwind-dw2-fde-darwin.c @@ -86,12 +86,18 @@ enum { ALLOCED_IMAGE_MASK = 2, /* The FDE entries were allocated by malloc, and must be freed. This isn't used by newer libgcc versions. */ - IMAGE_IS_TEXT_MASK = 4 /* This image is in the TEXT segment. */ + IMAGE_IS_TEXT_MASK = 4, /* This image is in the TEXT segment. */ + DESTRUCTOR_MAY_BE_CALLED_LIVE = 8 /* The destructor may be called on an + object that's part of the live + image list. */ }; -/* Delete any data we allocated on a live_images structure. - IMAGE has already been removed from the KEYMGR_GCC3_LIVE_IMAGE_LIST. - Called by KeyMgr (which will delete the struct after we return.) */ +/* Delete any data we allocated on a live_images structure. Either + IMAGE has already been removed from the + KEYMGR_GCC3_LIVE_IMAGE_LIST and the struct will be deleted + after we return, or that list is locked and we're being called + because this object might be about to be unloaded. Called by + KeyMgr. */ static void live_image_destructor (struct live_images *image) @@ -105,7 +111,10 @@ live_image_destructor (struct live_images *image) image->object_info = NULL; if (image->examined_p & ALLOCED_IMAGE_MASK) free (image->fde); + image->fde = NULL; } + image->examined_p = 0; + image->destructor = NULL; } /* Run through the list of live images. If we can allocate memory, @@ -165,7 +174,8 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc) image->destructor = live_image_destructor; image->object_info = ob; - image->examined_p |= EXAMINED_IMAGE_MASK; + image->examined_p |= (EXAMINED_IMAGE_MASK + | DESTRUCTOR_MAY_BE_CALLED_LIVE); } image->fde = real_fde; |