From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7891) id 9A8523858D37; Mon, 27 Mar 2023 08:58:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A8523858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679907524; bh=vYSEwKHtNZRdAHFrV3Rjvklx+G7SoXpXTb5Xk6/e6MU=; h=From:To:Subject:Date:From; b=VYlkKHd2oS5SZ6Xo6mhAg61GNXGWvrvNv734iCChvnRAr+cKF2wtEZG+/9bP/hy2A u0TKTAJfdr189O580LPtelKtD/n7A6jwT2xLEJcdjfll5YdztWYsvzc4f3KhrVHNCE WVT0KdHBPIuKpKsvYG1Bkv0s7Czbxb2LU1F1LQT8= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Yinyu Cai To: glibc-cvs@sourceware.org Subject: [glibc] LoongArch: ldconfig: Ignore EF_LARCH_OBJABI_V1 in shared objects X-Act-Checkin: glibc X-Git-Author: Xi Ruoyao X-Git-Refname: refs/heads/master X-Git-Oldrev: 152f863926e77c6f9c9a8b8779c8084eb844ec44 X-Git-Newrev: 952b7630c72ae245f370f1a2bcaade82bb1f7361 Message-Id: <20230327085844.9A8523858D37@sourceware.org> Date: Mon, 27 Mar 2023 08:58:44 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=952b7630c72ae245f370f1a2bcaade82bb1f7361 commit 952b7630c72ae245f370f1a2bcaade82bb1f7361 Author: Xi Ruoyao Date: Sun Mar 26 19:13:34 2023 +0800 LoongArch: ldconfig: Ignore EF_LARCH_OBJABI_V1 in shared objects Binutils 2.40 sets EF_LARCH_OBJABI_V1 for shared objects: $ ld --version | head -n1 GNU ld (GNU Binutils) 2.40 $ echo 'int dummy;' > dummy.c $ cc dummy.c -shared $ readelf -h a.out | grep Flags Flags: 0x43, DOUBLE-FLOAT, OBJ-v1 We need to ignore it in ldconfig or ldconfig will consider all shared objects linked by Binutils 2.40 "unsupported". Maybe we should stop setting EF_LARCH_OBJABI_V1 for shared objects, but Binutils 2.40 is already released and we cannot change it. Diff: --- sysdeps/unix/sysv/linux/loongarch/readelflib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/unix/sysv/linux/loongarch/readelflib.c b/sysdeps/unix/sysv/linux/loongarch/readelflib.c index bcaff86b36..ceba355959 100644 --- a/sysdeps/unix/sysv/linux/loongarch/readelflib.c +++ b/sysdeps/unix/sysv/linux/loongarch/readelflib.c @@ -40,7 +40,7 @@ process_elf_file (const char *file_name, const char *lib, int *flag, ret = process_elf64_file (file_name, lib, flag, isa_level, soname, file_contents, file_length); - flags = elf64_header->e_flags; + flags = elf64_header->e_flags & ~EF_LARCH_OBJABI_V1; /* LoongArch linkers encode the floating point ABI as part of the ELF headers. */ switch (flags & SUPPORTED_ELF_FLAGS)