1 /* IA-64 specific symbolic name handling.
2 Copyright (C) 2002-2009, 2014 Red Hat, Inc.
3 This file is part of elfutils.
4 Written by Ulrich Drepper <drepper@redhat.com>, 2002.
6 This file is free software; you can redistribute it and/or modify
7 it under the terms of either
9 * the GNU Lesser General Public License as published by the Free
10 Software Foundation; either version 3 of the License, or (at
11 your option) any later version
15 * the GNU General Public License as published by the Free
16 Software Foundation; either version 2 of the License, or (at
17 your option) any later version
19 or both in parallel, as here.
21 elfutils is distributed in the hope that it will be useful, but
22 WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 General Public License for more details.
26 You should have received copies of the GNU General Public License and
27 the GNU Lesser General Public License along with this program. If
28 not, see <http://www.gnu.org/licenses/>. */
39 #include "libebl_CPU.h"
43 ia64_segment_type_name (int segment, char *buf __attribute__ ((unused)),
44 size_t len __attribute__ ((unused)))
48 case PT_IA_64_ARCHEXT:
49 return "IA_64_ARCHEXT";
51 return "IA_64_UNWIND";
52 case PT_IA_64_HP_OPT_ANOT:
53 return "IA_64_HP_OPT_ANOT";
54 case PT_IA_64_HP_HSL_ANOT:
55 return "IA_64_HP_HSL_ANOT";
56 case PT_IA_64_HP_STACK:
57 return "IA_64_HP_STACK";
65 ia64_dynamic_tag_name (int64_t tag, char *buf __attribute__ ((unused)),
66 size_t len __attribute__ ((unused)))
70 case DT_IA_64_PLT_RESERVE:
71 return "IA_64_PLT_RESERVE";
78 /* Check dynamic tag. */
80 ia64_dynamic_tag_check (int64_t tag)
82 return tag == DT_IA_64_PLT_RESERVE;
85 /* Check whether machine flags are valid. */
87 ia64_machine_flag_check (GElf_Word flags)
89 return ((flags &~ EF_IA_64_ABI64) == 0);
92 /* Check whether SHF_MASKPROC flags are valid. */
94 ia64_machine_section_flag_check (GElf_Xword sh_flags)
96 return (sh_flags &~ (SHF_IA_64_SHORT | SHF_IA_64_NORECOV)) == 0;
99 /* Return symbolic representation of section type. */
101 ia64_section_type_name (int type,
102 char *buf __attribute__ ((unused)),
103 size_t len __attribute__ ((unused)))
109 case SHT_IA_64_UNWIND:
110 return "IA_64_UNWIND";
116 /* Check for the simple reloc types. */
118 ia64_reloc_simple_type (Ebl *ebl, int type,
119 int *addsub __attribute__ ((unused)))
123 /* The SECREL types when used with non-allocated sections
124 like .debug_* are the same as direct absolute relocs
125 applied to those sections, since a 0 section address is assumed.
126 So we treat them the same here. */
128 case R_IA64_SECREL32MSB:
129 case R_IA64_DIR32MSB:
130 if (ebl->data == ELFDATA2MSB)
133 case R_IA64_SECREL32LSB:
134 case R_IA64_DIR32LSB:
135 if (ebl->data == ELFDATA2LSB)
138 case R_IA64_DIR64MSB:
139 case R_IA64_SECREL64MSB:
140 if (ebl->data == ELFDATA2MSB)
143 case R_IA64_SECREL64LSB:
144 case R_IA64_DIR64LSB:
145 if (ebl->data == ELFDATA2LSB)
153 /* The SHT_IA_64_UNWIND section type is a valid target for relocation. */
155 ia64_check_reloc_target_type (Ebl *ebl __attribute__ ((unused)), Elf64_Word sh_type)
157 return sh_type == SHT_IA_64_UNWIND;