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