1 /* SH ELF support for BFD.
2 Copyright 2003, 2005, 2007 Free Software Foundation, Inc.
4 This file is part of BFD, the Binary File Descriptor library.
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software Foundation,
18 Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
23 #define SH64_CRANGES_SECTION_NAME ".cranges"
24 enum sh64_elf_cr_type {
31 /* The official definition is this:
39 but we have no use for that exact type. Instead we use this struct for
40 the internal representation. */
43 bfd_size_type cr_size;
44 enum sh64_elf_cr_type cr_type;
47 #define SH64_CRANGE_SIZE (4 + 4 + 2)
48 #define SH64_CRANGE_CR_ADDR_OFFSET 0
49 #define SH64_CRANGE_CR_SIZE_OFFSET 4
50 #define SH64_CRANGE_CR_TYPE_OFFSET (4 + 4)
52 /* Get the contents type of an arbitrary address, or return CRT_NONE. */
53 extern enum sh64_elf_cr_type sh64_get_contents_type
54 (asection *, bfd_vma, sh64_elf_crange *);
57 FIXME: This seems redundant now that we export the interface above. */
58 extern bfd_boolean sh64_address_is_shmedia
59 (asection *, bfd_vma);
61 extern int _bfd_sh64_crange_qsort_cmpb
62 (const void *, const void *);
63 extern int _bfd_sh64_crange_qsort_cmpl
64 (const void *, const void *);
65 extern int _bfd_sh64_crange_bsearch_cmpb
66 (const void *, const void *);
67 extern int _bfd_sh64_crange_bsearch_cmpl
68 (const void *, const void *);
70 struct sh64_section_data
72 flagword contents_flags;
74 /* Only used in the cranges section, but we don't have an official
75 backend-specific bfd field. */
76 bfd_size_type cranges_growth;
79 struct _sh64_elf_section_data
81 struct bfd_elf_section_data elf;
82 struct sh64_section_data *sh64_info;
85 #define sh64_elf_section_data(sec) \
86 ((struct _sh64_elf_section_data *) elf_section_data (sec))
88 #endif /* ELF32_SH64_H */