0

On my solaris 64 bit machine I'm creating an executable "drivertest" (1) by linking 3 object files drivermain.o (2), testcol.o (3) and teststmt.o (3). I have used the -m64 option in the commands to create 64 bit executable. When I try to run the executable I get the error "Illegal Instruction (core dumped)". When I try to view the core using dbx command it says "dbx: File `drivertest' is not ELF executable". My executable is 64 bit, so why can't dbx work with 64 bit application?

Also when I run the ldd command on the executable it gives a "file not found" error for several dependencies (4) , all of which are there in /export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r (5) and this directory is included in the LD_LIBRARY_PATH that has been exported using the setenv command. Why does this happen also?

(1)
CC -G -m64 -o drivertest SunOS.64.r/drivermain.o SunOS.64.r/testcol.o SunOS.64.r/teststmt.o  \
 -L/export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r -L/databases/oracle10.2.0_64BIT/lib -L/export/home/builds/pc9x_root/960/repo/third-party-libs/ACE/ace -L/export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r  \
 -lpmcuti -lpmasrt -lpmser -lpmi18n -lpmdec -lpmodl -lclntsh -lpmicudata -lpmicui18n -lpmicuio -lpmicuuc -lpmsdkcmn



(2)
CC +w +w2 -mt -features=extensions -erroff=doubunder -m64 -O  -KPIC -m64 -D_REENTRANT -DRW_MULTI_THREAD -DRW_NO_STL -DRW_BCB_NEW_IOSTREAMS -DPM_64BIT -DFD_SETSIZE=65536 -DUNIX -DSunOS -DINFA_PREFIX -I. -I/export/home/builds/pc9x_root/960/build/powrmart/server/dwriter -I/export/home/builds/pc9x_root/960/build/powrmart/server/dwriter/wrtfile -I/export/home/builds/pc9x_root/960/build/powrmart/server/include -I/export/home/builds/pc9x_root/960/build/powrmart/server/include/cef -I/export/home/builds/pc9x_root/960/build/powrmart/server/dmapper/trans -I/export/home/builds/pc9x_root/960/build/powrmart/server/dmapper/scrub -I/export/home/builds/pc9x_root/960/build/powrmart/server/dreader -I/export/home/builds/pc9x_root/960/build/powrmart/server/cmnutils -I/export/home/builds/pc9x_root/960/build/powrmart/common/cmnmisc -I/export/home/builds/pc9x_root/960/repo/third-party-libs/mitkerberos/include -I/export/home/builds/pc9x_root/960/repo/third-party-libs/CURL/include -I/export/home/builds/pc9x_root/960/repo/third-party-libs/OPENSSL/include -I/export/home/builds/pc9x_root/960/repo/third-party-libs/PMTL_PC -I/export/home/builds/pc9x_root/960/repo/third-party-libs/STLPORT_INCLUDE/stlport -I/export/home/builds/pc9x_root/960/repo/third-party-libs/ICU/include -I/export/home/builds/pc9x_root/960/repo/third-party-libs/ICU/source/common \
        -c /home/devops/drivertest/drivermain.cpp -o SunOS.64.r/drivermain.o

(3)            
CC +w +w2 -mt -features=extensions -erroff=doubunder -m64 -O  -KPIC -m64 -D_REENTRANT -DRW_MULTI_THREAD -DRW_NO_STL -DRW_BCB_NEW_IOSTREAMS -DPM_64BIT -DFD_SETSIZE=65536 -DUNIX -DSunOS -DINFA_PREFIX -I. -I/export/home/builds/pc9x_root/960/build/powrmart/server/dwriter -I/export/home/builds/pc9x_root/960/build/powrmart/server/dwriter/wrtfile -I/export/home/builds/pc9x_root/960/build/powrmart/server/include -I/export/home/builds/pc9x_root/960/build/powrmart/server/include/cef -I/export/home/builds/pc9x_root/960/build/powrmart/server/dmapper/trans -I/export/home/builds/pc9x_root/960/build/powrmart/server/dmapper/scrub -I/export/home/builds/pc9x_root/960/build/powrmart/server/dreader -I/export/home/builds/pc9x_root/960/build/powrmart/server/cmnutils -I/export/home/builds/pc9x_root/960/build/powrmart/common/cmnmisc -I/export/home/builds/pc9x_root/960/repo/third-party-libs/mitkerberos/include -I/export/home/builds/pc9x_root/960/repo/third-party-libs/CURL/include -I/export/home/builds/pc9x_root/960/repo/third-party-libs/OPENSSL/include -I/export/home/builds/pc9x_root/960/repo/third-party-libs/PMTL_PC -I/export/home/builds/pc9x_root/960/repo/third-party-libs/STLPORT_INCLUDE/stlport -I/export/home/builds/pc9x_root/960/repo/third-party-libs/ICU/include -I/export/home/builds/pc9x_root/960/repo/third-party-libs/ICU/source/common \
        -c /home/devops/drivertest/testcol.cpp -o SunOS.64.r/testcol.o

(4)
CC +w +w2 -mt -features=extensions -erroff=doubunder -m64 -O  -KPIC -m64 -D_REENTRANT -DRW_MULTI_THREAD -DRW_NO_STL -DRW_BCB_NEW_IOSTREAMS -DPM_64BIT -DFD_SETSIZE=65536 -DUNIX -DSunOS -DINFA_PREFIX -I. -I/export/home/builds/pc9x_root/960/build/powrmart/server/dwriter -I/export/home/builds/pc9x_root/960/build/powrmart/server/dwriter/wrtfile -I/export/home/builds/pc9x_root/960/build/powrmart/server/include -I/export/home/builds/pc9x_root/960/build/powrmart/server/include/cef -I/export/home/builds/pc9x_root/960/build/powrmart/server/dmapper/trans -I/export/home/builds/pc9x_root/960/build/powrmart/server/dmapper/scrub -I/export/home/builds/pc9x_root/960/build/powrmart/server/dreader -I/export/home/builds/pc9x_root/960/build/powrmart/server/cmnutils -I/export/home/builds/pc9x_root/960/build/powrmart/common/cmnmisc -I/export/home/builds/pc9x_root/960/repo/third-party-libs/mitkerberos/include -I/export/home/builds/pc9x_root/960/repo/third-party-libs/CURL/include -I/export/home/builds/pc9x_root/960/repo/third-party-libs/OPENSSL/include -I/export/home/builds/pc9x_root/960/repo/third-party-libs/PMTL_PC -I/export/home/builds/pc9x_root/960/repo/third-party-libs/STLPORT_INCLUDE/stlport -I/export/home/builds/pc9x_root/960/repo/third-party-libs/ICU/include -I/export/home/builds/pc9x_root/960/repo/third-party-libs/ICU/source/common \
        -c /home/devops/drivertest/teststmt.cpp -o SunOS.64.r/teststmt.o

(5)
psrux902b1% ldd drivertest
    libpmcuti.so =>  (file not found)
    libpmasrt.so =>  (file not found)
    libpmser.so =>   (file not found)
    libpmi18n.so =>  (file not found)
    libpmdec.so =>   (file not found)
    libpmodl.so =>   (file not found)
    libclntsh.so.10.1 =>     /databases/oracle10.2.0_64BIT/lib/libclntsh.so.10.1
    libpmicudata.so.32 =>    /export/home/builds/pc9x_root/960/repo/third-party-libs/ICU/lib/libpmicudata.so.32
    libpmicui18n.so.32 =>    /export/home/builds/pc9x_root/960/repo/third-party-libs/ICU/lib/libpmicui18n.so.32
    libpmicuio.so.32 =>      /export/home/builds/pc9x_root/960/repo/third-party-libs/ICU/lib/libpmicuio.so.32
    libpmicuuc.so.32 =>      /export/home/builds/pc9x_root/960/repo/third-party-libs/ICU/lib/libpmicuuc.so.32
    libpmsdkcmn.so =>        (file not found)
    libnnz10.so =>   /databases/oracle10.2.0_64BIT/lib/libnnz10.so
    libkstat.so.1 =>         /lib/64/libkstat.so.1
    libnsl.so.1 =>   /lib/64/libnsl.so.1
    libsocket.so.1 =>        /lib/64/libsocket.so.1
    libgen.so.1 =>   /lib/64/libgen.so.1
    libdl.so.1 =>    /lib/64/libdl.so.1
    libsched.so.1 =>         /usr/lib/64/libsched.so.1
    libaio.so.1 =>   /lib/64/libaio.so.1
    librt.so.1 =>    /lib/64/librt.so.1
    libm.so.2 =>     /lib/64/libm.so.2
    libc.so.1 =>     /lib/64/libc.so.1
    libpthread.so.1 =>       /lib/sparcv9/libpthread.so.1
    libmp.so.2 =>    /lib/64/libmp.so.2
    libmd.so.1 =>    /lib/64/libmd.so.1
    libscf.so.1 =>   /lib/64/libscf.so.1
    libdoor.so.1 =>  /lib/64/libdoor.so.1
    libuutil.so.1 =>         /lib/64/libuutil.so.1
    /platform/SUNW,T5240/lib/sparcv9/libc_psr.so.1
    /platform/SUNW,T5240/lib/sparcv9/libmd_psr.so.1


(6)
psrux902b1% ls /export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r/libpmasrt.so
/export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r/libpmasrt.so
psrux902b1% ls /export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r/libpmser.so
/export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r/libpmser.so
psrux902b1%  ls /export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r/libpmi18n.so
/export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r/libpmi18n.so
psrux902b1%  ls /export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r/libpmdec.so
/export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r/libpmdec.so
psrux902b1% ls /export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r/libpmodl.so
/export/home/builds/pc9x_root/960/build/powrmart/pmbuild/bin/SunOS.64.r/libpmodl.so
1
  • On Solaris, dbx comes with the Studio compilers - which compiler version are you using the dbx from?
    – alanc
    Dec 13, 2013 at 6:16

1 Answer 1

0

You can probably use file(1) to check what type of ELF binary which object/executable is. If you try to mix 32b and 64b ELF object's it's not going to work (i.e. if libpmcuti.so is a 32b object and your executable is 64b). Also make sure that LD_LIBRARY_PATH is actually exported. Since you use -m64, it seems your toolchain is 32b by default: dbx might be 32b as well, and fails to work with 64b executables?

2
  • file command does say /usr/bin/dbx is 32 bit, but where do I find the 64 bit dbx? Dec 8, 2013 at 16:13
  • Studio's dbx command is smart enough to re-exec itself from $STUDIOHOME/prod/bin/$MACH64 if it detects that you want it to run over a 64bit file. Feb 4, 2014 at 4:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.