/src/elfutils/backends/csky_symbol.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* C-SKY specific symbolic name handling. |
2 | | Copyright (C) 2019 Hangzhou C-SKY Microsystems co.,ltd. |
3 | | This file is part of elfutils. |
4 | | |
5 | | This file is free software; you can redistribute it and/or modify |
6 | | it under the terms of either |
7 | | |
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 |
11 | | |
12 | | or |
13 | | |
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 |
17 | | |
18 | | or both in parallel, as here. |
19 | | |
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. |
24 | | |
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/>. */ |
28 | | |
29 | | #ifdef HAVE_CONFIG_H |
30 | | # include <config.h> |
31 | | #endif |
32 | | |
33 | | #include <assert.h> |
34 | | #include <elf.h> |
35 | | #include <stddef.h> |
36 | | #include <string.h> |
37 | | |
38 | | #define BACKEND csky_ |
39 | | #include "libebl_CPU.h" |
40 | | |
41 | | /* Check for the simple reloc types. */ |
42 | | Elf_Type |
43 | | csky_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type, |
44 | | int *addsub __attribute__ ((unused))) |
45 | 0 | { |
46 | 0 | switch (type) |
47 | 0 | { |
48 | 0 | case R_CKCORE_ADDR32: |
49 | 0 | return ELF_T_WORD; |
50 | 0 | default: |
51 | 0 | return ELF_T_NUM; |
52 | 0 | } |
53 | 0 | } |
54 | | |
55 | | bool |
56 | | csky_machine_flag_check (GElf_Word flags) |
57 | 0 | { |
58 | 0 | switch (flags & EF_CSKY_ABIMASK) |
59 | 0 | { |
60 | 0 | case EF_CSKY_ABIV2: |
61 | 0 | return true; |
62 | 0 | case EF_CSKY_ABIV1: |
63 | 0 | default: |
64 | 0 | return false; |
65 | 0 | } |
66 | 0 | } |
67 | | |
68 | | const char * |
69 | | csky_section_type_name (int type, |
70 | | char *buf __attribute__ ((unused)), |
71 | | size_t len __attribute__ ((unused))) |
72 | 0 | { |
73 | 0 | if (type == SHT_CSKY_ATTRIBUTES) |
74 | 0 | return "CSKY_ATTRIBUTES"; |
75 | | |
76 | 0 | return NULL; |
77 | 0 | } |