iT邦幫忙

DAY 4
6

HP-UX管理實務經驗系列 第 4

怎麼判斷HP-UX系統內的程式是 32bit 或 64bit?

分享一個簡單判別程式是32位元還是64位元的方法

  • 64bit
    root@Lab1 # file testmem
    testmem: PA-RISC2.0 shared executable dynamically linked -not stripped
  • 32bit
    root@Lab1 # file /usr/bin/ls
    /usr/bin/ls: PA-RISC1.1 shared executable dynamically linked

PA2.0 can support 64 bit and 32bit mode. an a.out can be as a 32 bit binary in PA2.0, if you complie it with +DA2.0 option.

If you complie with +DA2.0W then the a.out will be as 64bit binary in PA2.0

Summary compile options as
+DA1.1 - 32bit in PA1.1
+DA2.0 - 32bit in PA2.0
+DA2.0W - 64bit in PA2.0

compile時的差異

  • 64 bit
    $ cc +DA2.0W a.c
    $ file a.out
    a.out: ELF-64 executable object file - PA-RISC 2.0 (LP64)

  • 32 bit
    $ cc +DA2.0 a.c
    $ file a.out
    a.out: PA-RISC2.0 shared executable dynamically linked -not stripped
    $ cc +DA1.1 a.c
    $ file a.out
    a.out: PA-RISC1.1 shared executable dynamically linked -not stripped


上一篇
HP-UX作業系統的發展歷史
下一篇
修改HP-UX系統參數的方法
系列文
HP-UX管理實務經驗18

尚未有邦友留言

立即登入留言