To determine whether UNIX systems and library files are 32-bit or 64-bit detailed _linux

Source: Internet
Author: User

To determine whether UNIX systems and library files are 32-bit or 64-bit detailed

First, view system 32 or 64-bit system

Bootinfo-y View the number of hardware bits
Bootinfo-k View kernel digits

Second, view the library file is 32-bit or 64-bit

1. Use the file command

Linux:

# file libnss1_files-2.2.4.so 
libnss1_files-2.2.4.so:elf 32-bit LSB shared object, Intel 80386, version 1, not Stripp Ed 
# file libtrsbean.so 
Libtrsbean.so:ELF 64-bit LSB Shared Object, version 1, not stripped

No description of the AIX:32 bit

#file/usr/ccs/lib/mcrt0.o 
/usr/ccs/lib/mcrt0.o:  executable (RISC system/6000) or object module not stripped< c11/> #file/usr/ccs/lib/mcrt0_64.o 
/usr/ccs/lib/mcrt0_64.o:    64-bit xcoff executable or object module not Stripped

Solaris:

# file libmp.so 
libmp.so:    ELF 32-bit MSB Dynamic Library SPARC version 1, dynamic link, no removal

2, through the binary view command OD View related library files can also solve this problem, but difficult, nor insurance. The following results are given in different systems for reference (due to tests that are done under only one version of the operating system, the following results cannot be adapted to all versions of the system)

Linux


The 32-bit 4th is 0101; 64-bit 4th is 0102-
 h for viewing by 16 in 2-byte integers, and the integer high and low bits are adjusted (such as 7f45 to 457f);-N 10 means view 10 bytes
#od-H-N 32.so 
   0000000 457f 464c 0101 0001 0000
#od-H-n 64.so 
   0000000 457f 464c 0102 0001 0000

Solaris

Similar to Linux, only the Linux-h parameter becomes-X. In addition, the results are not the same, Solaris is displayed in byte order, Linux is viewed in 16-in-2-byte integers, and the high-low level is adjusted.

#od-X-n 32.so      
   0000000 7f45 4c46 0101 0100 0000 #od-X-n
64.so      
   0000000 7f45 4c46 0102 0100 0000

Aix

32 bits is 01DF; 64 is 01f7.

#od-N 10-h crt0_r.o 
   0000000 01df 0003 3d65 462a 0000
#od-n 10-h mcrt0_64.o 0000000 01f7 0003 3fe2 
   7fd5 000 0

HP Unix

There is no actual operation, just open two files via UltraEdit xxx32.sl and XXX64.SL and compare the first few bytes (HP library file is. SL end is not. So). Found 64-bit files similar to Linux/solaris's.

0e
7f 4c 46 02 02 01

Thank you for reading, I hope to help you, thank you for your support for this site!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.