blob: be965fa6b2b1484eeff1cd33f62a33fea25913d1 [file] [log] [blame]
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00001/* Initialization of x86-64 specific backend library.
Mark Wielaard4b0342b2018-11-06 12:01:25 +01002 Copyright (C) 2002-2009, 2013, 2018 Red Hat, Inc.
H.J. Lu28ce4e82015-03-12 14:51:42 -07003 Copyright (C) H.J. Lu <hjl.tools@gmail.com>, 2015.
Mark Wielaardde2ed972012-06-05 17:15:16 +02004 This file is part of elfutils.
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00005 Written by Ulrich Drepper <drepper@redhat.com>, 2002.
6
Mark Wielaardde2ed972012-06-05 17:15:16 +02007 This file is free software; you can redistribute it and/or modify
8 it under the terms of either
Ulrich Drepperb08d5a82005-07-26 05:00:05 +00009
Mark Wielaardde2ed972012-06-05 17:15:16 +020010 * the GNU Lesser General Public License as published by the Free
11 Software Foundation; either version 3 of the License, or (at
12 your option) any later version
13
14 or
15
16 * the GNU General Public License as published by the Free
17 Software Foundation; either version 2 of the License, or (at
18 your option) any later version
19
20 or both in parallel, as here.
21
22 elfutils is distributed in the hope that it will be useful, but
Ulrich Drepper361df7d2006-04-04 21:38:57 +000023 WITHOUT ANY WARRANTY; without even the implied warranty of
24 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 General Public License for more details.
26
Mark Wielaardde2ed972012-06-05 17:15:16 +020027 You should have received copies of the GNU General Public License and
28 the GNU Lesser General Public License along with this program. If
29 not, see <http://www.gnu.org/licenses/>. */
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000030
31#ifdef HAVE_CONFIG_H
32# include <config.h>
33#endif
34
Roland McGrathcd60ea82005-11-16 01:57:40 +000035#define BACKEND x86_64_
36#define RELOC_PREFIX R_X86_64_
37#include "libebl_CPU.h"
38
39/* This defines the common reloc hooks based on x86_64_reloc.def. */
40#include "common-reloc.c"
41
H.J. Lu28ce4e82015-03-12 14:51:42 -070042extern __typeof (EBLHOOK (core_note)) x32_core_note attribute_hidden;
43
Mark Wielaard27a388b2020-06-10 20:55:58 +020044Ebl *
Chih-Hung Hsiehaa1c2ca2015-09-04 12:04:11 -070045x86_64_init (Elf *elf __attribute__ ((unused)),
46 GElf_Half machine __attribute__ ((unused)),
Mark Wielaard27a388b2020-06-10 20:55:58 +020047 Ebl *eh)
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000048{
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000049 /* We handle it. */
Roland McGrathcd60ea82005-11-16 01:57:40 +000050 x86_64_init_reloc (eh);
Roland McGrathf47ba532005-11-19 07:40:29 +000051 HOOK (eh, reloc_simple_type);
Mark Wielaard4b0342b2018-11-06 12:01:25 +010052 HOOK (eh, section_type_name);
H.J. Lu28ce4e82015-03-12 14:51:42 -070053 if (eh->class == ELFCLASS32)
54 eh->core_note = x32_core_note;
55 else
56 HOOK (eh, core_note);
Roland McGrathf47ba532005-11-19 07:40:29 +000057 HOOK (eh, return_value_location);
Roland McGrathc373d852006-10-10 00:25:21 +000058 HOOK (eh, register_info);
Roland McGrathcb6d8652007-08-23 08:10:54 +000059 HOOK (eh, auxv_info);
Ulrich Drepperff993222008-01-09 05:39:28 +000060 HOOK (eh, disasm);
Roland McGrath3c84db32009-06-24 17:41:40 -070061 HOOK (eh, abi_cfi);
Jan Kratochvil0b867462013-05-30 14:37:38 +020062 /* gcc/config/ #define DWARF_FRAME_REGISTERS. */
63 eh->frame_nregs = 17;
64 HOOK (eh, set_initial_registers_tid);
Ulf Hermanna55df2c2017-02-10 15:19:40 +010065 HOOK (eh, unwind);
Mark Wielaard00a25cf2020-11-17 15:08:05 +010066 HOOK (eh, check_reloc_target_type);
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000067
Mark Wielaard27a388b2020-06-10 20:55:58 +020068 return eh;
Ulrich Drepperb08d5a82005-07-26 05:00:05 +000069}