Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/unix/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
unix中的dumpbin等价物_Unix_Scons_Dumpbin - Fatal编程技术网

unix中的dumpbin等价物

unix中的dumpbin等价物,unix,scons,dumpbin,Unix,Scons,Dumpbin,我使用SCON编译了一些程序,然后我想检查它是什么类型的二进制文件。它是64位还是32位,在我使用的windows中dumpbin。我尝试在unix上使用nm,结果如下 ~/Documents/scons_unix/SCons_test$ nm VisualStudio08-32bit 0000000000600e50 d _DYNAMIC 0000000000600fe8 d _GLOBAL_OFFSET_TABLE_ 00000000004005f8 R _IO_stdin_used

我使用SCON编译了一些程序,然后我想检查它是什么类型的二进制文件。它是64位还是32位,在我使用的windows中dumpbin。我尝试在unix上使用nm,结果如下

~/Documents/scons_unix/SCons_test$ nm VisualStudio08-32bit
0000000000600e50 d _DYNAMIC
0000000000600fe8 d _GLOBAL_OFFSET_TABLE_
00000000004005f8 R _IO_stdin_used
                 w _Jv_RegisterClasses
0000000000600e30 d __CTOR_END__
0000000000600e28 d __CTOR_LIST__
0000000000600e40 D __DTOR_END__
0000000000600e38 d __DTOR_LIST__
00000000004006f0 r __FRAME_END__
0000000000600e48 d __JCR_END__
0000000000600e48 d __JCR_LIST__
0000000000601020 A __bss_start
0000000000601010 D __data_start
00000000004005b0 t __do_global_ctors_aux
0000000000400460 t __do_global_dtors_aux
0000000000601018 D __dso_handle
                 w __gmon_start__
0000000000600e24 d __init_array_end
0000000000600e24 d __init_array_start
00000000004005a0 T __libc_csu_fini
0000000000400510 T __libc_csu_init
                 U __libc_start_main@@GLIBC_2.2.5
0000000000601020 A _edata
0000000000601030 A _end
00000000004005e8 T _fini
00000000004003c8 T _init
0000000000400410 T _start
000000000040043c t call_gmon_start
0000000000601020 b completed.6531
0000000000601010 W data_start
0000000000601028 b dtor_idx.6533
00000000004004d0 t frame_dummy
00000000004004f4 T main
                 U puts@@GLIBC_2.2.5
然后我尝试使用objdump-f,结果如下

VisualStudio08-64bit:     file format elf64-x86-64
architecture: i386:x86-64, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x0000000000400410
但问题是下面的结果来自32位文件,64位和32位看起来都一样

VisualStudio08-32bit:     file format elf64-x86-64
architecture: i386:x86-64, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x0000000000400410
我不知道这有什么问题,也不知道斯科斯是否在搞砸建筑。这是我在施工图中看到的

#Builds a 32bit binary using the default compiler
env = Environment(TARGET_ARCH='x86')
env.Program('DefaultCompiler32-bit','helloworld-32bit.cpp')

file
是判断unix上二进制文件(或任何其他文件)的最简单方法:

$ file program64
program64: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped
$ file program32
program32: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, not stripped

看起来您并不是在构建一个32位文件,而您却认为自己在构建一个32位文件。如果它说的是
文件格式elf64-x86-64
,那么它是一个64位二进制文件。添加了scons标记,因为它看起来像是scons在做工作,这是所有问题的根源,将其变成一个单独的问题。