分享一個簡單判別程式是32位元還是64位元的方法
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
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