]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/i386-linux-tdep.c
Replace 'core_regset_sections' by iterator method
[thirdparty/binutils-gdb.git] / gdb / i386-linux-tdep.c
CommitLineData
871fbe6a 1/* Target-dependent code for GNU/Linux i386.
ca557f44 2
ecd75fc8 3 Copyright (C) 2000-2014 Free Software Foundation, Inc.
e7ee86a9
JB
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
a9762ec7 9 the Free Software Foundation; either version 3 of the License, or
e7ee86a9
JB
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
a9762ec7 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
e7ee86a9
JB
19
20#include "defs.h"
21#include "gdbcore.h"
22#include "frame.h"
23#include "value.h"
4e052eda 24#include "regcache.h"
c131fcee 25#include "regset.h"
6441c4a0 26#include "inferior.h"
0670c0aa 27#include "osabi.h"
38c968cf 28#include "reggroups.h"
5cb2fe25 29#include "dwarf2-frame.h"
8201327c
MK
30#include "i386-tdep.h"
31#include "i386-linux-tdep.h"
4aa995e1 32#include "linux-tdep.h"
0670c0aa 33#include "glibc-tdep.h"
871fbe6a 34#include "solib-svr4.h"
982e9687 35#include "symtab.h"
237fc4c9 36#include "arch-utils.h"
a96d9b2e
SDJ
37#include "xml-syscall.h"
38
c131fcee 39#include "i387-tdep.h"
df7e5265 40#include "x86-xstate.h"
c131fcee 41
a96d9b2e
SDJ
42/* The syscall's XML filename for i386. */
43#define XML_SYSCALL_FILENAME_I386 "syscalls/i386-linux.xml"
17ea7499 44
d02ed0bb 45#include "record-full.h"
77fcef51
HZ
46#include "linux-record.h"
47#include <stdint.h>
48
90884b2b 49#include "features/i386/i386-linux.c"
3a13a53b 50#include "features/i386/i386-mmx-linux.c"
1dbcd68c 51#include "features/i386/i386-mpx-linux.c"
c131fcee 52#include "features/i386/i386-avx-linux.c"
01f9f808 53#include "features/i386/i386-avx512-linux.c"
90884b2b 54
38c968cf
AC
55/* Return non-zero, when the register is in the corresponding register
56 group. Put the LINUX_ORIG_EAX register in the system group. */
57static int
58i386_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
59 struct reggroup *group)
60{
61 if (regnum == I386_LINUX_ORIG_EAX_REGNUM)
62 return (group == system_reggroup
63 || group == save_reggroup
64 || group == restore_reggroup);
65 return i386_register_reggroup_p (gdbarch, regnum, group);
66}
67
e7ee86a9
JB
68\f
69/* Recognizing signal handler frames. */
70
ca557f44 71/* GNU/Linux has two flavors of signals. Normal signal handlers, and
e7ee86a9
JB
72 "realtime" (RT) signals. The RT signals can provide additional
73 information to the signal handler if the SA_SIGINFO flag is set
74 when establishing a signal handler using `sigaction'. It is not
ca557f44
AC
75 unlikely that future versions of GNU/Linux will support SA_SIGINFO
76 for normal signals too. */
e7ee86a9
JB
77
78/* When the i386 Linux kernel calls a signal handler and the
79 SA_RESTORER flag isn't set, the return address points to a bit of
80 code on the stack. This function returns whether the PC appears to
81 be within this bit of code.
82
83 The instruction sequence for normal signals is
84 pop %eax
acd5c798 85 mov $0x77, %eax
e7ee86a9
JB
86 int $0x80
87 or 0x58 0xb8 0x77 0x00 0x00 0x00 0xcd 0x80.
88
89 Checking for the code sequence should be somewhat reliable, because
90 the effect is to call the system call sigreturn. This is unlikely
911bc6ee 91 to occur anywhere other than in a signal trampoline.
e7ee86a9
JB
92
93 It kind of sucks that we have to read memory from the process in
94 order to identify a signal trampoline, but there doesn't seem to be
911bc6ee
MK
95 any other way. Therefore we only do the memory reads if no
96 function name could be identified, which should be the case since
97 the code is on the stack.
e7ee86a9
JB
98
99 Detection of signal trampolines for handlers that set the
100 SA_RESTORER flag is in general not possible. Unfortunately this is
101 what the GNU C Library has been doing for quite some time now.
102 However, as of version 2.1.2, the GNU C Library uses signal
103 trampolines (named __restore and __restore_rt) that are identical
104 to the ones used by the kernel. Therefore, these trampolines are
105 supported too. */
106
acd5c798
MK
107#define LINUX_SIGTRAMP_INSN0 0x58 /* pop %eax */
108#define LINUX_SIGTRAMP_OFFSET0 0
109#define LINUX_SIGTRAMP_INSN1 0xb8 /* mov $NNNN, %eax */
110#define LINUX_SIGTRAMP_OFFSET1 1
111#define LINUX_SIGTRAMP_INSN2 0xcd /* int */
112#define LINUX_SIGTRAMP_OFFSET2 6
e7ee86a9 113
4252dc94 114static const gdb_byte linux_sigtramp_code[] =
e7ee86a9
JB
115{
116 LINUX_SIGTRAMP_INSN0, /* pop %eax */
acd5c798 117 LINUX_SIGTRAMP_INSN1, 0x77, 0x00, 0x00, 0x00, /* mov $0x77, %eax */
e7ee86a9
JB
118 LINUX_SIGTRAMP_INSN2, 0x80 /* int $0x80 */
119};
120
121#define LINUX_SIGTRAMP_LEN (sizeof linux_sigtramp_code)
122
10458914
DJ
123/* If THIS_FRAME is a sigtramp routine, return the address of the
124 start of the routine. Otherwise, return 0. */
e7ee86a9
JB
125
126static CORE_ADDR
10458914 127i386_linux_sigtramp_start (struct frame_info *this_frame)
e7ee86a9 128{
10458914 129 CORE_ADDR pc = get_frame_pc (this_frame);
4252dc94 130 gdb_byte buf[LINUX_SIGTRAMP_LEN];
e7ee86a9
JB
131
132 /* We only recognize a signal trampoline if PC is at the start of
133 one of the three instructions. We optimize for finding the PC at
134 the start, as will be the case when the trampoline is not the
135 first frame on the stack. We assume that in the case where the
136 PC is not at the start of the instruction sequence, there will be
137 a few trailing readable bytes on the stack. */
138
10458914 139 if (!safe_frame_unwind_memory (this_frame, pc, buf, LINUX_SIGTRAMP_LEN))
e7ee86a9
JB
140 return 0;
141
142 if (buf[0] != LINUX_SIGTRAMP_INSN0)
143 {
144 int adjust;
145
146 switch (buf[0])
147 {
148 case LINUX_SIGTRAMP_INSN1:
149 adjust = LINUX_SIGTRAMP_OFFSET1;
150 break;
151 case LINUX_SIGTRAMP_INSN2:
152 adjust = LINUX_SIGTRAMP_OFFSET2;
153 break;
154 default:
155 return 0;
156 }
157
158 pc -= adjust;
159
10458914 160 if (!safe_frame_unwind_memory (this_frame, pc, buf, LINUX_SIGTRAMP_LEN))
e7ee86a9
JB
161 return 0;
162 }
163
164 if (memcmp (buf, linux_sigtramp_code, LINUX_SIGTRAMP_LEN) != 0)
165 return 0;
166
167 return pc;
168}
169
170/* This function does the same for RT signals. Here the instruction
171 sequence is
acd5c798 172 mov $0xad, %eax
e7ee86a9
JB
173 int $0x80
174 or 0xb8 0xad 0x00 0x00 0x00 0xcd 0x80.
175
176 The effect is to call the system call rt_sigreturn. */
177
acd5c798
MK
178#define LINUX_RT_SIGTRAMP_INSN0 0xb8 /* mov $NNNN, %eax */
179#define LINUX_RT_SIGTRAMP_OFFSET0 0
180#define LINUX_RT_SIGTRAMP_INSN1 0xcd /* int */
181#define LINUX_RT_SIGTRAMP_OFFSET1 5
e7ee86a9 182
4252dc94 183static const gdb_byte linux_rt_sigtramp_code[] =
e7ee86a9 184{
acd5c798 185 LINUX_RT_SIGTRAMP_INSN0, 0xad, 0x00, 0x00, 0x00, /* mov $0xad, %eax */
e7ee86a9
JB
186 LINUX_RT_SIGTRAMP_INSN1, 0x80 /* int $0x80 */
187};
188
189#define LINUX_RT_SIGTRAMP_LEN (sizeof linux_rt_sigtramp_code)
190
10458914
DJ
191/* If THIS_FRAME is an RT sigtramp routine, return the address of the
192 start of the routine. Otherwise, return 0. */
e7ee86a9
JB
193
194static CORE_ADDR
10458914 195i386_linux_rt_sigtramp_start (struct frame_info *this_frame)
e7ee86a9 196{
10458914 197 CORE_ADDR pc = get_frame_pc (this_frame);
4252dc94 198 gdb_byte buf[LINUX_RT_SIGTRAMP_LEN];
e7ee86a9
JB
199
200 /* We only recognize a signal trampoline if PC is at the start of
201 one of the two instructions. We optimize for finding the PC at
202 the start, as will be the case when the trampoline is not the
203 first frame on the stack. We assume that in the case where the
204 PC is not at the start of the instruction sequence, there will be
205 a few trailing readable bytes on the stack. */
206
10458914 207 if (!safe_frame_unwind_memory (this_frame, pc, buf, LINUX_RT_SIGTRAMP_LEN))
e7ee86a9
JB
208 return 0;
209
210 if (buf[0] != LINUX_RT_SIGTRAMP_INSN0)
211 {
212 if (buf[0] != LINUX_RT_SIGTRAMP_INSN1)
213 return 0;
214
215 pc -= LINUX_RT_SIGTRAMP_OFFSET1;
216
10458914 217 if (!safe_frame_unwind_memory (this_frame, pc, buf,
8e6bed05 218 LINUX_RT_SIGTRAMP_LEN))
e7ee86a9
JB
219 return 0;
220 }
221
222 if (memcmp (buf, linux_rt_sigtramp_code, LINUX_RT_SIGTRAMP_LEN) != 0)
223 return 0;
224
225 return pc;
226}
227
10458914
DJ
228/* Return whether THIS_FRAME corresponds to a GNU/Linux sigtramp
229 routine. */
e7ee86a9 230
8201327c 231static int
10458914 232i386_linux_sigtramp_p (struct frame_info *this_frame)
e7ee86a9 233{
10458914 234 CORE_ADDR pc = get_frame_pc (this_frame);
2c02bd72 235 const char *name;
911bc6ee
MK
236
237 find_pc_partial_function (pc, &name, NULL, NULL);
238
ef17e74b
DJ
239 /* If we have NAME, we can optimize the search. The trampolines are
240 named __restore and __restore_rt. However, they aren't dynamically
241 exported from the shared C library, so the trampoline may appear to
242 be part of the preceding function. This should always be sigaction,
243 __sigaction, or __libc_sigaction (all aliases to the same function). */
244 if (name == NULL || strstr (name, "sigaction") != NULL)
10458914
DJ
245 return (i386_linux_sigtramp_start (this_frame) != 0
246 || i386_linux_rt_sigtramp_start (this_frame) != 0);
ef17e74b
DJ
247
248 return (strcmp ("__restore", name) == 0
249 || strcmp ("__restore_rt", name) == 0);
e7ee86a9
JB
250}
251
4a4e5149
DJ
252/* Return one if the PC of THIS_FRAME is in a signal trampoline which
253 may have DWARF-2 CFI. */
12b8a2cb
DJ
254
255static int
256i386_linux_dwarf_signal_frame_p (struct gdbarch *gdbarch,
4a4e5149 257 struct frame_info *this_frame)
12b8a2cb 258{
4a4e5149 259 CORE_ADDR pc = get_frame_pc (this_frame);
2c02bd72 260 const char *name;
12b8a2cb
DJ
261
262 find_pc_partial_function (pc, &name, NULL, NULL);
263
264 /* If a vsyscall DSO is in use, the signal trampolines may have these
265 names. */
266 if (name && (strcmp (name, "__kernel_sigreturn") == 0
267 || strcmp (name, "__kernel_rt_sigreturn") == 0))
268 return 1;
269
270 return 0;
271}
272
acd5c798
MK
273/* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>. */
274#define I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 20
275
10458914
DJ
276/* Assuming THIS_FRAME is a GNU/Linux sigtramp routine, return the
277 address of the associated sigcontext structure. */
e7ee86a9 278
b7d15bf7 279static CORE_ADDR
10458914 280i386_linux_sigcontext_addr (struct frame_info *this_frame)
e7ee86a9 281{
e17a4113
UW
282 struct gdbarch *gdbarch = get_frame_arch (this_frame);
283 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
e7ee86a9 284 CORE_ADDR pc;
acd5c798 285 CORE_ADDR sp;
4252dc94 286 gdb_byte buf[4];
acd5c798 287
10458914 288 get_frame_register (this_frame, I386_ESP_REGNUM, buf);
e17a4113 289 sp = extract_unsigned_integer (buf, 4, byte_order);
e7ee86a9 290
10458914 291 pc = i386_linux_sigtramp_start (this_frame);
e7ee86a9
JB
292 if (pc)
293 {
acd5c798
MK
294 /* The sigcontext structure lives on the stack, right after
295 the signum argument. We determine the address of the
296 sigcontext structure by looking at the frame's stack
297 pointer. Keep in mind that the first instruction of the
298 sigtramp code is "pop %eax". If the PC is after this
299 instruction, adjust the returned value accordingly. */
10458914 300 if (pc == get_frame_pc (this_frame))
e7ee86a9
JB
301 return sp + 4;
302 return sp;
303 }
304
10458914 305 pc = i386_linux_rt_sigtramp_start (this_frame);
e7ee86a9
JB
306 if (pc)
307 {
acd5c798
MK
308 CORE_ADDR ucontext_addr;
309
310 /* The sigcontext structure is part of the user context. A
311 pointer to the user context is passed as the third argument
312 to the signal handler. */
313 read_memory (sp + 8, buf, 4);
e17a4113 314 ucontext_addr = extract_unsigned_integer (buf, 4, byte_order);
acd5c798 315 return ucontext_addr + I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
e7ee86a9
JB
316 }
317
8a3fe4f8 318 error (_("Couldn't recognize signal trampoline."));
e7ee86a9
JB
319 return 0;
320}
321
6441c4a0
MK
322/* Set the program counter for process PTID to PC. */
323
8201327c 324static void
61a1198a 325i386_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
6441c4a0 326{
61a1198a 327 regcache_cooked_write_unsigned (regcache, I386_EIP_REGNUM, pc);
6441c4a0
MK
328
329 /* We must be careful with modifying the program counter. If we
330 just interrupted a system call, the kernel might try to restart
331 it when we resume the inferior. On restarting the system call,
332 the kernel will try backing up the program counter even though it
333 no longer points at the system call. This typically results in a
334 SIGSEGV or SIGILL. We can prevent this by writing `-1' in the
335 "orig_eax" pseudo-register.
336
337 Note that "orig_eax" is saved when setting up a dummy call frame.
338 This means that it is properly restored when that frame is
339 popped, and that the interrupted system call will be restarted
340 when we resume the inferior on return from a function call from
341 within GDB. In all other cases the system call will not be
342 restarted. */
61a1198a 343 regcache_cooked_write_unsigned (regcache, I386_LINUX_ORIG_EAX_REGNUM, -1);
6441c4a0 344}
77fcef51 345
8a2e0e28
HZ
346/* Record all registers but IP register for process-record. */
347
348static int
349i386_all_but_ip_registers_record (struct regcache *regcache)
350{
25ea693b 351 if (record_full_arch_list_add_reg (regcache, I386_EAX_REGNUM))
8a2e0e28 352 return -1;
25ea693b 353 if (record_full_arch_list_add_reg (regcache, I386_ECX_REGNUM))
8a2e0e28 354 return -1;
25ea693b 355 if (record_full_arch_list_add_reg (regcache, I386_EDX_REGNUM))
8a2e0e28 356 return -1;
25ea693b 357 if (record_full_arch_list_add_reg (regcache, I386_EBX_REGNUM))
8a2e0e28 358 return -1;
25ea693b 359 if (record_full_arch_list_add_reg (regcache, I386_ESP_REGNUM))
8a2e0e28 360 return -1;
25ea693b 361 if (record_full_arch_list_add_reg (regcache, I386_EBP_REGNUM))
8a2e0e28 362 return -1;
25ea693b 363 if (record_full_arch_list_add_reg (regcache, I386_ESI_REGNUM))
8a2e0e28 364 return -1;
25ea693b 365 if (record_full_arch_list_add_reg (regcache, I386_EDI_REGNUM))
8a2e0e28 366 return -1;
25ea693b 367 if (record_full_arch_list_add_reg (regcache, I386_EFLAGS_REGNUM))
8a2e0e28
HZ
368 return -1;
369
370 return 0;
371}
13b6d1d4
MS
372
373/* i386_canonicalize_syscall maps from the native i386 Linux set
374 of syscall ids into a canonical set of syscall ids used by
375 process record (a mostly trivial mapping, since the canonical
376 set was originally taken from the i386 set). */
377
378static enum gdb_syscall
379i386_canonicalize_syscall (int syscall)
380{
381 enum { i386_syscall_max = 499 };
382
383 if (syscall <= i386_syscall_max)
384 return syscall;
385 else
386 return -1;
387}
388
77fcef51
HZ
389/* Parse the arguments of current system call instruction and record
390 the values of the registers and memory that will be changed into
391 "record_arch_list". This instruction is "int 0x80" (Linux
392 Kernel2.4) or "sysenter" (Linux Kernel 2.6).
393
394 Return -1 if something wrong. */
395
8a2e0e28
HZ
396static struct linux_record_tdep i386_linux_record_tdep;
397
77fcef51 398static int
ffdf6de5 399i386_linux_intx80_sysenter_syscall_record (struct regcache *regcache)
77fcef51
HZ
400{
401 int ret;
13b6d1d4
MS
402 LONGEST syscall_native;
403 enum gdb_syscall syscall_gdb;
404
405 regcache_raw_read_signed (regcache, I386_EAX_REGNUM, &syscall_native);
77fcef51 406
13b6d1d4 407 syscall_gdb = i386_canonicalize_syscall (syscall_native);
2c543fc4 408
13b6d1d4 409 if (syscall_gdb < 0)
2c543fc4
HZ
410 {
411 printf_unfiltered (_("Process record and replay target doesn't "
13b6d1d4
MS
412 "support syscall number %s\n"),
413 plongest (syscall_native));
2c543fc4
HZ
414 return -1;
415 }
77fcef51 416
8a2e0e28
HZ
417 if (syscall_gdb == gdb_sys_sigreturn
418 || syscall_gdb == gdb_sys_rt_sigreturn)
419 {
420 if (i386_all_but_ip_registers_record (regcache))
421 return -1;
422 return 0;
423 }
424
13b6d1d4 425 ret = record_linux_system_call (syscall_gdb, regcache,
77fcef51
HZ
426 &i386_linux_record_tdep);
427 if (ret)
428 return ret;
429
430 /* Record the return value of the system call. */
25ea693b 431 if (record_full_arch_list_add_reg (regcache, I386_EAX_REGNUM))
77fcef51
HZ
432 return -1;
433
434 return 0;
435}
8a2e0e28
HZ
436
437#define I386_LINUX_xstate 270
438#define I386_LINUX_frame_size 732
439
70221824 440static int
8a2e0e28
HZ
441i386_linux_record_signal (struct gdbarch *gdbarch,
442 struct regcache *regcache,
2ea28649 443 enum gdb_signal signal)
8a2e0e28
HZ
444{
445 ULONGEST esp;
446
447 if (i386_all_but_ip_registers_record (regcache))
448 return -1;
449
25ea693b 450 if (record_full_arch_list_add_reg (regcache, I386_EIP_REGNUM))
8a2e0e28
HZ
451 return -1;
452
453 /* Record the change in the stack. */
454 regcache_raw_read_unsigned (regcache, I386_ESP_REGNUM, &esp);
455 /* This is for xstate.
456 sp -= sizeof (struct _fpstate); */
457 esp -= I386_LINUX_xstate;
458 /* This is for frame_size.
459 sp -= sizeof (struct rt_sigframe); */
460 esp -= I386_LINUX_frame_size;
25ea693b
MM
461 if (record_full_arch_list_add_mem (esp,
462 I386_LINUX_xstate + I386_LINUX_frame_size))
8a2e0e28
HZ
463 return -1;
464
25ea693b 465 if (record_full_arch_list_add_end ())
8a2e0e28
HZ
466 return -1;
467
468 return 0;
469}
6441c4a0 470\f
8201327c 471
9a7f938f
JK
472/* Core of the implementation for gdbarch get_syscall_number. Get pending
473 syscall number from REGCACHE. If there is no pending syscall -1 will be
474 returned. Pending syscall means ptrace has stepped into the syscall but
475 another ptrace call will step out. PC is right after the int $0x80
476 / syscall / sysenter instruction in both cases, PC does not change during
477 the second ptrace step. */
478
a96d9b2e 479static LONGEST
9a7f938f 480i386_linux_get_syscall_number_from_regcache (struct regcache *regcache)
a96d9b2e 481{
9a7f938f 482 struct gdbarch *gdbarch = get_regcache_arch (regcache);
a96d9b2e
SDJ
483 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
484 /* The content of a register. */
485 gdb_byte buf[4];
486 /* The result. */
487 LONGEST ret;
488
489 /* Getting the system call number from the register.
490 When dealing with x86 architecture, this information
491 is stored at %eax register. */
492 regcache_cooked_read (regcache, I386_LINUX_ORIG_EAX_REGNUM, buf);
493
494 ret = extract_signed_integer (buf, 4, byte_order);
495
496 return ret;
497}
498
9a7f938f
JK
499/* Wrapper for i386_linux_get_syscall_number_from_regcache to make it
500 compatible with gdbarch get_syscall_number method prototype. */
501
502static LONGEST
503i386_linux_get_syscall_number (struct gdbarch *gdbarch,
504 ptid_t ptid)
505{
506 struct regcache *regcache = get_thread_regcache (ptid);
507
508 return i386_linux_get_syscall_number_from_regcache (regcache);
509}
510
e9f1aad5
MK
511/* The register sets used in GNU/Linux ELF core-dumps are identical to
512 the register sets in `struct user' that are used for a.out
513 core-dumps. These are also used by ptrace(2). The corresponding
514 types are `elf_gregset_t' for the general-purpose registers (with
515 `elf_greg_t' the type of a single GP register) and `elf_fpregset_t'
516 for the floating-point registers.
517
518 Those types used to be available under the names `gregset_t' and
519 `fpregset_t' too, and GDB used those names in the past. But those
520 names are now used for the register sets used in the `mcontext_t'
521 type, which have a different size and layout. */
522
523/* Mapping between the general-purpose registers in `struct user'
524 format and GDB's register cache layout. */
525
526/* From <sys/reg.h>. */
be0d2954 527int i386_linux_gregset_reg_offset[] =
e9f1aad5
MK
528{
529 6 * 4, /* %eax */
530 1 * 4, /* %ecx */
531 2 * 4, /* %edx */
532 0 * 4, /* %ebx */
533 15 * 4, /* %esp */
534 5 * 4, /* %ebp */
535 3 * 4, /* %esi */
536 4 * 4, /* %edi */
537 12 * 4, /* %eip */
538 14 * 4, /* %eflags */
539 13 * 4, /* %cs */
540 16 * 4, /* %ss */
541 7 * 4, /* %ds */
542 8 * 4, /* %es */
543 9 * 4, /* %fs */
544 10 * 4, /* %gs */
545 -1, -1, -1, -1, -1, -1, -1, -1,
546 -1, -1, -1, -1, -1, -1, -1, -1,
547 -1, -1, -1, -1, -1, -1, -1, -1,
548 -1,
c131fcee 549 -1, -1, -1, -1, -1, -1, -1, -1,
01f9f808
MS
550 -1, -1, -1, -1, /* MPX registers BND0 ... BND3. */
551 -1, -1, /* MPX registers BNDCFGU, BNDSTATUS. */
552 -1, -1, -1, -1, -1, -1, -1, -1, /* k0 ... k7 (AVX512) */
553 -1, -1, -1, -1, -1, -1, -1, -1, /* zmm0 ... zmm7 (AVX512) */
554 11 * 4, /* "orig_eax" */
e9f1aad5
MK
555};
556
557/* Mapping between the general-purpose registers in `struct
558 sigcontext' format and GDB's register cache layout. */
559
a3386186 560/* From <asm/sigcontext.h>. */
bb489b3c 561static int i386_linux_sc_reg_offset[] =
a3386186
MK
562{
563 11 * 4, /* %eax */
564 10 * 4, /* %ecx */
565 9 * 4, /* %edx */
566 8 * 4, /* %ebx */
567 7 * 4, /* %esp */
568 6 * 4, /* %ebp */
569 5 * 4, /* %esi */
570 4 * 4, /* %edi */
571 14 * 4, /* %eip */
572 16 * 4, /* %eflags */
573 15 * 4, /* %cs */
574 18 * 4, /* %ss */
575 3 * 4, /* %ds */
576 2 * 4, /* %es */
577 1 * 4, /* %fs */
578 0 * 4 /* %gs */
579};
580
c131fcee
L
581/* Get XSAVE extended state xcr0 from core dump. */
582
583uint64_t
6df81a63 584i386_linux_core_read_xcr0 (bfd *abfd)
c131fcee
L
585{
586 asection *xstate = bfd_get_section_by_name (abfd, ".reg-xstate");
587 uint64_t xcr0;
588
589 if (xstate)
590 {
591 size_t size = bfd_section_size (abfd, xstate);
592
593 /* Check extended state size. */
df7e5265
GB
594 if (size < X86_XSTATE_AVX_SIZE)
595 xcr0 = X86_XSTATE_SSE_MASK;
c131fcee
L
596 else
597 {
598 char contents[8];
599
600 if (! bfd_get_section_contents (abfd, xstate, contents,
601 I386_LINUX_XSAVE_XCR0_OFFSET,
602 8))
603 {
1777feb0
MS
604 warning (_("Couldn't read `xcr0' bytes from "
605 "`.reg-xstate' section in core file."));
c131fcee
L
606 return 0;
607 }
608
609 xcr0 = bfd_get_64 (abfd, contents);
610 }
611 }
612 else
f335d1b3 613 xcr0 = 0;
c131fcee
L
614
615 return xcr0;
616}
617
90884b2b
L
618/* Get Linux/x86 target description from core dump. */
619
620static const struct target_desc *
621i386_linux_core_read_description (struct gdbarch *gdbarch,
622 struct target_ops *target,
623 bfd *abfd)
624{
90884b2b 625 /* Linux/i386. */
6df81a63 626 uint64_t xcr0 = i386_linux_core_read_xcr0 (abfd);
1dbcd68c 627
df7e5265 628 switch ((xcr0 & X86_XSTATE_ALL_MASK))
f335d1b3 629 {
df7e5265
GB
630 case X86_XSTATE_MPX_AVX512_MASK:
631 case X86_XSTATE_AVX512_MASK:
01f9f808 632 return tdesc_i386_avx512_linux;
df7e5265 633 case X86_XSTATE_MPX_MASK:
1dbcd68c 634 return tdesc_i386_mpx_linux;
df7e5265 635 case X86_XSTATE_AVX_MASK:
f335d1b3 636 return tdesc_i386_avx_linux;
df7e5265 637 case X86_XSTATE_SSE_MASK:
f335d1b3 638 return tdesc_i386_linux;
df7e5265 639 case X86_XSTATE_X87_MASK:
f335d1b3
L
640 return tdesc_i386_mmx_linux;
641 default:
642 break;
643 }
644
645 if (bfd_get_section_by_name (abfd, ".reg-xfp") != NULL)
c131fcee 646 return tdesc_i386_linux;
f335d1b3
L
647 else
648 return tdesc_i386_mmx_linux;
90884b2b
L
649}
650
5aa82d05
AA
651/* Iterate over core file register note sections. */
652
653static void
654i386_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
655 iterate_over_regset_sections_cb *cb,
656 void *cb_data,
657 const struct regcache *regcache)
658{
659 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
660
661 cb (".reg", 68, "general-purpose", cb_data);
662
663 if (tdep->xcr0 & X86_XSTATE_AVX)
664 cb (".reg-xstate", X86_XSTATE_MAX_SIZE, "XSAVE extended state", cb_data);
665 else if (tdep->xcr0 & X86_XSTATE_SSE)
666 cb (".reg-xfp", 512, "extended floating-point", cb_data);
667 else
668 cb (".reg2", 108, "floating-point", cb_data);
669}
670
9a7f938f
JK
671/* Linux kernel shows PC value after the 'int $0x80' instruction even if
672 inferior is still inside the syscall. On next PTRACE_SINGLESTEP it will
673 finish the syscall but PC will not change.
674
675 Some vDSOs contain 'int $0x80; ret' and during stepping out of the syscall
676 i386_displaced_step_fixup would keep PC at the displaced pad location.
677 As PC is pointing to the 'ret' instruction before the step
678 i386_displaced_step_fixup would expect inferior has just executed that 'ret'
679 and PC should not be adjusted. In reality it finished syscall instead and
680 PC should get relocated back to its vDSO address. Hide the 'ret'
681 instruction by 'nop' so that i386_displaced_step_fixup is not confused.
682
683 It is not fully correct as the bytes in struct displaced_step_closure will
684 not match the inferior code. But we would need some new flag in
685 displaced_step_closure otherwise to keep the state that syscall is finishing
686 for the later i386_displaced_step_fixup execution as the syscall execution
687 is already no longer detectable there. The new flag field would mean
688 i386-linux-tdep.c needs to wrap all the displacement methods of i386-tdep.c
689 which does not seem worth it. The same effect is achieved by patching that
690 'nop' instruction there instead. */
691
693be288 692static struct displaced_step_closure *
9a7f938f
JK
693i386_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
694 CORE_ADDR from, CORE_ADDR to,
695 struct regcache *regs)
696{
697 struct displaced_step_closure *closure;
698
699 closure = i386_displaced_step_copy_insn (gdbarch, from, to, regs);
700
701 if (i386_linux_get_syscall_number_from_regcache (regs) != -1)
702 {
703 /* Since we use simple_displaced_step_copy_insn, our closure is a
704 copy of the instruction. */
705 gdb_byte *insn = (gdb_byte *) closure;
706
707 /* Fake nop. */
708 insn[0] = 0x90;
709 }
710
711 return closure;
712}
713
8201327c
MK
714static void
715i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
716{
717 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
90884b2b
L
718 const struct target_desc *tdesc = info.target_desc;
719 struct tdesc_arch_data *tdesc_data = (void *) info.tdep_info;
720 const struct tdesc_feature *feature;
721 int valid_p;
722
723 gdb_assert (tdesc_data);
8201327c 724
a5ee0f0c
PA
725 linux_init_abi (info, gdbarch);
726
8201327c
MK
727 /* GNU/Linux uses ELF. */
728 i386_elf_init_abi (info, gdbarch);
729
90884b2b
L
730 /* Reserve a number for orig_eax. */
731 set_gdbarch_num_regs (gdbarch, I386_LINUX_NUM_REGS);
732
733 if (! tdesc_has_registers (tdesc))
734 tdesc = tdesc_i386_linux;
735 tdep->tdesc = tdesc;
736
737 feature = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.linux");
738 if (feature == NULL)
739 return;
8201327c 740
90884b2b
L
741 valid_p = tdesc_numbered_register (feature, tdesc_data,
742 I386_LINUX_ORIG_EAX_REGNUM,
743 "orig_eax");
744 if (!valid_p)
745 return;
746
747 /* Add the %orig_eax register used for syscall restarting. */
8201327c 748 set_gdbarch_write_pc (gdbarch, i386_linux_write_pc);
90884b2b
L
749
750 tdep->register_reggroup_p = i386_linux_register_reggroup_p;
8201327c 751
e9f1aad5
MK
752 tdep->gregset_reg_offset = i386_linux_gregset_reg_offset;
753 tdep->gregset_num_regs = ARRAY_SIZE (i386_linux_gregset_reg_offset);
754 tdep->sizeof_gregset = 17 * 4;
755
8201327c
MK
756 tdep->jb_pc_offset = 20; /* From <bits/setjmp.h>. */
757
911bc6ee 758 tdep->sigtramp_p = i386_linux_sigtramp_p;
b7d15bf7 759 tdep->sigcontext_addr = i386_linux_sigcontext_addr;
a3386186 760 tdep->sc_reg_offset = i386_linux_sc_reg_offset;
bb489b3c 761 tdep->sc_num_regs = ARRAY_SIZE (i386_linux_sc_reg_offset);
8201327c 762
c131fcee
L
763 tdep->xsave_xcr0_offset = I386_LINUX_XSAVE_XCR0_OFFSET;
764
a6b808b4 765 set_gdbarch_process_record (gdbarch, i386_process_record);
8a2e0e28 766 set_gdbarch_process_record_signal (gdbarch, i386_linux_record_signal);
a6b808b4 767
77fcef51 768 /* Initialize the i386_linux_record_tdep. */
5e31abdf
HZ
769 /* These values are the size of the type that will be used in a system
770 call. They are obtained from Linux Kernel source. */
2c543fc4
HZ
771 i386_linux_record_tdep.size_pointer
772 = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT;
5e31abdf
HZ
773 i386_linux_record_tdep.size__old_kernel_stat = 32;
774 i386_linux_record_tdep.size_tms = 16;
775 i386_linux_record_tdep.size_loff_t = 8;
776 i386_linux_record_tdep.size_flock = 16;
777 i386_linux_record_tdep.size_oldold_utsname = 45;
778 i386_linux_record_tdep.size_ustat = 20;
779 i386_linux_record_tdep.size_old_sigaction = 140;
780 i386_linux_record_tdep.size_old_sigset_t = 128;
781 i386_linux_record_tdep.size_rlimit = 8;
782 i386_linux_record_tdep.size_rusage = 72;
783 i386_linux_record_tdep.size_timeval = 8;
784 i386_linux_record_tdep.size_timezone = 8;
785 i386_linux_record_tdep.size_old_gid_t = 2;
786 i386_linux_record_tdep.size_old_uid_t = 2;
787 i386_linux_record_tdep.size_fd_set = 128;
788 i386_linux_record_tdep.size_dirent = 268;
789 i386_linux_record_tdep.size_dirent64 = 276;
790 i386_linux_record_tdep.size_statfs = 64;
791 i386_linux_record_tdep.size_statfs64 = 84;
792 i386_linux_record_tdep.size_sockaddr = 16;
2c543fc4
HZ
793 i386_linux_record_tdep.size_int
794 = gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT;
795 i386_linux_record_tdep.size_long
796 = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
797 i386_linux_record_tdep.size_ulong
798 = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
5e31abdf
HZ
799 i386_linux_record_tdep.size_msghdr = 28;
800 i386_linux_record_tdep.size_itimerval = 16;
801 i386_linux_record_tdep.size_stat = 88;
802 i386_linux_record_tdep.size_old_utsname = 325;
803 i386_linux_record_tdep.size_sysinfo = 64;
804 i386_linux_record_tdep.size_msqid_ds = 88;
805 i386_linux_record_tdep.size_shmid_ds = 84;
806 i386_linux_record_tdep.size_new_utsname = 390;
807 i386_linux_record_tdep.size_timex = 128;
808 i386_linux_record_tdep.size_mem_dqinfo = 24;
809 i386_linux_record_tdep.size_if_dqblk = 68;
810 i386_linux_record_tdep.size_fs_quota_stat = 68;
811 i386_linux_record_tdep.size_timespec = 8;
812 i386_linux_record_tdep.size_pollfd = 8;
813 i386_linux_record_tdep.size_NFS_FHSIZE = 32;
814 i386_linux_record_tdep.size_knfsd_fh = 132;
815 i386_linux_record_tdep.size_TASK_COMM_LEN = 16;
816 i386_linux_record_tdep.size_sigaction = 140;
817 i386_linux_record_tdep.size_sigset_t = 8;
818 i386_linux_record_tdep.size_siginfo_t = 128;
819 i386_linux_record_tdep.size_cap_user_data_t = 12;
820 i386_linux_record_tdep.size_stack_t = 12;
821 i386_linux_record_tdep.size_off_t = i386_linux_record_tdep.size_long;
822 i386_linux_record_tdep.size_stat64 = 96;
823 i386_linux_record_tdep.size_gid_t = 2;
824 i386_linux_record_tdep.size_uid_t = 2;
825 i386_linux_record_tdep.size_PAGE_SIZE = 4096;
826 i386_linux_record_tdep.size_flock64 = 24;
827 i386_linux_record_tdep.size_user_desc = 16;
828 i386_linux_record_tdep.size_io_event = 32;
829 i386_linux_record_tdep.size_iocb = 64;
830 i386_linux_record_tdep.size_epoll_event = 12;
2c543fc4
HZ
831 i386_linux_record_tdep.size_itimerspec
832 = i386_linux_record_tdep.size_timespec * 2;
5e31abdf
HZ
833 i386_linux_record_tdep.size_mq_attr = 32;
834 i386_linux_record_tdep.size_siginfo = 128;
835 i386_linux_record_tdep.size_termios = 36;
836 i386_linux_record_tdep.size_termios2 = 44;
837 i386_linux_record_tdep.size_pid_t = 4;
838 i386_linux_record_tdep.size_winsize = 8;
839 i386_linux_record_tdep.size_serial_struct = 60;
840 i386_linux_record_tdep.size_serial_icounter_struct = 80;
841 i386_linux_record_tdep.size_hayes_esp_config = 12;
2c543fc4
HZ
842 i386_linux_record_tdep.size_size_t = 4;
843 i386_linux_record_tdep.size_iovec = 8;
5e31abdf
HZ
844
845 /* These values are the second argument of system call "sys_ioctl".
846 They are obtained from Linux Kernel source. */
847 i386_linux_record_tdep.ioctl_TCGETS = 0x5401;
848 i386_linux_record_tdep.ioctl_TCSETS = 0x5402;
849 i386_linux_record_tdep.ioctl_TCSETSW = 0x5403;
850 i386_linux_record_tdep.ioctl_TCSETSF = 0x5404;
851 i386_linux_record_tdep.ioctl_TCGETA = 0x5405;
852 i386_linux_record_tdep.ioctl_TCSETA = 0x5406;
853 i386_linux_record_tdep.ioctl_TCSETAW = 0x5407;
854 i386_linux_record_tdep.ioctl_TCSETAF = 0x5408;
855 i386_linux_record_tdep.ioctl_TCSBRK = 0x5409;
856 i386_linux_record_tdep.ioctl_TCXONC = 0x540A;
857 i386_linux_record_tdep.ioctl_TCFLSH = 0x540B;
858 i386_linux_record_tdep.ioctl_TIOCEXCL = 0x540C;
859 i386_linux_record_tdep.ioctl_TIOCNXCL = 0x540D;
860 i386_linux_record_tdep.ioctl_TIOCSCTTY = 0x540E;
861 i386_linux_record_tdep.ioctl_TIOCGPGRP = 0x540F;
862 i386_linux_record_tdep.ioctl_TIOCSPGRP = 0x5410;
863 i386_linux_record_tdep.ioctl_TIOCOUTQ = 0x5411;
864 i386_linux_record_tdep.ioctl_TIOCSTI = 0x5412;
865 i386_linux_record_tdep.ioctl_TIOCGWINSZ = 0x5413;
866 i386_linux_record_tdep.ioctl_TIOCSWINSZ = 0x5414;
867 i386_linux_record_tdep.ioctl_TIOCMGET = 0x5415;
868 i386_linux_record_tdep.ioctl_TIOCMBIS = 0x5416;
869 i386_linux_record_tdep.ioctl_TIOCMBIC = 0x5417;
870 i386_linux_record_tdep.ioctl_TIOCMSET = 0x5418;
871 i386_linux_record_tdep.ioctl_TIOCGSOFTCAR = 0x5419;
872 i386_linux_record_tdep.ioctl_TIOCSSOFTCAR = 0x541A;
873 i386_linux_record_tdep.ioctl_FIONREAD = 0x541B;
874 i386_linux_record_tdep.ioctl_TIOCINQ = i386_linux_record_tdep.ioctl_FIONREAD;
875 i386_linux_record_tdep.ioctl_TIOCLINUX = 0x541C;
876 i386_linux_record_tdep.ioctl_TIOCCONS = 0x541D;
877 i386_linux_record_tdep.ioctl_TIOCGSERIAL = 0x541E;
878 i386_linux_record_tdep.ioctl_TIOCSSERIAL = 0x541F;
879 i386_linux_record_tdep.ioctl_TIOCPKT = 0x5420;
880 i386_linux_record_tdep.ioctl_FIONBIO = 0x5421;
881 i386_linux_record_tdep.ioctl_TIOCNOTTY = 0x5422;
882 i386_linux_record_tdep.ioctl_TIOCSETD = 0x5423;
883 i386_linux_record_tdep.ioctl_TIOCGETD = 0x5424;
884 i386_linux_record_tdep.ioctl_TCSBRKP = 0x5425;
885 i386_linux_record_tdep.ioctl_TIOCTTYGSTRUCT = 0x5426;
886 i386_linux_record_tdep.ioctl_TIOCSBRK = 0x5427;
887 i386_linux_record_tdep.ioctl_TIOCCBRK = 0x5428;
888 i386_linux_record_tdep.ioctl_TIOCGSID = 0x5429;
889 i386_linux_record_tdep.ioctl_TCGETS2 = 0x802c542a;
890 i386_linux_record_tdep.ioctl_TCSETS2 = 0x402c542b;
891 i386_linux_record_tdep.ioctl_TCSETSW2 = 0x402c542c;
892 i386_linux_record_tdep.ioctl_TCSETSF2 = 0x402c542d;
893 i386_linux_record_tdep.ioctl_TIOCGPTN = 0x80045430;
894 i386_linux_record_tdep.ioctl_TIOCSPTLCK = 0x40045431;
895 i386_linux_record_tdep.ioctl_FIONCLEX = 0x5450;
896 i386_linux_record_tdep.ioctl_FIOCLEX = 0x5451;
897 i386_linux_record_tdep.ioctl_FIOASYNC = 0x5452;
898 i386_linux_record_tdep.ioctl_TIOCSERCONFIG = 0x5453;
899 i386_linux_record_tdep.ioctl_TIOCSERGWILD = 0x5454;
900 i386_linux_record_tdep.ioctl_TIOCSERSWILD = 0x5455;
901 i386_linux_record_tdep.ioctl_TIOCGLCKTRMIOS = 0x5456;
902 i386_linux_record_tdep.ioctl_TIOCSLCKTRMIOS = 0x5457;
903 i386_linux_record_tdep.ioctl_TIOCSERGSTRUCT = 0x5458;
904 i386_linux_record_tdep.ioctl_TIOCSERGETLSR = 0x5459;
905 i386_linux_record_tdep.ioctl_TIOCSERGETMULTI = 0x545A;
906 i386_linux_record_tdep.ioctl_TIOCSERSETMULTI = 0x545B;
907 i386_linux_record_tdep.ioctl_TIOCMIWAIT = 0x545C;
908 i386_linux_record_tdep.ioctl_TIOCGICOUNT = 0x545D;
909 i386_linux_record_tdep.ioctl_TIOCGHAYESESP = 0x545E;
910 i386_linux_record_tdep.ioctl_TIOCSHAYESESP = 0x545F;
911 i386_linux_record_tdep.ioctl_FIOQSIZE = 0x5460;
912
913 /* These values are the second argument of system call "sys_fcntl"
914 and "sys_fcntl64". They are obtained from Linux Kernel source. */
915 i386_linux_record_tdep.fcntl_F_GETLK = 5;
916 i386_linux_record_tdep.fcntl_F_GETLK64 = 12;
917 i386_linux_record_tdep.fcntl_F_SETLK64 = 13;
918 i386_linux_record_tdep.fcntl_F_SETLKW64 = 14;
50ef67b3 919
77fcef51
HZ
920 i386_linux_record_tdep.arg1 = I386_EBX_REGNUM;
921 i386_linux_record_tdep.arg2 = I386_ECX_REGNUM;
922 i386_linux_record_tdep.arg3 = I386_EDX_REGNUM;
923 i386_linux_record_tdep.arg4 = I386_ESI_REGNUM;
924 i386_linux_record_tdep.arg5 = I386_EDI_REGNUM;
2c543fc4 925 i386_linux_record_tdep.arg6 = I386_EBP_REGNUM;
77fcef51 926
ffdf6de5
JK
927 tdep->i386_intx80_record = i386_linux_intx80_sysenter_syscall_record;
928 tdep->i386_sysenter_record = i386_linux_intx80_sysenter_syscall_record;
929 tdep->i386_syscall_record = i386_linux_intx80_sysenter_syscall_record;
77fcef51 930
203c3895 931 /* N_FUN symbols in shared libaries have 0 for their values and need
1777feb0 932 to be relocated. */
203c3895
UW
933 set_gdbarch_sofun_address_maybe_missing (gdbarch, 1);
934
871fbe6a 935 /* GNU/Linux uses SVR4-style shared libraries. */
982e9687 936 set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
871fbe6a
MK
937 set_solib_svr4_fetch_link_map_offsets
938 (gdbarch, svr4_ilp32_fetch_link_map_offsets);
939
940 /* GNU/Linux uses the dynamic linker included in the GNU C Library. */
bb41a796 941 set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
12b8a2cb
DJ
942
943 dwarf2_frame_set_signal_frame_p (gdbarch, i386_linux_dwarf_signal_frame_p);
b2756930
KB
944
945 /* Enable TLS support. */
946 set_gdbarch_fetch_tls_load_module_address (gdbarch,
947 svr4_fetch_objfile_link_map);
237fc4c9 948
5aa82d05
AA
949 /* Core file support. */
950 set_gdbarch_iterate_over_regset_sections
951 (gdbarch, i386_linux_iterate_over_regset_sections);
90884b2b
L
952 set_gdbarch_core_read_description (gdbarch,
953 i386_linux_core_read_description);
954
237fc4c9
PA
955 /* Displaced stepping. */
956 set_gdbarch_displaced_step_copy_insn (gdbarch,
9a7f938f 957 i386_linux_displaced_step_copy_insn);
237fc4c9
PA
958 set_gdbarch_displaced_step_fixup (gdbarch, i386_displaced_step_fixup);
959 set_gdbarch_displaced_step_free_closure (gdbarch,
960 simple_displaced_step_free_closure);
961 set_gdbarch_displaced_step_location (gdbarch,
962 displaced_step_at_entry_point);
4aa995e1 963
a96d9b2e
SDJ
964 /* Functions for 'catch syscall'. */
965 set_xml_syscall_file_name (XML_SYSCALL_FILENAME_I386);
966 set_gdbarch_get_syscall_number (gdbarch,
967 i386_linux_get_syscall_number);
968
4aa995e1 969 set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
8201327c
MK
970}
971
972/* Provide a prototype to silence -Wmissing-prototypes. */
973extern void _initialize_i386_linux_tdep (void);
974
975void
976_initialize_i386_linux_tdep (void)
977{
05816f70 978 gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LINUX,
8201327c 979 i386_linux_init_abi);
90884b2b 980
1777feb0 981 /* Initialize the Linux target description. */
90884b2b 982 initialize_tdesc_i386_linux ();
3a13a53b 983 initialize_tdesc_i386_mmx_linux ();
c131fcee 984 initialize_tdesc_i386_avx_linux ();
1dbcd68c 985 initialize_tdesc_i386_mpx_linux ();
01f9f808 986 initialize_tdesc_i386_avx512_linux ();
8201327c 987}