is it possible to turn off vdso on glibc side?

Posted by heroxbd on Stack Overflow See other posts from Stack Overflow or by heroxbd
Published on 2013-07-01T14:03:46Z Indexed on 2013/07/03 17:05 UTC
Read the original article Hit count: 277

Filed under:
|
|

I am aware that passing vdso=0 to kernel can turn this feature off, and that the dynamic linker in glibc can automatic detect and use vdso feature from kernel.

Here I met with this problem. There is a RHEL 5.6 box (kernel 2.6.18-238.el5) in my institution where I only have a normal user access, probably suffering from RHEL bug 673616.

As I compile a toolchain of linux-headers-3.9/gcc-4.7.2/glibc-2.17/binutils-2.23 on top of it, gcc bootstrap fails in cc1 in stage2 cannnot be run

Program received signal SIGSEGV, Segmentation fault.
0x00002aaaaaaca6eb in ?? ()
(gdb) info sharedlibrary 
From                To                  Syms Read   Shared Object Library
0x00002aaaaaaabba0  0x00002aaaaaac3249  Yes (*)     /home/benda/gnto/lib64/ld-linux-x86-64.so.2
0x00002aaaaacd29b0  0x00002aaaaace2480  Yes (*)     /home/benda/gnto/usr/lib/libmpc.so.3
0x00002aaaaaef2cd0  0x00002aaaaaf36c08  Yes (*)     /home/benda/gnto/usr/lib/libmpfr.so.4
0x00002aaaab14f280  0x00002aaaab19b658  Yes (*)     /home/benda/gnto/usr/lib/libgmp.so.10
0x00002aaaab3b3060  0x00002aaaab3b3b50  Yes (*)     /home/benda/gnto/lib/libdl.so.2
0x00002aaaab5b87b0  0x00002aaaab5c4bb0  Yes (*)     /home/benda/gnto/usr/lib/libz.so.1
0x00002aaaab7d0e70  0x00002aaaab80f62c  Yes (*)     /home/benda/gnto/lib/libm.so.6
0x00002aaaaba70d40  0x00002aaaabb81aec  Yes (*)     /home/benda/gnto/lib/libc.so.6
(*): Shared library is missing debugging information.

and a simple program

#include <sys/time.h>
#include <stdio.h>

int main () {
    struct timeval tim;
    gettimeofday(&tim, NULL);
    return 0;
}

get segment fault in the same way if compiled against glibc-2.17 and xgcc from stage1.

Both cc1 and the test program can be run on another running RHEL 5.5 (kernel 2.6.18-194.26.1.el5) with gcc-4.7.2/glibc-2.17/binutils-2.23 as normal user.

I cannot simply upgrade the box to a newer RHEL version, nor could I turn VDSO off via sysctl or proc. The question is, is there a way to compile glibc so that it turns off VDSO unconditionally?

© Stack Overflow or respective owner

Related posts about gcc

Related posts about linux-kernel