]> sourceware.org Git - glibc.git/commitdiff
LoongArch: ldconfig: Ignore EF_LARCH_OBJABI_V1 in shared objects
authorXi Ruoyao <xry111@xry111.site>
Sun, 26 Mar 2023 11:13:34 +0000 (19:13 +0800)
committercaiyinyu <caiyinyu@loongson.cn>
Mon, 27 Mar 2023 08:57:56 +0000 (16:57 +0800)
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.

sysdeps/unix/sysv/linux/loongarch/readelflib.c

index bcaff86b362209b53ac5d95cb6bec6b5e0f03b32..ceba3559595ed4c7df56b9a35b42d58f1de3af50 100644 (file)
@@ -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)
This page took 0.044576 seconds and 5 git commands to generate.