gcc/ld - create a new libc.so with __isoc99_sscanf@@GLIBC_2.7 symbol from glibc.2.6

前端 未结 2 1111
自闭症患者
自闭症患者 2020-12-15 13:18

I have an application, which does a error when I try to run it:

/lib/libc.so.6: version `GLIBC_2.7\' not found

But the only symbol it needs

2条回答
  •  余生分开走
    2020-12-15 13:54

    I found @felipecs answer very helpful. In addition our application had to do some dynamic linking using ocaml, and we found that the given script doesn't work for this scenario, since it makes the application only export the __isoc99_sscanf symbol as a global.

    GLIBC_2.7 {
     global: *;
    };
    

    the above script resolves this issue and allows ocaml's dynamic linker to work properly. using the -D_GNU_SOURCE option alone wasn't enough to avoid this issue since the dependency on GLIBC_2.7 came from a prebuilt binary we were statically linking with.

提交回复
热议问题