10.03.2017 17:13, Alexander Monakov wrote:
On Fri, 10 Mar 2017, Michael Thayer wrote:
$ gcc test.c -o test -ldl -Wl,-rpath,'$ORIGIN'
$ ./test
True
$ gcc test.c -o test -ldl -Wl,-rpath,'$ORIGIN' -fsanitize=address
$ ./test
This seems unexpected, but you can investigate it a bit more on your end: add
'-v' to gcc command line to see how linker flags differ, run 'readelf -d' on
./test to check how rpath flag changes, or run 'LD_DEBUG=libs ./test' to see
how dynamic lookup decisions are made.
Thanks for the fast answer! See output below (for simplicity not quite
as generified as the output above). What I notice in the LD_DEBUG
output is that in the failing case the run path is used for the first
two library searches (libasan.so.3 and libc.so.6) but not for any
following searches.
Regards
Michael
michael@michael-Latitude-E6420:~/vbox/trunk/out/linux.amd64/debug/bin$
gcc -v test.c -o test -ldl -Wl,-rpath,'$ORIGIN'
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
6.3.0-8ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++
--prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu-
--enable-shared --enable-linker-build-id --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --libdir=/usr/lib
--enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin
--enable-default-pie --with-system-zlib --disable-browser-plugin
--enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre
--enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64
--with-arch-directory=amd64
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib
--enable-objc-gc=auto --enable-multiarch --disable-werror
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.3.0 20170221 (Ubuntu 6.3.0-8ubuntu1)
COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/6/cc1 -quiet -v -imultiarch
x86_64-linux-gnu test.c -quiet -dumpbase test.c -mtune=generic
-march=x86-64 -auxbase test -version -fstack-protector-strong -Wformat
-Wformat-security -o /tmp/ccyT8BKy.s
GNU C11 (Ubuntu 6.3.0-8ubuntu1) version 6.3.0 20170221 (x86_64-linux-gnu)
compiled by GNU C version 6.3.0 20170221, GMP version 6.1.2, MPFR
version 3.1.5, MPC version 1.0.3, isl version 0.15
warning: GMP header version 6.1.2 differs from library version 6.1.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/6/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-linux-gnu/6/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
GNU C11 (Ubuntu 6.3.0-8ubuntu1) version 6.3.0 20170221 (x86_64-linux-gnu)
compiled by GNU C version 6.3.0 20170221, GMP version 6.1.2, MPFR
version 3.1.5, MPC version 1.0.3, isl version 0.15
warning: GMP header version 6.1.2 differs from library version 6.1.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: efffe3a8eab4a38b76a97676d9f27d34
COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-mtune=generic' '-march=x86-64'
as -v --64 -o /tmp/cclzJ0sV.o /tmp/ccyT8BKy.s
GNU assembler version 2.28 (x86_64-linux-gnu) using BFD version (GNU
Binutils for Ubuntu) 2.28
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/6/collect2 -plugin
/usr/lib/gcc/x86_64-linux-gnu/6/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccvCq7ci.res
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr
-m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o test
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/6/crtbeginS.o
-L/usr/lib/gcc/x86_64-linux-gnu/6
-L/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib
-L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/6/../../..
/tmp/cclzJ0sV.o -ldl -rpath $ORIGIN -lgcc --as-needed -lgcc_s
--no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed
/usr/lib/gcc/x86_64-linux-gnu/6/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-mtune=generic' '-march=x86-64'
michael@michael-Latitude-E6420:~/vbox/trunk/out/linux.amd64/debug/bin$
readelf -d ./test
Dynamic section at offset 0xdc8 contains 26 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libdl.so.2]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
0x000000000000000c (INIT) 0x5a0
0x000000000000000d (FINI) 0x7d4
0x0000000000000019 (INIT_ARRAY) 0x200db0
0x000000000000001b (INIT_ARRAYSZ) 8 (bytes)
0x000000000000001a (FINI_ARRAY) 0x200db8
0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
0x000000006ffffef5 (GNU_HASH) 0x298
0x0000000000000005 (STRTAB) 0x390
0x0000000000000006 (SYMTAB) 0x2b8
0x000000000000000a (STRSZ) 176 (bytes)
0x000000000000000b (SYMENT) 24 (bytes)
0x0000000000000015 (DEBUG) 0x0
0x0000000000000003 (PLTGOT) 0x200fa8
0x0000000000000007 (RELA) 0x498
0x0000000000000008 (RELASZ) 264 (bytes)
0x0000000000000009 (RELAENT) 24 (bytes)
0x000000000000001e (FLAGS) BIND_NOW
0x000000006ffffffb (FLAGS_1) Flags: NOW PIE
0x000000006ffffffe (VERNEED) 0x458
0x000000006fffffff (VERNEEDNUM) 2
0x000000006ffffff0 (VERSYM) 0x440
0x000000006ffffff9 (RELACOUNT) 3
0x0000000000000000 (NULL) 0x0
michael@michael-Latitude-E6420:~/vbox/trunk/out/linux.amd64/debug/bin$
LD_DEBUG=libs ./test
32721: find library=libdl.so.2 [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/tls/x86_64:/home/michael/vbox/trunk/out/linux.amd64/debug/bin/tls:/home/michael/vbox/trunk/out/linux.amd64/debug/bin/x86_64:/home/michael/vbox/trunk/out/linux.amd64/debug/bin
(RUNPATH from file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/tls/x86_64/libdl.so.2
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/tls/libdl.so.2
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/x86_64/libdl.so.2
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/libdl.so.2
32721: search cache=/etc/ld.so.cache
32721: trying file=/lib/x86_64-linux-gnu/libdl.so.2
32721:
32721: find library=libc.so.6 [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/libc.so.6
32721: search cache=/etc/ld.so.cache
32721: trying file=/lib/x86_64-linux-gnu/libc.so.6
32721:
32721:
32721: calling init: /lib/x86_64-linux-gnu/libc.so.6
32721:
32721:
32721: calling init: /lib/x86_64-linux-gnu/libdl.so.2
32721:
32721:
32721: initialize program: ./test
32721:
32721:
32721: transferring control: ./test
32721:
32721: find library=VBoxOGLrenderspu.so [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/VBoxOGLrenderspu.so
32721:
32721: find library=VBoxOGLhostcrutil.so [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/VBoxOGLhostcrutil.so
32721:
32721: find library=VBoxRT.so [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/VBoxRT.so
32721:
32721: find library=libXmu.so.6 [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/libXmu.so.6
32721: search cache=/etc/ld.so.cache
32721: trying file=/usr/lib/x86_64-linux-gnu/libXmu.so.6
32721:
32721: find library=libX11.so.6 [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/libX11.so.6
32721: search cache=/etc/ld.so.cache
32721: trying file=/usr/lib/x86_64-linux-gnu/libX11.so.6
32721:
32721: find library=libXext.so.6 [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/libXext.so.6
32721: search cache=/etc/ld.so.cache
32721: trying file=/usr/lib/x86_64-linux-gnu/libXext.so.6
32721:
32721: find library=libpthread.so.0 [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/libpthread.so.0
32721: search cache=/etc/ld.so.cache
32721: trying file=/lib/x86_64-linux-gnu/libpthread.so.0
32721:
32721: find library=libstdc++.so.6 [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/libstdc++.so.6
32721: search cache=/etc/ld.so.cache
32721: trying file=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
32721:
32721: find library=libm.so.6 [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/libm.so.6
32721: search cache=/etc/ld.so.cache
32721: trying file=/lib/x86_64-linux-gnu/libm.so.6
32721:
32721: find library=libgcc_s.so.1 [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/libgcc_s.so.1
32721: search cache=/etc/ld.so.cache
32721: trying file=/lib/x86_64-linux-gnu/libgcc_s.so.1
32721:
32721: find library=libcrypt.so.1 [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/libcrypt.so.1
32721: search cache=/etc/ld.so.cache
32721: trying file=/lib/x86_64-linux-gnu/libcrypt.so.1
32721:
32721: find library=libz.so.1 [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/libz.so.1
32721: search cache=/etc/ld.so.cache
32721: trying file=/lib/x86_64-linux-gnu/libz.so.1
32721:
32721: find library=librt.so.1 [0]; searching
32721: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32721: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/librt.so.1
32721: search cache=/etc/ld.so.cache
32721: trying file=/lib/x86_64-linux-gnu/librt.so.1
32721:
32721: find library=libXt.so.6 [0]; searching
32721: search cache=/etc/ld.so.cache
32721: trying file=/usr/lib/x86_64-linux-gnu/libXt.so.6
32721:
32721: find library=libxcb.so.1 [0]; searching
32721: search cache=/etc/ld.so.cache
32721: trying file=/usr/lib/x86_64-linux-gnu/libxcb.so.1
32721:
32721: find library=libSM.so.6 [0]; searching
32721: search cache=/etc/ld.so.cache
32721: trying file=/usr/lib/x86_64-linux-gnu/libSM.so.6
32721:
32721: find library=libICE.so.6 [0]; searching
32721: search cache=/etc/ld.so.cache
32721: trying file=/usr/lib/x86_64-linux-gnu/libICE.so.6
32721:
32721: find library=libXau.so.6 [0]; searching
32721: search cache=/etc/ld.so.cache
32721: trying file=/usr/lib/x86_64-linux-gnu/libXau.so.6
32721:
32721: find library=libXdmcp.so.6 [0]; searching
32721: search cache=/etc/ld.so.cache
32721: trying file=/usr/lib/x86_64-linux-gnu/libXdmcp.so.6
32721:
32721: find library=libuuid.so.1 [0]; searching
32721: search cache=/etc/ld.so.cache
32721: trying file=/lib/x86_64-linux-gnu/libuuid.so.1
32721:
32721:
32721: calling init: /lib/x86_64-linux-gnu/libpthread.so.0
32721:
32721:
32721: calling init: /lib/x86_64-linux-gnu/libuuid.so.1
32721:
32721:
32721: calling init: /usr/lib/x86_64-linux-gnu/libXdmcp.so.6
32721:
32721:
32721: calling init: /usr/lib/x86_64-linux-gnu/libXau.so.6
32721:
32721:
32721: calling init: /usr/lib/x86_64-linux-gnu/libICE.so.6
32721:
32721:
32721: calling init: /usr/lib/x86_64-linux-gnu/libSM.so.6
32721:
32721:
32721: calling init: /usr/lib/x86_64-linux-gnu/libxcb.so.1
32721:
32721:
32721: calling init: /usr/lib/x86_64-linux-gnu/libX11.so.6
32721:
32721:
32721: calling init: /usr/lib/x86_64-linux-gnu/libXt.so.6
32721:
32721:
32721: calling init: /lib/x86_64-linux-gnu/librt.so.1
32721:
32721:
32721: calling init: /lib/x86_64-linux-gnu/libz.so.1
32721:
32721:
32721: calling init: /lib/x86_64-linux-gnu/libcrypt.so.1
32721:
32721:
32721: calling init: /lib/x86_64-linux-gnu/libgcc_s.so.1
32721:
32721:
32721: calling init: /lib/x86_64-linux-gnu/libm.so.6
32721:
32721:
32721: calling init: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
32721:
32721:
32721: calling init: /usr/lib/x86_64-linux-gnu/libXext.so.6
32721:
32721:
32721: calling init: /usr/lib/x86_64-linux-gnu/libXmu.so.6
32721:
32721:
32721: calling init:
/home/michael/vbox/trunk/out/linux.amd64/debug/bin/VBoxRT.so
32721:
32721:
32721: calling init:
/home/michael/vbox/trunk/out/linux.amd64/debug/bin/VBoxOGLhostcrutil.so
32721:
32721:
32721: calling init:
/home/michael/vbox/trunk/out/linux.amd64/debug/bin/VBoxOGLrenderspu.so
32721:
True
32721:
32721: calling fini: ./test [0]
32721:
32721:
32721: calling fini:
/home/michael/vbox/trunk/out/linux.amd64/debug/bin/VBoxOGLrenderspu.so [0]
32721:
32721:
32721: calling fini:
/home/michael/vbox/trunk/out/linux.amd64/debug/bin/VBoxOGLhostcrutil.so [0]
32721:
32721:
32721: calling fini:
/home/michael/vbox/trunk/out/linux.amd64/debug/bin/VBoxRT.so [0]
32721:
32721:
32721: calling fini: /usr/lib/x86_64-linux-gnu/libXmu.so.6 [0]
32721:
32721:
32721: calling fini: /usr/lib/x86_64-linux-gnu/libXext.so.6 [0]
32721:
32721:
32721: calling fini: /usr/lib/x86_64-linux-gnu/libstdc++.so.6 [0]
32721:
32721:
32721: calling fini: /lib/x86_64-linux-gnu/libm.so.6 [0]
32721:
32721:
32721: calling fini: /lib/x86_64-linux-gnu/libgcc_s.so.1 [0]
32721:
32721:
32721: calling fini: /lib/x86_64-linux-gnu/libcrypt.so.1 [0]
32721:
32721:
32721: calling fini: /lib/x86_64-linux-gnu/libz.so.1 [0]
32721:
32721:
32721: calling fini: /lib/x86_64-linux-gnu/librt.so.1 [0]
32721:
32721:
32721: calling fini: /lib/x86_64-linux-gnu/libpthread.so.0 [0]
32721:
32721:
32721: calling fini: /usr/lib/x86_64-linux-gnu/libXt.so.6 [0]
32721:
32721:
32721: calling fini: /usr/lib/x86_64-linux-gnu/libX11.so.6 [0]
32721:
32721:
32721: calling fini: /lib/x86_64-linux-gnu/libdl.so.2 [0]
32721:
32721:
32721: calling fini: /usr/lib/x86_64-linux-gnu/libxcb.so.1 [0]
32721:
32721:
32721: calling fini: /usr/lib/x86_64-linux-gnu/libSM.so.6 [0]
32721:
32721:
32721: calling fini: /usr/lib/x86_64-linux-gnu/libICE.so.6 [0]
32721:
32721:
32721: calling fini: /usr/lib/x86_64-linux-gnu/libXau.so.6 [0]
32721:
32721:
32721: calling fini: /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 [0]
32721:
32721:
32721: calling fini: /lib/x86_64-linux-gnu/libuuid.so.1 [0]
32721:
michael@michael-Latitude-E6420:~/vbox/trunk/out/linux.amd64/debug/bin$
gcc -v test.c -o test -ldl -Wl,-rpath,'$ORIGIN' -fsanitize=address
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
6.3.0-8ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-6/README.Bugs
--enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++
--prefix=/usr --program-suffix=-6 --program-prefix=x86_64-linux-gnu-
--enable-shared --enable-linker-build-id --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --libdir=/usr/lib
--enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes
--with-default-libstdcxx-abi=new --enable-gnu-unique-object
--disable-vtable-verify --enable-libmpx --enable-plugin
--enable-default-pie --with-system-zlib --disable-browser-plugin
--enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-6-amd64/jre
--enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-6-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-6-amd64
--with-arch-directory=amd64
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-target-system-zlib
--enable-objc-gc=auto --enable-multiarch --disable-werror
--with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 6.3.0 20170221 (Ubuntu 6.3.0-8ubuntu1)
COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-fsanitize=address'
'-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/6/cc1 -quiet -v -imultiarch
x86_64-linux-gnu test.c -quiet -dumpbase test.c -mtune=generic
-march=x86-64 -auxbase test -version -fsanitize=address
-fstack-protector-strong -Wformat -Wformat-security -o /tmp/ccYHNlkH.s
GNU C11 (Ubuntu 6.3.0-8ubuntu1) version 6.3.0 20170221 (x86_64-linux-gnu)
compiled by GNU C version 6.3.0 20170221, GMP version 6.1.2, MPFR
version 3.1.5, MPC version 1.0.3, isl version 0.15
warning: GMP header version 6.1.2 differs from library version 6.1.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/6/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-linux-gnu/6/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/6/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
GNU C11 (Ubuntu 6.3.0-8ubuntu1) version 6.3.0 20170221 (x86_64-linux-gnu)
compiled by GNU C version 6.3.0 20170221, GMP version 6.1.2, MPFR
version 3.1.5, MPC version 1.0.3, isl version 0.15
warning: GMP header version 6.1.2 differs from library version 6.1.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: efffe3a8eab4a38b76a97676d9f27d34
COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-fsanitize=address'
'-mtune=generic' '-march=x86-64'
as -v --64 -o /tmp/cchUIAOX.o /tmp/ccYHNlkH.s
GNU assembler version 2.28 (x86_64-linux-gnu) using BFD version (GNU
Binutils for Ubuntu) 2.28
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/6/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/6/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-fsanitize=address'
'-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/6/collect2 -plugin
/usr/lib/gcc/x86_64-linux-gnu/6/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-linux-gnu/6/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccBRQqke.res
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s --sysroot=/ --build-id --eh-frame-hdr
-m elf_x86_64 --hash-style=gnu --as-needed -dynamic-linker
/lib64/ld-linux-x86-64.so.2 -pie -z now -z relro -o test
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crti.o
/usr/lib/gcc/x86_64-linux-gnu/6/crtbeginS.o
-L/usr/lib/gcc/x86_64-linux-gnu/6
-L/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu
-L/usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib
-L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu
-L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/6/../../..
/usr/lib/gcc/x86_64-linux-gnu/6/libasan_preinit.o --push-state
--no-as-needed -lasan --pop-state /tmp/cchUIAOX.o -ldl -rpath $ORIGIN
-lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s
--no-as-needed /usr/lib/gcc/x86_64-linux-gnu/6/crtendS.o
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/crtn.o
COLLECT_GCC_OPTIONS='-v' '-o' 'test' '-fsanitize=address'
'-mtune=generic' '-march=x86-64'
michael@michael-Latitude-E6420:~/vbox/trunk/out/linux.amd64/debug/bin$
readelf -d ./test
Dynamic section at offset 0xd58 contains 31 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libasan.so.3]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN]
0x000000000000000c (INIT) 0x838
0x000000000000000d (FINI) 0xab4
0x0000000000000020 (PREINIT_ARRAY) 0x200d28
0x0000000000000021 (PREINIT_ARRAYSZ) 0x8
0x0000000000000019 (INIT_ARRAY) 0x200d30
0x000000000000001b (INIT_ARRAYSZ) 16 (bytes)
0x000000000000001a (FINI_ARRAY) 0x200d40
0x000000000000001c (FINI_ARRAYSZ) 16 (bytes)
0x000000006ffffef5 (GNU_HASH) 0x298
0x0000000000000005 (STRTAB) 0x480
0x0000000000000006 (SYMTAB) 0x2d0
0x000000000000000a (STRSZ) 303 (bytes)
0x000000000000000b (SYMENT) 24 (bytes)
0x0000000000000015 (DEBUG) 0x0
0x0000000000000003 (PLTGOT) 0x200f88
0x0000000000000002 (PLTRELSZ) 24 (bytes)
0x0000000000000014 (PLTREL) RELA
0x0000000000000017 (JMPREL) 0x820
0x0000000000000007 (RELA) 0x5f8
0x0000000000000008 (RELASZ) 552 (bytes)
0x0000000000000009 (RELAENT) 24 (bytes)
0x000000000000001e (FLAGS) BIND_NOW
0x000000006ffffffb (FLAGS_1) Flags: NOW PIE
0x000000006ffffffe (VERNEED) 0x5d8
0x000000006fffffff (VERNEEDNUM) 1
0x000000006ffffff0 (VERSYM) 0x5b0
0x000000006ffffff9 (RELACOUNT) 11
0x0000000000000000 (NULL) 0x0
michael@michael-Latitude-E6420:~/vbox/trunk/out/linux.amd64/debug/bin$
LD_DEBUG=libs ./test
32744: find library=libasan.so.3 [0]; searching
32744: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/tls/x86_64:/home/michael/vbox/trunk/out/linux.amd64/debug/bin/tls:/home/michael/vbox/trunk/out/linux.amd64/debug/bin/x86_64:/home/michael/vbox/trunk/out/linux.amd64/debug/bin
(RUNPATH from file ./test)
32744: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/tls/x86_64/libasan.so.3
32744: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/tls/libasan.so.3
32744: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/x86_64/libasan.so.3
32744: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/libasan.so.3
32744: search cache=/etc/ld.so.cache
32744: trying file=/usr/lib/x86_64-linux-gnu/libasan.so.3
32744:
32744: find library=libc.so.6 [0]; searching
32744: search
path=/home/michael/vbox/trunk/out/linux.amd64/debug/bin(RUNPATH from
file ./test)
32744: trying
file=/home/michael/vbox/trunk/out/linux.amd64/debug/bin/libc.so.6
32744: search cache=/etc/ld.so.cache
32744: trying file=/lib/x86_64-linux-gnu/libc.so.6
32744:
32744: find library=libdl.so.2 [0]; searching
32744: search cache=/etc/ld.so.cache
32744: trying file=/lib/x86_64-linux-gnu/libdl.so.2
32744:
32744: find library=librt.so.1 [0]; searching
32744: search cache=/etc/ld.so.cache
32744: trying file=/lib/x86_64-linux-gnu/librt.so.1
32744:
32744: find library=libpthread.so.0 [0]; searching
32744: search cache=/etc/ld.so.cache
32744: trying file=/lib/x86_64-linux-gnu/libpthread.so.0
32744:
32744: find library=libm.so.6 [0]; searching
32744: search cache=/etc/ld.so.cache
32744: trying file=/lib/x86_64-linux-gnu/libm.so.6
32744:
32744: find library=libgcc_s.so.1 [0]; searching
32744: search cache=/etc/ld.so.cache
32744: trying file=/lib/x86_64-linux-gnu/libgcc_s.so.1
32744:
32744:
32744: calling init: /lib/x86_64-linux-gnu/libpthread.so.0
32744:
32744:
32744: calling preinit: ./test
32744:
32744: /usr/lib/x86_64-linux-gnu/libasan.so.3: error: symbol
lookup error: undefined symbol: __isoc99_printf (fatal)
32744: /usr/lib/x86_64-linux-gnu/libasan.so.3: error: symbol
lookup error: undefined symbol: __isoc99_sprintf (fatal)
32744: /usr/lib/x86_64-linux-gnu/libasan.so.3: error: symbol
lookup error: undefined symbol: __isoc99_snprintf (fatal)
32744: /usr/lib/x86_64-linux-gnu/libasan.so.3: error: symbol
lookup error: undefined symbol: __isoc99_fprintf (fatal)
32744: /usr/lib/x86_64-linux-gnu/libasan.so.3: error: symbol
lookup error: undefined symbol: __isoc99_vprintf (fatal)
32744: /usr/lib/x86_64-linux-gnu/libasan.so.3: error: symbol
lookup error: undefined symbol: __isoc99_vsprintf (fatal)
32744: /usr/lib/x86_64-linux-gnu/libasan.so.3: error: symbol
lookup error: undefined symbol: __isoc99_vsnprintf (fatal)
32744: /usr/lib/x86_64-linux-gnu/libasan.so.3: error: symbol
lookup error: undefined symbol: __isoc99_vfprintf (fatal)
32744: /usr/lib/x86_64-linux-gnu/libasan.so.3: error: symbol
lookup error: undefined symbol: __cxa_throw (fatal)
32744:
32744: calling init: /lib/x86_64-linux-gnu/libc.so.6
32744:
32744:
32744: calling init: /lib/x86_64-linux-gnu/libgcc_s.so.1
32744:
32744:
32744: calling init: /lib/x86_64-linux-gnu/libm.so.6
32744:
32744:
32744: calling init: /lib/x86_64-linux-gnu/librt.so.1
32744:
32744:
32744: calling init: /lib/x86_64-linux-gnu/libdl.so.2
32744:
32744:
32744: calling init: /usr/lib/x86_64-linux-gnu/libasan.so.3
32744:
32744:
32744: initialize program: ./test
32744:
32744:
32744: transferring control: ./test
32744:
32744: find library=VBoxOGLrenderspu.so [0]; searching
32744: search cache=/etc/ld.so.cache
32744: search
path=/lib/x86_64-linux-gnu/tls/x86_64:/lib/x86_64-linux-gnu/tls:/lib/x86_64-linux-gnu/x86_64:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/tls/x86_64:/usr/lib/x86_64-linux-gnu/tls:/usr/lib/x86_64-linux-gnu/x86_64:/usr/lib/x86_64-linux-gnu:/lib/tls/x86_64:/lib/tls:/lib/x86_64:/lib:/usr/lib/tls/x86_64:/usr/lib/tls:/usr/lib/x86_64:/usr/lib
(system search path)
32744: trying
file=/lib/x86_64-linux-gnu/tls/x86_64/VBoxOGLrenderspu.so
32744: trying file=/lib/x86_64-linux-gnu/tls/VBoxOGLrenderspu.so
32744: trying file=/lib/x86_64-linux-gnu/x86_64/VBoxOGLrenderspu.so
32744: trying file=/lib/x86_64-linux-gnu/VBoxOGLrenderspu.so
32744: trying
file=/usr/lib/x86_64-linux-gnu/tls/x86_64/VBoxOGLrenderspu.so
32744: trying file=/usr/lib/x86_64-linux-gnu/tls/VBoxOGLrenderspu.so
32744: trying
file=/usr/lib/x86_64-linux-gnu/x86_64/VBoxOGLrenderspu.so
32744: trying file=/usr/lib/x86_64-linux-gnu/VBoxOGLrenderspu.so
32744: trying file=/lib/tls/x86_64/VBoxOGLrenderspu.so
32744: trying file=/lib/tls/VBoxOGLrenderspu.so
32744: trying file=/lib/x86_64/VBoxOGLrenderspu.so
32744: trying file=/lib/VBoxOGLrenderspu.so
32744: trying file=/usr/lib/tls/x86_64/VBoxOGLrenderspu.so
32744: trying file=/usr/lib/tls/VBoxOGLrenderspu.so
32744: trying file=/usr/lib/x86_64/VBoxOGLrenderspu.so
32744: trying file=/usr/lib/VBoxOGLrenderspu.so
32744:
32744:
32744: calling fini: ./test [0]
32744:
32744:
32744: calling fini: /usr/lib/x86_64-linux-gnu/libasan.so.3 [0]
32744:
32744:
32744: calling fini: /lib/x86_64-linux-gnu/libdl.so.2 [0]
32744:
32744:
32744: calling fini: /lib/x86_64-linux-gnu/librt.so.1 [0]
32744:
32744:
32744: calling fini: /lib/x86_64-linux-gnu/libpthread.so.0 [0]
32744:
32744:
32744: calling fini: /lib/x86_64-linux-gnu/libm.so.6 [0]
32744:
32744:
32744: calling fini: /lib/x86_64-linux-gnu/libgcc_s.so.1 [0]
32744:
--
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt
ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603
Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister
der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher