1 |
/* BFD back-end for Motorola 88000 COFF "Binary Compatability Standard" files. |
/* BFD back-end for Motorola 88000 COFF "Binary Compatibility Standard" files. |
2 |
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000, |
Copyright 1990, 1991, 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000, |
3 |
2001 |
2001, 2002, 2003 |
4 |
Free Software Foundation, Inc. |
Free Software Foundation, Inc. |
5 |
Written by Cygnus Support. |
Written by Cygnus Support. |
6 |
|
|
28 |
#include "coff/internal.h" |
#include "coff/internal.h" |
29 |
#include "libcoff.h" |
#include "libcoff.h" |
30 |
|
|
31 |
static boolean m88k_is_local_label_name PARAMS ((bfd *, const char *)); |
static bfd_boolean m88k_is_local_label_name PARAMS ((bfd *, const char *)); |
32 |
static bfd_reloc_status_type m88k_special_reloc |
static bfd_reloc_status_type m88k_special_reloc |
33 |
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); |
PARAMS ((bfd *, arelent *, asymbol *, PTR, asection *, bfd *, char **)); |
34 |
static void rtype2howto PARAMS ((arelent *, struct internal_reloc *)); |
static void rtype2howto PARAMS ((arelent *, struct internal_reloc *)); |
44 |
|
|
45 |
#define coff_bfd_is_local_label_name m88k_is_local_label_name |
#define coff_bfd_is_local_label_name m88k_is_local_label_name |
46 |
|
|
47 |
static boolean |
static bfd_boolean |
48 |
m88k_is_local_label_name (abfd, name) |
m88k_is_local_label_name (abfd, name) |
49 |
bfd *abfd ATTRIBUTE_UNUSED; |
bfd *abfd ATTRIBUTE_UNUSED; |
50 |
const char *name; |
const char *name; |
85 |
asection *reloc_target_output_section; |
asection *reloc_target_output_section; |
86 |
long relocation = 0; |
long relocation = 0; |
87 |
|
|
88 |
/* Work out which section the relocation is targetted at and the |
/* Work out which section the relocation is targeted at and the |
89 |
initial relocation command value. */ |
initial relocation command value. */ |
90 |
|
|
91 |
/* Get symbol value. (Common symbols are special.) */ |
/* Get symbol value. (Common symbols are special.) */ |
120 |
(unsigned char *) data + addr); |
(unsigned char *) data + addr); |
121 |
} |
} |
122 |
|
|
123 |
/* If we are not producing relocateable output, return an error if |
/* If we are not producing relocatable output, return an error if |
124 |
the symbol is not defined. */ |
the symbol is not defined. */ |
125 |
if (bfd_is_und_section (symbol->section) && output_bfd == (bfd *) NULL) |
if (bfd_is_und_section (symbol->section) && output_bfd == (bfd *) NULL) |
126 |
return bfd_reloc_undefined; |
return bfd_reloc_undefined; |
152 |
02, /* rightshift */ |
02, /* rightshift */ |
153 |
1, /* size (0 = byte, 1 = short, 2 = long) */ |
1, /* size (0 = byte, 1 = short, 2 = long) */ |
154 |
16, /* bitsize */ |
16, /* bitsize */ |
155 |
true, /* pc_relative */ |
TRUE, /* pc_relative */ |
156 |
0, /* bitpos */ |
0, /* bitpos */ |
157 |
complain_overflow_signed, /* complain_on_overflow */ |
complain_overflow_signed, /* complain_on_overflow */ |
158 |
m88k_special_reloc, /* special_function */ |
m88k_special_reloc, /* special_function */ |
159 |
"PCR16L", /* name */ |
"PCR16L", /* name */ |
160 |
false, /* partial_inplace */ |
FALSE, /* partial_inplace */ |
161 |
0x0000ffff, /* src_mask */ |
0x0000ffff, /* src_mask */ |
162 |
0x0000ffff, /* dst_mask */ |
0x0000ffff, /* dst_mask */ |
163 |
true), /* pcrel_offset */ |
TRUE), /* pcrel_offset */ |
164 |
|
|
165 |
HOWTO (R_PCR26L, /* type */ |
HOWTO (R_PCR26L, /* type */ |
166 |
02, /* rightshift */ |
02, /* rightshift */ |
167 |
2, /* size (0 = byte, 1 = short, 2 = long) */ |
2, /* size (0 = byte, 1 = short, 2 = long) */ |
168 |
26, /* bitsize */ |
26, /* bitsize */ |
169 |
true, /* pc_relative */ |
TRUE, /* pc_relative */ |
170 |
0, /* bitpos */ |
0, /* bitpos */ |
171 |
complain_overflow_signed, /* complain_on_overflow */ |
complain_overflow_signed, /* complain_on_overflow */ |
172 |
m88k_special_reloc, /* special_function */ |
m88k_special_reloc, /* special_function */ |
173 |
"PCR26L", /* name */ |
"PCR26L", /* name */ |
174 |
false, /* partial_inplace */ |
FALSE, /* partial_inplace */ |
175 |
0x03ffffff, /* src_mask */ |
0x03ffffff, /* src_mask */ |
176 |
0x03ffffff, /* dst_mask */ |
0x03ffffff, /* dst_mask */ |
177 |
true), /* pcrel_offset */ |
TRUE), /* pcrel_offset */ |
178 |
|
|
179 |
HOWTO (R_VRT16, /* type */ |
HOWTO (R_VRT16, /* type */ |
180 |
00, /* rightshift */ |
00, /* rightshift */ |
181 |
1, /* size (0 = byte, 1 = short, 2 = long) */ |
1, /* size (0 = byte, 1 = short, 2 = long) */ |
182 |
16, /* bitsize */ |
16, /* bitsize */ |
183 |
false, /* pc_relative */ |
FALSE, /* pc_relative */ |
184 |
0, /* bitpos */ |
0, /* bitpos */ |
185 |
complain_overflow_bitfield, /* complain_on_overflow */ |
complain_overflow_bitfield, /* complain_on_overflow */ |
186 |
m88k_special_reloc, /* special_function */ |
m88k_special_reloc, /* special_function */ |
187 |
"VRT16", /* name */ |
"VRT16", /* name */ |
188 |
false, /* partial_inplace */ |
FALSE, /* partial_inplace */ |
189 |
0x0000ffff, /* src_mask */ |
0x0000ffff, /* src_mask */ |
190 |
0x0000ffff, /* dst_mask */ |
0x0000ffff, /* dst_mask */ |
191 |
true), /* pcrel_offset */ |
TRUE), /* pcrel_offset */ |
192 |
|
|
193 |
HOWTO (R_HVRT16, /* type */ |
HOWTO (R_HVRT16, /* type */ |
194 |
16, /* rightshift */ |
16, /* rightshift */ |
195 |
1, /* size (0 = byte, 1 = short, 2 = long) */ |
1, /* size (0 = byte, 1 = short, 2 = long) */ |
196 |
16, /* bitsize */ |
16, /* bitsize */ |
197 |
false, /* pc_relative */ |
FALSE, /* pc_relative */ |
198 |
0, /* bitpos */ |
0, /* bitpos */ |
199 |
complain_overflow_dont, /* complain_on_overflow */ |
complain_overflow_dont, /* complain_on_overflow */ |
200 |
m88k_special_reloc, /* special_function */ |
m88k_special_reloc, /* special_function */ |
201 |
"HVRT16", /* name */ |
"HVRT16", /* name */ |
202 |
false, /* partial_inplace */ |
FALSE, /* partial_inplace */ |
203 |
0x0000ffff, /* src_mask */ |
0x0000ffff, /* src_mask */ |
204 |
0x0000ffff, /* dst_mask */ |
0x0000ffff, /* dst_mask */ |
205 |
true), /* pcrel_offset */ |
TRUE), /* pcrel_offset */ |
206 |
|
|
207 |
HOWTO (R_LVRT16, /* type */ |
HOWTO (R_LVRT16, /* type */ |
208 |
00, /* rightshift */ |
00, /* rightshift */ |
209 |
1, /* size (0 = byte, 1 = short, 2 = long) */ |
1, /* size (0 = byte, 1 = short, 2 = long) */ |
210 |
16, /* bitsize */ |
16, /* bitsize */ |
211 |
false, /* pc_relative */ |
FALSE, /* pc_relative */ |
212 |
0, /* bitpos */ |
0, /* bitpos */ |
213 |
complain_overflow_dont, /* complain_on_overflow */ |
complain_overflow_dont, /* complain_on_overflow */ |
214 |
m88k_special_reloc, /* special_function */ |
m88k_special_reloc, /* special_function */ |
215 |
"LVRT16", /* name */ |
"LVRT16", /* name */ |
216 |
false, /* partial_inplace */ |
FALSE, /* partial_inplace */ |
217 |
0x0000ffff, /* src_mask */ |
0x0000ffff, /* src_mask */ |
218 |
0x0000ffff, /* dst_mask */ |
0x0000ffff, /* dst_mask */ |
219 |
true), /* pcrel_offset */ |
TRUE), /* pcrel_offset */ |
220 |
|
|
221 |
HOWTO (R_VRT32, /* type */ |
HOWTO (R_VRT32, /* type */ |
222 |
00, /* rightshift */ |
00, /* rightshift */ |
223 |
2, /* size (0 = byte, 1 = short, 2 = long) */ |
2, /* size (0 = byte, 1 = short, 2 = long) */ |
224 |
32, /* bitsize */ |
32, /* bitsize */ |
225 |
false, /* pc_relative */ |
FALSE, /* pc_relative */ |
226 |
0, /* bitpos */ |
0, /* bitpos */ |
227 |
complain_overflow_bitfield, /* complain_on_overflow */ |
complain_overflow_bitfield, /* complain_on_overflow */ |
228 |
m88k_special_reloc, /* special_function */ |
m88k_special_reloc, /* special_function */ |
229 |
"VRT32", /* name */ |
"VRT32", /* name */ |
230 |
false, /* partial_inplace */ |
FALSE, /* partial_inplace */ |
231 |
0xffffffff, /* src_mask */ |
0xffffffff, /* src_mask */ |
232 |
0xffffffff, /* dst_mask */ |
0xffffffff, /* dst_mask */ |
233 |
true), /* pcrel_offset */ |
TRUE), /* pcrel_offset */ |
234 |
}; |
}; |
235 |
|
|
236 |
/* Code to turn an external r_type into a pointer to an entry in the |
/* Code to turn an external r_type into a pointer to an entry in the |
288 |
|
|
289 |
#undef coff_write_armap |
#undef coff_write_armap |
290 |
|
|
291 |
CREATE_BIG_COFF_TARGET_VEC (m88kbcs_vec, "coff-m88kbcs", 0, 0, '_', NULL) |
CREATE_BIG_COFF_TARGET_VEC (m88kbcs_vec, "coff-m88kbcs", 0, 0, '_', NULL, COFF_SWAP_TABLE) |