blob: 269d12e5bbe442d738f24d723fab9ca1199e36f6 [file] [log] [blame]
Brian Silverman86497922018-02-10 19:28:39 -05001/* m68k specific symbolic name handling.
2 This file is part of elfutils.
3
4 This file is free software; you can redistribute it and/or modify
5 it under the terms of either
6
7 * the GNU Lesser General Public License as published by the Free
8 Software Foundation; either version 3 of the License, or (at
9 your option) any later version
10
11 or
12
13 * the GNU General Public License as published by the Free
14 Software Foundation; either version 2 of the License, or (at
15 your option) any later version
16
17 or both in parallel, as here.
18
19 elfutils is distributed in the hope that it will be useful, but
20 WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 General Public License for more details.
23
24 You should have received copies of the GNU General Public License and
25 the GNU Lesser General Public License along with this program. If
26 not, see <http://www.gnu.org/licenses/>. */
27
28#ifdef HAVE_CONFIG_H
29# include <config.h>
30#endif
31
32#include <assert.h>
33#include <elf.h>
34#include <stddef.h>
35#include <string.h>
36
37#define BACKEND m68k_
38#include "libebl_CPU.h"
39
40
41/* Return true if the symbol type is that referencing the GOT. */
42bool
43m68k_gotpc_reloc_check (Elf *elf __attribute__ ((unused)), int type)
44{
45 switch (type)
46 {
47 case R_68K_GOT32:
48 case R_68K_GOT16:
49 case R_68K_GOT8:
50 return true;
51 }
52 return false;
53}
54
55/* Check for the simple reloc types. */
56Elf_Type
57m68k_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type)
58{
59 switch (type)
60 {
61 case R_68K_32:
62 return ELF_T_SWORD;
63 case R_68K_16:
64 return ELF_T_HALF;
65 case R_68K_8:
66 return ELF_T_BYTE;
67 default:
68 return ELF_T_NUM;
69 }
70}