Issue 91615
Summary Can JITLink support libc.so.6 for old version such as GLIBC_2.2.5
Labels libc
Assignees
Reporter Thrrreeee
    
I found that a .BC file I inputted, which was compiled from a multi-threaded program,  been lifted from an executable program compiled with an older version of glibc to a newer one (GLIBC_2.2.5). While it compiles successfully with clang, upon using readelf, I noticed that it references both GLIBC_2.2.5 and GLIBC_2.34. However, errors occur when compiling with ORC JIT, specifically within the glibc.so file. This might be due to JITLink's lack of robust support for older versions of glibc, or it could be because ORC JIT, following the content of the generated .bcfile, compiles using the old version of glibc, leading to incorrect execution in my newer environment.
The following information is the output of "image dump sections" that I used for debugging.
>Sections for '/lib/x86_64-linux-gnu/libc.so.6' (x86_64):
  SectID     Type Load Address                             Perm File Off.  File Size  Flags Section Name
  0xfffffffffffffffd container [0x00007fffed200000-0x00007fffed225ad8)  r--  0x00000000 0x00025ad8 0x00000000 libc.so.6.PT_LOAD[0]
  0x00000001 regular [0x00007fffed200350-0x00007fffed200380)  r--  0x00000350 0x00000030 0x00000002 libc.so.6.PT_LOAD[0]..note.gnu.property
  0x00000002 regular [0x00007fffed200380-0x00007fffed2003a4)  r--  0x00000380 0x00000024 0x00000002 libc.so.6.PT_LOAD[0]..note.gnu.build-id
  0x00000003 regular [0x00007fffed2003a4-0x00007fffed2003c4)  r--  0x000003a4 0x00000020 0x00000002 libc.so.6.PT_LOAD[0]..note.ABI-tag
  0x00000004 regular [0x00007fffed2003c8-0x00007fffed2043d4)  r--  0x000003c8 0x0000400c 0x00000002 libc.so.6.PT_LOAD[0]..hash
  0x00000005 regular [0x00007fffed2043d8-0x00007fffed208bb8)  r--  0x000043d8 0x000047e0 0x00000002 libc.so.6.PT_LOAD[0]..gnu.hash
>

The following information is obtained from using readelf on an executable program compiled with clang.

> Version symbols section '.gnu.version' contains 11 entries:
 Addr: 0x0000000000000560  Offset: 0x00000560  Link: 5 (.dynsym)
  000:   0 (*local*)       2 (GLIBC_2.2.5)   3 (GLIBC_2.34)    1 (*global*)
  004:   2 (GLIBC_2.2.5)   1 (*global*)      2 (GLIBC_2.2.5) 3 (GLIBC_2.34)
  008:   1 (*global*)      3 (GLIBC_2.34)    2 (GLIBC_2.2.5)

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to