1 /* Arm specific symbolic name handling.
2 Copyright (C) 2002-2009, 2014, 2015, 2017 Red Hat, Inc.
3 This file is part of elfutils.
5 This file is free software; you can redistribute it and/or modify
6 it under the terms of either
8 * the GNU Lesser General Public License as published by the Free
9 Software Foundation; either version 3 of the License, or (at
10 your option) any later version
14 * the GNU General Public License as published by the Free
15 Software Foundation; either version 2 of the License, or (at
16 your option) any later version
18 or both in parallel, as here.
20 elfutils is distributed in the hope that it will be useful, but
21 WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 General Public License for more details.
25 You should have received copies of the GNU General Public License and
26 the GNU Lesser General Public License along with this program. If
27 not, see <http://www.gnu.org/licenses/>. */
38 #include "libebl_CPU.h"
42 arm_segment_type_name (int segment, char *buf __attribute__ ((unused)),
43 size_t len __attribute__ ((unused)))
53 /* Return symbolic representation of section type. */
55 arm_section_type_name (int type,
56 char *buf __attribute__ ((unused)),
57 size_t len __attribute__ ((unused)))
63 case SHT_ARM_PREEMPTMAP:
64 return "ARM_PREEMPTMAP";
65 case SHT_ARM_ATTRIBUTES:
66 return "ARM_ATTRIBUTES";
72 /* Check whether machine flags are valid. */
74 arm_machine_flag_check (GElf_Word flags)
76 switch (flags & EF_ARM_EABIMASK)
78 case EF_ARM_EABI_UNKNOWN:
79 case EF_ARM_EABI_VER1:
80 case EF_ARM_EABI_VER2:
81 case EF_ARM_EABI_VER3:
82 case EF_ARM_EABI_VER4:
83 case EF_ARM_EABI_VER5:
89 return ((flags &~ (EF_ARM_EABIMASK
101 | EF_ARM_MAVERICK_FLOAT
102 | EF_ARM_SYMSARESORTED
103 | EF_ARM_DYNSYMSUSESEGIDX
104 | EF_ARM_MAPSYMSFIRST
107 | EF_ARM_LE8)) == 0);
110 /* Check for the simple reloc types. */
112 arm_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type,
113 int *addsub __attribute__ ((unused)))
128 /* The SHT_ARM_EXIDX section type is a valid target for relocation. */
130 arm_check_reloc_target_type (Ebl *ebl __attribute__ ((unused)), Elf64_Word sh_type)
132 return sh_type == SHT_ARM_EXIDX;
136 arm_symbol_type_name (int type,
137 char *buf __attribute__ ((unused)),
138 size_t len __attribute__ ((unused)))
148 /* A data mapping symbol is a symbol with "$d" name or "$d.<any...>" name,
149 * STT_NOTYPE, STB_LOCAL and st_size of zero. The indicate the stat of a
150 * sequence of data items. */
152 arm_data_marker_symbol (const GElf_Sym *sym, const char *sname)
154 return (sym != NULL && sname != NULL
155 && sym->st_size == 0 && GELF_ST_BIND (sym->st_info) == STB_LOCAL
156 && GELF_ST_TYPE (sym->st_info) == STT_NOTYPE
157 && (strcmp (sname, "$d") == 0 || strncmp (sname, "$d.", 3) == 0));