diff options
author | Florian Weimer <fweimer@redhat.com> | 2019-11-02 20:04:02 +0100 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2019-11-15 13:03:40 +0100 |
commit | e1d559f337de2c8ab68a6749dfe873477c883807 (patch) | |
tree | 89136f8318e432a07ea7db9fcda976b33ad99086 /elf/dl-close.c | |
parent | c7bf5ceab6ec776ac7350d3b0190776bf532ac54 (diff) | |
download | glibc-e1d559f337de2c8ab68a6749dfe873477c883807.tar glibc-e1d559f337de2c8ab68a6749dfe873477c883807.tar.gz glibc-e1d559f337de2c8ab68a6749dfe873477c883807.tar.bz2 glibc-e1d559f337de2c8ab68a6749dfe873477c883807.zip |
Introduce link_map_audit_state accessor function
To improve GCC 10 compatibility, it is necessary to remove the l_audit
zero-length array from the end of struct link_map. In preparation of
that, this commit introduces an accessor function for the audit state,
so that it is possible to change the representation of the audit state
without adjusting the code that accesses it.
Tested on x86_64-linux-gnu. Built on i686-gnu.
Change-Id: Id815673c29950fc011ae5301d7cde12624f658df
Diffstat (limited to 'elf/dl-close.c')
-rw-r--r-- | elf/dl-close.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/elf/dl-close.c b/elf/dl-close.c index de91c28f72..c32e6473ad 100644 --- a/elf/dl-close.c +++ b/elf/dl-close.c @@ -302,8 +302,12 @@ _dl_close_worker (struct link_map *map, bool force) for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt) { if (afct->objclose != NULL) - /* Return value is ignored. */ - (void) afct->objclose (&imap->l_audit[cnt].cookie); + { + struct auditstate *state + = link_map_audit_state (imap, cnt); + /* Return value is ignored. */ + (void) afct->objclose (&state->cookie); + } afct = afct->next; } @@ -478,7 +482,10 @@ _dl_close_worker (struct link_map *map, bool force) for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt) { if (afct->activity != NULL) - afct->activity (&head->l_audit[cnt].cookie, LA_ACT_DELETE); + { + struct auditstate *state = link_map_audit_state (head, cnt); + afct->activity (&state->cookie, LA_ACT_DELETE); + } afct = afct->next; } @@ -774,7 +781,10 @@ _dl_close_worker (struct link_map *map, bool force) for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt) { if (afct->activity != NULL) - afct->activity (&head->l_audit[cnt].cookie, LA_ACT_CONSISTENT); + { + struct auditstate *state = link_map_audit_state (head, cnt); + afct->activity (&state->cookie, LA_ACT_CONSISTENT); + } afct = afct->next; } |