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/rtld.c | |
parent | c7bf5ceab6ec776ac7350d3b0190776bf532ac54 (diff) | |
download | glibc-e1d559f337de2c8ab68a6749dfe873477c883807.zip glibc-e1d559f337de2c8ab68a6749dfe873477c883807.tar.gz glibc-e1d559f337de2c8ab68a6749dfe873477c883807.tar.bz2 |
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/rtld.c')
-rw-r--r-- | elf/rtld.c | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -1025,9 +1025,9 @@ ERROR: audit interface '%s' requires version %d (maximum supported version %d); else *last_audit = (*last_audit)->next = &newp->ifaces; - /* The dynamic linker link map is statically allocated, initialize - the data now. */ - GL (dl_rtld_map).l_audit[GLRO (dl_naudit)].cookie + /* The dynamic linker link map is statically allocated, so the + cookie in _dl_new_object has not happened. */ + link_map_audit_state (&GL (dl_rtld_map), GLRO (dl_naudit))->cookie = (intptr_t) &GL (dl_rtld_map); ++GLRO(dl_naudit); @@ -1046,9 +1046,9 @@ notify_audit_modules_of_loaded_object (struct link_map *map) { if (afct->objopen != NULL) { - map->l_audit[cnt].bindflags - = afct->objopen (map, LM_ID_BASE, &map->l_audit[cnt].cookie); - map->l_audit_any_plt |= map->l_audit[cnt].bindflags != 0; + struct auditstate *state = link_map_audit_state (map, cnt); + state->bindflags = afct->objopen (map, LM_ID_BASE, &state->cookie); + map->l_audit_any_plt |= state->bindflags != 0; } afct = afct->next; @@ -1662,7 +1662,8 @@ ERROR: '%s': cannot process note segment.\n", _dl_argv[0]); for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt) { if (afct->activity != NULL) - afct->activity (&main_map->l_audit[cnt].cookie, LA_ACT_ADD); + afct->activity (&link_map_audit_state (main_map, cnt)->cookie, + LA_ACT_ADD); afct = afct->next; } @@ -2333,7 +2334,8 @@ ERROR: '%s': cannot process note segment.\n", _dl_argv[0]); for (unsigned int cnt = 0; cnt < GLRO(dl_naudit); ++cnt) { if (afct->activity != NULL) - afct->activity (&head->l_audit[cnt].cookie, LA_ACT_CONSISTENT); + afct->activity (&link_map_audit_state (head, cnt)->cookie, + LA_ACT_CONSISTENT); afct = afct->next; } |