/[gcl]/gcl/binutils/bfd/elf32-i860.c
ViewVC logotype

Diff of /gcl/binutils/bfd/elf32-i860.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by camm, Fri Aug 9 05:35:15 2002 UTC revision 1.1.1.1.20.1 by camm, Fri Sep 30 02:08:58 2005 UTC
# Line 1  Line 1 
1  /* Intel i860 specific support for 32-bit ELF.  /* Intel i860 specific support for 32-bit ELF.
2     Copyright 1993, 1995, 1999, 2000, 2001, 2002     Copyright 1993, 1995, 1999, 2000, 2001, 2002, 2003, 2004, 2005
3     Free Software Foundation, Inc.     Free Software Foundation, Inc.
4    
5     Full i860 support contributed by Jason Eckhardt <jle@cygnus.com>.     Full i860 support contributed by Jason Eckhardt <jle@cygnus.com>.
# Line 26  Foundation, Inc., 59 Temple Place - Suit Line 26  Foundation, Inc., 59 Temple Place - Suit
26  #include "elf-bfd.h"  #include "elf-bfd.h"
27  #include "elf/i860.h"  #include "elf/i860.h"
28    
29  /* Prototypes.  */  /* special_function for R_860_PC26 relocation.  */
30  static reloc_howto_type *lookup_howto  static bfd_reloc_status_type
31    PARAMS ((unsigned int));  i860_howto_pc26_reloc (bfd *abfd ATTRIBUTE_UNUSED,
32                           arelent *reloc_entry,
33                           asymbol *symbol,
34                           void *data ATTRIBUTE_UNUSED,
35                           asection *input_section,
36                           bfd *output_bfd,
37                           char **error_message ATTRIBUTE_UNUSED)
38    {
39      bfd_vma insn;
40      bfd_vma relocation;
41      bfd_byte *addr;
42    
43      if (output_bfd != NULL
44          && (symbol->flags & BSF_SECTION_SYM) == 0
45          && (! reloc_entry->howto->partial_inplace
46              || reloc_entry->addend == 0))
47        {
48          reloc_entry->address += input_section->output_offset;
49          return bfd_reloc_ok;
50        }
51    
52      /* Used elf32-mips.c as an example.  */
53      if (bfd_is_und_section (symbol->section)
54          && output_bfd == (bfd *) NULL)
55        return bfd_reloc_undefined;
56    
57      if (bfd_is_com_section (symbol->section))
58        relocation = 0;
59      else
60        relocation = symbol->value;
61    
62      relocation += symbol->section->output_section->vma;
63      relocation += symbol->section->output_offset;
64      relocation += reloc_entry->addend;
65    
66      if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
67        return bfd_reloc_outofrange;
68    
69      /* Adjust for PC-relative relocation.  */
70      relocation -= (input_section->output_section->vma
71                     + input_section->output_offset
72                     + reloc_entry->address
73                     + 4);
74    
75      /* Check for target out of range.  */
76      if ((bfd_signed_vma)relocation > (0x3ffffff << 2)
77          || (bfd_signed_vma)relocation < (-0x4000000 << 2))
78        return bfd_reloc_outofrange;
79    
80      addr = (bfd_byte *) data + reloc_entry->address;
81      insn = bfd_get_32 (abfd, addr);
82    
83      relocation >>= reloc_entry->howto->rightshift;
84      insn = (insn & ~reloc_entry->howto->dst_mask)
85             | (relocation & reloc_entry->howto->dst_mask);
86    
87      bfd_put_32 (abfd, (bfd_vma) insn, addr);
88    
89      return bfd_reloc_ok;
90    }
91    
92    /* special_function for R_860_PC16 relocation.  */
93    static bfd_reloc_status_type
94    i860_howto_pc16_reloc (bfd *abfd,
95                           arelent *reloc_entry,
96                           asymbol *symbol,
97                           void *data,
98                           asection *input_section,
99                           bfd *output_bfd,
100                           char **error_message ATTRIBUTE_UNUSED)
101    {
102      bfd_vma insn;
103      bfd_vma relocation;
104      bfd_byte *addr;
105    
106      if (output_bfd != NULL
107          && (symbol->flags & BSF_SECTION_SYM) == 0
108          && (! reloc_entry->howto->partial_inplace
109              || reloc_entry->addend == 0))
110        {
111          reloc_entry->address += input_section->output_offset;
112          return bfd_reloc_ok;
113        }
114    
115      /* Used elf32-mips.c as an example.  */
116      if (bfd_is_und_section (symbol->section)
117          && output_bfd == (bfd *) NULL)
118        return bfd_reloc_undefined;
119    
120      if (bfd_is_com_section (symbol->section))
121        relocation = 0;
122      else
123        relocation = symbol->value;
124    
125      relocation += symbol->section->output_section->vma;
126      relocation += symbol->section->output_offset;
127      relocation += reloc_entry->addend;
128    
129  static reloc_howto_type *elf32_i860_reloc_type_lookup    if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
130    PARAMS ((bfd *abfd, bfd_reloc_code_real_type code));      return bfd_reloc_outofrange;
131    
132  static void elf32_i860_info_to_howto_rela    /* Adjust for PC-relative relocation.  */
133    PARAMS ((bfd *, arelent *, Elf32_Internal_Rela *));    relocation -= (input_section->output_section->vma
134                     + input_section->output_offset
135                     + reloc_entry->address
136                     + 4);
137    
138      /* Check for target out of range.  */
139      if ((bfd_signed_vma)relocation > (0x7fff << 2)
140          || (bfd_signed_vma)relocation < (-0x8000 << 2))
141        return bfd_reloc_outofrange;
142    
143      addr = (bfd_byte *) data + reloc_entry->address;
144      insn = bfd_get_32 (abfd, addr);
145    
146      relocation >>= reloc_entry->howto->rightshift;
147      relocation = (((relocation & 0xf800) << 5) | (relocation & 0x7ff))
148                   & reloc_entry->howto->dst_mask;
149      insn = (insn & ~reloc_entry->howto->dst_mask) | relocation;
150    
151      bfd_put_32 (abfd, (bfd_vma) insn, addr);
152    
153      return bfd_reloc_ok;
154    }
155    
156    /* special_function for R_860_HIGHADJ relocation.  */
157    static bfd_reloc_status_type
158    i860_howto_highadj_reloc (bfd *abfd,
159                              arelent *reloc_entry,
160                              asymbol *symbol,
161                              void *data,
162                              asection *input_section,
163                              bfd *output_bfd,
164                              char **error_message ATTRIBUTE_UNUSED)
165    {
166      bfd_vma insn;
167      bfd_vma relocation;
168      bfd_byte *addr;
169    
170      if (output_bfd != NULL
171          && (symbol->flags & BSF_SECTION_SYM) == 0
172          && (! reloc_entry->howto->partial_inplace
173              || reloc_entry->addend == 0))
174        {
175          reloc_entry->address += input_section->output_offset;
176          return bfd_reloc_ok;
177        }
178    
179  static bfd_reloc_status_type elf32_i860_relocate_splitn    /* Used elf32-mips.c as an example.  */
180    PARAMS ((bfd *,  Elf_Internal_Rela *, bfd_byte *, bfd_vma));    if (bfd_is_und_section (symbol->section)
181          && output_bfd == (bfd *) NULL)
182        return bfd_reloc_undefined;
183    
184  static bfd_reloc_status_type elf32_i860_relocate_pc16    if (bfd_is_com_section (symbol->section))
185    PARAMS ((bfd *,  asection *, Elf_Internal_Rela *, bfd_byte *, bfd_vma));      relocation = 0;
186      else
187        relocation = symbol->value;
188    
189  static bfd_reloc_status_type elf32_i860_relocate_pc26    relocation += symbol->section->output_section->vma;
190    PARAMS ((bfd *,  asection *, Elf_Internal_Rela *, bfd_byte *, bfd_vma));    relocation += symbol->section->output_offset;
191      relocation += reloc_entry->addend;
192      relocation += 0x8000;
193    
194  static bfd_reloc_status_type elf32_i860_relocate_highadj    if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
195    PARAMS ((bfd *,  Elf_Internal_Rela *, bfd_byte *, bfd_vma));      return bfd_reloc_outofrange;
196    
197  static boolean elf32_i860_relocate_section    addr = (bfd_byte *) data + reloc_entry->address;
198    PARAMS ((bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *,    insn = bfd_get_32 (abfd, addr);
            Elf_Internal_Rela *, Elf_Internal_Sym *, asection **));  
199    
200  static bfd_reloc_status_type i860_final_link_relocate    relocation = ((relocation >> 16) & 0xffff);
   PARAMS ((reloc_howto_type *, bfd *, asection *, bfd_byte *,  
            Elf_Internal_Rela *, bfd_vma));  
201    
202  static boolean elf32_i860_is_local_label_name    insn = (insn & 0xffff0000) | relocation;
203    PARAMS ((bfd *, const char *));  
204      bfd_put_32 (abfd, (bfd_vma) insn, addr);
205    
206      return bfd_reloc_ok;
207    }
208    
209    /* special_function for R_860_SPLITn relocations.  */
210    static bfd_reloc_status_type
211    i860_howto_splitn_reloc (bfd *abfd,
212                             arelent *reloc_entry,
213                             asymbol *symbol,
214                             void *data,
215                             asection *input_section,
216                             bfd *output_bfd,
217                             char **error_message ATTRIBUTE_UNUSED)
218    {
219      bfd_vma insn;
220      bfd_vma relocation;
221      bfd_byte *addr;
222    
223      if (output_bfd != NULL
224          && (symbol->flags & BSF_SECTION_SYM) == 0
225          && (! reloc_entry->howto->partial_inplace
226              || reloc_entry->addend == 0))
227        {
228          reloc_entry->address += input_section->output_offset;
229          return bfd_reloc_ok;
230        }
231    
232      /* Used elf32-mips.c as an example.  */
233      if (bfd_is_und_section (symbol->section)
234          && output_bfd == (bfd *) NULL)
235        return bfd_reloc_undefined;
236    
237      if (bfd_is_com_section (symbol->section))
238        relocation = 0;
239      else
240        relocation = symbol->value;
241    
242      relocation += symbol->section->output_section->vma;
243      relocation += symbol->section->output_offset;
244      relocation += reloc_entry->addend;
245    
246      if (reloc_entry->address > bfd_get_section_limit (abfd, input_section))
247        return bfd_reloc_outofrange;
248    
249      addr = (bfd_byte *) data + reloc_entry->address;
250      insn = bfd_get_32 (abfd, addr);
251    
252      relocation = (((relocation & 0xf800) << 5) | (relocation & 0x7ff))
253                   & reloc_entry->howto->dst_mask;
254      insn = (insn & ~reloc_entry->howto->dst_mask) | relocation;
255    
256      bfd_put_32 (abfd, (bfd_vma) insn, addr);
257    
258      return bfd_reloc_ok;
259    }
260    
261  /* This howto table is preliminary.  */  /* This howto table is preliminary.  */
262  static reloc_howto_type elf32_i860_howto_table [] =  static reloc_howto_type elf32_i860_howto_table [] =
# Line 67  static reloc_howto_type elf32_i860_howto Line 266  static reloc_howto_type elf32_i860_howto
266           0,                     /* rightshift */           0,                     /* rightshift */
267           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
268           32,                    /* bitsize */           32,                    /* bitsize */
269           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
270           0,                     /* bitpos */           0,                     /* bitpos */
271           complain_overflow_bitfield, /* complain_on_overflow */           complain_overflow_bitfield, /* complain_on_overflow */
272           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
273           "R_860_NONE",          /* name */           "R_860_NONE",          /* name */
274           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
275           0,                     /* src_mask */           0,                     /* src_mask */
276           0,                     /* dst_mask */           0,                     /* dst_mask */
277           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
278    
279    /* A 32-bit absolute relocation.  */    /* A 32-bit absolute relocation.  */
280    HOWTO (R_860_32,              /* type */    HOWTO (R_860_32,              /* type */
281           0,                     /* rightshift */           0,                     /* rightshift */
282           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
283           32,                    /* bitsize */           32,                    /* bitsize */
284           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
285           0,                     /* bitpos */           0,                     /* bitpos */
286           complain_overflow_bitfield, /* complain_on_overflow */           complain_overflow_bitfield, /* complain_on_overflow */
287           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
288           "R_860_32",            /* name */           "R_860_32",            /* name */
289           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
290           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
291           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
292           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
293    
294    HOWTO (R_860_COPY,            /* type */    HOWTO (R_860_COPY,            /* type */
295           0,                     /* rightshift */           0,                     /* rightshift */
296           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
297           32,                    /* bitsize */           32,                    /* bitsize */
298           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
299           0,                     /* bitpos */           0,                     /* bitpos */
300           complain_overflow_bitfield, /* complain_on_overflow */           complain_overflow_bitfield, /* complain_on_overflow */
301           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
302           "R_860_COPY",          /* name */           "R_860_COPY",          /* name */
303           true,                  /* partial_inplace */           TRUE,                  /* partial_inplace */
304           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
305           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
306           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
307    
308    HOWTO (R_860_GLOB_DAT,        /* type */    HOWTO (R_860_GLOB_DAT,        /* type */
309           0,                     /* rightshift */           0,                     /* rightshift */
310           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
311           32,                    /* bitsize */           32,                    /* bitsize */
312           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
313           0,                     /* bitpos */           0,                     /* bitpos */
314           complain_overflow_bitfield, /* complain_on_overflow */           complain_overflow_bitfield, /* complain_on_overflow */
315           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
316           "R_860_GLOB_DAT",      /* name */           "R_860_GLOB_DAT",      /* name */
317           true,                  /* partial_inplace */           TRUE,                  /* partial_inplace */
318           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
319           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
320           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
321    
322    HOWTO (R_860_JUMP_SLOT,       /* type */    HOWTO (R_860_JUMP_SLOT,       /* type */
323           0,                     /* rightshift */           0,                     /* rightshift */
324           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
325           32,                    /* bitsize */           32,                    /* bitsize */
326           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
327           0,                     /* bitpos */           0,                     /* bitpos */
328           complain_overflow_bitfield, /* complain_on_overflow */           complain_overflow_bitfield, /* complain_on_overflow */
329           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
330           "R_860_JUMP_SLOT",     /* name */           "R_860_JUMP_SLOT",     /* name */
331           true,                  /* partial_inplace */           TRUE,                  /* partial_inplace */
332           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
333           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
334           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
335    
336    HOWTO (R_860_RELATIVE,        /* type */    HOWTO (R_860_RELATIVE,        /* type */
337           0,                     /* rightshift */           0,                     /* rightshift */
338           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
339           32,                    /* bitsize */           32,                    /* bitsize */
340           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
341           0,                     /* bitpos */           0,                     /* bitpos */
342           complain_overflow_bitfield, /* complain_on_overflow */           complain_overflow_bitfield, /* complain_on_overflow */
343           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
344           "R_860_RELATIVE",      /* name */           "R_860_RELATIVE",      /* name */
345           true,                  /* partial_inplace */           TRUE,                  /* partial_inplace */
346           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
347           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
348           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
349    
350    /* A 26-bit PC-relative relocation.  */    /* A 26-bit PC-relative relocation.  */
351    HOWTO (R_860_PC26,            /* type */    HOWTO (R_860_PC26,            /* type */
352           2,                     /* rightshift */           2,                     /* rightshift */
353           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
354           26,                    /* bitsize */           26,                    /* bitsize */
355           true,                  /* pc_relative */           TRUE,                  /* pc_relative */
356           0,                     /* bitpos */           0,                     /* bitpos */
357           complain_overflow_bitfield, /* complain_on_overflow */           complain_overflow_bitfield, /* complain_on_overflow */
358           bfd_elf_generic_reloc, /* special_function */           i860_howto_pc26_reloc, /* special_function */
359           "R_860_PC26",          /* name */           "R_860_PC26",          /* name */
360           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
361           0x3ffffff,             /* src_mask */           0x3ffffff,             /* src_mask */
362           0x3ffffff,             /* dst_mask */           0x3ffffff,             /* dst_mask */
363           true),                 /* pcrel_offset */           TRUE),                 /* pcrel_offset */
364    
365    HOWTO (R_860_PLT26,           /* type */    HOWTO (R_860_PLT26,           /* type */
366           0,                     /* rightshift */           0,                     /* rightshift */
367           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
368           26,                    /* bitsize */           26,                    /* bitsize */
369           true,                  /* pc_relative */           TRUE,                  /* pc_relative */
370           0,                     /* bitpos */           0,                     /* bitpos */
371           complain_overflow_bitfield, /* complain_on_overflow */           complain_overflow_bitfield, /* complain_on_overflow */
372           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
373           "R_860_PLT26",         /* name */           "R_860_PLT26",         /* name */
374           true,                  /* partial_inplace */           TRUE,                  /* partial_inplace */
375           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
376           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
377           true),                 /* pcrel_offset */           TRUE),                 /* pcrel_offset */
378    
379    /* A 16-bit PC-relative relocation.  */    /* A 16-bit PC-relative relocation.  */
380    HOWTO (R_860_PC16,            /* type */    HOWTO (R_860_PC16,            /* type */
381           2,                     /* rightshift */           2,                     /* rightshift */
382           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
383           16,                    /* bitsize */           16,                    /* bitsize */
384           true,                  /* pc_relative */           TRUE,                  /* pc_relative */
385           0,                     /* bitpos */           0,                     /* bitpos */
386           complain_overflow_bitfield, /* complain_on_overflow */           complain_overflow_bitfield, /* complain_on_overflow */
387           bfd_elf_generic_reloc, /* special_function */           i860_howto_pc16_reloc, /* special_function */
388           "R_860_PC16",          /* name */           "R_860_PC16",          /* name */
389           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
390           0x1f07ff,              /* src_mask */           0x1f07ff,              /* src_mask */
391           0x1f07ff,              /* dst_mask */           0x1f07ff,              /* dst_mask */
392           true),                 /* pcrel_offset */           TRUE),                 /* pcrel_offset */
393    
394    HOWTO (R_860_LOW0,            /* type */    HOWTO (R_860_LOW0,            /* type */
395           0,                     /* rightshift */           0,                     /* rightshift */
396           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
397           16,                    /* bitsize */           16,                    /* bitsize */
398           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
399           0,                     /* bitpos */           0,                     /* bitpos */
400           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
401           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
402           "R_860_LOW0",          /* name */           "R_860_LOW0",          /* name */
403           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
404           0xffff,                /* src_mask */           0xffff,                /* src_mask */
405           0xffff,                /* dst_mask */           0xffff,                /* dst_mask */
406           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
407    
408    HOWTO (R_860_SPLIT0,          /* type */    HOWTO (R_860_SPLIT0,          /* type */
409           0,                     /* rightshift */           0,                     /* rightshift */
410           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
411           16,                    /* bitsize */           16,                    /* bitsize */
412           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
413           0,                     /* bitpos */           0,                     /* bitpos */
414           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
415           bfd_elf_generic_reloc, /* special_function */           i860_howto_splitn_reloc, /* special_function */
416           "R_860_SPLIT0",        /* name */           "R_860_SPLIT0",        /* name */
417           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
418           0x1f07ff,              /* src_mask */           0x1f07ff,              /* src_mask */
419           0x1f07ff,              /* dst_mask */           0x1f07ff,              /* dst_mask */
420           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
421    
422    HOWTO (R_860_LOW1,            /* type */    HOWTO (R_860_LOW1,            /* type */
423           0,                     /* rightshift */           0,                     /* rightshift */
424           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
425           16,                    /* bitsize */           16,                    /* bitsize */
426           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
427           0,                     /* bitpos */           0,                     /* bitpos */
428           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
429           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
430           "R_860_LOW1",          /* name */           "R_860_LOW1",          /* name */
431           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
432           0xfffe,                /* src_mask */           0xfffe,                /* src_mask */
433           0xfffe,                /* dst_mask */           0xfffe,                /* dst_mask */
434           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
435    
436    HOWTO (R_860_SPLIT1,          /* type */    HOWTO (R_860_SPLIT1,          /* type */
437           0,                     /* rightshift */           0,                     /* rightshift */
438           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
439           16,                    /* bitsize */           16,                    /* bitsize */
440           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
441           0,                     /* bitpos */           0,                     /* bitpos */
442           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
443           bfd_elf_generic_reloc, /* special_function */           i860_howto_splitn_reloc, /* special_function */
444           "R_860_SPLIT1",        /* name */           "R_860_SPLIT1",        /* name */
445           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
446           0x1f07fe,              /* src_mask */           0x1f07fe,              /* src_mask */
447           0x1f07fe,              /* dst_mask */           0x1f07fe,              /* dst_mask */
448           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
449    
450    HOWTO (R_860_LOW2,            /* type */    HOWTO (R_860_LOW2,            /* type */
451           0,                     /* rightshift */           0,                     /* rightshift */
452           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
453           16,                    /* bitsize */           16,                    /* bitsize */
454           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
455           0,                     /* bitpos */           0,                     /* bitpos */
456           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
457           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
458           "R_860_LOW2",          /* name */           "R_860_LOW2",          /* name */
459           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
460           0xfffc,                /* src_mask */           0xfffc,                /* src_mask */
461           0xfffc,                /* dst_mask */           0xfffc,                /* dst_mask */
462           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
463    
464    HOWTO (R_860_SPLIT2,          /* type */    HOWTO (R_860_SPLIT2,          /* type */
465           0,                     /* rightshift */           0,                     /* rightshift */
466           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
467           16,                    /* bitsize */           16,                    /* bitsize */
468           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
469           0,                     /* bitpos */           0,                     /* bitpos */
470           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
471           bfd_elf_generic_reloc, /* special_function */           i860_howto_splitn_reloc, /* special_function */
472           "R_860_SPLIT2",        /* name */           "R_860_SPLIT2",        /* name */
473           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
474           0x1f07fc,              /* src_mask */           0x1f07fc,              /* src_mask */
475           0x1f07fc,              /* dst_mask */           0x1f07fc,              /* dst_mask */
476           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
477    
478    HOWTO (R_860_LOW3,            /* type */    HOWTO (R_860_LOW3,            /* type */
479           0,                     /* rightshift */           0,                     /* rightshift */
480           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
481           16,                    /* bitsize */           16,                    /* bitsize */
482           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
483           0,                     /* bitpos */           0,                     /* bitpos */
484           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
485           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
486           "R_860_LOW3",          /* name */           "R_860_LOW3",          /* name */
487           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
488           0xfff8,                /* src_mask */           0xfff8,                /* src_mask */
489           0xfff8,                /* dst_mask */           0xfff8,                /* dst_mask */
490           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
491    
492    HOWTO (R_860_LOGOT0,          /* type */    HOWTO (R_860_LOGOT0,          /* type */
493           0,                     /* rightshift */           0,                     /* rightshift */
494           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
495           16,                    /* bitsize */           16,                    /* bitsize */
496           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
497           0,                     /* bitpos */           0,                     /* bitpos */
498           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
499           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
500           "R_860_LOGOT0",        /* name */           "R_860_LOGOT0",        /* name */
501           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
502           0,                     /* src_mask */           0,                     /* src_mask */
503           0xffff,                /* dst_mask */           0xffff,                /* dst_mask */
504           true),                 /* pcrel_offset */           TRUE),                 /* pcrel_offset */
505    
506    HOWTO (R_860_SPGOT0,          /* type */    HOWTO (R_860_SPGOT0,          /* type */
507           0,                     /* rightshift */           0,                     /* rightshift */
508           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
509           16,                    /* bitsize */           16,                    /* bitsize */
510           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
511           0,                     /* bitpos */           0,                     /* bitpos */
512           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
513           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
514           "R_860_SPGOT0",        /* name */           "R_860_SPGOT0",        /* name */
515           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
516           0,                     /* src_mask */           0,                     /* src_mask */
517           0xffff,                /* dst_mask */           0xffff,                /* dst_mask */
518           true),                 /* pcrel_offset */           TRUE),                 /* pcrel_offset */
519    
520    HOWTO (R_860_LOGOT1,          /* type */    HOWTO (R_860_LOGOT1,          /* type */
521           0,                     /* rightshift */           0,                     /* rightshift */
522           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
523           16,                    /* bitsize */           16,                    /* bitsize */
524           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
525           0,                     /* bitpos */           0,                     /* bitpos */
526           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
527           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
528           "R_860_LOGOT1",        /* name */           "R_860_LOGOT1",        /* name */
529           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
530           0,                     /* src_mask */           0,                     /* src_mask */
531           0xffff,                /* dst_mask */           0xffff,                /* dst_mask */
532           true),                 /* pcrel_offset */           TRUE),                 /* pcrel_offset */
533    
534    HOWTO (R_860_SPGOT1,          /* type */    HOWTO (R_860_SPGOT1,          /* type */
535           0,                     /* rightshift */           0,                     /* rightshift */
536           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
537           16,                    /* bitsize */           16,                    /* bitsize */
538           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
539           0,                     /* bitpos */           0,                     /* bitpos */
540           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
541           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
542           "R_860_SPGOT1",        /* name */           "R_860_SPGOT1",        /* name */
543           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
544           0,                     /* src_mask */           0,                     /* src_mask */
545           0xffff,                /* dst_mask */           0xffff,                /* dst_mask */
546           true),                 /* pcrel_offset */           TRUE),                 /* pcrel_offset */
547    
548    HOWTO (R_860_LOGOTOFF0,        /* type */    HOWTO (R_860_LOGOTOFF0,        /* type */
549           0,                     /* rightshift */           0,                     /* rightshift */
550           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
551           32,                    /* bitsize */           32,                    /* bitsize */
552           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
553           0,                     /* bitpos */           0,                     /* bitpos */
554           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
555           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
556           "R_860_LOGOTOFF0",     /* name */           "R_860_LOGOTOFF0",     /* name */
557           true,                  /* partial_inplace */           TRUE,                  /* partial_inplace */
558           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
559           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
560           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
561    
562    HOWTO (R_860_SPGOTOFF0,        /* type */    HOWTO (R_860_SPGOTOFF0,        /* type */
563           0,                     /* rightshift */           0,                     /* rightshift */
564           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
565           32,                    /* bitsize */           32,                    /* bitsize */
566           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
567           0,                     /* bitpos */           0,                     /* bitpos */
568           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
569           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
570           "R_860_SPGOTOFF0",     /* name */           "R_860_SPGOTOFF0",     /* name */
571           true,                  /* partial_inplace */           TRUE,                  /* partial_inplace */
572           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
573           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
574           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
575    
576    HOWTO (R_860_LOGOTOFF1,        /* type */    HOWTO (R_860_LOGOTOFF1,        /* type */
577           0,                     /* rightshift */           0,                     /* rightshift */
578           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
579           32,                    /* bitsize */           32,                    /* bitsize */
580           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
581           0,                     /* bitpos */           0,                     /* bitpos */
582           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
583           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
584           "R_860_LOGOTOFF1",     /* name */           "R_860_LOGOTOFF1",     /* name */
585           true,                  /* partial_inplace */           TRUE,                  /* partial_inplace */
586           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
587           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
588           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
589    
590    HOWTO (R_860_SPGOTOFF1,       /* type */    HOWTO (R_860_SPGOTOFF1,       /* type */
591           0,                     /* rightshift */           0,                     /* rightshift */
592           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
593           32,                    /* bitsize */           32,                    /* bitsize */
594           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
595           0,                     /* bitpos */           0,                     /* bitpos */
596           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
597           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
598           "R_860_SPGOTOFF1",     /* name */           "R_860_SPGOTOFF1",     /* name */
599           true,                  /* partial_inplace */           TRUE,                  /* partial_inplace */
600           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
601           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
602           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
603    
604    HOWTO (R_860_LOGOTOFF2,        /* type */    HOWTO (R_860_LOGOTOFF2,        /* type */
605           0,                     /* rightshift */           0,                     /* rightshift */
606           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
607           32,                    /* bitsize */           32,                    /* bitsize */
608           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
609           0,                     /* bitpos */           0,                     /* bitpos */
610           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
611           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
612           "R_860_LOGOTOFF2",     /* name */           "R_860_LOGOTOFF2",     /* name */
613           true,                  /* partial_inplace */           TRUE,                  /* partial_inplace */
614           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
615           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
616           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
617    
618    HOWTO (R_860_LOGOTOFF3,        /* type */    HOWTO (R_860_LOGOTOFF3,        /* type */
619           0,                     /* rightshift */           0,                     /* rightshift */
620           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
621           32,                    /* bitsize */           32,                    /* bitsize */
622           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
623           0,                     /* bitpos */           0,                     /* bitpos */
624           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
625           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
626           "R_860_LOGOTOFF3",     /* name */           "R_860_LOGOTOFF3",     /* name */
627           true,                  /* partial_inplace */           TRUE,                  /* partial_inplace */
628           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
629           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
630           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
631    
632    HOWTO (R_860_LOPC,            /* type */    HOWTO (R_860_LOPC,            /* type */
633           0,                     /* rightshift */           0,                     /* rightshift */
634           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
635           16,                    /* bitsize */           16,                    /* bitsize */
636           true,                  /* pc_relative */           TRUE,                  /* pc_relative */
637           0,                     /* bitpos */           0,                     /* bitpos */
638           complain_overflow_bitfield, /* complain_on_overflow */           complain_overflow_bitfield, /* complain_on_overflow */
639           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
640           "R_860_LOPC",          /* name */           "R_860_LOPC",          /* name */
641           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
642           0xffff,                /* src_mask */           0xffff,                /* src_mask */
643           0xffff,                /* dst_mask */           0xffff,                /* dst_mask */
644           true),                 /* pcrel_offset */           TRUE),                 /* pcrel_offset */
645    
646    HOWTO (R_860_HIGHADJ,         /* type */    HOWTO (R_860_HIGHADJ,         /* type */
647           0,                     /* rightshift */           0,                     /* rightshift */
648           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
649           16,                    /* bitsize */           16,                    /* bitsize */
650           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
651           0,                     /* bitpos */           0,                     /* bitpos */
652           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
653           bfd_elf_generic_reloc, /* special_function */           i860_howto_highadj_reloc, /* special_function */
654           "R_860_HIGHADJ",       /* name */           "R_860_HIGHADJ",       /* name */
655           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
656           0xffff,                /* src_mask */           0xffff,                /* src_mask */
657           0xffff,                /* dst_mask */           0xffff,                /* dst_mask */
658           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
659    
660    HOWTO (R_860_HAGOT,           /* type */    HOWTO (R_860_HAGOT,           /* type */
661           0,                     /* rightshift */           0,                     /* rightshift */
662           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
663           16,                    /* bitsize */           16,                    /* bitsize */
664           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
665           0,                     /* bitpos */           0,                     /* bitpos */
666           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
667           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
668           "R_860_HAGOT",         /* name */           "R_860_HAGOT",         /* name */
669           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
670           0,                     /* src_mask */           0,                     /* src_mask */
671           0xffff,                /* dst_mask */           0xffff,                /* dst_mask */
672           true),                 /* pcrel_offset */           TRUE),                 /* pcrel_offset */
673    
674    HOWTO (R_860_HAGOTOFF,        /* type */    HOWTO (R_860_HAGOTOFF,        /* type */
675           0,                     /* rightshift */           0,                     /* rightshift */
676           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
677           32,                    /* bitsize */           32,                    /* bitsize */
678           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
679           0,                     /* bitpos */           0,                     /* bitpos */
680           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
681           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
682           "R_860_HAGOTOFF",      /* name */           "R_860_HAGOTOFF",      /* name */
683           true,                  /* partial_inplace */           TRUE,                  /* partial_inplace */
684           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
685           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
686           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
687    
688    HOWTO (R_860_HAPC,            /* type */    HOWTO (R_860_HAPC,            /* type */
689           0,                     /* rightshift */           0,                     /* rightshift */
690           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
691           16,                    /* bitsize */           16,                    /* bitsize */
692           true,                  /* pc_relative */           TRUE,                  /* pc_relative */
693           0,                     /* bitpos */           0,                     /* bitpos */
694           complain_overflow_bitfield, /* complain_on_overflow */           complain_overflow_bitfield, /* complain_on_overflow */
695           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
696           "R_860_HAPC",          /* name */           "R_860_HAPC",          /* name */
697           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
698           0xffff,                /* src_mask */           0xffff,                /* src_mask */
699           0xffff,                /* dst_mask */           0xffff,                /* dst_mask */
700           true),                 /* pcrel_offset */           TRUE),                 /* pcrel_offset */
701    
702    HOWTO (R_860_HIGH,            /* type */    HOWTO (R_860_HIGH,            /* type */
703           16,                    /* rightshift */           16,                    /* rightshift */
704           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
705           16,                    /* bitsize */           16,                    /* bitsize */
706           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
707           0,                     /* bitpos */           0,                     /* bitpos */
708           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
709           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
710           "R_860_HIGH",          /* name */           "R_860_HIGH",          /* name */
711           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
712           0xffff,                /* src_mask */           0xffff,                /* src_mask */
713           0xffff,                /* dst_mask */           0xffff,                /* dst_mask */
714           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
715    
716    HOWTO (R_860_HIGOT,           /* type */    HOWTO (R_860_HIGOT,           /* type */
717           0,                     /* rightshift */           0,                     /* rightshift */
718           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
719           16,                    /* bitsize */           16,                    /* bitsize */
720           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
721           0,                     /* bitpos */           0,                     /* bitpos */
722           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
723           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
724           "R_860_HIGOT",         /* name */           "R_860_HIGOT",         /* name */
725           false,                 /* partial_inplace */           FALSE,                 /* partial_inplace */
726           0,                     /* src_mask */           0,                     /* src_mask */
727           0xffff,                /* dst_mask */           0xffff,                /* dst_mask */
728           true),                 /* pcrel_offset */           TRUE),                 /* pcrel_offset */
729    
730    HOWTO (R_860_HIGOTOFF,        /* type */    HOWTO (R_860_HIGOTOFF,        /* type */
731           0,                     /* rightshift */           0,                     /* rightshift */
732           2,                     /* size (0 = byte, 1 = short, 2 = long) */           2,                     /* size (0 = byte, 1 = short, 2 = long) */
733           32,                    /* bitsize */           32,                    /* bitsize */
734           false,                 /* pc_relative */           FALSE,                 /* pc_relative */
735           0,                     /* bitpos */           0,                     /* bitpos */
736           complain_overflow_dont, /* complain_on_overflow */           complain_overflow_dont, /* complain_on_overflow */
737           bfd_elf_generic_reloc, /* special_function */           bfd_elf_generic_reloc, /* special_function */
738           "R_860_HIGOTOFF",      /* name */           "R_860_HIGOTOFF",      /* name */
739           true,                  /* partial_inplace */           TRUE,                  /* partial_inplace */
740           0xffffffff,            /* src_mask */           0xffffffff,            /* src_mask */
741           0xffffffff,            /* dst_mask */           0xffffffff,            /* dst_mask */
742           false),                /* pcrel_offset */           FALSE),                /* pcrel_offset */
743  };  };
744    
745  static unsigned char elf_code_to_howto_index[R_860_max + 1];  static unsigned char elf_code_to_howto_index[R_860_max + 1];
746    
747  static reloc_howto_type *  static reloc_howto_type *
748  lookup_howto (rtype)  lookup_howto (unsigned int rtype)
      unsigned int rtype;  
749  {  {
750    static int initialized = 0;    static int initialized = 0;
751    int i;    int i;
# Line 572  lookup_howto (rtype) Line 770  lookup_howto (rtype)
770    
771  /* Given a BFD reloc, return the matching HOWTO structure.  */  /* Given a BFD reloc, return the matching HOWTO structure.  */
772  static reloc_howto_type *  static reloc_howto_type *
773  elf32_i860_reloc_type_lookup (abfd, code)  elf32_i860_reloc_type_lookup (bfd *abfd ATTRIBUTE_UNUSED,
774       bfd * abfd ATTRIBUTE_UNUSED;                                bfd_reloc_code_real_type code)
      bfd_reloc_code_real_type code;  
775  {  {
776    unsigned int rtype;    unsigned int rtype;
777    
# Line 691  elf32_i860_reloc_type_lookup (abfd, code Line 888  elf32_i860_reloc_type_lookup (abfd, code
888    
889  /* Given a ELF reloc, return the matching HOWTO structure.  */  /* Given a ELF reloc, return the matching HOWTO structure.  */
890  static void  static void
891  elf32_i860_info_to_howto_rela (abfd, bfd_reloc, elf_reloc)  elf32_i860_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
892       bfd *abfd ATTRIBUTE_UNUSED;                                 arelent *bfd_reloc,
893       arelent *bfd_reloc;                                 Elf_Internal_Rela *elf_reloc)
      Elf64_Internal_Rela *elf_reloc;  
894  {  {
895    bfd_reloc->howto    bfd_reloc->howto
896      = lookup_howto ((unsigned) ELF32_R_TYPE (elf_reloc->r_info));      = lookup_howto ((unsigned) ELF32_R_TYPE (elf_reloc->r_info));
# Line 703  elf32_i860_info_to_howto_rela (abfd, bfd Line 899  elf32_i860_info_to_howto_rela (abfd, bfd
899  /* Specialized relocation handler for R_860_SPLITn.  These relocations  /* Specialized relocation handler for R_860_SPLITn.  These relocations
900     involves a 16-bit field that is split into two contiguous parts.  */     involves a 16-bit field that is split into two contiguous parts.  */
901  static bfd_reloc_status_type  static bfd_reloc_status_type
902  elf32_i860_relocate_splitn (input_bfd, rello, contents, value)  elf32_i860_relocate_splitn (bfd *input_bfd,
903       bfd *input_bfd;                              Elf_Internal_Rela *rello,
904       Elf_Internal_Rela *rello;                              bfd_byte *contents,
905       bfd_byte *contents;                              bfd_vma value)
      bfd_vma value;  
906  {  {
907    bfd_vma insn;    bfd_vma insn;
908    reloc_howto_type *howto;    reloc_howto_type *howto;
# Line 718  elf32_i860_relocate_splitn (input_bfd, r Line 913  elf32_i860_relocate_splitn (input_bfd, r
913    value += rello->r_addend;    value += rello->r_addend;
914    
915    /* Separate the fields and insert.  */    /* Separate the fields and insert.  */
916    value = (((value & 0xf8) << 5) | (value & 0x7ff)) & howto->dst_mask;    value = (((value & 0xf800) << 5) | (value & 0x7ff)) & howto->dst_mask;
917    insn = (insn & ~howto->dst_mask) | value;    insn = (insn & ~howto->dst_mask) | value;
918    
919    bfd_put_32 (input_bfd, insn, contents + rello->r_offset);    bfd_put_32 (input_bfd, insn, contents + rello->r_offset);
# Line 729  elf32_i860_relocate_splitn (input_bfd, r Line 924  elf32_i860_relocate_splitn (input_bfd, r
924     involves a 16-bit, PC-relative field that is split into two contiguous     involves a 16-bit, PC-relative field that is split into two contiguous
925     parts.  */     parts.  */
926  static bfd_reloc_status_type  static bfd_reloc_status_type
927  elf32_i860_relocate_pc16 (input_bfd, input_section, rello, contents, value)  elf32_i860_relocate_pc16 (bfd *input_bfd,
928       bfd *input_bfd;                            asection *input_section,
929       asection *input_section;                            Elf_Internal_Rela *rello,
930       Elf_Internal_Rela *rello;                            bfd_byte *contents,
931       bfd_byte *contents;                            bfd_vma value)
      bfd_vma value;  
932  {  {
933    bfd_vma insn;    bfd_vma insn;
934    reloc_howto_type *howto;    reloc_howto_type *howto;
# Line 749  elf32_i860_relocate_pc16 (input_bfd, inp Line 943  elf32_i860_relocate_pc16 (input_bfd, inp
943    /* Relocate.  */    /* Relocate.  */
944    value += rello->r_addend;    value += rello->r_addend;
945    
946    /* Separate the fields and insert.  */    /* Adjust the value by 4, then separate the fields and insert.  */
947    value = (((value & 0xf8) << 5) | (value & 0x7ff)) & howto->dst_mask;    value = (value - 4) >> howto->rightshift;
948      value = (((value & 0xf800) << 5) | (value & 0x7ff)) & howto->dst_mask;
949    insn = (insn & ~howto->dst_mask) | value;    insn = (insn & ~howto->dst_mask) | value;
950    
951    bfd_put_32 (input_bfd, insn, contents + rello->r_offset);    bfd_put_32 (input_bfd, insn, contents + rello->r_offset);
# Line 761  elf32_i860_relocate_pc16 (input_bfd, inp Line 956  elf32_i860_relocate_pc16 (input_bfd, inp
956  /* Specialized relocation handler for R_860_PC26.  This relocation  /* Specialized relocation handler for R_860_PC26.  This relocation
957     involves a 26-bit, PC-relative field which must be adjusted by 4.  */     involves a 26-bit, PC-relative field which must be adjusted by 4.  */
958  static bfd_reloc_status_type  static bfd_reloc_status_type
959  elf32_i860_relocate_pc26 (input_bfd, input_section, rello, contents, value)  elf32_i860_relocate_pc26 (bfd *input_bfd,
960       bfd *input_bfd;                            asection *input_section,
961       asection *input_section;                            Elf_Internal_Rela *rello,
962       Elf_Internal_Rela *rello;                            bfd_byte *contents,
963       bfd_byte *contents;                            bfd_vma value)
      bfd_vma value;  
964  {  {
965    bfd_vma insn;    bfd_vma insn;
966    reloc_howto_type *howto;    reloc_howto_type *howto;
# Line 792  elf32_i860_relocate_pc26 (input_bfd, inp Line 986  elf32_i860_relocate_pc26 (input_bfd, inp
986    
987  /* Specialized relocation handler for R_860_HIGHADJ.  */  /* Specialized relocation handler for R_860_HIGHADJ.  */
988  static bfd_reloc_status_type  static bfd_reloc_status_type
989  elf32_i860_relocate_highadj (input_bfd, rel, contents, value)  elf32_i860_relocate_highadj (bfd *input_bfd,
990       bfd *input_bfd;                               Elf_Internal_Rela *rel,
991       Elf_Internal_Rela *rel;                               bfd_byte *contents,
992       bfd_byte *contents;                               bfd_vma value)
      bfd_vma value;  
993  {  {
994    bfd_vma insn;    bfd_vma insn;
995    
996    insn = bfd_get_32 (input_bfd, contents + rel->r_offset);    insn = bfd_get_32 (input_bfd, contents + rel->r_offset);
997    
   value += ((rel->r_addend & 0x8000) << 1);  
998    value += rel->r_addend;    value += rel->r_addend;
999      value += 0x8000;
1000    value = ((value >> 16) & 0xffff);    value = ((value >> 16) & 0xffff);
1001    
1002    insn = (insn & 0xffff0000) | value;    insn = (insn & 0xffff0000) | value;
# Line 815  elf32_i860_relocate_highadj (input_bfd, Line 1008  elf32_i860_relocate_highadj (input_bfd,
1008  /* Perform a single relocation.  By default we use the standard BFD  /* Perform a single relocation.  By default we use the standard BFD
1009     routines. However, we handle some specially.  */     routines. However, we handle some specially.  */
1010  static bfd_reloc_status_type  static bfd_reloc_status_type
1011  i860_final_link_relocate (howto, input_bfd, input_section, contents, rel, relocation)  i860_final_link_relocate (reloc_howto_type *howto,
1012       reloc_howto_type *  howto;                            bfd *input_bfd,
1013       bfd *               input_bfd;                            asection *input_section,
1014       asection *          input_section;                            bfd_byte *contents,
1015       bfd_byte *          contents;                            Elf_Internal_Rela *rel,
1016       Elf_Internal_Rela * rel;                            bfd_vma relocation)
      bfd_vma             relocation;  
1017  {  {
1018    return _bfd_final_link_relocate (howto, input_bfd, input_section,    return _bfd_final_link_relocate (howto, input_bfd, input_section,
1019                                     contents, rel->r_offset, relocation,                                     contents, rel->r_offset, relocation,
# Line 831  i860_final_link_relocate (howto, input_b Line 1023  i860_final_link_relocate (howto, input_b
1023  /* Relocate an i860 ELF section.  /* Relocate an i860 ELF section.
1024    
1025     This is boiler-plate code copied from fr30.     This is boiler-plate code copied from fr30.
    There is some attempt to make this function usable for many architectures,  
    both USE_REL and USE_RELA ['twould be nice if such a critter existed],  
    if only to serve as a learning tool.  
1026    
1027     The RELOCATE_SECTION function is called by the new ELF backend linker     The RELOCATE_SECTION function is called by the new ELF backend linker
1028     to handle the relocations for a section.     to handle the relocations for a section.
# Line 843  i860_final_link_relocate (howto, input_b Line 1032  i860_final_link_relocate (howto, input_b
1032     zero.     zero.
1033    
1034     This function is responsible for adjusting the section contents as     This function is responsible for adjusting the section contents as
1035     necessary, and (if using Rela relocs and generating a relocateable     necessary, and (if using Rela relocs and generating a relocatable
1036     output file) adjusting the reloc addend as necessary.     output file) adjusting the reloc addend as necessary.
1037    
1038     This function does not have to worry about setting the reloc     This function does not have to worry about setting the reloc
# Line 857  i860_final_link_relocate (howto, input_b Line 1046  i860_final_link_relocate (howto, input_b
1046     The global hash table entry for the global symbols can be found     The global hash table entry for the global symbols can be found
1047     via elf_sym_hashes (input_bfd).     via elf_sym_hashes (input_bfd).
1048    
1049     When generating relocateable output, this function must handle     When generating relocatable output, this function must handle
1050     STB_LOCAL/STT_SECTION symbols specially.  The output symbol is     STB_LOCAL/STT_SECTION symbols specially.  The output symbol is
1051     going to be the section symbol corresponding to the output     going to be the section symbol corresponding to the output
1052     section, which means that the addend must be adjusted     section, which means that the addend must be adjusted
1053     accordingly.  */     accordingly.  */
1054  static boolean  static bfd_boolean
1055  elf32_i860_relocate_section (output_bfd, info, input_bfd, input_section,  elf32_i860_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
1056                               contents, relocs, local_syms, local_sections)                               struct bfd_link_info *info,
1057       bfd *                   output_bfd ATTRIBUTE_UNUSED;                               bfd *input_bfd,
1058       struct bfd_link_info *  info;                               asection *input_section,
1059       bfd *                   input_bfd;                               bfd_byte *contents,
1060       asection *              input_section;                               Elf_Internal_Rela *relocs,
1061       bfd_byte *              contents;                               Elf_Internal_Sym *local_syms,
1062       Elf_Internal_Rela *     relocs;                               asection **local_sections)
      Elf_Internal_Sym *      local_syms;  
      asection **             local_sections;  
1063  {  {
1064    Elf_Internal_Shdr *           symtab_hdr;    Elf_Internal_Shdr *symtab_hdr;
1065    struct elf_link_hash_entry ** sym_hashes;    struct elf_link_hash_entry **sym_hashes;
1066    Elf_Internal_Rela *           rel;    Elf_Internal_Rela *rel;
1067    Elf_Internal_Rela *           relend;    Elf_Internal_Rela *relend;
1068    
1069    if (info->relocateable)    if (info->relocatable)
1070      return true;      return TRUE;
1071    
1072    symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;    symtab_hdr = & elf_tdata (input_bfd)->symtab_hdr;
1073    sym_hashes = elf_sym_hashes (input_bfd);    sym_hashes = elf_sym_hashes (input_bfd);
# Line 899  elf32_i860_relocate_section (output_bfd, Line 1086  elf32_i860_relocate_section (output_bfd,
1086        int                          r_type;        int                          r_type;
1087    
1088        r_type = ELF32_R_TYPE (rel->r_info);        r_type = ELF32_R_TYPE (rel->r_info);
   
 #if 0  
       if (   r_type == R_860_GNU_VTINHERIT  
           || r_type == R_860_GNU_VTENTRY)  
         continue;  
 #endif  
   
1089        r_symndx = ELF32_R_SYM (rel->r_info);        r_symndx = ELF32_R_SYM (rel->r_info);
1090    
1091        howto = lookup_howto ((unsigned) ELF32_R_TYPE (rel->r_info));        howto = lookup_howto ((unsigned) ELF32_R_TYPE (rel->r_info));
# Line 917  elf32_i860_relocate_section (output_bfd, Line 1097  elf32_i860_relocate_section (output_bfd,
1097          {          {
1098            sym = local_syms + r_symndx;            sym = local_syms + r_symndx;
1099            sec = local_sections [r_symndx];            sec = local_sections [r_symndx];
1100            relocation = _bfd_elf_rela_local_sym (output_bfd, sym, sec, rel);            relocation = _bfd_elf_rela_local_sym (output_bfd, sym, &sec, rel);
1101    
1102            name = bfd_elf_string_from_elf_section            name = bfd_elf_string_from_elf_section
1103              (input_bfd, symtab_hdr->sh_link, sym->st_name);              (input_bfd, symtab_hdr->sh_link, sym->st_name);
# Line 925  elf32_i860_relocate_section (output_bfd, Line 1105  elf32_i860_relocate_section (output_bfd,
1105          }          }
1106        else        else
1107          {          {
1108            h = sym_hashes [r_symndx - symtab_hdr->sh_info];            bfd_boolean unresolved_reloc, warned;
1109    
1110            while (h->root.type == bfd_link_hash_indirect            RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
1111                   || h->root.type == bfd_link_hash_warning)                                     r_symndx, symtab_hdr, sym_hashes,
1112              h = (struct elf_link_hash_entry *) h->root.u.i.link;                                     h, sec, relocation,
1113                                       unresolved_reloc, warned);
           name = h->root.root.string;  
   
           if (h->root.type == bfd_link_hash_defined  
               || h->root.type == bfd_link_hash_defweak)  
             {  
               sec = h->root.u.def.section;  
               relocation = (h->root.u.def.value  
                             + sec->output_section->vma  
                             + sec->output_offset);  
             }  
           else if (h->root.type == bfd_link_hash_undefweak)  
             {  
               relocation = 0;  
             }  
           else  
             {  
               if (! ((*info->callbacks->undefined_symbol)  
                      (info, h->root.root.string, input_bfd,  
                       input_section, rel->r_offset, true)))  
                 return false;  
               relocation = 0;  
             }  
1114          }          }
1115    
1116        switch (r_type)        switch (r_type)
# Line 1018  elf32_i860_relocate_section (output_bfd, Line 1176  elf32_i860_relocate_section (output_bfd,
1176              {              {
1177              case bfd_reloc_overflow:              case bfd_reloc_overflow:
1178                r = info->callbacks->reloc_overflow                r = info->callbacks->reloc_overflow
1179                  (info, name, howto->name, (bfd_vma) 0,                  (info, (h ? &h->root : NULL), name, howto->name,
1180                   input_bfd, input_section, rel->r_offset);                   (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
1181                break;                break;
1182    
1183              case bfd_reloc_undefined:              case bfd_reloc_undefined:
1184                r = info->callbacks->undefined_symbol                r = info->callbacks->undefined_symbol
1185                  (info, name, input_bfd, input_section, rel->r_offset, true);                  (info, name, input_bfd, input_section, rel->r_offset, TRUE);
1186                break;                break;
1187    
1188              case bfd_reloc_outofrange:              case bfd_reloc_outofrange:
# Line 1049  elf32_i860_relocate_section (output_bfd, Line 1207  elf32_i860_relocate_section (output_bfd,
1207                (info, msg, name, input_bfd, input_section, rel->r_offset);                (info, msg, name, input_bfd, input_section, rel->r_offset);
1208    
1209            if (! r)            if (! r)
1210              return false;              return FALSE;
1211          }          }
1212      }      }
1213    
1214    return true;    return TRUE;
1215  }  }
1216    
1217  /* Return whether a symbol name implies a local label.  SVR4/860 compilers  /* Return whether a symbol name implies a local label.  SVR4/860 compilers
# Line 1061  elf32_i860_relocate_section (output_bfd, Line 1219  elf32_i860_relocate_section (output_bfd,
1219     function prolog. These should be local.     function prolog. These should be local.
1220     ??? Do any other SVR4 compilers have this convention? If so, this should     ??? Do any other SVR4 compilers have this convention? If so, this should
1221     be added to the generic routine.  */     be added to the generic routine.  */
1222  static boolean  static bfd_boolean
1223  elf32_i860_is_local_label_name (abfd, name)  elf32_i860_is_local_label_name (bfd *abfd, const char *name)
      bfd *abfd;  
      const char *name;  
1224  {  {
1225    if (name[0] == '.' && name[1] == 'e' && name[2] == 'p' && name[3] == '.')    if (name[0] == '.' && name[1] == 'e' && name[2] == 'p' && name[3] == '.')
1226      return true;      return TRUE;
1227    
1228    return _bfd_elf_is_local_label_name (abfd, name);    return _bfd_elf_is_local_label_name (abfd, name);
1229  }  }

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.1.1.1.20.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26