about summary refs log tree commit diff
path: root/elf/dl-fini.c
diff options
context:
space:
mode:
Diffstat (limited to 'elf/dl-fini.c')
-rw-r--r--elf/dl-fini.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/elf/dl-fini.c b/elf/dl-fini.c
index bed736d756..70e7346304 100644
--- a/elf/dl-fini.c
+++ b/elf/dl-fini.c
@@ -152,9 +152,12 @@ _dl_fini (void)
 		      for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt)
 			{
 			  if (afct->objclose != NULL)
-			    /* Return value is ignored.  */
-			    (void) afct->objclose (&l->l_audit[cnt].cookie);
-
+			    {
+			      struct auditstate *state
+				= link_map_audit_state (l, cnt);
+			      /* Return value is ignored.  */
+			      (void) afct->objclose (&state->cookie);
+			    }
 			  afct = afct->next;
 			}
 		    }