diff options
author | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-01 21:02:25 +0000 |
---|---|---|
committer | geoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-04-01 21:02:25 +0000 |
commit | fc8903b37c1014afad4c4ae946e961833bf1c6ce (patch) | |
tree | 7dda1a745701280d4bdb9390428df2c2e9f1c033 /gcc/unwind-dw2-fde-darwin.c | |
parent | 48104d4593ae09fc990e9315c91c941b0c964e3a (diff) | |
download | gcc-fc8903b37c1014afad4c4ae946e961833bf1c6ce.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65145 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/unwind-dw2-fde-darwin.c')
-rw-r--r-- | gcc/unwind-dw2-fde-darwin.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/gcc/unwind-dw2-fde-darwin.c b/gcc/unwind-dw2-fde-darwin.c index 8bd161f2c03..cd979dc1d1e 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; |