public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] LoongArch: ldconfig: Ignore EF_LARCH_OBJABI_V1 in shared objects
@ 2023-03-26 11:13 Xi Ruoyao
  2023-03-27 13:44 ` Carlos O'Donell
  0 siblings, 1 reply; 6+ messages in thread
From: Xi Ruoyao @ 2023-03-26 11:13 UTC (permalink / raw)
  To: libc-alpha; +Cc: caiyinyu, Wang Xuerui, Adhemerval Zanella Netto, Xi Ruoyao

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 | 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)
-- 
2.39.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-29 13:13 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-26 11:13 [PATCH] LoongArch: ldconfig: Ignore EF_LARCH_OBJABI_V1 in shared objects Xi Ruoyao
2023-03-27 13:44 ` Carlos O'Donell
2023-03-27 14:57   ` Xi Ruoyao
2023-03-27 16:54     ` Adhemerval Zanella Netto
2023-03-27 17:46       ` Xi Ruoyao
2023-03-29 13:12       ` Carlos O'Donell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).