add missing file for previous patch
[external/binutils.git] / packaging / binutils-2.22-branch-updates.patch
1 # DP: updates from the binutils-2.22 branch
2
3 diff --git a/bfd/ChangeLog b/bfd/ChangeLog
4 index 0059346..a7199ae 100644
5 --- a/bfd/ChangeLog
6 +++ b/bfd/ChangeLog
7 @@ -1,3 +1,49 @@
8 +2011-12-10  David Daney  <david.daney@cavium.com>
9 +
10 +       Backport from mainline:
11 +
12 +       2011-12-10  David Daney  <david.daney@cavium.com>
13 +
14 +       * elfxx-mips.c (mips_elf_link_hash_table.rld_value): Remove.
15 +       (mips_elf_link_hash_table.rld_symbol): New field;
16 +       (MIPS_ELF_RLD_MAP_SIZE): New macro.
17 +       (_bfd_mips_elf_add_symbol_hook): Remember __rld_obj_head symbol
18 +       in rld_symbol.
19 +       (_bfd_mips_elf_create_dynamic_sections): Remember __rld_map symbol
20 +       in rld_symbol.
21 +       (_bfd_mips_elf_size_dynamic_sections): Set correct size for .rld_map.
22 +       (_bfd_mips_elf_finish_dynamic_symbol): Remove .rld_map handling.
23 +       (_bfd_mips_elf_finish_dynamic_sections): Use rld_symbol to
24 +       calculate DT_MIPS_RLD_MAP value.
25 +       (_bfd_mips_elf_link_hash_table_create): Initialize rld_symbol,
26 +       quit initializing rld_value.
27 +
28 +2011-12-03  Alan Modra  <amodra@gmail.com>
29 +
30 +       PR ld/13468
31 +       * elflink.c (bfd_elf_final_link): Don't segfault when checking
32 +       for DT_TEXTREL and .dynamic does not exist.
33 +
34 +2011-12-03  Alan Modra  <amodra@gmail.com>
35 +
36 +       PR ld/13470
37 +       * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Revert substantive
38 +       change in 2011-07-01 commit.  Comment.
39 +       * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
40 +
41 +2011-12-01  Mikael Pettersson  <mikpe@it.uu.se>
42 +
43 +       Apply mainline patches
44 +       * elf32-m68k.c (elf_m68k_check_relocs) <R_68K_8, R68K_16, R_68K_32>: For
45 +       non-SEC_ALLOC sections break before GOT and PLT accounting.
46 +
47 +2011-12-01  Hans-Peter Nilsson  <hp@axis.com>
48 +
49 +       Apply mainline patches
50 +       * elf32-cris.c (cris_elf_check_relocs) <plt accounting for
51 +       R_CRIS_8, R_CRIS_16, and R_CRIS_32>: Move early break for
52 +       non-SEC_ALLOC sections before GOT and PLT accounting.
53 +
54  2011-11-21  Tristan Gingold  <gingold@adacore.com>
55  
56         * configure.in: Bump version to 2.22.0
57 diff --git a/bfd/elf32-cris.c b/bfd/elf32-cris.c
58 index 243a8ec..310f6d1 100644
59 --- a/bfd/elf32-cris.c
60 +++ b/bfd/elf32-cris.c
61 @@ -3579,6 +3579,12 @@ cris_elf_check_relocs (bfd *abfd,
62                  sec,
63                  cris_elf_howto_table[r_type].name);
64             }
65 +
66 +         /* We don't need to handle relocs into sections not going into
67 +            the "real" output.  */
68 +         if ((sec->flags & SEC_ALLOC) == 0)
69 +           break;
70 +
71           if (h != NULL)
72             {
73               h->non_got_ref = 1;
74 @@ -3608,11 +3614,6 @@ cris_elf_check_relocs (bfd *abfd,
75           if (! info->shared)
76             break;
77  
78 -         /* We don't need to handle relocs into sections not going into
79 -            the "real" output.  */
80 -         if ((sec->flags & SEC_ALLOC) == 0)
81 -           break;
82 -
83           /* We may need to create a reloc section in the dynobj and made room
84              for this reloc.  */
85           if (sreloc == NULL)
86 diff --git a/bfd/elf32-m68k.c b/bfd/elf32-m68k.c
87 index 612525c..3e9ada9 100644
88 --- a/bfd/elf32-m68k.c
89 +++ b/bfd/elf32-m68k.c
90 @@ -2816,6 +2816,11 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
91         case R_68K_8:
92         case R_68K_16:
93         case R_68K_32:
94 +         /* We don't need to handle relocs into sections not going into
95 +            the "real" output.  */
96 +         if ((sec->flags & SEC_ALLOC) == 0)
97 +             break;
98 +
99           if (h != NULL)
100             {
101               /* Make sure a plt entry is created for this symbol if it
102 @@ -2829,8 +2834,7 @@ elf_m68k_check_relocs (abfd, info, sec, relocs)
103  
104           /* If we are creating a shared library, we need to copy the
105              reloc into the shared library.  */
106 -         if (info->shared
107 -             && (sec->flags & SEC_ALLOC) != 0)
108 +         if (info->shared)
109             {
110               /* When creating a shared object, we must copy these
111                  reloc types into the output file.  We create a reloc
112 diff --git a/bfd/elf32-ppc.c b/bfd/elf32-ppc.c
113 index 0c25c3e..574cd98 100644
114 --- a/bfd/elf32-ppc.c
115 +++ b/bfd/elf32-ppc.c
116 @@ -2987,10 +2987,6 @@ ppc_elf_copy_indirect_symbol (struct bfd_link_info *info,
117    edir->elf.needs_plt |= eind->elf.needs_plt;
118    edir->elf.pointer_equality_needed |= eind->elf.pointer_equality_needed;
119  
120 -  /* If we were called to copy over info for a weak sym, that's all.  */
121 -  if (eind->elf.root.type != bfd_link_hash_indirect)
122 -    return;
123 -
124    if (eind->dyn_relocs != NULL)
125      {
126        if (edir->dyn_relocs != NULL)
127 @@ -3022,6 +3018,16 @@ ppc_elf_copy_indirect_symbol (struct bfd_link_info *info,
128        eind->dyn_relocs = NULL;
129      }
130  
131 +  /* If we were called to copy over info for a weak sym, that's all.
132 +     You might think dyn_relocs need not be copied over;  After all,
133 +     both syms will be dynamic or both non-dynamic so we're just
134 +     moving reloc accounting around.  However, ELIMINATE_COPY_RELOCS 
135 +     code in ppc_elf_adjust_dynamic_symbol needs to check for
136 +     dyn_relocs in read-only sections, and it does so on what is the
137 +     DIR sym here.  */
138 +  if (eind->elf.root.type != bfd_link_hash_indirect)
139 +    return;
140 +
141    /* Copy over the GOT refcount entries that we may have already seen to
142       the symbol which just became indirect.  */
143    edir->elf.got.refcount += eind->elf.got.refcount;
144 diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c
145 index 93d1314..32a3430 100644
146 --- a/bfd/elf64-ppc.c
147 +++ b/bfd/elf64-ppc.c
148 @@ -4435,10 +4435,6 @@ ppc64_elf_copy_indirect_symbol (struct bfd_link_info *info,
149    edir->elf.ref_regular_nonweak |= eind->elf.ref_regular_nonweak;
150    edir->elf.needs_plt |= eind->elf.needs_plt;
151  
152 -  /* If we were called to copy over info for a weak sym, that's all.  */
153 -  if (eind->elf.root.type != bfd_link_hash_indirect)
154 -    return;
155 -
156    /* Copy over any dynamic relocs we may have on the indirect sym.  */
157    if (eind->dyn_relocs != NULL)
158      {
159 @@ -4471,6 +4467,16 @@ ppc64_elf_copy_indirect_symbol (struct bfd_link_info *info,
160        eind->dyn_relocs = NULL;
161      }
162  
163 +  /* If we were called to copy over info for a weak sym, that's all.
164 +     You might think dyn_relocs need not be copied over;  After all,
165 +     both syms will be dynamic or both non-dynamic so we're just
166 +     moving reloc accounting around.  However, ELIMINATE_COPY_RELOCS 
167 +     code in ppc64_elf_adjust_dynamic_symbol needs to check for
168 +     dyn_relocs in read-only sections, and it does so on what is the
169 +     DIR sym here.  */
170 +  if (eind->elf.root.type != bfd_link_hash_indirect)
171 +    return;
172 +
173    /* Copy over got entries that we may have already seen to the
174       symbol which just became indirect.  */
175    if (eind->elf.got.glist != NULL)
176 diff --git a/bfd/elflink.c b/bfd/elflink.c
177 index fc4266b..8556cec 100644
178 --- a/bfd/elflink.c
179 +++ b/bfd/elflink.c
180 @@ -11188,15 +11188,12 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
181         goto error_return;
182  
183        /* Check for DT_TEXTREL (late, in case the backend removes it).  */
184 -      if ((info->warn_shared_textrel && info->shared)
185 -         || info->error_textrel)
186 +      if (((info->warn_shared_textrel && info->shared)
187 +          || info->error_textrel)
188 +         && (o = bfd_get_section_by_name (dynobj, ".dynamic")) != NULL)
189         {
190           bfd_byte *dyncon, *dynconend;
191  
192 -         /* Fix up .dynamic entries.  */
193 -         o = bfd_get_section_by_name (dynobj, ".dynamic");
194 -         BFD_ASSERT (o != NULL);
195 -
196           dyncon = o->contents;
197           dynconend = o->contents + o->size;
198           for (; dyncon < dynconend; dyncon += bed->s->sizeof_dyn)
199 diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
200 index 33a454d..6b908ad 100644
201 --- a/bfd/elfxx-mips.c
202 +++ b/bfd/elfxx-mips.c
203 @@ -436,8 +436,8 @@ struct mips_elf_link_hash_table
204       entry is set to the address of __rld_obj_head as in IRIX5.  */
205    bfd_boolean use_rld_obj_head;
206  
207 -  /* This is the value of the __rld_map or __rld_obj_head symbol.  */
208 -  bfd_vma rld_value;
209 +  /* The  __rld_map or __rld_obj_head symbol. */
210 +  struct elf_link_hash_entry *rld_symbol;
211  
212    /* This is set if we see any mips16 stub sections.  */
213    bfd_boolean mips16_stubs_seen;
214 @@ -768,6 +768,10 @@ static bfd *reldyn_sorting_bfd;
215  #define MIPS_ELF_GOT_SIZE(abfd) \
216    (get_elf_backend_data (abfd)->s->arch_size / 8)
217  
218 +/* The size of the .rld_map section. */
219 +#define MIPS_ELF_RLD_MAP_SIZE(abfd) \
220 +  (get_elf_backend_data (abfd)->s->arch_size / 8)
221 +
222  /* The size of a symbol-table entry.  */
223  #define MIPS_ELF_SYM_SIZE(abfd) \
224    (get_elf_backend_data (abfd)->s->sizeof_sym)
225 @@ -7081,6 +7085,7 @@ _bfd_mips_elf_add_symbol_hook (bfd *abfd, struct bfd_link_info *info,
226         return FALSE;
227  
228        mips_elf_hash_table (info)->use_rld_obj_head = TRUE;
229 +      mips_elf_hash_table (info)->rld_symbol = h;
230      }
231  
232    /* If this is a mips16 text symbol, add 1 to the value to make it
233 @@ -7266,6 +7271,7 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
234  
235           if (! bfd_elf_link_record_dynamic_symbol (info, h))
236             return FALSE;
237 +         mips_elf_hash_table (info)->rld_symbol = h;
238         }
239      }
240  
241 @@ -9027,7 +9033,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
242         {
243           /* We add a room for __rld_map.  It will be filled in by the
244              rtld to contain a pointer to the _r_debug structure.  */
245 -         s->size += 4;
246 +         s->size += MIPS_ELF_RLD_MAP_SIZE (output_bfd);
247         }
248        else if (SGI_COMPAT (output_bfd)
249                && CONST_STRNEQ (name, ".compact_rel"))
250 @@ -10030,31 +10036,6 @@ _bfd_mips_elf_finish_dynamic_symbol (bfd *output_bfd,
251    if (IRIX_COMPAT (output_bfd) == ict_irix6)
252      mips_elf_irix6_finish_dynamic_symbol (output_bfd, name, sym);
253  
254 -  if (! info->shared)
255 -    {
256 -      if (! mips_elf_hash_table (info)->use_rld_obj_head
257 -         && (strcmp (name, "__rld_map") == 0
258 -             || strcmp (name, "__RLD_MAP") == 0))
259 -       {
260 -         asection *s = bfd_get_section_by_name (dynobj, ".rld_map");
261 -         BFD_ASSERT (s != NULL);
262 -         sym->st_value = s->output_section->vma + s->output_offset;
263 -         bfd_put_32 (output_bfd, 0, s->contents);
264 -         if (mips_elf_hash_table (info)->rld_value == 0)
265 -           mips_elf_hash_table (info)->rld_value = sym->st_value;
266 -       }
267 -      else if (mips_elf_hash_table (info)->use_rld_obj_head
268 -              && strcmp (name, "__rld_obj_head") == 0)
269 -       {
270 -         /* IRIX6 does not use a .rld_map section.  */
271 -         if (IRIX_COMPAT (output_bfd) == ict_irix5
272 -              || IRIX_COMPAT (output_bfd) == ict_none)
273 -           BFD_ASSERT (bfd_get_section_by_name (dynobj, ".rld_map")
274 -                       != NULL);
275 -         mips_elf_hash_table (info)->rld_value = sym->st_value;
276 -       }
277 -    }
278 -
279    /* Keep dynamic MIPS16 symbols odd.  This allows the dynamic linker to
280       treat MIPS16 symbols like any other.  */
281    if (ELF_ST_IS_MIPS16 (sym->st_other))
282 @@ -10517,7 +10498,19 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
283               break;
284  
285             case DT_MIPS_RLD_MAP:
286 -             dyn.d_un.d_ptr = mips_elf_hash_table (info)->rld_value;
287 +             {
288 +               struct elf_link_hash_entry *h;
289 +               h = mips_elf_hash_table (info)->rld_symbol;
290 +               if (!h)
291 +                 {
292 +                   dyn_to_skip = MIPS_ELF_DYN_SIZE (dynobj);
293 +                   swap_out_p = FALSE;
294 +                   break;
295 +                 }
296 +               s = h->root.u.def.section;
297 +               dyn.d_un.d_ptr = (s->output_section->vma + s->output_offset
298 +                                 + h->root.u.def.value);
299 +             }
300               break;
301  
302             case DT_MIPS_OPTIONS:
303 @@ -12794,7 +12787,7 @@ _bfd_mips_elf_link_hash_table_create (bfd *abfd)
304    ret->procedure_count = 0;
305    ret->compact_rel_size = 0;
306    ret->use_rld_obj_head = FALSE;
307 -  ret->rld_value = 0;
308 +  ret->rld_symbol = NULL;
309    ret->mips16_stubs_seen = FALSE;
310    ret->use_plts_and_copy_relocs = FALSE;
311    ret->is_vxworks = FALSE;
312 diff --git a/bfd/version.h b/bfd/version.h
313 index c6800ec..cb20c1b 100644
314 --- a/bfd/version.h
315 +++ b/bfd/version.h
316 @@ -1,4 +1,4 @@
317 -#define BFD_VERSION_DATE 20111121
318 +#define BFD_VERSION_DATE 20111211
319  #define BFD_VERSION @bfd_version@
320  #define BFD_VERSION_STRING  @bfd_version_package@ @bfd_version_string@
321  #define REPORT_BUGS_TO @report_bugs_to@
322 diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
323 index 233d962..1b84638 100644
324 --- a/ld/testsuite/ChangeLog
325 +++ b/ld/testsuite/ChangeLog
326 @@ -1,3 +1,8 @@
327 +2011-12-01  Hans-Peter Nilsson  <hp@axis.com>
328 +
329 +       * ld-cris/pic-gc-72.d: Revert last change to adjust for reverted
330 +       cause for last change.
331 +
332  2011-11-10  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
333  
334         Apply mainline patches.
335 diff --git a/ld/testsuite/ld-cris/pic-gc-72.d b/ld/testsuite/ld-cris/pic-gc-72.d
336 index 7e72752..7c30980 100644
337 --- a/ld/testsuite/ld-cris/pic-gc-72.d
338 +++ b/ld/testsuite/ld-cris/pic-gc-72.d
339 @@ -19,11 +19,10 @@ Contents of section .dynsym:
340  Contents of section .dynstr:
341  #...
342  Contents of section .text:
343 - 016e 0f050f05                             .*
344 + 0188 0f050f05                             .*
345  Contents of section .dynamic:
346 - 2174 .*
347  #...
348  Contents of section .got:
349 - 21cc 74210000 00000000 00000000           .*
350 + 21e4 8c210000 00000000 00000000           .*
351  Contents of section .data:
352 - 21d8 00000000                             .*
353 + 21f0 00000000                             .*
354 diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
355 index a445030..26f759e 100644
356 --- a/opcodes/ChangeLog
357 +++ b/opcodes/ChangeLog
358 @@ -1,3 +1,8 @@
359 +2011-11-25  Pierre Muller  <muller@ics.u-strasbg.fr>
360 +
361 +       * mips-dis.c (print_insn_micromips): Rename local variable iprintf
362 +       to infprintf to avoid shadow warning.
363 +
364  2011-10-27  Peter Bergner  <bergner@vnet.ibm.com>
365  
366         * ppc-opc.c (powerpc_opcodes) <drrndq, drrndq., dtstexq, dctqpq,
367 diff --git a/opcodes/mips-dis.c b/opcodes/mips-dis.c
368 index 4e18d8a..72285de 100644
369 --- a/opcodes/mips-dis.c
370 +++ b/opcodes/mips-dis.c
371 @@ -2260,7 +2260,7 @@ print_insn_mips16 (bfd_vma memaddr, struct disassemble_info *info)
372  static int
373  print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
374  {
375 -  const fprintf_ftype iprintf = info->fprintf_func;
376 +  const fprintf_ftype infprintf = info->fprintf_func;
377    const struct mips_opcode *op, *opend;
378    unsigned int lsb, msbd, msb;
379    void *is = info->stream;
380 @@ -2307,7 +2307,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
381        status = (*info->read_memory_func) (memaddr + 2, buffer, 2, info);
382        if (status != 0)
383         {
384 -         iprintf (is, "micromips 0x%x", higher);
385 +         infprintf (is, "micromips 0x%x", higher);
386           (*info->memory_error_func) (status, memaddr + 2, info);
387           return -1;
388         }
389 @@ -2320,7 +2320,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
390        status = (*info->read_memory_func) (memaddr + 4, buffer, 2, info);
391        if (status != 0)
392         {
393 -         iprintf (is, "micromips 0x%x", higher);
394 +         infprintf (is, "micromips 0x%x", higher);
395           (*info->memory_error_func) (status, memaddr + 4, info);
396           return -1;
397         }
398 @@ -2328,7 +2328,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
399         insn = bfd_getb16 (buffer);
400        else
401         insn = bfd_getl16 (buffer);
402 -      iprintf (is, "0x%x%04x (48-bit insn)", higher, insn);
403 +      infprintf (is, "0x%x%04x (48-bit insn)", higher, insn);
404  
405        info->insn_type = dis_noninsn;
406        return 6;
407 @@ -2341,7 +2341,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
408        status = (*info->read_memory_func) (memaddr + 2, buffer, 2, info);
409        if (status != 0)
410         {
411 -         iprintf (is, "micromips 0x%x", higher);
412 +         infprintf (is, "micromips 0x%x", higher);
413           (*info->memory_error_func) (status, memaddr + 2, info);
414           return -1;
415         }
416 @@ -2371,9 +2371,9 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
417         {
418           const char *s;
419  
420 -         iprintf (is, "%s", op->name);
421 +         infprintf (is, "%s", op->name);
422           if (op->args[0] != '\0')
423 -           iprintf (is, "\t");
424 +           infprintf (is, "\t");
425  
426           for (s = op->args; *s != '\0'; s++)
427             {
428 @@ -2382,37 +2382,37 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
429                 case ',':
430                 case '(':
431                 case ')':
432 -                 iprintf (is, "%c", *s);
433 +                 infprintf (is, "%c", *s);
434                   break;
435  
436                 case '.':
437                   delta = GET_OP (insn, OFFSET10);
438                   if (delta & 0x200)
439                     delta |= ~0x3ff;
440 -                 iprintf (is, "%d", delta);
441 +                 infprintf (is, "%d", delta);
442                   break;
443  
444                 case '1':
445 -                 iprintf (is, "0x%lx", GET_OP (insn, STYPE));
446 +                 infprintf (is, "0x%lx", GET_OP (insn, STYPE));
447                   break;
448  
449                 case '<':
450 -                 iprintf (is, "0x%lx", GET_OP (insn, SHAMT));
451 +                 infprintf (is, "0x%lx", GET_OP (insn, SHAMT));
452                   break;
453  
454                 case '\\':
455 -                 iprintf (is, "0x%lx", GET_OP (insn, 3BITPOS));
456 +                 infprintf (is, "0x%lx", GET_OP (insn, 3BITPOS));
457                   break;
458  
459                 case '|':
460 -                 iprintf (is, "0x%lx", GET_OP (insn, TRAP));
461 +                 infprintf (is, "0x%lx", GET_OP (insn, TRAP));
462                   break;
463  
464                 case '~':
465                   delta = GET_OP (insn, OFFSET12);
466                   if (delta & 0x800)
467                     delta |= ~0x7ff;
468 -                 iprintf (is, "%d", delta);
469 +                 infprintf (is, "%d", delta);
470                   break;
471  
472                 case 'a':
473 @@ -2433,34 +2433,34 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
474                 case 'r':
475                 case 's':
476                 case 'v':
477 -                 iprintf (is, "%s", mips_gpr_names[GET_OP (insn, RS)]);
478 +                 infprintf (is, "%s", mips_gpr_names[GET_OP (insn, RS)]);
479                   break;
480  
481                 case 'c':
482 -                 iprintf (is, "0x%lx", GET_OP (insn, CODE));
483 +                 infprintf (is, "0x%lx", GET_OP (insn, CODE));
484                   break;
485  
486                 case 'd':
487 -                 iprintf (is, "%s", mips_gpr_names[GET_OP (insn, RD)]);
488 +                 infprintf (is, "%s", mips_gpr_names[GET_OP (insn, RD)]);
489                   break;
490  
491                 case 'h':
492 -                 iprintf (is, "0x%lx", GET_OP (insn, PREFX));
493 +                 infprintf (is, "0x%lx", GET_OP (insn, PREFX));
494                   break;
495  
496                 case 'i':
497                 case 'u':
498 -                 iprintf (is, "0x%lx", GET_OP (insn, IMMEDIATE));
499 +                 infprintf (is, "0x%lx", GET_OP (insn, IMMEDIATE));
500                   break;
501  
502                 case 'j': /* Same as i, but sign-extended.  */
503                 case 'o':
504                   delta = (GET_OP (insn, DELTA) ^ 0x8000) - 0x8000;
505 -                 iprintf (is, "%d", delta);
506 +                 infprintf (is, "%d", delta);
507                   break;
508  
509                 case 'k':
510 -                 iprintf (is, "0x%x", GET_OP (insn, CACHE));
511 +                 infprintf (is, "0x%x", GET_OP (insn, CACHE));
512                   break;
513  
514                 case 'n':
515 @@ -2472,26 +2472,26 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
516                     if (s_reg_encode != 0)
517                       {
518                         if (s_reg_encode == 1)
519 -                         iprintf (is, "%s", mips_gpr_names[16]);
520 +                         infprintf (is, "%s", mips_gpr_names[16]);
521                         else if (s_reg_encode < 9)
522 -                         iprintf (is, "%s-%s",
523 +                         infprintf (is, "%s-%s",
524                                    mips_gpr_names[16],
525                                    mips_gpr_names[15 + s_reg_encode]);
526                         else if (s_reg_encode == 9)
527 -                         iprintf (is, "%s-%s,%s",
528 +                         infprintf (is, "%s-%s,%s",
529                                    mips_gpr_names[16],
530                                    mips_gpr_names[23],
531                                    mips_gpr_names[30]);
532                         else
533 -                         iprintf (is, "UNKNOWN");
534 +                         infprintf (is, "UNKNOWN");
535                       }
536  
537                     if (immed & 0x10) /* For ra.  */
538                       {
539                         if (s_reg_encode == 0)
540 -                         iprintf (is, "%s", mips_gpr_names[31]);
541 +                         infprintf (is, "%s", mips_gpr_names[31]);
542                         else
543 -                         iprintf (is, ",%s", mips_gpr_names[31]);
544 +                         infprintf (is, ",%s", mips_gpr_names[31]);
545                       }
546                     break;
547                   }
548 @@ -2504,32 +2504,32 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
549                   break;
550  
551                 case 'q':
552 -                 iprintf (is, "0x%lx", GET_OP (insn, CODE2));
553 +                 infprintf (is, "0x%lx", GET_OP (insn, CODE2));
554                   break;
555  
556                 case 't':
557                 case 'w':
558 -                 iprintf (is, "%s", mips_gpr_names[GET_OP (insn, RT)]);
559 +                 infprintf (is, "%s", mips_gpr_names[GET_OP (insn, RT)]);
560                   break;
561  
562                 case 'y':
563 -                 iprintf (is, "%s", mips_gpr_names[GET_OP (insn, RS3)]);
564 +                 infprintf (is, "%s", mips_gpr_names[GET_OP (insn, RS3)]);
565                   break;
566  
567                 case 'z':
568 -                 iprintf (is, "%s", mips_gpr_names[0]);
569 +                 infprintf (is, "%s", mips_gpr_names[0]);
570                   break;
571  
572                 case 'B':
573 -                 iprintf (is, "0x%lx", GET_OP (insn, CODE10));
574 +                 infprintf (is, "0x%lx", GET_OP (insn, CODE10));
575                   break;
576  
577                 case 'C':
578 -                 iprintf (is, "0x%lx", GET_OP (insn, COPZ));
579 +                 infprintf (is, "0x%lx", GET_OP (insn, COPZ));
580                   break;
581  
582                 case 'D':
583 -                 iprintf (is, "%s", mips_fpr_names[GET_OP (insn, FD)]);
584 +                 infprintf (is, "%s", mips_fpr_names[GET_OP (insn, FD)]);
585                   break;
586  
587                 case 'E':
588 @@ -2540,7 +2540,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
589                     'T' format.  Therefore, until we gain understanding of
590                     cp2 register names, we can simply print the register
591                     numbers.  */
592 -                 iprintf (is, "$%ld", GET_OP (insn, RT));
593 +                 infprintf (is, "$%ld", GET_OP (insn, RT));
594                   break;
595  
596                 case 'G':
597 @@ -2559,44 +2559,44 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
598                     case 0x000002fc:                            /* mtc0  */
599                     case 0x580000fc:                            /* dmfc0 */
600                     case 0x580002fc:                            /* dmtc0 */
601 -                     iprintf (is, "%s", mips_cp0_names[GET_OP (insn, RS)]);
602 +                     infprintf (is, "%s", mips_cp0_names[GET_OP (insn, RS)]);
603                       break;
604                     default:
605 -                     iprintf (is, "$%ld", GET_OP (insn, RS));
606 +                     infprintf (is, "$%ld", GET_OP (insn, RS));
607                       break;
608                     }
609                   break;
610  
611                 case 'H':
612 -                 iprintf (is, "%ld", GET_OP (insn, SEL));
613 +                 infprintf (is, "%ld", GET_OP (insn, SEL));
614                   break;
615  
616                 case 'K':
617 -                 iprintf (is, "%s", mips_hwr_names[GET_OP (insn, RS)]);
618 +                 infprintf (is, "%s", mips_hwr_names[GET_OP (insn, RS)]);
619                   break;
620  
621                 case 'M':
622 -                 iprintf (is, "$fcc%ld", GET_OP (insn, CCC));
623 +                 infprintf (is, "$fcc%ld", GET_OP (insn, CCC));
624                   break;
625  
626                 case 'N':
627 -                 iprintf (is,
628 +                 infprintf (is,
629                            (op->pinfo & (FP_D | FP_S)) != 0
630                            ? "$fcc%ld" : "$cc%ld",
631                            GET_OP (insn, BCC));
632                   break;
633  
634                 case 'R':
635 -                 iprintf (is, "%s", mips_fpr_names[GET_OP (insn, FR)]);
636 +                 infprintf (is, "%s", mips_fpr_names[GET_OP (insn, FR)]);
637                   break;
638  
639                 case 'S':
640                 case 'V':
641 -                 iprintf (is, "%s", mips_fpr_names[GET_OP (insn, FS)]);
642 +                 infprintf (is, "%s", mips_fpr_names[GET_OP (insn, FS)]);
643                   break;
644  
645                 case 'T':
646 -                 iprintf (is, "%s", mips_fpr_names[GET_OP (insn, FT)]);
647 +                 infprintf (is, "%s", mips_fpr_names[GET_OP (insn, FT)]);
648                   break;
649  
650                 case '+':
651 @@ -2606,18 +2606,18 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
652                     {
653                     case 'A':
654                       lsb = GET_OP (insn, EXTLSB);
655 -                     iprintf (is, "0x%x", lsb);
656 +                     infprintf (is, "0x%x", lsb);
657                       break;
658  
659                     case 'B':
660                       msb = GET_OP (insn, INSMSB);
661 -                     iprintf (is, "0x%x", msb - lsb + 1);
662 +                     infprintf (is, "0x%x", msb - lsb + 1);
663                       break;
664  
665                     case 'C':
666                     case 'H':
667                       msbd = GET_OP (insn, EXTMSBD);
668 -                     iprintf (is, "0x%x", msbd + 1);
669 +                     infprintf (is, "0x%x", msbd + 1);
670                       break;
671  
672                     case 'D':
673 @@ -2637,30 +2637,30 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
674                                                      mips_cp0sel_names_len,
675                                                      cp0reg, sel);
676                         if (n != NULL)
677 -                         iprintf (is, "%s", n->name);
678 +                         infprintf (is, "%s", n->name);
679                         else
680 -                         iprintf (is, "$%d,%d", cp0reg, sel);
681 +                         infprintf (is, "$%d,%d", cp0reg, sel);
682                         break;
683                       }
684  
685                     case 'E':
686                       lsb = GET_OP (insn, EXTLSB) + 32;
687 -                     iprintf (is, "0x%x", lsb);
688 +                     infprintf (is, "0x%x", lsb);
689                       break;
690  
691                     case 'F':
692                       msb = GET_OP (insn, INSMSB) + 32;
693 -                     iprintf (is, "0x%x", msb - lsb + 1);
694 +                     infprintf (is, "0x%x", msb - lsb + 1);
695                       break;
696  
697                     case 'G':
698                       msbd = GET_OP (insn, EXTMSBD) + 32;
699 -                     iprintf (is, "0x%x", msbd + 1);
700 +                     infprintf (is, "0x%x", msbd + 1);
701                       break;
702  
703                     default:
704                       /* xgettext:c-format */
705 -                     iprintf (is,
706 +                     infprintf (is,
707                                _("# internal disassembler error, "
708                                  "unrecognized modifier (+%c)"),
709                                *s);
710 @@ -2674,111 +2674,111 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
711                   switch (*s)
712                     {
713                     case 'a':   /* global pointer.  */
714 -                     iprintf (is, "%s", mips_gpr_names[28]);
715 +                     infprintf (is, "%s", mips_gpr_names[28]);
716                       break;
717  
718                     case 'b':
719                       regno = micromips_to_32_reg_b_map[GET_OP (insn, MB)];
720 -                     iprintf (is, "%s", mips_gpr_names[regno]);
721 +                     infprintf (is, "%s", mips_gpr_names[regno]);
722                       break;
723  
724                     case 'c':
725                       regno = micromips_to_32_reg_c_map[GET_OP (insn, MC)];
726 -                     iprintf (is, "%s", mips_gpr_names[regno]);
727 +                     infprintf (is, "%s", mips_gpr_names[regno]);
728                       break;
729  
730                     case 'd':
731                       regno = micromips_to_32_reg_d_map[GET_OP (insn, MD)];
732 -                     iprintf (is, "%s", mips_gpr_names[regno]);
733 +                     infprintf (is, "%s", mips_gpr_names[regno]);
734                       break;
735  
736                     case 'e':
737                       regno = micromips_to_32_reg_e_map[GET_OP (insn, ME)];
738 -                     iprintf (is, "%s", mips_gpr_names[regno]);
739 +                     infprintf (is, "%s", mips_gpr_names[regno]);
740                       break;
741  
742                     case 'f':
743                       /* Save lastregno for "mt" to print out later.  */
744                       lastregno = micromips_to_32_reg_f_map[GET_OP (insn, MF)];
745 -                     iprintf (is, "%s", mips_gpr_names[lastregno]);
746 +                     infprintf (is, "%s", mips_gpr_names[lastregno]);
747                       break;
748  
749                     case 'g':
750                       regno = micromips_to_32_reg_g_map[GET_OP (insn, MG)];
751 -                     iprintf (is, "%s", mips_gpr_names[regno]);
752 +                     infprintf (is, "%s", mips_gpr_names[regno]);
753                       break;
754  
755                     case 'h':
756                       regno = micromips_to_32_reg_h_map[GET_OP (insn, MH)];
757 -                     iprintf (is, "%s", mips_gpr_names[regno]);
758 +                     infprintf (is, "%s", mips_gpr_names[regno]);
759                       break;
760  
761                     case 'i':
762                       regno = micromips_to_32_reg_i_map[GET_OP (insn, MI)];
763 -                     iprintf (is, "%s", mips_gpr_names[regno]);
764 +                     infprintf (is, "%s", mips_gpr_names[regno]);
765                       break;
766  
767                     case 'j':
768 -                     iprintf (is, "%s", mips_gpr_names[GET_OP (insn, MJ)]);
769 +                     infprintf (is, "%s", mips_gpr_names[GET_OP (insn, MJ)]);
770                       break;
771  
772                     case 'l':
773                       regno = micromips_to_32_reg_l_map[GET_OP (insn, ML)];
774 -                     iprintf (is, "%s", mips_gpr_names[regno]);
775 +                     infprintf (is, "%s", mips_gpr_names[regno]);
776                       break;
777  
778                     case 'm':
779                       regno = micromips_to_32_reg_m_map[GET_OP (insn, MM)];
780 -                     iprintf (is, "%s", mips_gpr_names[regno]);
781 +                     infprintf (is, "%s", mips_gpr_names[regno]);
782                       break;
783  
784                     case 'n':
785                       regno = micromips_to_32_reg_n_map[GET_OP (insn, MN)];
786 -                     iprintf (is, "%s", mips_gpr_names[regno]);
787 +                     infprintf (is, "%s", mips_gpr_names[regno]);
788                       break;
789  
790                     case 'p':
791                       /* Save lastregno for "mt" to print out later.  */
792                       lastregno = GET_OP (insn, MP);
793 -                     iprintf (is, "%s", mips_gpr_names[lastregno]);
794 +                     infprintf (is, "%s", mips_gpr_names[lastregno]);
795                       break;
796  
797                     case 'q':
798                       regno = micromips_to_32_reg_q_map[GET_OP (insn, MQ)];
799 -                     iprintf (is, "%s", mips_gpr_names[regno]);
800 +                     infprintf (is, "%s", mips_gpr_names[regno]);
801                       break;
802  
803                     case 'r':   /* program counter.  */
804 -                     iprintf (is, "$pc");
805 +                     infprintf (is, "$pc");
806                       break;
807  
808                     case 's':   /* stack pointer.  */
809                       lastregno = 29;
810 -                     iprintf (is, "%s", mips_gpr_names[29]);
811 +                     infprintf (is, "%s", mips_gpr_names[29]);
812                       break;
813  
814                     case 't':
815 -                     iprintf (is, "%s", mips_gpr_names[lastregno]);
816 +                     infprintf (is, "%s", mips_gpr_names[lastregno]);
817                       break;
818  
819                     case 'z':   /* $0.  */
820 -                     iprintf (is, "%s", mips_gpr_names[0]);
821 +                     infprintf (is, "%s", mips_gpr_names[0]);
822                       break;
823  
824                     case 'A':
825                       /* Sign-extend the immediate.  */
826                       immed = ((GET_OP (insn, IMMA) ^ 0x40) - 0x40) << 2;
827 -                     iprintf (is, "%d", immed);
828 +                     infprintf (is, "%d", immed);
829                       break;
830  
831                     case 'B':
832                       immed = micromips_imm_b_map[GET_OP (insn, IMMB)];
833 -                     iprintf (is, "%d", immed);
834 +                     infprintf (is, "%d", immed);
835                       break;
836  
837                     case 'C':
838                       immed = micromips_imm_c_map[GET_OP (insn, IMMC)];
839 -                     iprintf (is, "0x%lx", immed);
840 +                     infprintf (is, "0x%lx", immed);
841                       break;
842  
843                     case 'D':
844 @@ -2797,50 +2797,50 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
845  
846                     case 'F':
847                       immed = GET_OP (insn, IMMF);
848 -                     iprintf (is, "0x%x", immed);
849 +                     infprintf (is, "0x%x", immed);
850                       break;
851  
852                     case 'G':
853                       immed = (insn >> MICROMIPSOP_SH_IMMG) + 1;
854                       immed = (immed & MICROMIPSOP_MASK_IMMG) - 1;
855 -                     iprintf (is, "%d", immed);
856 +                     infprintf (is, "%d", immed);
857                       break;
858  
859                     case 'H':
860                       immed = GET_OP (insn, IMMH) << 1;
861 -                     iprintf (is, "%d", immed);
862 +                     infprintf (is, "%d", immed);
863                       break;
864  
865                     case 'I':
866                       immed = (insn >> MICROMIPSOP_SH_IMMI) + 1;
867                       immed = (immed & MICROMIPSOP_MASK_IMMI) - 1;
868 -                     iprintf (is, "%d", immed);
869 +                     infprintf (is, "%d", immed);
870                       break;
871  
872                     case 'J':
873                       immed = GET_OP (insn, IMMJ) << 2;
874 -                     iprintf (is, "%d", immed);
875 +                     infprintf (is, "%d", immed);
876                       break;
877  
878                     case 'L':
879                       immed = GET_OP (insn, IMML);
880 -                     iprintf (is, "%d", immed);
881 +                     infprintf (is, "%d", immed);
882                       break;
883  
884                     case 'M':
885                       immed = (insn >> MICROMIPSOP_SH_IMMM) - 1;
886                       immed = (immed & MICROMIPSOP_MASK_IMMM) + 1;
887 -                     iprintf (is, "%d", immed);
888 +                     infprintf (is, "%d", immed);
889                       break;
890  
891                     case 'N':
892                       immed = GET_OP (insn, IMMN);
893                       if (immed == 0)
894 -                       iprintf (is, "%s,%s",
895 +                       infprintf (is, "%s,%s",
896                                  mips_gpr_names[16],
897                                  mips_gpr_names[31]);
898                       else
899 -                       iprintf (is, "%s-%s,%s",
900 +                       infprintf (is, "%s-%s,%s",
901                                  mips_gpr_names[16],
902                                  mips_gpr_names[16 + immed],
903                                  mips_gpr_names[31]);
904 @@ -2848,35 +2848,35 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
905  
906                     case 'O':
907                       immed = GET_OP (insn, IMMO);
908 -                     iprintf (is, "0x%x", immed);
909 +                     infprintf (is, "0x%x", immed);
910                       break;
911  
912                     case 'P':
913                       immed = GET_OP (insn, IMMP) << 2;
914 -                     iprintf (is, "%d", immed);
915 +                     infprintf (is, "%d", immed);
916                       break;
917  
918                     case 'Q':
919                       /* Sign-extend the immediate.  */
920                       immed = (GET_OP (insn, IMMQ) ^ 0x400000) - 0x400000;
921                       immed <<= 2;
922 -                     iprintf (is, "%d", immed);
923 +                     infprintf (is, "%d", immed);
924                       break;
925  
926                     case 'U':
927                       immed = GET_OP (insn, IMMU) << 2;
928 -                     iprintf (is, "%d", immed);
929 +                     infprintf (is, "%d", immed);
930                       break;
931  
932                     case 'W':
933                       immed = GET_OP (insn, IMMW) << 2;
934 -                     iprintf (is, "%d", immed);
935 +                     infprintf (is, "%d", immed);
936                       break;
937  
938                     case 'X':
939                       /* Sign-extend the immediate.  */
940                       immed = (GET_OP (insn, IMMX) ^ 0x8) - 0x8;
941 -                     iprintf (is, "%d", immed);
942 +                     infprintf (is, "%d", immed);
943                       break;
944  
945                     case 'Y':
946 @@ -2885,12 +2885,12 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
947                       if (immed >= -2 && immed <= 1)
948                         immed ^= 0x100;
949                       immed = immed << 2;
950 -                     iprintf (is, "%d", immed);
951 +                     infprintf (is, "%d", immed);
952                       break;
953  
954                     default:
955                       /* xgettext:c-format */
956 -                     iprintf (is,
957 +                     infprintf (is,
958                                _("# internal disassembler error, "
959                                  "unrecognized modifier (m%c)"),
960                                *s);
961 @@ -2900,7 +2900,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
962  
963                 default:
964                   /* xgettext:c-format */
965 -                 iprintf (is,
966 +                 infprintf (is,
967                            _("# internal disassembler error, "
968                              "unrecognized modifier (%c)"),
969                            *s);
970 @@ -2937,7 +2937,7 @@ print_insn_micromips (bfd_vma memaddr, struct disassemble_info *info)
971      }
972  #undef GET_OP
973  
974 -  iprintf (is, "0x%x", insn);
975 +  infprintf (is, "0x%x", insn);
976    info->insn_type = dis_noninsn;
977  
978    return length;