Search code examples
glibcelf

Application returns ENOSYS 38 Function not implemented


The func1() which i want to invoke has binding as below:

readelf -Ws /lib/libc.so.6 | grep  func1

    592: 000d8910    40 FUNC    WEAK   DEFAULT   12 func1@@GLIBC_2.13
   1690: 000d8910    40 FUNC    WEAK   DEFAULT   12 func2@@GLIBC_2.13**

Is this the reason , because of which when I invoke func1() from my application it returns an errno =38 , that is : ENOSYS 38 /* Function not implemented */

Can I somehow make the func1() binding as GLOBAL and then invoke the same from my application program?


Solution

  • Is this the reason

    No. Symbol binding is all about being able to call the function (you can call GLOBAL, but not LOCAL function) and being able to override the definition (you can link multiple WEAKly defined functions into a single executable without a multiply-defined linker error).

    Once you can call the function, its binding is out of the picture, and it returns whatever it returns.

    The reason you get ENOSYS is most likely that your kernel is too old.