← 返回命令列表

Linux command

setarch 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Run

setarch i686 [command]

Run

setarch x86_64 [bash]

Disable

setarch [linux32] -R [command]

List

setarch --list

说明

setarch changes the reported architecture for a program's execution environment. It modifies what uname -m reports and can affect how programs behave based on architecture detection. The command is useful for running 32-bit applications on 64-bit systems, compatibility testing, and debugging programs that behave differently based on architecture. The linux32 and linux64 symlinks are shortcuts for common uses.

参数

arch
Target architecture (i686, x86_64, linux32, linux64, etc.)
-R, --addr-no-randomize
Disable address space layout randomization (ASLR).
-F, --fdpic-funcptrs
Treat user-space function pointers as pointers to function descriptors.
-Z, --mmap-page-zero
Turn on MMAP_PAGE_ZERO for legacy programs.
-L, --addr-compat-layout
Use legacy virtual address space layout.
-X, --read-implies-exec
Turn on READ_IMPLIES_EXEC.
-B, --32bit
Turn on ADDR_LIMIT_32BIT.
-I, --short-inode
Turn on SHORT_INODE.
-S, --whole-seconds
Turn on WHOLE_SECONDS.
-T, --sticky-timeouts
Turn on STICKY_TIMEOUTS.
-3, --3gb
Use a 3GB memory layout.
--uname-2.6
Report a 2.6 kernel version in uname.
--list
List supported architectures and exit.
-v, --verbose
Be verbose.
-h, --help
Display help.

FAQ

What is the setarch command used for?

setarch changes the reported architecture for a program's execution environment. It modifies what uname -m reports and can affect how programs behave based on architecture detection. The command is useful for running 32-bit applications on 64-bit systems, compatibility testing, and debugging programs that behave differently based on architecture. The linux32 and linux64 symlinks are shortcuts for common uses.

How do I run a basic setarch example?

Run `setarch i686 [command]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does arch do in setarch?

Target architecture (i686, x86_64, linux32, linux64, etc.)