Changeset 609 for branches/GNU/src/binutils/bfd/cpu-h8300.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/bfd/cpu-h8300.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 /* BFD library support routines for the HitachiH8/300 architecture.2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2000 1 /* BFD library support routines for the Renesas H8/300 architecture. 2 Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1996, 2000, 2001, 2002, 2003 3 3 Free Software Foundation, Inc. 4 4 Hacked by Steve Chamberlain of Cygnus Support. 5 5 6 This file is part of BFD, the Binary File Descriptor library.6 This file is part of BFD, the Binary File Descriptor library. 7 7 8 This program is free software; you can redistribute it and/or modify9 it under the terms of the GNU General Public License as published by10 the Free Software Foundation; either version 2 of the License, or11 (at your option) any later version.8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 2 of the License, or 11 (at your option) any later version. 12 12 13 This program is distributed in the hope that it will be useful,14 but WITHOUT ANY WARRANTY; without even the implied warranty of15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 GNU General Public License for more details.13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 17 18 You should have received a copy of the GNU General Public License19 along with this program; if not, write to the Free Software20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */18 You should have received a copy of the GNU General Public License 19 along with this program; if not, write to the Free Software 20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 21 21 22 22 #include "bfd.h" … … 24 24 #include "libbfd.h" 25 25 26 int bfd_default_scan_num_mach (); 26 static bfd_boolean h8300_scan 27 PARAMS ((const struct bfd_arch_info *, const char *)); 28 static const bfd_arch_info_type * compatible 29 PARAMS ((const bfd_arch_info_type *, const bfd_arch_info_type *)); 27 30 28 static b oolean31 static bfd_boolean 29 32 h8300_scan (info, string) 30 33 const struct bfd_arch_info *info; … … 32 35 { 33 36 if (*string != 'h' && *string != 'H') 34 return false;37 return FALSE; 35 38 36 39 string++; 37 40 if (*string != '8') 38 return false;41 return FALSE; 39 42 40 43 string++; … … 43 46 44 47 if (*string != '3') 45 return false;48 return FALSE; 46 49 string++; 47 50 if (*string != '0') 48 return false;51 return FALSE; 49 52 string++; 50 53 if (*string != '0') 51 return false;54 return FALSE; 52 55 string++; 53 56 if (*string == '-') 54 57 string++; 58 59 /* In ELF linker scripts, we typically express the architecture/machine 60 as architecture:machine. 61 62 So if we've matched so far and encounter a colon, try to match the 63 string following the colon. */ 64 if (*string == ':') 65 { 66 string++; 67 return h8300_scan (info, string); 68 } 69 55 70 if (*string == 'h' || *string == 'H') 56 71 { 72 string++; 73 if (*string == 'n' || *string == 'N') 74 return (info->mach == bfd_mach_h8300hn); 75 57 76 return (info->mach == bfd_mach_h8300h); 58 77 } 59 78 else if (*string == 's' || *string == 'S') 60 79 { 80 string++; 81 if (*string == 'n' || *string == 'N') 82 return (info->mach == bfd_mach_h8300sn); 83 61 84 return (info->mach == bfd_mach_h8300s); 62 85 } 63 86 else 64 { 65 return info->mach == bfd_mach_h8300; 66 } 87 return info->mach == bfd_mach_h8300; 67 88 } 68 89 … … 77 98 { 78 99 /* It's really not a good idea to mix and match modes. */ 79 if (in-> mach != out->mach)100 if (in->arch != out->arch || in->mach != out->mach) 80 101 return 0; 81 102 else … … 83 104 } 84 105 85 static const bfd_arch_info_type h8300 _info_struct =106 static const bfd_arch_info_type h8300sn_info_struct = 86 107 { 87 16, /* 16 bits in a word*/88 16, /* 16 bits in an address*/89 8, /* 8 bits in a byte */108 32, /* 32 bits in a word. */ 109 32, /* 32 bits in an address. */ 110 8, /* 8 bits in a byte. */ 90 111 bfd_arch_h8300, 91 bfd_mach_h8300 ,92 "h8300 ", /* arch_name*/93 "h8300 ", /* printable name*/112 bfd_mach_h8300sn, 113 "h8300sn", /* Architecture name. */ 114 "h8300sn", /* Printable name. */ 94 115 1, 95 true, /* the default machine*/116 FALSE, /* The default machine. */ 96 117 compatible, 97 118 h8300_scan, 98 #if 0 99 local_bfd_reloc_type_lookup, 100 #endif 101 0, 119 0 120 }; 121 122 123 static const bfd_arch_info_type h8300hn_info_struct = 124 { 125 32, /* 32 bits in a word. */ 126 32, /* 32 bits in an address. */ 127 8, /* 8 bits in a byte. */ 128 bfd_arch_h8300, 129 bfd_mach_h8300hn, 130 "h8300hn", /* Architecture name. */ 131 "h8300hn", /* Printable name. */ 132 1, 133 FALSE, /* The default machine. */ 134 compatible, 135 h8300_scan, 136 &h8300sn_info_struct 137 }; 138 139 static const bfd_arch_info_type h8300s_info_struct = 140 { 141 32, /* 32 bits in a word. */ 142 32, /* 32 bits in an address. */ 143 8, /* 8 bits in a byte. */ 144 bfd_arch_h8300, 145 bfd_mach_h8300s, 146 "h8300s", /* Architecture name. */ 147 "h8300s", /* Printable name. */ 148 1, 149 FALSE, /* The default machine. */ 150 compatible, 151 h8300_scan, 152 & h8300hn_info_struct 102 153 }; 103 154 104 155 static const bfd_arch_info_type h8300h_info_struct = 105 156 { 106 32, /* 32 bits in a word */107 32, /* 32 bits in an address */108 8, /* 8 bits in a byte */157 32, /* 32 bits in a word. */ 158 32, /* 32 bits in an address. */ 159 8, /* 8 bits in a byte. */ 109 160 bfd_arch_h8300, 110 161 bfd_mach_h8300h, 111 "h8300h", /* arch_name*/112 "h8300h", /* printable name*/162 "h8300h", /* Architecture name. */ 163 "h8300h", /* Printable name. */ 113 164 1, 114 false, /* the default machine*/165 FALSE, /* The default machine. */ 115 166 compatible, 116 167 h8300_scan, 117 #if 0 118 local_bfd_reloc_type_lookup, 119 #endif 120 &h8300_info_struct, 168 &h8300s_info_struct 121 169 }; 122 170 123 171 const bfd_arch_info_type bfd_h8300_arch = 124 172 { 125 32, /* 32 bits in a word*/126 32, /* 32 bits in an address*/127 8, /* 8 bits in a byte */173 16, /* 16 bits in a word. */ 174 16, /* 16 bits in an address. */ 175 8, /* 8 bits in a byte. */ 128 176 bfd_arch_h8300, 129 bfd_mach_h8300 s,130 "h8300 s", /* arch_name*/131 "h8300 s", /* printable name*/177 bfd_mach_h8300, 178 "h8300", /* Architecture name. */ 179 "h8300", /* Printable name. */ 132 180 1, 133 false, /* the default machine*/181 TRUE, /* The default machine. */ 134 182 compatible, 135 183 h8300_scan, 136 #if 0 137 local_bfd_reloc_type_lookup, 138 #endif 139 &h8300h_info_struct, 184 &h8300h_info_struct 140 185 }; -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.