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-object.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/dl-object.c')
-rw-r--r-- | elf/dl-object.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/elf/dl-object.c b/elf/dl-object.c index 4dff99e..225e2cc 100644 --- a/elf/dl-object.c +++ b/elf/dl-object.c @@ -81,7 +81,7 @@ _dl_new_object (char *realname, const char *libname, int type, struct link_map *new; struct libname_list *newname; #ifdef SHARED - size_t audit_space = naudit * sizeof (new->l_audit[0]); + size_t audit_space = naudit * sizeof (struct auditstate); #else # define audit_space 0 #endif @@ -134,10 +134,8 @@ _dl_new_object (char *realname, const char *libname, int type, #ifdef SHARED for (unsigned int cnt = 0; cnt < naudit; ++cnt) - { - new->l_audit[cnt].cookie = (uintptr_t) new; - /* new->l_audit[cnt].bindflags = 0; */ - } + /* No need to initialize bindflags due to calloc. */ + link_map_audit_state (new, cnt)->cookie = (uintptr_t) new; #endif /* new->l_global = 0; We use calloc therefore not necessary. */ |