From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1962) id 0BB223857C42; Thu, 7 Apr 2022 18:38:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BB223857C42 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Stefan Liebler To: glibc-cvs@sourceware.org Subject: [glibc] S390: Fix elf/tst-audit25[ab] X-Act-Checkin: glibc X-Git-Author: Stefan Liebler X-Git-Refname: refs/heads/master X-Git-Oldrev: 4f2146c4f41c409d92441d6365dc3aceaf70c7fe X-Git-Newrev: 5325233313c66aea13e86f5dd59618e9dd74b510 Message-Id: <20220407183844.0BB223857C42@sourceware.org> Date: Thu, 7 Apr 2022 18:38:44 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Apr 2022 18:38:44 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5325233313c66aea13e86f5dd59618e9dd74b510 commit 5325233313c66aea13e86f5dd59618e9dd74b510 Author: Stefan Liebler Date: Thu Apr 7 13:59:48 2022 +0200 S390: Fix elf/tst-audit25[ab] If glibc is configured with --disable-default-pie and build on s390 with -O3, the tests elf/tst-audit25a and elf/tst-audit25b are failing as there are additional la_symbind lines for free and malloc. It turns out that those belong to the executable. In fact those are the PLT-stubs. Furthermore la_symbind is also called for calloc and realloc symbols, but those belong to libc. Those functions are not called at all, but dlsym'ed in elf/dl-minimal.c: __rtld_malloc_init_real (struct link_map *main_map) { ... void *new_calloc = lookup_malloc_symbol (main_map, "calloc", &version); void *new_free = lookup_malloc_symbol (main_map, "free", &version); void *new_malloc = lookup_malloc_symbol (main_map, "malloc", &version); void *new_realloc = lookup_malloc_symbol (main_map, "realloc", &version); ... } Therefore, this commit just ignored symbols with LA_SYMB_DLSYM flag. Reviewed-by: Adheemrval Zanella Diff: --- elf/tst-auditmod25.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/elf/tst-auditmod25.c b/elf/tst-auditmod25.c index 20640a8daf..0524c5aab1 100644 --- a/elf/tst-auditmod25.c +++ b/elf/tst-auditmod25.c @@ -72,7 +72,8 @@ la_symbind32 (Elf32_Sym *sym, unsigned int ndx, unsigned int *flags, const char *symname) #endif { - if (*refcook != -1 && *defcook != -1 && symname[0] != '\0') + if (*refcook != -1 && *defcook != -1 && symname[0] != '\0' + && (*flags & LA_SYMB_DLSYM) == 0) fprintf (stderr, "la_symbind: %s %u\n", symname, *flags & (LA_SYMB_NOPLTENTER | LA_SYMB_NOPLTEXIT) ? 1 : 0); return sym->st_value;