1SETARCH(8) System Administration SETARCH(8)
2
3
4
6 setarch - change reported architecture in new program environment
7 and/or set personality flags
8
10 setarch [arch] [options] [program [argument...]]
11
12 setarch --list|-h|-V
13
14 arch [options] [program [argument...]]
15
17 setarch modifies execution domains and process personality flags.
18
19 The execution domains currently only affects the output of uname -m.
20 For example, on an AMD64 system, running setarch i386 program will
21 cause program to see i686 instead of x86_64 as the machine type. It can
22 also be used to set various personality options. The default program is
23 /bin/sh.
24
25 Since version 2.33 the arch command line argument is optional and
26 setarch may be used to change personality flags (ADDR_LIMIT_*,
27 SHORT_INODE, etc) without modification of the execution domain.
28
30 --list
31 List the architectures that setarch knows about. Whether setarch
32 can actually set each of these architectures depends on the running
33 kernel.
34
35 --show[=personality]
36 Show the currently active personality and flags. If the personality
37 argument is provided, it is shown instead of the current one.
38 personality is a hexadecimal number with values was described in
39 sys/personality.h.
40
41 --uname-2.6
42 Causes the program to see a kernel version number beginning with
43 2.6. Turns on UNAME26.
44
45 -v, --verbose
46 Be verbose.
47
48 -3, --3gb
49 Specifies program should use a maximum of 3GB of address space.
50 Supported on x86. Turns on ADDR_LIMIT_3GB.
51
52 --4gb
53 This option has no effect. It is retained for backward
54 compatibility only, and may be removed in future releases.
55
56 -B, --32bit
57 Limit the address space to 32 bits to emulate hardware. Supported
58 on ARM and Alpha. Turns on ADDR_LIMIT_32BIT.
59
60 -F, --fdpic-funcptrs
61 Treat user-space function pointers to signal handlers as pointers
62 to address descriptors. This option has no effect on architectures
63 that do not support FDPIC ELF binaries. In kernel v4.14 support is
64 limited to ARM, Blackfin, Fujitsu FR-V, and SuperH CPU
65 architectures.
66
67 -I, --short-inode
68 Obsolete bug emulation flag. Turns on SHORT_INODE.
69
70 -L, --addr-compat-layout
71 Provide legacy virtual address space layout. Use when the program
72 binary does not have PT_GNU_STACK ELF header. Turns on
73 ADDR_COMPAT_LAYOUT.
74
75 -R, --addr-no-randomize
76 Disables randomization of the virtual address space. Turns on
77 ADDR_NO_RANDOMIZE.
78
79 -S, --whole-seconds
80 Obsolete bug emulation flag. Turns on WHOLE_SECONDS.
81
82 -T, --sticky-timeouts
83 This makes select(2), pselect(2), and ppoll(2) system calls
84 preserve the timeout value instead of modifying it to reflect the
85 amount of time not slept when interrupted by a signal handler. Use
86 when program depends on this behavior. For more details see the
87 timeout description in select(2) manual page. Turns on
88 STICKY_TIMEOUTS.
89
90 -X, --read-implies-exec
91 If this is set then mmap(2) PROT_READ will also add the PROT_EXEC
92 bit - as expected by legacy x86 binaries. Notice that the ELF
93 loader will automatically set this bit when it encounters a legacy
94 binary. Turns on READ_IMPLIES_EXEC.
95
96 -Z, --mmap-page-zero
97 SVr4 bug emulation that will set mmap(2) page zero as read-only.
98 Use when program depends on this behavior, and the source code is
99 not available to be fixed. Turns on MMAP_PAGE_ZERO.
100
101 -h, --help
102 Display help text and exit.
103
104 -V, --version
105 Print version and exit.
106
108 setarch --addr-no-randomize mytestprog
109 setarch ppc32 rpmbuild --target=ppc --rebuild foo.src.rpm
110 setarch ppc32 -v -vL3 rpmbuild --target=ppc --rebuild bar.src.rpm
111 setarch ppc32 --32bit rpmbuild --target=ppc --rebuild foo.src.rpm
112
114 Elliot Lee <sopwith@redhat.com>, Jindrich Novy <jnovy@redhat.com>,
115 Karel Zak <kzak@redhat.com>
116
118 personality(2), select(2)
119
121 For bug reports, use the issue tracker at
122 https://github.com/util-linux/util-linux/issues.
123
125 The setarch command is part of the util-linux package which can be
126 downloaded from Linux Kernel Archive
127 <https://www.kernel.org/pub/linux/utils/util-linux/>.
128
129
130
131util-linux 2.39.2 2023-06-14 SETARCH(8)