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
22 can also be used to set various personality options. The default pro‐
23 gram is /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 List the architectures that setarch knows about. Whether
31 setarch can actually set each of these architectures depends on
32 the running kernel.
33
34 --uname-2.6
35 Causes the program to see a kernel version number beginning with
36 2.6. Turns on UNAME26.
37
38 -v, --verbose
39 Be verbose.
40
41 -3, --3gb
42 Specifies program should use a maximum of 3GB of address space.
43 Supported on x86. Turns on ADDR_LIMIT_3GB.
44
45 --4gb This option has no effect. It is retained for backward compati‐
46 bility only, and may be removed in future releases.
47
48 -B, --32bit
49 Limit the address space to 32 bits to emulate hardware. Sup‐
50 ported on ARM and Alpha. Turns on ADDR_LIMIT_32BIT.
51
52 -F, --fdpic-funcptrs
53 Treat user-space function pointers to signal handlers as point‐
54 ers to address descriptors. This option has no effect on archi‐
55 tectures that do not support FDPIC ELF binaries. In kernel
56 v4.14 support is limited to ARM, Blackfin, Fujitsu FR-V, and
57 SuperH CPU architectures.
58
59 -I, --short-inode
60 Obsolete bug emulation flag. Turns on SHORT_INODE.
61
62 -L, --addr-compat-layout
63 Provide legacy virtual address space layout. Use when the pro‐
64 gram binary does not have PT_GNU_STACK ELF header. Turns on
65 ADDR_COMPAT_LAYOUT.
66
67 -R, --addr-no-randomize
68 Disables randomization of the virtual address space. Turns on
69 ADDR_NO_RANDOMIZE.
70
71 -S, --whole-seconds
72 Obsolete bug emulation flag. Turns on WHOLE_SECONDS.
73
74 -T, --sticky-timeouts
75 This makes select(2), pselect(2), and ppoll(2) system calls pre‐
76 serve the timeout value instead of modifying it to reflect the
77 amount of time not slept when interrupted by a signal handler.
78 Use when program depends on this behavior. For more details see
79 the timeout description in select(2) manual page. Turns on
80 STICKY_TIMEOUTS.
81
82 -X, --read-implies-exec
83 If this is set then mmap(3p) PROT_READ will also add the
84 PROT_EXEC bit - as expected by legacy x86 binaries. Notice that
85 the ELF loader will automatically set this bit when it encoun‐
86 ters a legacy binary. Turns on READ_IMPLIES_EXEC.
87
88 -Z, --mmap-page-zero
89 SVr4 bug emulation that will set mmap(3p) page zero as read-
90 only. Use when program depends on this behavior, and the source
91 code is not available to be fixed. Turns on MMAP_PAGE_ZERO.
92
93 -V, --version
94 Display version information and exit.
95
96 -h, --help
97 Display help text and exit.
98
100 setarch --addr-no-randomize mytestprog
101 setarch ppc32 rpmbuild --target=ppc --rebuild foo.src.rpm
102 setarch ppc32 -v -vL3 rpmbuild --target=ppc --rebuild bar.src.rpm
103 setarch ppc32 --32bit rpmbuild --target=ppc --rebuild foo.src.rpm
104
106 Elliot Lee ⟨sopwith@redhat.com⟩
107 Jindrich Novy ⟨jnovy@redhat.com⟩
108 Karel Zak ⟨kzak@redhat.com⟩
109
111 personality(2), select(2)
112
114 The setarch command is part of the util-linux package and is available
115 from Linux Kernel Archive ⟨https://www.kernel.org/pub/linux/utils/util-
116 linux/⟩.
117
118
119
120util-linux December 2017 SETARCH(8)