]>
Commit | Line | Data |
---|---|---|
2b798ecd | 1 | .TH SETARCH 8 "December 2017" "util-linux" "System Administration" |
8b3a46d2 | 2 | .SH NAME |
05541825 | 3 | setarch \- change reported architecture in new program environment and/or set personality flags |
8b3a46d2 | 4 | .SH SYNOPSIS |
181ebbb3 | 5 | .B setarch |
05541825 | 6 | .RI [ arch ] |
c372860d | 7 | [options] |
181ebbb3 | 8 | .RI [ program |
6ad5b22c BS |
9 | .RI [ argument ...]] |
10 | .sp | |
05541825 KZ |
11 | .B setarch |
12 | .BR \-\-list | \-h | \-V | |
13 | .sp | |
6ad5b22c BS |
14 | .B arch |
15 | [options] | |
16 | .RI [ program | |
17 | .RI [ argument ...]] | |
8b3a46d2 KZ |
18 | .SH DESCRIPTION |
19 | .B setarch | |
05541825 KZ |
20 | modifies execution domains and process personality flags. |
21 | .PP | |
22 | The execution domains currently only affects the output of \fBuname -m\fR. | |
6ad5b22c BS |
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. | |
05541825 KZ |
27 | .PP |
28 | Since version 2.33 the | |
29 | .I arch | |
b9c3b903 | 30 | command line argument is optional and |
05541825 KZ |
31 | .B setarch |
32 | may be used to change personality flags (ADDR_LIMIT_*, SHORT_INODE, etc) without | |
33 | modification of the execution domain. | |
8b3a46d2 KZ |
34 | .SH OPTIONS |
35 | .TP | |
8854b121 BS |
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. | |
e0771cf8 | 39 | .TP |
8854b121 BS |
40 | .B \-\-uname\-2.6 |
41 | Causes the \fIprogram\fR to see a kernel version number beginning with 2.6. | |
2b798ecd | 42 | Turns on UNAME26. |
70eebc40 | 43 | .TP |
c372860d BS |
44 | .BR \-v , " \-\-verbose" |
45 | Be verbose. | |
46 | .TP | |
edd82b9c | 47 | \fB\-3\fR, \fB\-\-3gb\fR |
2b798ecd SK |
48 | Specifies |
49 | .I program | |
50 | should use a maximum of 3GB of address space. Supported on x86. Turns on | |
51 | ADDR_LIMIT_3GB. | |
8b3a46d2 | 52 | .TP |
edd82b9c | 53 | \fB\-\-4gb\fR |
2b798ecd SK |
54 | This option has no effect. It is retained for backward compatibility only, |
55 | and may be removed in future releases. | |
edd82b9c KZ |
56 | .TP |
57 | \fB\-B\fR, \fB\-\-32bit\fR | |
2b798ecd SK |
58 | Limit the address space to 32 bits to emulate hardware. Supported on ARM |
59 | and Alpha. Turns on ADDR_LIMIT_32BIT. | |
8b3a46d2 | 60 | .TP |
edd82b9c | 61 | \fB\-F\fR, \fB\-\-fdpic\-funcptrs\fR |
2b798ecd SK |
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. | |
8b3a46d2 | 66 | .TP |
edd82b9c | 67 | \fB\-I\fR, \fB\-\-short\-inode\fR |
2b798ecd | 68 | Obsolete bug emulation flag. Turns on SHORT_INODE. |
8b3a46d2 | 69 | .TP |
edd82b9c | 70 | \fB\-L\fR, \fB\-\-addr\-compat\-layout\fR |
2b798ecd SK |
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. | |
8b3a46d2 | 75 | .TP |
edd82b9c | 76 | \fB\-R\fR, \fB\-\-addr\-no\-randomize\fR |
2b798ecd SK |
77 | Disables randomization of the virtual address space. Turns on |
78 | ADDR_NO_RANDOMIZE. | |
8b3a46d2 | 79 | .TP |
edd82b9c | 80 | \fB\-S\fR, \fB\-\-whole\-seconds\fR |
2b798ecd | 81 | Obsolete bug emulation flag. Turns on WHOLE_SECONDS. |
8b3a46d2 | 82 | .TP |
edd82b9c | 83 | \fB\-T\fR, \fB\-\-sticky\-timeouts\fR |
2b798ecd SK |
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. | |
8b3a46d2 | 95 | .TP |
edd82b9c | 96 | \fB\-X\fR, \fB\-\-read\-implies\-exec\fR |
2b798ecd | 97 | If this is set then |
dbeb1d73 | 98 | .BR mmap (3p) |
2b798ecd SK |
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. | |
8b3a46d2 | 102 | .TP |
edd82b9c | 103 | \fB\-Z\fR, \fB\-\-mmap\-page\-zero\fR |
2b798ecd | 104 | SVr4 bug emulation that will set |
dbeb1d73 | 105 | .BR mmap (3p) |
2b798ecd SK |
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. | |
8b3a46d2 | 109 | Turns on MMAP_PAGE_ZERO. |
c372860d BS |
110 | .TP |
111 | .BR \-V , " \-\-version" | |
112 | Display version information and exit. | |
113 | .TP | |
114 | .BR \-h , " \-\-help" | |
115 | Display help text and exit. | |
8b3a46d2 | 116 | .SH EXAMPLES |
05541825 KZ |
117 | setarch --addr-no-randomize mytestprog |
118 | .br | |
8b3a46d2 KZ |
119 | setarch ppc32 rpmbuild --target=ppc --rebuild foo.src.rpm |
120 | .br | |
121 | setarch ppc32 -v -vL3 rpmbuild --target=ppc --rebuild bar.src.rpm | |
8df90dec KZ |
122 | .br |
123 | setarch ppc32 --32bit rpmbuild --target=ppc --rebuild foo.src.rpm | |
8b3a46d2 | 124 | .SH AUTHOR |
79f84818 | 125 | .MT sopwith@redhat.com |
e0771cf8 | 126 | Elliot Lee |
79f84818 | 127 | .ME |
8b3a46d2 | 128 | .br |
79f84818 | 129 | .MT jnovy@redhat.com |
e0771cf8 | 130 | Jindrich Novy |
79f84818 | 131 | .ME |
05541825 KZ |
132 | .br |
133 | .MT kzak@redhat.com | |
134 | Karel Zak | |
135 | .ME | |
2b798ecd SK |
136 | .SH "SEE ALSO" |
137 | .BR personality (2), | |
138 | .BR select (2) | |
8b3a46d2 | 139 | .SH AVAILABILITY |
601d12fb | 140 | The setarch command is part of the util-linux package and is available from |
d673b74e | 141 | .UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/ |
e0771cf8 SK |
142 | Linux Kernel Archive |
143 | .UE . |