9fd4a45aec4ae1be777189782df279589b6f1689
[openwrt/openwrt.git] / toolchain / binutils / patches / 2.19.1+cs / 000-codesourcery_2009q1_203.patch
1 --- /dev/null
2 +++ b/ChangeLog.csl
3 @@ -0,0 +1,5630 @@
4 +2009-05-21 Maxim Kuvyrkov <maxim@codesourcery.com>
5 +
6 + gas/
7 + * config/tc-m68k.c (mcf52235_ctrl): Remove non-existent CACR, ACR[01].
8 + (mcf53017_ctrl): Fix RAMBAR.
9 +
10 +2009-04-30 Nathan Sidwell <nathan@codesourcery.com>
11 +
12 + * release-notes-csl.xml: Add arm* TARGET for -mauto-it note.
13 +
14 +2009-04-23 Andrew Stubbs <ams@codesourcery.com>
15 +
16 + Issue #5328
17 +
18 + * release-notes-csl.xml: Document bug fix.
19 +
20 + bfd/
21 + * elf32-arm.c (elf32_arm_fix_exidx_coverage): Don't attempt to
22 + fix discarded sections.
23 +
24 +2009-04-22 Daniel Jacobowitz <dan@codesourcery.com>
25 +
26 + Issue #4502
27 +
28 + * release-notes-csl.xml (Assembler fix for -mauto-it): New note.
29 +
30 + gas/
31 + * config/tc-arm.c (handle_it_state): Use force_automatic_it_block_close
32 + to close the previous IT block. Only close the next IT block if we
33 + opened a new one for an IT-only instruction.
34 +
35 +2009-04-22 Nathan Sidwell <nathan@codesourcery.com>
36 +
37 + Issue 5271
38 +
39 + Backport 2009-04-22 Nathan Sidwell <nathan@codesourcery.com>
40 + ld/testsuite/
41 + * ld-scripts/rgn-at1.d: Cope with larger padding on sections.
42 + * ld-scripts/rgn-at2.d: Likewise.
43 + * ld-scripts/rgn-at3.d: Likewise.
44 +
45 + Backport 2009-04-03 Nathan Sidwell <nathan@codesourcery.com>
46 + ld/testuite/
47 + * ld-scripts/rgn-at.s: Use explicit .section pseudos.
48 +
49 +2009-04-21 Andrew Jenner <andrew@codesourcery.com>
50 +
51 + Issue #5270
52 +
53 + * ld/testsuite/ld-elf/eh5.d: Accept 0b as well as 1b for the
54 + personality byte in the augmentation data.
55 +
56 +2009-04-20 Daniel Gutson <dgutson@codesourcery.com>
57 +
58 + Issue #5050
59 +
60 + binutils/
61 + * readelf.c (get_arm_section_type_name): Added support for
62 + new sections headers.
63 +
64 + include/elf
65 + * arm.h: (SHT_ARM_DEBUGOVERLAY): New define.
66 + (SHT_ARM_OVERLAYSECTION): New define.
67 +
68 + * release-notes-csl.xml: Document.
69 +
70 +2009-04-15 Nathan Froyd <froydnj@codesourcery.com>
71 +
72 + * release-notes-csl.xml: Fix typo.
73 +
74 +2009-04-14 Daniel Jacobowitz <dan@codesourcery.com>
75 +
76 + Issue #1956, #2786, #5144
77 + * release-notes-csl.xml (Mapping symbols): New note.
78 +
79 + gas/testsuite/
80 + * gas/arm/mapdir.d, gas/arm/mapdir.s: New files.
81 +
82 + gas/
83 + * config/tc-arm.c (make_mapping_symbol): New function, from
84 + mapping_state. Save mapping symbols in the frag.
85 + (insert_data_mapping_symbol): New.
86 + (mapping_state): Use make_mapping_symbol.
87 + (mapping_state_2): New. Provide dummy definition.
88 + (opcode_select): Do not call mapping_state.
89 + (s_bss): Call md_elf_section_change_hook instead of mapping_state.
90 + (arm_handle_align): Update use of tc_frag_data.
91 + Call insert_data_mapping_symbol.
92 + (arm_init_frag): Update use of tc_frag_data. Call
93 + mapping_state_2.
94 + (check_mapping_symbols): New function.
95 + (arm_adjust_symtab): Use check_mapping_symbols.
96 + * config/tc-arm.h (struct arm_frag_type): New.
97 + (TC_FRAG_TYPE): Change to struct arm_frag_type.
98 + (TC_FRAG_INIT): Pass max_chars.
99 + (arm_init_frag): Update prototype.
100 +
101 + ld/testsuite/
102 + * ld-arm/thumb2-bl-blx-interwork.d: Correct disassembly.
103 + * ld-arm/script-type.sym: Add an additional $a mapping symbol.
104 +
105 + binutils/testsuite/
106 + * binutils-all/arm/thumb2-cond.s: Use instructions.
107 +
108 +2009-04-12 Daniel Jacobowitz <dan@codesourcery.com>
109 +
110 + Issue #5185
111 +
112 + * release-notes-csl.xml (Incorrect placement of linker-generated
113 + functions): New note.
114 +
115 + bfd/
116 + * elf32-arm.c (elf32_arm_next_input_section): Skip flags without
117 + SEC_CODE.
118 + (group_sections): Handle empty lists.
119 +
120 +2009-04-09 Daniel Jacobowitz <dan@codesourcery.com>
121 +
122 + Issue #4849
123 +
124 + * release-notes-csl.xml (Assembler floating point format): New note.
125 +
126 + gas/testsuite/
127 + * gas/arm/mapmisc.d: Correct expected output for .double and .dcb.d.
128 +
129 +2009-04-09 Daniel Gutson <dgutson@codesourcery.com>
130 +
131 + Issue #4502
132 +
133 + gas/testsuite/
134 + * gas/arm/arm-it-auto.d: fixed test case dump.
135 +
136 +2009-04-09 Catherine Moore <clm@codesourcery.com>
137 +
138 + gas/
139 + * config/tc-mips.c (check_for_24k_errata): Adjust if block.
140 + Remove return.
141 +
142 +2009-04-09 Daniel Gutson <dgutson@codesourcery.com>
143 + Issue #4502
144 +
145 + gas/
146 + * config/tc-arm.c (do_automatic_it): New variable.
147 + (it_instruction_type): New enum.
148 + (arm_it): New field.
149 + (it_state): New enum.
150 + (current_it): New struct and global variable.
151 + (current_it_compatible): New function.
152 + (conditional_insn): New function.
153 + (set_it_insn_type): New macro.
154 + (set_it_insn_type_last): New macro.
155 + (do_t_add_sub): Call automatic IT machinery functions.
156 + (do_t_arit3): Likewise.
157 + (do_t_arit3c): Likewise.
158 + (do_t_blx): Likewise.
159 + (do_t_branch): Likewise.
160 + (do_t_bkpt): Likewise.
161 + (do_t_branch23): Likewise.
162 + (do_t_bx): Likewise.
163 + (do_t_bxj): Likewise.
164 + (do_t_cps): Likewise.
165 + (do_t_cpsi): Likewise.
166 + (do_t_cbz): Likewise.
167 + (do_t_it): Likewise.
168 + (encode_thumb2_ldmstm): Likewise.
169 + (do_t_ldst): Likewise.
170 + (do_t_mov_cmp): Likewise.
171 + (do_t_mvn_tst): Likewise.
172 + (do_t_mul): Likewise.
173 + (do_t_neg): Likewise.
174 + (do_t_setend): Likewise.
175 + (do_t_shift): Likewise.
176 + (do_t_tb): Likewise.
177 + (output_it_inst): New function.
178 + (new_automatic_it_block): New function.
179 + (close_automatic_it_block): New function.
180 + (current_it_add_mask): New function.
181 + (it_fsm_pre_encode): New function.
182 + (handle_it_state): New function.
183 + (it_fsm_post_encode): New function.
184 + (force_automatic_it_block_close): New function.
185 + (in_it_block): New function.
186 + (md_assemble): Call automatic IT block machinery functions.
187 + (arm_frob_label): Likewise.
188 + (arm_opts): New element.
189 + * doc/c-arm.texi: New option -mauto-it.
190 +
191 + gas/testsuite/
192 + * gas/arm/arm-it-auto.d: New test.
193 + * gas/arm/arm-it-auto.s: New file.
194 + * gas/arm/thumb2_it_auto.d: New test.
195 + * gas/arm/thumb2_it_bad.l: Error message updated.
196 + * gas/arm/thumb2_it_bad_auto.d: New test.
197 + * gas/arm/thumb2_it.d: Comment added.
198 + * gas/arm/thumb2_it_bad.d: Comment added.
199 +
200 + * release-notes-csl.xml: Document.
201 +
202 +2009-04-08 Daniel Gutson <dgutson@codesourcery.com>
203 +
204 + gas/testsuite/
205 + * gas/arm/thumb2_it.d: Removed obsolete regex.
206 +
207 +2009-04-08 Paul Brook <paul@codesourcery.com>
208 +
209 + Issue #5162
210 + bfd/
211 + * elf32-arm.c (make_branch_to_a8_stub): Ignore long branch stubs.
212 +
213 +2009-04-08 Catherine Moore <clm@codesourcery.com>
214 +
215 + Issue #4593
216 +
217 + gas/
218 + * config/tc-mips.c (mips_fix_24k): Declare.
219 + (check_for_24k_errata): New.
220 + (mips_cleanup): Call check_for_24k_errata.
221 + (start_noreorder): Likewise.
222 + (md_mips_end): Likewise.
223 + (s_change_sec): Likewise.
224 + (s_change_section): Likewise.
225 + (append_insn): Call check_for_24k_errata. Prevent
226 + ERET/DERET instructions from being moved into delay
227 + slots.
228 + (OPTION_FIX_24K): New.
229 + (OPTION_NO_FIX_24k): New.
230 + (md_longopts): Add "mfix-24k" and "mno-fix-24k".
231 + (md_parse_option): Handle fix-24k options.
232 + (md_show_usage): Display fix-24k options.
233 + * doc/c-mips.texi: Document.
234 + * testsuite/gas/mips/mips.exp: Run new tests.
235 + * testsuite/gas/mips/eret.s: New test.
236 + * testsuite/gas/mips/eret.d: New test output.
237 + * testsuite/gas/mips/eret.l: New test output.
238 +
239 + * release-notes-csl.xml: New note.
240 +
241 +2009-04-08 Nathan Froyd <froydnj@codesourcery.com>
242 +
243 + Issue #5170
244 +
245 + * release-notes-csl.xml (tlbilx encoding fix): New note.
246 +
247 + Backport from mainline:
248 +
249 + gas/
250 + 2009-04-07 Peter Bergner <bergner@vnet.ibm.com>
251 +
252 + * ppc-opc.c (powerpc_opcodes) <"tlbilxlpid", "tlbilxpid", "tlbilxva",
253 + "tlbilx">: Use secondary opcode "18" as per the ISA 2.06 documentation.
254 + Reorder entries so the extended mnemonics are listed before tlbilx.
255 +
256 + opcodes/
257 + 2009-04-07 Peter Bergner <bergner@vnet.ibm.com>
258 +
259 + * gas/ppc/e500mc.d: Update to match extended mnemonics.
260 +
261 +2009-04-06 Daniel Gutson <dgutson@codesourcery.com>
262 +
263 + Issue #5124
264 +
265 + gas/
266 + * config/tc-arm.c (arm_frag_align_code): Fixed the string message.
267 + * config/tc-arm.h (MAX_MEM_ALIGNMENT_BYTES): New macro.
268 + (MAX_MEM_FOR_RS_ALIGN_CODE): Macro changed to use the above.
269 +
270 + gas/testsuite/
271 + * gas/arm/align64.d: New file.
272 + * gas/arm/align64.s: New file.
273 +
274 + * release-notes-csl.xml: Document.
275 +
276 +2009-04-06 Andrew Jenner <andrew@codesourcery.com>
277 +
278 + bfd/
279 + * elf32-arm.c: Move sysdep.h to start of file.
280 +
281 +2009-04-06 Kazu Hirata <kazu@codesourcery.com>
282 +
283 + Backport from FSF:
284 + ld/
285 + 2009-04-06 Kazu Hirata <kazu@codesourcery.com>
286 + * ld.texinfo (-L): Mention that -L options do not affect how ld
287 + searches for a linker script unless -T option is specified.
288 + * ldfile.c (ldfile_find_command_file): Append the path obtained
289 + from the program name to the search path instead of
290 + prepending. Add a new parameter "default_only". Restrict the
291 + search to the default script location if the new parameter is
292 + true.
293 + (ldfile_open_command_file_1): New.
294 + (ldfile_open_command_file): Call ldfile_open_command_file_1.
295 + (ldfile_open_default_command_file): New.
296 +
297 + * ldfile.c (ldfile_find_command_file): Initialize result.
298 +
299 +2009-04-05 Kazu Hirata <kazu@codesourcery.com>
300 +
301 + Issue #5010
302 + binutils/
303 + * objcopy.c (maybe_sign_extend_vma): New.
304 + (setup_section): Call maybe_sign_extend_vma after manipulating
305 + addresses.
306 +
307 + * release-notes-csl.xml: Mention the bug fix above.
308 +
309 +2009-04-03 Julian Brown <julian@codesourcery.com>
310 +
311 + * release-notes-csl.xml (Cortex-A8 erratum workaround enabled
312 + for ARMv7-A): Add note.
313 +
314 +2009-04-03 Julian Brown <julian@codesourcery.com>
315 +
316 + ld/
317 + * emultempl/armelf.em (OPTION_NO_FIX_CORTEX_A8): New.
318 + (PARSE_AND_LIST_LONGOPTS): Add --no-fix-cortex-a8 option. Remove
319 + argument from --fix-cortex-a8.
320 + (PARSE_AND_LIST_OPTIONS): Adjust for --[no-]fix-cortex-a8 syntax.
321 + (PARSE_FIX_CORTEX_A8, PARSE_NO_FIX_CORTEX_A8): Handle
322 + --[no-]fix-cortex-a8 syntax.
323 + * ld.texinfo (--fix-cortex-a8): Document.
324 +
325 + bfd/
326 + * elf32-arm.c (bfd_elf32_arm_set_cortex_a8_fix): Re-enable fix by
327 + default on ARM v7-A.
328 +
329 +2009-04-03 Nathan Sidwell <nathan@codesourcery.com>
330 +
331 + Issue #5022
332 + ld/
333 + * ldlang.c (lang_leave_output_section_statement): Set lma_region
334 + if it is not overridden and section is for the same vma region as
335 + the previous section.
336 +
337 + ld/testsuite/
338 + * ld-scripts/rgn-at.exp: New.
339 + * ld-scripts/rgn-at.s: New.
340 + * ld-scripts/rgn-at1.d: New.
341 + * ld-scripts/rgn-at1.t: New.
342 + * ld-scripts/rgn-at2.d: New.
343 + * ld-scripts/rgn-at2.t: New.
344 + * ld-scripts/rgn-at3.d: New.
345 + * ld-scripts/rgn-at3.t: New.
346 +
347 + * release-notes-csl.xml: Add note.
348 +
349 +2009-04-02 Nathan Sidwell <nathan@codesourcery.com>
350 +
351 + Issues #4842, #5076
352 + gas/
353 + * config/tc-armlinux-eabi.h (FPU_DEFAULT): Default to plain VFP.
354 + * config/tc-armeabi.h (FPU_DEFAULT): Likewise.
355 + * config/tc-arm.c (md_begin): If FPU_DEFAULT is set, don't infer
356 + the default FPU from the processor.
357 +
358 + gas/testsuite/
359 + * gas/arm/attr-mcpu.d: Add -mfpu=neon.
360 +
361 + * release-notes-csl.xml: Add note.
362 +
363 +2009-03-31 Paul Brook <paul@codesourcery.com>
364 +
365 + Issue #1531
366 +
367 + bfd/
368 + * bfd-in.h (elf32_arm_fix_exidx_coverage): Add prototype.
369 + * bfd-in2.h: Regenerate.
370 + * elf32-arm.c (arm_unwind_edit_type, arm_unwind_table_edit): Define.
371 + (_arm_elf_section_data): Add text and exidx fields.
372 + (add_unwind_table_edit, get_arm_elf_section_data, adjust_exidx_size,
373 + insert_cantunwind_after, elf32_arm_fix_exidx_coverage, offset_prel31,
374 + copy_exidx_entry): New functions.
375 + (elf32_arm_write_section): Fixup .ARM.exidx contents.
376 +
377 + ld/
378 + * emultempl/armelf.em (compare_output_sec_vma): New function.
379 + (gld${EMULATION_NAME}_finish): Add exidx munging code.
380 +
381 + ld/testsuite/
382 + * ld-arm/arm.ld: Add .ARM.exidx and .ARM.extab.
383 + * ld-arm/arm-elf.exp: Add unwind-[1-4].
384 + * ld-arm/unwind-1.d: New test.
385 + * ld-arm/unwind-1.s: New test.
386 + * ld-arm/unwind-2.d: New test.
387 + * ld-arm/unwind-2.s: New test.
388 + * ld-arm/unwind-3.d: New test.
389 + * ld-arm/unwind-3.s: New test.
390 + * ld-arm/unwind-4.d: New test.
391 + * ld-arm/unwind-4.s: New test.
392 +
393 +2009-03-30 Andrew Jenner <andrew@codesourcery.com>
394 +
395 + ld/
396 + * emultempl/octeonelf.em: Source mipself.em.
397 +
398 + gas/
399 + * config/tc-arm.c: Move as.h to start of file.
400 +
401 +2009-03-30 Joseph Myers <joseph@codesourcery.com>
402 +
403 + Issue #5084
404 +
405 + Backport from FSF:
406 +
407 + gas/testsuite/
408 + * gas/arm/mapsecs.d, gas/arm/mapsecs.s: New.
409 +
410 + opcodes/
411 + * arm-dis.c (print_insn): Also check section matches in backwards
412 + search for mapping symbol.
413 +
414 +2009-03-30 Julian Brown <julian@codesourcery.com>
415 +
416 + bfd/
417 + * elf32-arm.c (a8_erratum_fix): Add r_type, st_type, sym_name,
418 + non_a8_stub fields.
419 + (find_thumb_glue): Add forward declaration.
420 + (elf32_arm_size_stubs): Improve integration of Cortex-A8 erratum
421 + workaround and ARM/Thumb interworking.
422 +
423 + ld/testsuite/
424 + * ld-arm/cortex-a8-fix-b.s: Update for text at 0x8f00.
425 + * ld-arm/cortex-a8-fix-bl.s: Likewise.
426 + * ld-arm/cortex-a8-fix-bcc.s: Likewise.
427 + * ld-arm/cortex-a8-fix-blx.s: Likewise.
428 + * ld-arm/cortex-a8-fix-b.d: Update.
429 + * ld-arm/cortex-a8-fix-bl.d: Update.
430 + * ld-arm/cortex-a8-fix-bcc.d: Update.
431 + * ld-arm/cortex-a8-fix-blx.d: Update.
432 + * ld-arm/cortex-a8-arm-target.s: New.
433 + * ld-arm/cortex-a8-thumb-target.s: New.
434 + * ld-arm/cortex-a8-fix-b-rel.s: New.
435 + * ld-arm/cortex-a8-fix-b-rel-arm.d: New.
436 + * ld-arm/cortex-a8-fix-b-rel-thumb.d: New.
437 + * ld-arm/cortex-a8-fix-bl-rel.s: New.
438 + * ld-arm/cortex-a8-fix-bl-rel-arm.d: New.
439 + * ld-arm/cortex-a8-fix-bl-rel-thumb.d: New.
440 + * ld-arm/cortex-a8-fix-bcc-rel.s: New.
441 + * ld-arm/cortex-a8-fix-bcc-rel-thumb.d: New.
442 + * ld-arm/cortex-a8-fix-blx-rel.s: New.
443 + * ld-arm/cortex-a8-fix-blx-rel-arm.d: New.
444 + * ld-arm/cortex-a8-fix-blx-rel-thumb.d: New.
445 + * ld-arm/arm-elf.exp: Move text section to 0x8f00 in existing
446 + Cortex-A8 erratum workaround tests, and add above new tests.
447 +
448 +2009-03-29 Mark Mitchell <mark@codesourcery.com>
449 +
450 + Backport:
451 +
452 + 2009-03-28 Mark Mitchell <mark@codesourcery.com>
453 + bfd/
454 + * coff-arm.c (coff_arm_merge_private_bfd_data): Use "error:", not
455 + "ERROR:", in error messages.
456 + * cpu-arm.c (bfd_arm_merge_machines): Likewise.
457 + * elf-attrs.c (_bfd_elf_merge_object_attributes): Likewise.
458 + * elf32-arm.c (tag_cpu_arch_combine): Likewise.
459 + (elf32_arm_merge_eabi_attributes): Likewise.
460 + (elf32_arm_merge_private_bfd_data): Likewise.
461 +
462 +2009-03-24 Daniel Jacobowitz <dan@codesourcery.com>
463 +
464 + bfd/
465 + * elf32-arm.c (INTERWORK_FLAG): Check BFD_LINKER_CREATED.
466 +
467 +2009-03-22 Mark Mitchell <mark@codesourcery.com>
468 +
469 + ld/testsuite/
470 + * ld-arm/arm-elf.exp (armelftests): Use -EL for Cortex-A8 tests.
471 +
472 +2009-03-20 Julian Brown <julian@codesourcery.com>
473 +
474 + * release-notes-csl.xml (Erratum workaround for Cortex-A8 processors):
475 + Add note.
476 +
477 +2009-03-20 Julian Brown <julian@codesourcery.com>
478 +
479 + ld/testsuite/
480 + * ld-arm/arm-elf.exp (Cortex-A8 erratum fix, b.w)
481 + (Cortex-A8 erratum fix, bl.w, Cortex-A8 erratum fix, bcc.w)
482 + (Cortex-A8 erratum fix, blx.w): Pass --fix-cortex-a8 option.
483 +
484 + bfd/
485 + * elf32-arm.c (bfd_elf32_arm_set_cortex_a8_fix): Disable fix by
486 + default in all cases.
487 +
488 +2009-03-20 Julian Brown <julian@codesourcery.com>
489 +
490 + gas/
491 + * config/tc-arm.c (do_t_blx): Always use BFD_RELOC_THUMB_PCREL_BLX.
492 + (md_pcrel_from_section): Align address for BLX.
493 + (tc_gen_reloc): Change BFD_RELOC_THUMB_PCREL_BLX relocations to
494 + BFD_RELOC_THUMB_PCREL_BRANCH23 for EABI v4+.
495 +
496 + ld/testsuite/
497 + * ld-arm/arm-elf.exp (armeabitests): Add thumb2-bl-blx-interwork test.
498 + * ld-arm/thumb2-bl-blx-interwork.s: New.
499 + * ld-arm/thumb2-bl-blx-interwork.d: New.
500 +
501 +2009-03-20 Andrew Stubbs <ams@codesourcery.com>
502 +
503 + * release-note-csl.xml: Document issue #4250 changes.
504 +
505 +2009-03-20 Daniel Jacobowitz <dan@codesourcery.com>
506 +
507 + * release-notes-csl.xml (Incorrect linker-generated functions): New
508 + note.
509 +
510 +2009-03-19 Daniel Jacobowitz <dan@codesourcery.com>
511 +
512 + Issue #4727
513 +
514 + ld/
515 + * emultempl/armelf.em (bfd_for_interwork, arm_elf_after_open)
516 + (arm_elf_set_bfd_for_interworking): Delete.
517 + (arm_elf_before_allocation): Do not set the interworking BFD.
518 + Move allocation inside not-dynamic block.
519 + (arm_elf_create_output_section_statements): Create glue sections
520 + and set the interworking BFD here.
521 + (LDEMUL_AFTER_OPEN): Delete.
522 +
523 + ld/testsuite/
524 + * ld-arm/farcall-mix.d, ld-arm/farcall-mix2.d,
525 + ld-arm/farcall-group-size2.d, ld-arm/farcall-group.d: Update for
526 + linker changes.
527 +
528 + bfd/
529 + * elf32-arm.c (elf32_arm_write_section): Declare early.
530 + (elf32_arm_size_stubs): Skip non-stub sections in the stub BFD.
531 + (arm_allocate_glue_section_space): Exclude empty sections.
532 + (ARM_GLUE_SECTION_FLAGS): Add SEC_LINKER_CREATED.
533 + (bfd_elf32_arm_add_glue_sections_to_bfd): Do not skip the stub
534 + BFD.
535 + (elf32_arm_output_glue_section, elf32_arm_final_link): New.
536 + (elf32_arm_merge_eabi_attributes): Skip the stub BFD.
537 + (elf32_arm_size_dynamic_sections): Allocate interworking
538 + sections here.
539 + (bfd_elf32_bfd_final_link): Define.
540 +
541 +2009-03-18 Daniel Gutson <dgutson@codesourcery.com>
542 +
543 + Issue #4753
544 +
545 + gas/
546 + * doc/c-arm.texi: Added entries for cpus ARM Cortex-M0 and Cortex-M1.
547 +
548 +2009-03-18 Andrew Stubbs <ams@codesourcery.com>
549 +
550 + Issue #4250
551 +
552 + gas/
553 + * config/tc-arm.c (md_apply_fix): Check BFD_RELOC_ARM_IMMEDIATE and
554 + BFD_RELOC_ARM_ADRL_IMMEDIATE value is in the correct section.
555 + Check BFD_RELOC_ARM_ADRL_IMMEDIATE has a defined symbol.
556 +
557 + gas/testsuites/
558 + * gas/arm/adr-invalid.d: New file.
559 + * gas/arm/adr-invalid.l: New file.
560 + * gas/arm/adr-invalid.s: New file.
561 +
562 +2009-03-17 Daniel Gutson <dgutson@codesourcery.com>
563 +
564 + Issue #4753
565 +
566 + gas/
567 + * config/tc-arm.c (arm_cpus): Added cortex-m0.
568 +
569 +2009-03-17 Daniel Jacobowitz <dan@codesourcery.com>
570 +
571 + bfd/
572 + * elf32-arm.c (elf32_arm_check_relocs): Correct symbian_p test.
573 +
574 +2009-03-16 Daniel Gutson <dgutson@codesourcery.com>
575 +
576 + Issue #4753
577 +
578 + * gas/config/tc-arm.c (arm_cpus): Added cortex-m0.
579 +
580 +2009-03-16 Julian Brown <julian@codesourcery.com>
581 +
582 + ld/
583 + * emultempl/armelf.em (fix_cortex_a8): New.
584 + (arm_elf_before_allocation): Call bfd_elf32_arm_set_cortex_a8_fix.
585 + (arm_elf_create_output_section_statements): Add fix_cortex_a8 to
586 + bfd_elf32_arm_set_target_relocs.
587 + (OPTION_FIX_CORTEX_A8): New.
588 + (PARSE_AND_LIST_LONGOPTS): Add fix-cortex-a8 options.
589 + (PARSE_AND_LIST_OPTIONS): Add fix-cortex-a8 option.
590 + (PARSE_AND_LIST_ARGS_CASES): Handle OPTION_FIX_CORTEX_A8.
591 +
592 + bfd/
593 + * elf32-arm.c (stub_reloc_type): Remove.
594 + (THUMB32_INSN, THUMB32_B_INSN): New macros.
595 + (insn_sequence): Change type of reloc_type.
596 + (elf32_arm_stub_a8_veneer_b_cond, elf32_arm_stub_a8_veneer_b)
597 + (elf32_arm_stub_a8_veneer_blx): New stub sequences.
598 + (elf32_arm_stub_type): Add arm_stub_a8_veneer_b_cond,
599 + arm_stub_a8_veneer_b, arm_stub_a8_veneer_bl and
600 + arm_stub_a8_veneer_blx.
601 + (_arm_elf_section_data): Add target_addend field.
602 + (a8_erratum_fix, a8_erratum_reloc): New structs.
603 + (elf32_arm_link_hash_table): Add a8_erratum_fixes,
604 + num_a8_erratum_fixes, fix_cortex_a8.
605 + (elf32_arm_link_hash_table_create): Zero fix_cortex_a8.
606 + (elf32_arm_final_link_relocate): Add forward declaration.
607 + (arm_build_one_stub): Add support for THUMB32_TYPE, Thumb-2
608 + relocations, multiple relocations per stub.
609 + (find_stub_size_and_template): New.
610 + (arm_size_one_stub): Use find_stub_size_and_template.
611 + (a8_reloc_compare): New.
612 + (elf32_arm_size_stubs): Add Cortex-A8 erratum workaround support.
613 + (bfd_elf32_arm_set_cortex_a8_fix): New.
614 + (bfd_elf32_arm_set_target_relocs): Add fix_cortex_a8 argument.
615 + (arm_map_one_stub): Add THUMB32_TYPE support.
616 + (a8_branch_to_stub_data): New.
617 + (make_branch_to_a8_stub): New.
618 + (elf32_arm_write_section): Add Cortex-A8 erratum workaround support.
619 + * bfd-in.h (bfd_elf32_arm_set_cortex_a8_fix): New.
620 + * bfd-in2.h: Regenerate.
621 +
622 + ld/testsuite/
623 + * ld-arm/cortex-a8-fix-b.s: New.
624 + * ld-arm/cortex-a8-fix-b.d: New.
625 + * ld-arm/cortex-a8-fix-bl.s: New.
626 + * ld-arm/cortex-a8-fix-bl.d: New.
627 + * ld-arm/cortex-a8-fix-bcc.s: New.
628 + * ld-arm/cortex-a8-fix-bcc.d: New.
629 + * ld-arm/cortex-a8-fix-blx.s: New.
630 + * ld-arm/cortex-a8-fix-blx.d: New.
631 +
632 +2009-03-16 Andrew Stubbs <ams@codesourcery.com>
633 +
634 + * release-notes-csl.xml: Document linker bug fix.
635 +
636 +2009-03-16 Andrew Stubbs <ams@codesourcery.com>
637 +
638 + bfd/
639 + * dwarf2.c (read_section): Always use rawsize, if available.
640 +
641 + Backport
642 + 2009-03-16 Alan Modra <amodra@bigpond.net.au>
643 + * simple.c (bfd_simple_get_relocated_section_contents): Use larger
644 + of rawsize and size for buffer.
645 +
646 +2009-03-12 Andrew Stubbs <ams@codesourcery.com>
647 +
648 + bfd/
649 + * dwarf2.c (read_section): Always check the offset, even when the
650 + section has been read before.
651 +
652 +2009-03-11 Joseph Myers <joseph@codesourcery.com>
653 +
654 + binutils/testsuite/
655 + * binutils-all/objdump.W, binutils-all/objdump.s: Don't match
656 + literal "tmpdir/" in expected output.
657 +
658 +2009-03-09 Catherine Moore <clm@codesourcery.com>
659 +
660 + Issue #4861
661 +
662 + Backport from FSF:
663 +
664 + 2009-03-03 Alan Modra <amodra@bigpond.net.au>
665 +
666 + * objdump.c (disassemble_section): Mask address before sign
667 + extending.
668 +
669 +2009-03-08 Mark Mitchell <mark@codesourcery.com>
670 +
671 + ld/testsuite/
672 + * ld-elfcomm/elfcomm.exp: Compile with -fcommon.
673 +
674 +2009-03-06 Catherine Moore <clm@codesourcery.com>
675 +
676 + Issue # 4861
677 +
678 + Backport from FSF:
679 +
680 + 2009-03-05 Nick Clifton <nickc@redhat.com>
681 +
682 + * objdump.c (disassemble_section): If the computed next offset is
683 + not beyond the current offset then just continue to the end.
684 +
685 +2009-03-05 Joseph Myers <joseph@codesourcery.com>
686 +
687 + Issue #4808
688 +
689 + Backport from FSF:
690 +
691 + gas/
692 + 2009-03-05 Joseph Myers <joseph@codesourcery.com>
693 + * read.c (s_fill, s_space, s_float_space, float_cons, stringer,
694 + s_incbin): Call md_cons_align (1).
695 +
696 + gas/testsuite/
697 + 2009-03-05 Joseph Myers <joseph@codesourcery.com>
698 + * gas/arm/mapmisc.d, gas/arm/mapmisc.dat, gas/arm/mapmisc.s: New.
699 +
700 +2009-03-01 Mark Mitchell <mark@codesourcery.com>
701 +
702 + Issue #4781
703 +
704 + * release-notes-csl.xml: Document change.
705 + gas/
706 + * config/tc-arm.c (md_assemble): Allow barrier instructions on
707 + ARMv6-M cores.
708 + gas/testsuite/
709 + * arm/archv6m.s: Add dmb, dsb, and isb.
710 + * arm/archv6m.d: Likewise.
711 +
712 +2009-02-24 Sandra Loosemore <sandra@codesourcery.com>
713 +
714 + Issue #2369
715 + Patch applied simultaneously on mainline.
716 +
717 + ld/
718 + * ld.texinfo (Options): Correct typos in example. Recommend
719 + using joined forms of syntax for passing options with arguments
720 + from a driver.
721 + (-a): Use consistent syntax for documenting option arguments.
722 + Clean up indexing and markup.
723 + (-A/--architecture): Likewise.
724 + (-f/--auxiliary): Likewise.
725 + (-F/--filter): Likewise.
726 + (-fini): Likewise.
727 + (-G/--gpsize): Likewise.
728 + (-h/-soname):Likewise.
729 + (-init): Likewise.
730 + (-l/--library): Likewise.
731 + (-L/--library-path): Likewise.
732 + (-m): Likewise.
733 + (--defsym): Likewise.
734 + (-I/--dynamic-linker): Likewise.
735 + (-Map): Likewise.
736 + (--oformat): Likewise.
737 + (--retain-symbols-file): Likewise.
738 + (-rpath): Likewise.
739 + (-rpath-link): Likewise.
740 + (--sort-common): Likewise.
741 + (--sort-section): Likewise.
742 + (--split-by-file): Likewise.
743 + (--split-by-reloc): Likewise.
744 + (--sysroot): Likewise.
745 + (--section-start): Likewise.
746 + (-Tbss, -Tdata, -Ttext): Likewise.
747 + (-Ttext-segment): Likewise.
748 + (--version-script): Likewise.
749 + (--wrap): Likewise.
750 +
751 +2009-02-24 Maxim Kuvyrkov <maxim@codesourcery.com>
752 +
753 + Revert:
754 +
755 + 2009-02-19 Maxim Kuvyrkov <maxim@codesourcery.com>
756 + Issue #4600
757 +
758 + bfd/
759 + * elf.c (_bfd_elf_map_sections_to_segments): Fix sanity check.
760 +
761 + 2008-03-25 Maxim Kuvyrkov <maxim@codesourcery.com>
762 +
763 + bfd/
764 +
765 + * elf.c (_bfd_elf_map_sections_to_segments): Check user's
766 + mapping of section to segments.
767 +
768 +2009-02-22 Mark Mitchell <mark@codesourcery.com>
769 +
770 + * release-notes-csl.xml: Document change.
771 + gas/
772 + * config/tc-arm.c (warn_deprecated_sp): New macro.
773 + (do_t_mov_cmp): Permit R13 as the second
774 + argument to "cmp.n".
775 + gas/testsuite/
776 + * gas/arm/thumb2_bad_reg.s: Update.
777 + * gas/arm/thumb2_bad_reg.l: Likewise.
778 +
779 +2009-02-23 Daniel Jacobowitz <dan@codesourcery.com>
780 +
781 + bfd/
782 + * elf32-arm.c (elf32_arm_stub_long_branch_any_any_pic): Rename
783 + to elf32_arm_stub_long_branch_any_arm_pic.
784 + (elf32_arm_stub_long_branch_any_thumb_pic): New.
785 + (enum elf32_arm_stub_type, arm_type_of_stub)
786 + (arm_size_one_stub): Handle any to ARM PIC and any to Thumb PIC
787 + separately.
788 +
789 + ld/testsuite/
790 + * ld-arm/farcall-arm-thumb-blx-pic-veneer.d,
791 + ld-arm/farcall-arm-thumb-pic-veneer.d,
792 + ld-arm/farcall-thumb-thumb-blx-pic-veneer.d: Update for fixed
793 + Thumb PIC stub.
794 +
795 +2009-02-23 Joseph Myers <joseph@codesourcery.com>
796 +
797 + bfd/
798 + * elf32-arm.c (PREV_SEC): Update comment.
799 + (group_sections): Rename argument to stubs_always_after_branch.
800 + Reverse the list and place stubs at the end of input sections.
801 + Undefine NEXT_SEC.
802 + (elf32_arm_size_stubs): Update to use stubs_always_after_branch.
803 +
804 + ld/
805 + * ld.texinfo (ARM): Document changed meaning of --stub-group-size.
806 + * emultempl/armelf.em (hook_in_stub): Insert after the input section.
807 + (elf32_arm_add_stub_section): Update comment.
808 + (PARSE_AND_LIST_OPTIONS): Update help for --stub-group-size.
809 +
810 +2009-02-23 Daniel Jacobowitz <dan@codesourcery.com>
811 +
812 + ld/testsuite/
813 + * ld-arm/arm-elf.exp (armeabitests): Update duplicate test names.
814 + Use normal output files for big-endian.
815 + * ld-arm/farcall-arm-arm-be.d, ld-arm/farcall-thumb-arm-be.d: Delete.
816 + * ld-arm/farcall-arm-arm-be8.d, ld-arm/farcall-arm-arm-pic-veneer.d,
817 + ld-arm/farcall-arm-arm.d, ld-arm/farcall-arm-thumb-blx-pic-veneer.d,
818 + ld-arm/farcall-arm-thumb-blx.d, ld-arm/farcall-arm-thumb-pic-veneer.d,
819 + ld-arm/farcall-arm-thumb.d, ld-arm/farcall-group-size2.d,
820 + ld-arm/farcall-group.d, ld-arm/farcall-mix.d, ld-arm/farcall-mix2.d,
821 + ld-arm/farcall-thumb-arm-be8.d,
822 + ld-arm/farcall-thumb-arm-blx-pic-veneer.d,
823 + ld-arm/farcall-thumb-arm-blx.d, ld-arm/farcall-thumb-arm-short.d,
824 + ld-arm/farcall-thumb-arm.d,
825 + ld-arm/farcall-thumb-thumb-blx-pic-veneer.d,
826 + ld-arm/farcall-thumb-thumb-blx.d, ld-arm/farcall-thumb-thumb-m.d,
827 + ld-arm/farcall-thumb-thumb.d, ld-arm/thumb2-bl-as-thumb1-bad.d,
828 + ld-arm/thumb2-bl-bad.d: Update for moved stubs.
829 +
830 +2009-02-23 Daniel Jacobowitz <dan@codesourcery.com>
831 +
832 + Backport:
833 +
834 + 2009-02-23 Daniel Jacobowitz <dan@codesourcery.com>
835 +
836 + bfd/
837 + * elf32-arm.c (arm_build_one_stub): Initialize stub_reloc_offset.
838 + Fix formatting.
839 + (arm_size_one_stub): Remove unnecessary break.
840 + (arm_map_one_stub): Fix formatting. Return after BFD_FAIL.
841 +
842 + 2009-02-23 Daniel Jacobowitz <dan@codesourcery.com>
843 +
844 + ld/testsuite/
845 + * ld-arm/arm-elf.exp (armeabitests): Run new tests. Correct BE8 output
846 + filename.
847 + * ld-arm/farcall-arm-arm-be.d, ld-arm/farcall-thumb-arm-be.d: New.
848 +
849 + 2009-02-23 Christophe Lyon <christophe.lyon@st.com>
850 +
851 + bfd/
852 + * elf32-arm.c (stub_insn_type): New type.
853 + (stub_reloc_type): Likewise.
854 + (insn_sequence): Likewise.
855 + (elf32_arm_stub_long_branch_any_any): Encode using insn_sequence.
856 + (elf32_arm_stub_long_branch_v4t_arm_thumb): Likewise.
857 + (elf32_arm_stub_long_branch_thumb_only): Likewise.
858 + (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
859 + (elf32_arm_stub_short_branch_v4t_thumb_arm): Likewise.
860 + (elf32_arm_stub_long_branch_any_any_pic): Likewise.
861 + (elf32_arm_stub_hash_entry): Add new helper fields.
862 + (stub_hash_newfunc): Initialize these new fields.
863 + (arm_build_one_stub): Encode Arm and Thumb instructions separately
864 + to take endianness into account.
865 + (arm_size_one_stub): Compute size of stubs using insn_sequence.
866 + (arm_map_one_stub): Code is now more generic, thanks to
867 + insn_sequence.
868 +
869 + ld/testsuite/
870 + * ld-arm/arm-elf.exp: Add new farcall-thumb-arm-be8 test.
871 + * ld-arm/farcall-thumb-arm-be8.d: New expected result.
872 + * ld-arm/farcall-arm-arm-be8.d: Replace wildcards by instructions.
873 +
874 + 2009-02-23 Christophe Lyon <christophe.lyon@st.com>
875 +
876 + bfd/
877 + * elf32-arm.c (elf32_arm_stub_long_branch_thumb_only): Fix stub
878 + code.
879 + (elf32_arm_stub_long_branch_v4t_thumb_arm): Likewise.
880 + (arm_type_of_stub): Use Thumb-only long branch stub (non-PIC) when
881 + BLX is not available. Fix typo in warning message. Add comments
882 + and improve formatting.
883 + (arm_build_one_stub): Adjust to new
884 + elf32_arm_stub_long_branch_v4t_thumb_arm stub.
885 + (arm_map_one_stub): Likewise.
886 +
887 + ld/testsuite/
888 + * ld-arm/arm-elf.exp: Rewrite non-EABI variants of
889 + thumb2-bl-as-thumb1-bad and thumb2-bl-bad tests, which now
890 + pass. farcall-thumb-thumb now passes in EABI mode.
891 + * ld-arm/farcall-thumb-arm-pic-veneer.d: Fixed name, source, as
892 + and ld flags to match intended test.
893 + * ld-arm/farcall-thumb-arm.d: New expected result.
894 + * ld-arm/farcall-thumb-thumb-m.d: Likewise.
895 + * ld-arm/farcall-thumb-thumb-m-pic-veneer.d: Fixed name and ld
896 + flags.
897 + * ld-arm/farcall-thumb-thumb-pic-veneer.d: Likewise.
898 + * ld-arm/farcall-thumb-thumb.d: New expected result, this test is
899 + now expected to pass.
900 + * ld-arm/thumb2-bl-as-thumb1-bad-noeabi.d: Likewise.
901 + * ld-arm/thumb2-bl-bad-noeabi.d: Likewise.
902 + * ld-arm/thumb2-bl-as-thumb1-bad.d: Update addresses according to
903 + new use.
904 + * ld-arm/thumb2-bl-as-thumb1-bad.s: Update comment.
905 +
906 + 2009-02-18 Christophe Lyon <christophe.lyon@st.com>
907 +
908 + bfd/
909 + * elf32-arm.c (arm_build_one_stub): Fix relocation target for pic
910 + stub. Catch default case error.
911 + (arm_map_one_stub): Add missing Thumb mapping symbol.
912 +
913 + ld/testsuite/
914 + * ld-arm/farcall-arm-arm-pic-veneer.d,
915 + ld-arm/farcall-arm-thumb-blx-pic-veneer.d,
916 + ld-arm/farcall-arm-thumb-pic-veneer.d,
917 + ld-arm/farcall-thumb-arm-blx-pic-veneer.d,
918 + ld-arm/farcall-thumb-thumb-blx-pic-veneer.d: Fix expected stub
919 + target.
920 +
921 + 2009-02-16 Christophe Lyon <christophe.lyon@st.com>
922 +
923 + bfd/
924 + * elf32-arm.c (arm_long_branch_stub,
925 + arm_thumb_v4t_long_branch_stub,
926 + arm_thumb_thumb_long_branch_stub,
927 + arm_thumb_arm_v4t_long_branch_stub,
928 + arm_thumb_arm_v4t_short_branch_stub,
929 + arm_pic_long_branch_stub):
930 + Renamed to elf32_arm_stub_long_branch_any_any,
931 + elf32_arm_stub_long_branch_v4t_arm_thumb,
932 + elf32_arm_stub_long_branch_thumb_only,
933 + elf32_arm_stub_long_branch_v4t_thumb_arm,
934 + elf32_arm_stub_short_branch_v4t_thumb_arm,
935 + elf32_arm_stub_long_branch_any_any_pic.
936 + (arm_stub_long_branch, arm_thumb_v4t_stub_long_branch,
937 + arm_thumb_thumb_stub_long_branch,
938 + arm_thumb_arm_v4t_stub_long_branch,
939 + arm_thumb_arm_v4t_stub_short_branch, arm_stub_pic_long_branch):
940 + Renamed to arm_stub_long_branch_any_any,
941 + arm_stub_long_branch_v4t_arm_thumb,
942 + arm_stub_long_branch_thumb_only,
943 + arm_stub_long_branch_v4t_thumb_arm,
944 + arm_stub_short_branch_v4t_thumb_arm,
945 + arm_stub_long_branch_any_any_pic.
946 +
947 +2009-02-22 Mark Mitchell <mark@codesourcery.com>
948 +
949 + Issue #4694
950 + * release-notes-csl.xml: Document fix.
951 + Backport:
952 + libiberty/
953 + 2009-02-21 Mark Mitchell <mark@codesourcery.com>
954 + * make-temp-file.c (<windows.h>): Include on Windows.
955 + (choose_tmpdir): On Windows, use GetTempPath.
956 +
957 +2009-02-19 Maxim Kuvyrkov <maxim@codesourcery.com>
958 +
959 + Issue #4600
960 +
961 + bfd/
962 + * elf.c (_bfd_elf_map_sections_to_segments): Fix sanity check.
963 +
964 +2009-02-18 Nathan Sidwell <nathan@codesourcery.com>
965 +
966 + Issue #4577
967 + gas/
968 + * config/tc-arm.c (do_nop): Generate v6k nops whenever possible.
969 + (arm_handle_align): Generate v6k ARM, thumb2 wide & narrow nops
970 + whenever possible.
971 +
972 + gas/testsuite/
973 + * gas/arm/align.s, gas/arm/align.d: New.
974 + * gas/arm/thumb32.d, gas/arm/arch6zk.d, gas/arm/arch6zk.s,
975 + arm/thumb2_relax.d: Adjust for align changes.
976 +
977 +2009-02-05 Joseph Myers <joseph@codesourcery.com>
978 +
979 + bfd/
980 + * elf.c: Revert local version of issue 3598 patch.
981 +
982 +2009-02-05 Joseph Myers <joseph@codesourcery.com>
983 +
984 + bfd/
985 + * elflink.c: Resync with upstream.
986 +
987 + binutils/
988 + * sysdep.h: Resync with upstream.
989 +
990 +2009-02-05 Joseph Myers <joseph@codesourcery.com>
991 +
992 + gas/
993 + * config/tc-m68k.c: Resync whitespace with upstream.
994 + * config/tc-mips.c: Remove duplicate 74kf3_2 entry.
995 +
996 + gas/testsuite/
997 + * gas/arm/backslash-at.d: Resync with upstream.
998 +
999 + include/opcode/
1000 + * mips.h: Remove relics of old Octeon support.
1001 +
1002 +2009-02-05 Joseph Myers <joseph@codesourcery.com>
1003 +
1004 + gas/
1005 + * config/tc-mips.c: Remove relics of old Octeon support. Adjust
1006 + error checking in line with
1007 + <https://intranet.codesourcery.com/ml/gnu-mips-sgxx/2008-08/msg00069.html>.
1008 +
1009 + gas/testsuite/
1010 + * gas/mips/octeon1.l, gas/mips/octeon3.d, gas/mips/octeon3.s:
1011 + Update for assembler changes.
1012 +
1013 + opcodes/
1014 + * mips-dis.c: Remove relics of old Octeon support.
1015 + * mips-opc.c: Restore Octeon sync instructions.
1016 +
1017 +2009-02-04 Maxim Kuvyrkov <maxim@codesourcery.com>
1018 +
1019 + Clean up m68k TLS implementation after upstream contribution.
1020 +
1021 + ld/testsuite/
1022 + * ld-m68k/tls-gd-ie-1.d: Update.
1023 + * ld-m68k/tls-gd-3.d, ld-m68k/tls-gd-3.s: Move to gas testsuite.
1024 + * ld-m68k/m68k.exp (merge isa-a isa-a:nodiv): Fix test.
1025 + (tls-*): Run only for m68k-*-linux* targets.
1026 +
1027 + gas/testsuite/
1028 + * gas/m68k/tls-gd-3.d, gas/m68k/tls-gd-3.s: New test.
1029 + * gas/m68k/all.exp: Run it.
1030 +
1031 + gas/
1032 + * config/tc-m68k.c: Fix whitespace.
1033 +
1034 + bfd/
1035 + * elf32-m68k.c: Fix formatting.
1036 + (elf_m68k_relocate_section): Remove duplicate code. Use
1037 + SYMBOL_REFERENCES_LOCAL.
1038 + (elf_m68k_finish_dynamic_symbol): Use SYMBOL_REFERENCES_LOCAL.
1039 +
1040 +2009-02-04 Andrew Jenner <andrew@codesourcery.com>
1041 +
1042 + gas/
1043 + * configure.tgt: Handle mips-montavista-elf.
1044 +
1045 +2009-02-03 Kazu Hirata <kazu@codesourcery.com>
1046 +
1047 + config/
1048 + * mh-mingw (BOOT_CFLAGS): Remove -D__USE_MINGW_ACCESS.
1049 + (CFLAGS): Comment out.
1050 +
1051 + libiberty/
1052 + * cygpath.c (msvcrt_dll): Change the return type to HMODULE.
1053 + (msvcrt_fopen): Use HMODULE for the return value from msvcrt_dll.OB
1054 +
1055 +2009-02-03 Joseph Myers <joseph@codesourcery.com>
1056 +
1057 + Issue #4540
1058 +
1059 + bfd/
1060 + * elfxx-mips.c (_bfd_mips_elf_section_processing): Remove special
1061 + .sbss handling.
1062 +
1063 +2009-02-02 Kazu Hirata <kazu@codesourcery.com>
1064 +
1065 + gprof/
1066 + * gprof.h: Include gconfig.h. #undef PACKAGE.
1067 +
1068 + ld/
1069 + * gprof.h: Include config.h.
1070 +
1071 +2009-01-30 Catherine Moore <clm@codesourcery.com>
1072 +
1073 + bfd/
1074 + elf32-m68k.c (elf_m68k_relocate_section): Pass relocation
1075 + type to elf_m68k_init_got_entry_key.
1076 +
1077 +2009-01-29 Joseph Myers <joseph@codesourcery.com>
1078 +
1079 + bfd/
1080 + * elf32-arm.c: Resync whitespace with upstream.
1081 +
1082 + gas/
1083 + * doc/c-mips.texi: Remove duplicate 74kf3_2 entry.
1084 +
1085 + ld/
1086 + * configure.in: Replace AC_ERROR with AC_MSG_ERROR.
1087 + * emultempl/m68kelf.em: Resync whitespace with upstream.
1088 +
1089 +2009-01-29 Catherine Moore <clm@codesourcery.com>
1090 +
1091 + bfd/
1092 + elfxx-mips.c (mips_elf_calculate_relocation): Add check
1093 + for (h != NULL).
1094 +
1095 +2009-01-28 Joseph Myers <joseph@codesourcery.com>
1096 +
1097 + bfd/
1098 + * elfxx-mips.c (mips_mach_extensions): Remove duplicate Octeon
1099 + entry.
1100 +
1101 + gas/
1102 + * config/tc-mips.c (CPU_HAS_DROR): Remove Octeon handling.
1103 + (CPU_HAS_INS): Remove.
1104 +
1105 + gas/testsuite/
1106 + * gas/mips/mips.exp: Resync whitespace with upstream.
1107 +
1108 + include/elf/
1109 + * mips.h: Resync whitespace with upstream.
1110 +
1111 + include/opcode/
1112 + * mips.h (OPCODE_IS_MEMBER): Remove duplicate Octeon check.
1113 +
1114 + opcodes/
1115 + * mips-opc.c (mips_builtin_opcodes): Remove duplicate pop
1116 + instruction.
1117 +
1118 +2009-01-28 Joseph Myers <joseph@codesourcery.com>
1119 +
1120 + * config.sub: Remove XLR targets.
1121 + * configure.ac: Move mips*-sde-elf* case to upstream location.
1122 + Don't add target-sdemdi.
1123 + * configure: Regenerate.
1124 +
1125 + bfd/
1126 + * elf.c: Remove duplicate if conditional.
1127 + * elf32-m68k.c: Remove conflict marker.
1128 + * elfxx-mips.c: Resync whitespace with upstream. Remove duplicate
1129 + comment.
1130 +
1131 + config/
1132 + * mt-sde: Revert difference from upstream.
1133 +
1134 + ld/testsuite/
1135 + * ld-arm/arm-elf.exp: Remove duplicate runs of some tests.
1136 +
1137 + opcodes/
1138 + * ppc-dis.c: Remove duplicate if conditional.
1139 +
1140 +2009-01-25 Maxim Kuvyrkov <maxim@codesourcery.com>
1141 +
1142 + bfd/
1143 + * elf32-m68k.c (elf_m68k_finalize_got_offsets): Fix condition.
1144 +
1145 +2009-01-25 Maxim Kuvyrkov <maxim@codesourcery.com>
1146 +
1147 + bfd/
1148 + * elf32-m68k.c (struct elf_m68k_finalize_got_offsets_arg): Remove
1149 + use_neg_got_offsets_p field.
1150 + (elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets):
1151 + Update, don't use not initialized data, initialize data before
1152 + using it.
1153 +
1154 +2009-01-21 Andrew Stubbs <ams@codesourcery.com>
1155 +
1156 + Issue #4300
1157 +
1158 + gas/
1159 + * config/tc-arm.c (attributes_set_explicitly): New array.
1160 + (s_arm_eabi_attribute): Check return value from s_vendor_attribute.
1161 + (cpu_arch): Add ARM_ARCH_V5T.
1162 + (aeabi_set_attribute_int): New function.
1163 + (aeabi_set_attribute_string): New function.
1164 + (aeabi_set_public_attributes): Set attributes according to the user's
1165 + intentions, rather than the actual state of the binary.
1166 + Use aeabi_set_attribute_int and aeabi_set_attribute_string instead of
1167 + bfd_elf_add_proc_attr_int and bfd_elf_add_proc_attr_string.
1168 + Support WMMXv2. Use attribute names instead of numbers.
1169 + * read.c (s_vendor_attribute): Change return type to int.
1170 + Return the tag number that was set.
1171 + * read.h (s_vendor_attribute): Change return type to int.
1172 +
1173 + gas/testsuite/
1174 + * gas/arm/attr-cpu-directive.d: New file.
1175 + * gas/arm/attr-cpu-directive.s: New file.
1176 + * gas/arm/attr-default.d: New file.
1177 + * gas/arm/attr-march-all.d: New file.
1178 + * gas/arm/attr-march-armv1.d: New file.
1179 + * gas/arm/attr-march-armv2.d: New file.
1180 + * gas/arm/attr-march-armv2a.d: New file.
1181 + * gas/arm/attr-march-armv2s.d: New file.
1182 + * gas/arm/attr-march-armv3.d: New file.
1183 + * gas/arm/attr-march-armv3m.d: New file.
1184 + * gas/arm/attr-march-armv4.d: New file.
1185 + * gas/arm/attr-march-armv4t.d: New file.
1186 + * gas/arm/attr-march-armv4txm.d: New file.
1187 + * gas/arm/attr-march-armv4xm.d: New file.
1188 + * gas/arm/attr-march-armv5.d: New file.
1189 + * gas/arm/attr-march-armv5t.d: New file.
1190 + * gas/arm/attr-march-armv5te.d: New file.
1191 + * gas/arm/attr-march-armv5tej.d: New file.
1192 + * gas/arm/attr-march-armv5texp.d: New file.
1193 + * gas/arm/attr-march-armv5txm.d: New file.
1194 + * gas/arm/attr-march-armv6-m.d: New file.
1195 + * gas/arm/attr-march-armv6.d: New file.
1196 + * gas/arm/attr-march-armv6j.d: New file.
1197 + * gas/arm/attr-march-armv6k.d: New file.
1198 + * gas/arm/attr-march-armv6kt2.d: New file.
1199 + * gas/arm/attr-march-armv6t2.d: New file.
1200 + * gas/arm/attr-march-armv6z.d: New file.
1201 + * gas/arm/attr-march-armv6zk.d: New file.
1202 + * gas/arm/attr-march-armv6zkt2.d: New file.
1203 + * gas/arm/attr-march-armv6zt2.d: New file.
1204 + * gas/arm/attr-march-armv7-a.d: New file.
1205 + * gas/arm/attr-march-armv7-m.d: New file.
1206 + * gas/arm/attr-march-armv7-r.d: New file.
1207 + * gas/arm/attr-march-armv7.d: New file.
1208 + * gas/arm/attr-march-armv7a.d: New file.
1209 + * gas/arm/attr-march-armv7m.d: New file.
1210 + * gas/arm/attr-march-armv7r.d: New file.
1211 + * gas/arm/attr-march-iwmmxt.d: New file.
1212 + * gas/arm/attr-march-iwmmxt2.d: New file.
1213 + * gas/arm/attr-march-marvell-f.d: New file.
1214 + * gas/arm/attr-march-xscale.d: New file.
1215 + * gas/arm/attr-mcpu.d: New file.
1216 + * gas/arm/attr-mfpu-arm1020e.d: New file.
1217 + * gas/arm/attr-mfpu-arm1020t.d: New file.
1218 + * gas/arm/attr-mfpu-arm1136jf-s.d: New file.
1219 + * gas/arm/attr-mfpu-arm1136jfs.d: New file.
1220 + * gas/arm/attr-mfpu-arm7500fe.d: New file.
1221 + * gas/arm/attr-mfpu-fpa.d: New file.
1222 + * gas/arm/attr-mfpu-fpa10.d: New file.
1223 + * gas/arm/attr-mfpu-fpa11.d: New file.
1224 + * gas/arm/attr-mfpu-fpe.d: New file.
1225 + * gas/arm/attr-mfpu-fpe2.d: New file.
1226 + * gas/arm/attr-mfpu-fpe3.d: New file.
1227 + * gas/arm/attr-mfpu-maverick.d: New file.
1228 + * gas/arm/attr-mfpu-neon-fp16.d: New file.
1229 + * gas/arm/attr-mfpu-neon.d: New file.
1230 + * gas/arm/attr-mfpu-softfpa.d: New file.
1231 + * gas/arm/attr-mfpu-softvfp+vfp.d: New file.
1232 + * gas/arm/attr-mfpu-softvfp.d: New file.
1233 + * gas/arm/attr-mfpu-vfp.d: New file.
1234 + * gas/arm/attr-mfpu-vfp10-r0.d: New file.
1235 + * gas/arm/attr-mfpu-vfp10.d: New file.
1236 + * gas/arm/attr-mfpu-vfp3.d: New file.
1237 + * gas/arm/attr-mfpu-vfp9.d: New file.
1238 + * gas/arm/attr-mfpu-vfpv2.d: New file.
1239 + * gas/arm/attr-mfpu-vfpv3-d16.d: New file.
1240 + * gas/arm/attr-mfpu-vfpv3.d: New file.
1241 + * gas/arm/attr-mfpu-vfpxd.d: New file.
1242 + * gas/arm/attr-order.d: Update Tag_ARM_ISA_use and Tag_THUMB_ISA_use.
1243 + * gas/arm/attr-override-cpu-directive.d: New file.
1244 + * gas/arm/attr-override-cpu-directive.s: New file.
1245 + * gas/arm/attr-override-mcpu.d: New file.
1246 + * gas/arm/attr-override-mcpu.s: New file.
1247 + * gas/arm/blank.s: New file.
1248 + * gas/arm/eabi_attr_1.d: Update Tag_ARM_ISA_use and Tag_THUMB_ISA_use.
1249 +
1250 + ld/testsuite/
1251 + * ld-arm/attr-merge-3.attr: Update following gas change.
1252 + * ld-arm/attr-merge-2.attr: Update Tag_ARM_ISA_use and
1253 + Tag_THUMB_ISA_use following gas changes.
1254 + * ld-arm/attr-merge-4.attr: Likewise.
1255 + * ld-arm/attr-merge-5.attr: Likewise.
1256 + * ld-arm/attr-merge-arch-1.attr: Likewise.
1257 + * ld-arm/attr-merge-arch-2.attr: Likewise.
1258 + * ld-arm/attr-merge-unknown-2.d: Likewise.
1259 + * ld-arm/attr-merge-unknown-2r.d: Likewise.
1260 + * ld-arm/attr-merge-unknown-3.d: Likewise.
1261 + * ld-arm/attr-merge-wchar-00-nowarn.d: Likewise.
1262 + * ld-arm/attr-merge-wchar-00.d: Likewise.
1263 + * ld-arm/attr-merge-wchar-02-nowarn.d: Likewise.
1264 + * ld-arm/attr-merge-wchar-02.d: Likewise.
1265 + * ld-arm/attr-merge-wchar-04-nowarn.d: Likewise.
1266 + * ld-arm/attr-merge-wchar-04.d: Likewise.
1267 + * ld-arm/attr-merge-wchar-20-nowarn.d: Likewise.
1268 + * ld-arm/attr-merge-wchar-20.d: Likewise.
1269 + * ld-arm/attr-merge-wchar-22-nowarn.d: Likewise.
1270 + * ld-arm/attr-merge-wchar-22.d: Likewise.
1271 + * ld-arm/attr-merge-wchar-24-nowarn.d: Likewise.
1272 + * ld-arm/attr-merge-wchar-40-nowarn.d: Likewise.
1273 + * ld-arm/attr-merge-wchar-40.d: Likewise.
1274 + * ld-arm/attr-merge-wchar-42-nowarn.d: Likewise.
1275 + * ld-arm/attr-merge-wchar-44-nowarn.d: Likewise.
1276 + * ld-arm/attr-merge-wchar-44.d: Likewise.
1277 + * ld-arm/attr-merge.attr: Likewise.
1278 +
1279 +2009-01-21 Andrew Stubbs <ams@codesourcery.com>
1280 +
1281 + bfd/
1282 + * elf-attrs.c (is_default_attr): Substitute magic numbers with macros.
1283 + (obj_attr_size): Likewise.
1284 + (write_obj_attribute): Likewise.
1285 + (_bfd_elf_copy_obj_attributes): Likewise.
1286 + (_bfd_elf_parse_attributes): Likewise.
1287 + * elf-bfd.h (ATTR_TYPE_FLAG_INT_VAL): New define.
1288 + (ATTR_TYPE_FLAG_STR_VAL, ATTR_TYPE_FLAG_NO_DEFAULT): New defines.
1289 + (ATTR_TYPE_HAS_INT_VAL, ATTR_TYPE_HAS_STR_VAL): New defines.
1290 + (ATTR_TYPE_HAS_NO_DEFAULT): New define.
1291 + * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Replace magic numbers
1292 + with macros.
1293 +
1294 +2009-01-06 Andrew Stubbs <ams@codesourcery.com>
1295 +
1296 + * release-notes-csl.xml: Document ARM attributes improvements.
1297 +
1298 +2009-01-01 Joseph Myers <joseph@codesourcery.com>
1299 +
1300 + Backport from FSF:
1301 +
1302 + bfd/
1303 + 2008-12-23 Nick Clifton <nickc@redhat.com>
1304 + PR 7093
1305 + * elf32-arm.c (bfd_elf32_arm_init_maps): Only process ARM ELF
1306 + object files.
1307 +
1308 +2008-12-24 Andrew Stubbs <ams@codesourcery.com>
1309 +
1310 + ld/testsuite/
1311 + * ld-arm/arm-elf.exp (armeabitests): Add EABI attribute merging 3,
1312 + EABI attribute merging 4, and EABI attribute merging 5,
1313 + EABI attribute arch merging 1, EABI attribute arch merging 1 reversed,
1314 + EABI attribute arch merging 2, EABI attribute arch merging 2 reversed.
1315 + Add attr-merge-unknown-1, attr-merge-unknown-2, attr-merge-unknown-2r,
1316 + and attr-merge-unknown-3 dump tests.
1317 + * ld-arm/arch-v6.s: New file.
1318 + * ld-arm/arch-v6k.s: New file.
1319 + * ld-arm/arch-v6t2.s: New file.
1320 + * ld-arm/attr-merge-3.attr: New file.
1321 + * ld-arm/attr-merge-3a.s: New file.
1322 + * ld-arm/attr-merge-3b.s: New file.
1323 + * ld-arm/attr-merge-4.attr: New file.
1324 + * ld-arm/attr-merge-4a.s: New file.
1325 + * ld-arm/attr-merge-4b.s: New file.
1326 + * ld-arm/attr-merge-5.attr: New file.
1327 + * ld-arm/attr-merge-5.s: New file.
1328 + * ld-arm/attr-merge-arch-1.attr: New file.
1329 + * ld-arm/attr-merge-arch-2.attr: New file.
1330 + * ld-arm/attr-merge-unknown-1.d: New file.
1331 + * ld-arm/attr-merge-unknown-1.s: New file.
1332 + * ld-arm/attr-merge-unknown-2.d: New file.
1333 + * ld-arm/attr-merge-unknown-2.s: New file.
1334 + * ld-arm/attr-merge-unknown-2r.d: New file.
1335 + * ld-arm/attr-merge-unknown-3.d: New file.
1336 + * ld-arm/blank.s: New file.
1337 +
1338 +2008-12-24 Andrew Stubbs <ams@codesourcery.com>
1339 +
1340 + bfd/
1341 + * elf-attrs.c (vendor_set_obj_attr_contents): Support tag ordering.
1342 + * elf-bfd.h (elf_backend_data): Add obj_attrs_order.
1343 + * elf32-arm.c (elf32_arm_obj_attrs_order): New function.
1344 + (elf_backend_obj_attrs_order): New define.
1345 + * elfxx-target.h (elf_backend_obj_attrs_order): New define.
1346 + (elfNN_bed): Add elf_backend_obj_attrs_order.
1347 +
1348 + gas/testsuite/
1349 + * gas/arm/attr-order.d: New file.
1350 + * gas/arm/attr-order.s: New file.
1351 +
1352 +2008-12-24 Andrew Stubbs <ams@codesourcery.com>
1353 +
1354 + bfd/
1355 + * elf-attrs.c (is_default_attr): Support defaultless attributes.
1356 + (bfd_elf_add_obj_attr_int): Get type from _bfd_elf_obj_attrs_arg_type.
1357 + (bfd_elf_add_obj_attr_string): Likewise.
1358 + (bfd_elf_add_obj_attr_int_string): Likewise.
1359 + (_bfd_elf_parse_attributes): Allow for unknown flag bits in type.
1360 + * elf-bfd.h (struct obj_attribute): Document new flag bit.
1361 + * elf32-arm.c (elf32_arm_obj_attrs_arg_type): Specify that
1362 + Tag_nodefaults has no default value.
1363 + (elf32_arm_merge_eabi_attributes): Modify the Tag_nodefaults
1364 + comment to reflect the new state.
1365 +
1366 + gas/
1367 + * read.c (s_vendor_attribute): Allow for unknown flag bits in type.
1368 +
1369 +2008-12-24 Andrew Stubbs <ams@codesourcery.com>
1370 + Daniel Jacobowitz <dan@codesourcery.com>
1371 +
1372 + Issue #1581
1373 +
1374 + gas/
1375 + * config/tc-arm.c (arm_copy_symbol_attributes): New function.
1376 + * config/tc-arm.h (arm_copy_symbol_attributes): New prototype.
1377 + (CONVERT_SYMBOLIC_ATTRIBUTE): New define.
1378 + * read.c (s_vendor_attribute): Add support for symbolic tag names.
1379 + Improve string parser.
1380 + * doc/c-arm.texi (ARM Machine Directives): Document
1381 + .eabi_attribute symbolic tag names.
1382 +
1383 + gas/testsuite/
1384 + * gas/arm/attr-syntax.d: New file.
1385 + * gas/arm/attr-syntax.s: New file.
1386 +
1387 +2008-12-24 Andrew Stubbs <ams@codesourcery.com>
1388 + Julian Brown <julian@codesourcery.com>
1389 +
1390 + bfd/
1391 + * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 71 to include all known
1392 + ARM attributes in ABI 2.07.
1393 + * elf32-arm.c (get_secondary_compatible_arch): New function.
1394 + (set_secondary_compatible_arch): New function.
1395 + (tag_cpu_arch_combine): New function.
1396 + (elf32_arm_copy_one_eabi_other_attribute): Delete function.
1397 + (elf32_arm_copy_eabi_other_attribute_list): Delete function.
1398 + (elf32_arm_merge_eabi_attributes): Rename order_312 to order_021 to
1399 + make it fit with order_01243.
1400 + Add support for Tag_also_compatible_with,
1401 + Tag_CPU_unaligned_access, Tag_T2EE_use, Tag_Virtualization_use,
1402 + Tag_MPextension_use, Tag_nodefaults and Tag_conformance.
1403 + Improve/tidy up support for Tag_CPU_raw_name, Tag_CPU_name,
1404 + Tag_CPU_arch, Tag_ABI_HardFP_use, Tag_VFP_HP_extension,
1405 + Tag_ABI_FP_denormal, Tag_ABI_PCS_GOT_use, Tag_ABI_align8_needed,
1406 + Tag_VFP_arch and Tag_ABI_FP_16bit_format.
1407 + Rework the way unknown attributes are handled.
1408 + Defer errors until all attributes have been processed.
1409 +
1410 + gas/
1411 + * config/tc-arm.c (cpu_arch): Change ARM_ARCH_V6M to 11.
1412 +
1413 + include/elf/
1414 + * arm.h (TAG_CPU_ARCH_V6_M, TAG_CPU_ARCH_V6S_M): New defines.
1415 + (MAX_TAG_CPU_ARCH, TAG_CPU_ARCH_V4T_PLUS_V6_M): New defines.
1416 + (Tag_NEON_arch): Rename to Tag_Advanced_SIMD_arch to match ARM ABI
1417 + version 2.07.
1418 + (Tag_undefined39, Tag_nodefaults): New enum values.
1419 + (Tag_also_compatible_with, Tag_T2EE_use): Likewise.
1420 + (Tag_conformance, Tag_Virtualization_use): Likewise.
1421 + (Tag_undefined69, Tag_MPextension_use): Likewise.
1422 +
1423 +2008-12-24 Andrew Stubbs <ams@codesourcery.com>
1424 +
1425 + bfd/
1426 + * elf-attrs.c (bfd_elf_add_obj_attr_compat): Rename to
1427 + bfd_elf_add_obj_attr_int_string.
1428 + Read Tag_compatibility from its new location in the attribute array,
1429 + rather than the attribute list.
1430 + (_bfd_elf_copy_obj_attributes): bfd_elf_add_obj_attr_compat ->
1431 + bfd_elf_add_obj_attr_int_string.
1432 + (_bfd_elf_parse_attributes): Likewise.
1433 + (_bfd_elf_merge_object_attributes): There's now only one
1434 + Tag_compatibility, and it's in the array, not the list.
1435 + * elf-bfd.h (NUM_KNOWN_OBJ_ATTRIBUTES): Set to 33 to include
1436 + Tag_compatibility.
1437 + (bfd_elf_add_obj_attr_compat): Rename to
1438 + bfd_elf_add_obj_attr_int_string.
1439 + (bfd_elf_add_proc_attr_compat): Rename to
1440 + bfd_elf_add_proc_attr_int_string.
1441 + elf32-arm.c (elf32_arm_merge_eabi_attributes): Explicitly don't handle
1442 + Tag_compatibility.
1443 +
1444 + gas/
1445 + * read.c (s_vendor_attribute): bfd_elf_add_obj_attr_compat ->
1446 + bfd_elf_add_obj_attr_int_string.
1447 +
1448 +2008-12-11 Nathan Sidwell <nathan@codesourcery.com>
1449 +
1450 + gas/
1451 + * config/tc-m68k.c (m68k_cpus): Add 51jm.
1452 +
1453 +2008-12-09 Andrew Stubbs <ams@codesourcery.com>
1454 +
1455 + binutils/
1456 + * readelf.c (arm_attr_tag_CPU_arch): Add "v6-M" and "v6S-M".
1457 + (arm_attr_tag_WMMX_arch): Add "WMMXv2".
1458 + (arm_attr_tag_NEON_arch): Rename to ...
1459 + (arm_attr_tag_Advanced_SIMD_arch): ... official name.
1460 + (arm_attr_tag_ABI_PCS_config): Rename to ...
1461 + (arm_attr_tag_PCS_config): ... official name.
1462 + (arm_attr_tag_ABI_PCS_RO_DATA): Rename to ...
1463 + (arm_attr_tag_ABI_PCS_RO_data): ... official name.
1464 + (arm_attr_tag_ABI_FP_denormal): Add "Sign only".
1465 + (arm_attr_tag_CPU_unaligned_access): New array.
1466 + (arm_attr_tag_T2EE_use): New array.
1467 + (arm_attr_tag_Virtualization_use): New array.
1468 + (arm_attr_tag_MPextension_use): New array.
1469 + (arm_attr_publ): NEON_arch -> Advanced_SIMD_arch.
1470 + ABI_PCS_config -> PCS_config.
1471 + ABI_PCS_RO_DATA -> ABI_PCS_RO_data.
1472 + Add CPU_unaligned_access, nodefaults, also_compatible_with,
1473 + T2EE_use, conformance, Virtualization_use and MPextension_use.
1474 + (display_arm_attribute): Handle Tag_nodefaults and
1475 + Tag_also_compatible_with.
1476 +
1477 +2008-12-01 Daniel Jacobowitz <dan@codesourcery.com>
1478 +
1479 + Issue #2968
1480 + * release-notes-csl.xml: Document attribute fix.
1481 +
1482 + bfd/
1483 + * elf-attrs.c (elf_new_obj_attr, bfd_elf_get_obj_attr_int): Correct
1484 + comments.
1485 + (_bfd_elf_merge_object_attributes): Support final Tag_compatibility.
1486 +
1487 +2008-11-30 Maxim Kuvyrkov <maxim@codesourcery.com>
1488 +
1489 + bfd/
1490 + * elf32-m68k.c (elf_m68k_relocate_section): Fix indentation,
1491 + adjust relocation when appropriate.
1492 +
1493 +2008-11-24 Joseph Myers <joseph@codesourcery.com>
1494 +
1495 + bfd/
1496 + * elf32-arm.c (elf32_arm_final_link_relocate): Do not turn
1497 + branches to undefine weak symbols into branches to the next
1498 + instruction if creating PLT entries for those symbols.
1499 +
1500 + ld/testsuite/
1501 + * ld-arm/thumb2-bl-undefweak.d, ld-arm/thumb2-bl-undefweak.s: New.
1502 + * ld-arm/arm-elf.exp: Run thumb2-bl-undefweak test.
1503 +
1504 +2008-11-14 Catheirne Moore <clm@codesourcery.com>
1505 +
1506 + opcodes/
1507 + * mips-opc.c (sync, sync.p, sync.l, synci): Remove duplicates.
1508 +
1509 +2008-11-12 Catherine Moore <clm@codesourcery.com>
1510 +
1511 + gas/testsuite/
1512 + * gas/mips/mips.exp (mips32-sync): Only run for mips targets.
1513 +
1514 +2008-11-09 Catherine Moore <clm@codesourcery.com>
1515 +
1516 + Issue #4135
1517 +
1518 + Backport from mainline:
1519 +
1520 + 2008-11-06 Chao-ying Fu <fu@mips.com>
1521 +
1522 + opcodes/
1523 + * mips-opc.c (synciobdma, syncs, syncw, syncws): Move these
1524 + before sync.
1525 + (sync): New instruction with 5-bit sync type.
1526 + * mips-dis.c (print_insn_args: Add case '1' to print 5-bit values.
1527 +
1528 + gas/
1529 + * config/tc-mips.c (validate_mips_insn): Add case '1'.
1530 + (mips_ip): Add case '1' to process sync type.
1531 +
1532 + gas/testsuite/
1533 + * gas/mips/mips32-sync.d, gas/mip/mips32-sync.s: New tests.
1534 + * gas/mips/mips.exp: Run them.
1535 +
1536 + include/opcode/
1537 + * mips.h: Doucument '1' for 5-bit sync type.
1538 +
1539 +2008-11-07 Catherine Moore <clm@codesourcery.com>
1540 +
1541 + Issue #3827
1542 +
1543 + * bfd/elfxx-mips.c (_bfd_mips_elf_always_size_sections): Move
1544 + the sizing of the nonpic to pic stubs prior to the check for
1545 + the presence of a dynamic object.
1546 +
1547 +2008-10-24 Maxim Kuvyrkov <maxim@codesourcery.com>
1548 +
1549 + gas/
1550 + * config/tc-m68k.c (md_pseudo_table): Use .long instead of .word
1551 + to handle TLS debug information.
1552 + (m68k_elf_cons): Remove workaround.
1553 +
1554 +2008-10-24 Nathan Sidwell <nathan@codesourcery.com>
1555 +
1556 + gas/
1557 + * config/tc-m68k.c (m68k_elf_cons): Force used.
1558 +
1559 +2008-10-23 Nathan Sidwell <nathan@codesourcery.com>
1560 +
1561 + gas/
1562 + * config/tc-m68k.c (md_pseudo_table): Disable .word override for
1563 + now.
1564 +
1565 +2008-10-13 Sandra Loosemore <sandra@codesourcery.com>
1566 +
1567 + * release-notes-csl.xsl (Bug fix for assembly listing):
1568 + Conditionalize for windows host.
1569 + (Bug fix for objdump on Windows): Likewise.
1570 +
1571 +2008-10-13 Andrew Stubbs <ams@codesourcery.com>
1572 +
1573 + Issue #3536
1574 +
1575 + Backport from mainline:
1576 + bfd/
1577 + 2008-10-08 Alan Modra <amodra@bigpond.net.au>
1578 +
1579 + * elf.c (assign_file_positions_for_load_sections): When checking
1580 + a segment for contents, don't assume that a non-TLS nobits section
1581 + must only be followed by nobits sections.
1582 +
1583 +2008-10-13 Nathan Sidwell <nathan@codesourcery.com>
1584 +
1585 + gas/
1586 + * config/tc-mips.c (mips_cpu_info_table): Add ice9.
1587 +
1588 +2008-10-11 Maxim Kuvyrkov <maxim@codesourcery.com>
1589 +
1590 + M68K NPTL support.
1591 + gas/
1592 + * config/tc-m68k.c (m68k_elf_cons): New static function.
1593 + (md_pseudo_table): Use it.
1594 + (md_apply_fix): Fix to set thread local flag.
1595 + (m68k_elf_suffix): New static function; helper for m68k_elf_cons.
1596 +
1597 + gas/testsuite/
1598 + * gas/m68k/tls-1.s: Remove.
1599 +
1600 + bfd/
1601 + * elf32-m68k.c: Handle 2-slot GOT entries. Rename variables and
1602 + fields from n_entries to n_slots where appropriate, update comments.
1603 + (struct elf_m68k_got_entry.type): Move field to ...
1604 + (struct elf_m68k_got_entry_key): ... here. Update all uses.
1605 + (struct elf_m68k_got): Update comments.
1606 + (elf_m68k_reloc_got_tls_p): Rename to elf_m68k_reloc_tls_p, handle
1607 + all relocations. Update all uses.
1608 + (elf_m68k_init_got, elf_m68k_init_got_entry_key): Update.
1609 + (elf_m68k_got_entry_hash, elf_m68k_got_entry_eq): Update,
1610 + handle key->type.
1611 + (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT): Update name, update all uses.
1612 + (ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): Same.
1613 + (elf_m68k_get_got_entry, elf_m68k_update_got_entry_type): Update.
1614 + (elf_m68k_remove_got_entry_type, elf_m68k_add_entry_to_got): Update.
1615 + (elf_m68k_can_merge_gots_1, elf_m68k_can_merge_gots): Update.
1616 + (elf_m68k_merge_gots_1, elf_m68k_merge_gots): Update.
1617 + (struct elf_m68k_finalize_got_offsets_arg: n_ldm_entries): New field.
1618 + (elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets):
1619 + Update, handle TLS_LDM entries.
1620 + (struct elf_m68k_partition_multi_got_arg): Add slots_relas_diff
1621 + field, remove obsoleted local_n_entries field.
1622 + (elf_m68k_partition_multi_got_2): New static function.
1623 + (elf_m68k_partition_multi_got_1, elf_m68k_partition_multi_got): Use it,
1624 + update.
1625 + (elf_m68k_remove_got_entry): Update.
1626 + (elf_m68k_install_rela, dtpoff_base, tpoff): New static functions.
1627 + (elf_m68k_relocate_section, elf_m68k_finish_dynamic_symbol):
1628 + Handle TLS relocations.
1629 +
1630 + ld/testsuite/
1631 + * ld-m68k/tls-gd-1.d, ld-m68k/tls-gd-2.d, ld-m68k/tls-gd-3.d:
1632 + New tests.
1633 + * ld-m68k/tls-gd-ie-1.d, ld-m68k/tls-ie-1.d: New tests.
1634 + * ld-m68k/tls-ld-1.d, ld-m68k/tls-ld-2.d: New tests.
1635 + * ld-m68k/tls-ld-1.s, ld-m68k/tls-ld-2.s, ld-m68k/tls-le-1.s:
1636 + New test sources.
1637 + * ld-m68k/tls-no-1.s, ld-m68k/tls-gd-ie-1.s, ld-m68k/tls-gd-1.s:
1638 + New test sources.
1639 + * ld-m68k/tls-gd-2.s, ld-m68k/tls-gd-3.s, ld-m68k/tls-ie-1.s:
1640 + New test sources.
1641 + * ld-m68k/m68k.exp: Run new tests.
1642 +
1643 +2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
1644 +
1645 + binutils/
1646 + * readelf.c (display_mips_gnu_attribute): Move Power-specific
1647 + block of code...
1648 + (display_power_gnu_attribute): ...here. Oops.
1649 +
1650 +2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
1651 +
1652 + Issue #3928
1653 +
1654 + Backport:
1655 +
1656 + include/elf/
1657 + 2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
1658 + * ppc.h: Add Tag_GNU_Power_ABI_Struct_Return.
1659 +
1660 + bfd/
1661 + 2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
1662 + * elf32-ppc.c (ppc_elf_merge_obj_attributes): Merge
1663 + Tag_GNU_Power_ABI_Struct_Return.
1664 +
1665 + binutils/
1666 + 2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
1667 + * readelf.c (display_power_gnu_attribute): Decode
1668 + Tag_GNU_Power_ABI_Struct_Return.
1669 +
1670 + ld/testsuite/
1671 + 2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
1672 + * ld-powerpc/gnu-attr-12-1.s: New file.
1673 + * ld-powerpc/gnu-attr-12-2.s: New file.
1674 + * ld-powerpc/gnu-attr-12-11.d: New file.
1675 + * ld-powerpc/gnu-attr-12-21.d: New file.
1676 + * ld-powerpc/powerpc.exp: Run new dump tests.
1677 +
1678 +
1679 +2008-10-09 Joseph Myers <joseph@codesourcery.com>
1680 +
1681 + bfd/
1682 + * coff64-rs6000.c (rs6000coff64_vec, aix5coff64_vec): Add
1683 + copy_link_hash_symbol_type initializers.
1684 +
1685 +2008-10-09 Joseph Myers <joseph@codesourcery.com>
1686 +
1687 + Backport:
1688 +
1689 + bfd/
1690 + 2008-02-17 Mark Kettenis <kettenis@gnu.org>
1691 + * elf.c (swap_out_syms): Avoid preprocessing directive within
1692 + macro arg.
1693 +
1694 +2008-10-03 Kazu Hirata <kazu@codesourcery.com>
1695 +
1696 + Issue 1365
1697 + gas/
1698 + * listing.c (buffer_line): Open the source file with FOPEN_RB.
1699 + Manually process line ends.
1700 +
1701 + * release-notes-csl.xml: Add a release note about the
1702 + assembler bug.
1703 +
1704 +2008-09-26 Julian Brown <julian@codesourcery.com>
1705 +
1706 + * release-notes-csl.xml (Mixed-case NEON register aliases): Add note.
1707 +
1708 +2008-09-25 Maciej W. Rozycki <macro@codesourcery.com>
1709 +
1710 + Issue #3634
1711 + gas/testsuite/
1712 + * gas/mips/mips.exp: Move the "ice9a" test to the target
1713 + section.
1714 +
1715 +2008-09-25 Joseph Myers <joseph@codesourcery.com>
1716 +
1717 + bfd/
1718 + * libbfd-in.h (_bfd_nolink_bfd_copy_link_hash_symbol_type):
1719 + Define.
1720 + * libbfd.h: Regenerate.
1721 +
1722 +2008-09-25 Julian Brown <julian@codesourcery.com>
1723 +
1724 + Issue #3893
1725 +
1726 + gas/
1727 + * config/tc-arm.c (create_neon_reg_alias): Fix case-sensitivity for
1728 + Neon register aliases.
1729 +
1730 +2008-09-17 Catherine Moore <clm@codesourcery.com>
1731 +
1732 + gas/
1733 + * config/tc-arm.c (aeabi_set_public_attributes): Fix setting
1734 + of attribute 12 for neon fpus. Set attributes 36 and 38 for
1735 + neon-fp16 fpus.
1736 +
1737 + binutils/
1738 + * readelf.c (arm_attr_tag_ABI_FP_16bit_format): New.
1739 + (arm_attr_tag_VFP_HP_extension): New.
1740 + (arm_attr_public_tag arm_attr_public_tags): Support new
1741 + attributes.
1742 +
1743 + bfd/
1744 + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Merge
1745 + half-precision attributes.
1746 + (elf32_arm_copy_one_eabi_other_attribute): New.
1747 + (elf32_arm_copy_other_attribute_list): New.
1748 +
1749 +2008-09-24 Andrew Stubbs <ams@codesourcery.com>
1750 +
1751 + Issue #3598
1752 +
1753 + * release-notes-csl.xml: Document.
1754 +
1755 + bfd/
1756 + * elf.c (elf_fake_sections): Find the signature symbol for
1757 + SHT_GROUP sections when doing objcopy/strip.
1758 +
1759 +2008-09-24 Joseph Myers <joseph@codesourcery.com>
1760 +
1761 + ld/
1762 + * emulparams/elf64ppc.sh (OTHER_GOT_RELOC_SECTIONS): Add .rela.opd
1763 + and .rela.branch_lt.
1764 +
1765 +2008-09-13 Maciej W. Rozycki <macro@codesourcery.com>
1766 + Daniel Gutson <daniel@codesourcery.com>
1767 +
1768 + Issue #3634
1769 + gas/
1770 + * config/tc-mips.c (ICE9A_MOVNDS): New macro.
1771 + (MAX_NOPS): Rename to...
1772 + (MAX_HIST_INSNS): ... this. Adjust references and comments
1773 + accordingly.
1774 + (mips_fix_ice9a): New variable.
1775 + (ice9a_fp_stall_hazard_p): New function.
1776 + (ice9a_fp_round_hazard_p): New function.
1777 + (ice9a_movnd_workaround_p): Likewise.
1778 + (ice9a_insn_accesses_f30_p): Likewise.
1779 + (check_for_ice9a): Likewise.
1780 + (mips_cleanup): Likewise.
1781 + (nops_for_insn): Call check_for_ice9a().
1782 + (OPTION_FIX_ICE9A): New macro.
1783 + (OPTION_NO_FIX_ICE9A): Likewise.
1784 + (OPTION_MISC_BASE): Adjust accordingly.
1785 + (md_longopts): Add "mfix-ice9a" and "mno-fix-ice9a".
1786 + (md_parse_option): Handle OPTION_FIX_ICE9A and
1787 + OPTION_NO_FIX_ICE9A.
1788 + (md_show_usage): Document "-mfix-ice9a".
1789 + * config/tc-mips.h (mips_cleanup): New declaration.
1790 + (md_cleanup): New macro.
1791 + * doc/c-mips.texi (MIPS Opts): Document "-mfix-ice9a" and
1792 + "-mno-fix-ice9a".
1793 + * doc/as.texinfo (Target MIPS options): Likewise.
1794 +
1795 + gas/testsuite/
1796 + * gas/mips/ice9a.l: New test for the "-mfix-ice9a" option.
1797 + * gas/mips/ice9a.s: Source for the new test.
1798 + * gas/mips/mips.exp: Run the new test.
1799 +
1800 +2008-09-22 Catherine Moore <clm@codesourcery.com>
1801 +
1802 + Issue #3806
1803 + * release-notes-csl.xml: Document.
1804 +
1805 +2008-09-22 Catherine Moore <clm@codesourcery.com>
1806 +
1807 + Issue #3806
1808 + bfd/
1809 + * elfxx-mips.c (allocate_dynrelocs): Avoid a copy_reloc if
1810 + dynamic sections have not been created.
1811 +
1812 +2008-09-13 Catherine Moore <clm@codesourcery.com>
1813 +
1814 + gas/testsuite/
1815 + * gas/arm/half-prec-neon.d: New.
1816 + * gas/arm/half-prec-neon.s: New.
1817 + * gas/arm/half-prec-vfp3.d: New.
1818 + * gas/arm/half-prec-vfp3.s: New.
1819 + * gas/arm/half-prec-psyntax.d: New.
1820 + * gas/arm/half-prec-psyntax.s: New.
1821 +
1822 + gas/
1823 + * config/tc-arm.c (neon_type_mask): Renumber.
1824 + (type_chk_of_el_type): Handle F_F16.
1825 + (neon_cvt_flavour): Recognize half-precision conversions.
1826 + (do_neon_cvt): New shapes NS_QD and NS_DQ. Encode half-precision
1827 + conversions.
1828 + (do_neon_cvtt): Encode the T bit.
1829 + (asm_opcode_insns): vcvt, vcvtt support.
1830 + (arm_option_cpu_value): Add neon-fp16 support.
1831 +
1832 + include/
1833 + * opcode/arm.h (FPU_NEON_FP16): New.
1834 + (FPU_ARCH_NEON_FP16): New.
1835 + * elf/arm.h (Tag_ABI_FP_16bit_format): Define.
1836 +
1837 + opcodes/
1838 + * arm-dis.c (coprocessor_opcodes): Add half-precision vcvt
1839 + instructions.
1840 + (neon_opcodes): Likewise.
1841 + (print_insn_coprocessor): Print 't' or 'b' for
1842 + vcvt instructions.
1843 +
1844 +2008-09-10 Mark Mitchell <mark@codesourcery.com>
1845 +
1846 + * release-notes-csl.xml: Mention recent improvements.
1847 +
1848 +2008-09-09 Mark Mitchell <mark@codesourcery.com>
1849 +
1850 + Issue #2882
1851 + gas/
1852 + * config/tc-arm.c (BAD_SP): Define.
1853 + (s_arm_unwind_fnstart): Use REG_SP.
1854 + (s_arm_unwind_setfp): Likewise.
1855 + (reject_bad_reg): New macro.
1856 + (do_co_reg): Check for bad registers.
1857 + (do_co_reg2c): Likewise.
1858 + (do_srs): Use REG_SP.
1859 + (do_t_add_sub): Check for bad registers.
1860 + (do_t_adr): Likewise.
1861 + (do_t_arit3): Likewise.
1862 + (do_t_arit3c): Likewise.
1863 + (do_t_bfc): Likewise.
1864 + (do_t_bfi): Likewise.
1865 + (do_t_bfx): Likewise.
1866 + (do_t_blx): Likewise.
1867 + (do_t_bx): Likewise.
1868 + (do_t_bxj): Likewise.
1869 + (do_t_clz): Likewise.
1870 + (do_t_div): Likewise.
1871 + (do_t_mla): Likewise.
1872 + (do_t_mlal): Likewise.
1873 + (do_t_mov_cmp): Likewise.
1874 + (do_t_mov16): Likewise.
1875 + (do_t_mvn_tst): Likewise.
1876 + (do_t_mrs): Likewise.
1877 + (do_t_msr): Likewise.
1878 + (do_t_mul): Likewise.
1879 + (do_t_mull): Likewise.
1880 + (do_t_orn): Likewise.
1881 + (do_t_pkhbt): Likewise.
1882 + (do_t_pld): Likewise.
1883 + (do_t_rbit): Likewise.
1884 + (do_t_rev): Likewise.
1885 + (do_t_rrx): Likewise.
1886 + (do_t_rsb): Likewise.
1887 + (do_t_shift): Likewise.
1888 + (do_t_simd): Likewise.
1889 + (do_t_ssat): Likewise.
1890 + (do_t_ssat16): Likewise.
1891 + (do_t_sxtah): Likewise.
1892 + (do_t_sxth): Likewise.
1893 + (do_t_tb): Likewise.
1894 + (do_t_usat): Likewise.
1895 + (do_t_usat16): Likewise.
1896 + (nysn_insert_sp): Use REG_SP.
1897 + gas/testsuite/
1898 + * gas/arm/copro.s: Avoid using r15 where not permitted.
1899 + * gas/arm/copro.d: Adjust accordingly.
1900 + * gas/arm/thumb2_bad_reg.s: New.
1901 + * gas/arm/thumb2_bad_reg.l: Likewise.
1902 + * gas/arm/thumb2_bad_reg.d: Likewise.
1903 +
1904 +2008-09-10 Maxim Kuvyrkov <maxim@codesourcery.com>
1905 +
1906 + gas/testsuite/
1907 + * gas/m68k/br-isac.d: Fix whitespace.
1908 +
1909 +2008-09-09 Mark Mitchell <mark@codesourcery.com>
1910 +
1911 + gas/
1912 + * config/tc-arm.c (do_t_orn): New function.
1913 + (do_t_rrx): Likewise.
1914 + (insns): Add orn and rrx.
1915 + gas/testsuite/
1916 + * gas/arm/thumb32.s: Add tests for orn and rrx.
1917 + * gas/arm/thumb32.d: Adjust accordingly.
1918 + * gas/arm/thumb32.l: Likewise.
1919 + * gas/arm/thumb2_invert.s: Add tests for orn and orr.
1920 + * gas/arm/thumb2_invert.d: Adjust accordingly.
1921 + * gas/arm/tcompat.s: Add tests for rrx.
1922 + * gas/arm/tcompat.d: Adjust accordingly.
1923 +
1924 +2008-09-09 Mark Mitchell <mark@codesourcery.com>
1925 +
1926 + gas/
1927 + * config/tc-arm.c (insns): Add qasx, qsax, shasx, shsax, ssax,
1928 + uasx, uhasx, uhsx, uqasx, uqsax, usax.
1929 + gas/testsuite/
1930 + * gas/arm/thumb32.s (qadd): Add tests for them.
1931 + * gas/arm/thumb32.d: Adjust accordingly.
1932 +
1933 +2008-09-09 Mark Mitchell <mark@codesourcery.com>
1934 +
1935 + gas/
1936 + * config/tc-arm.c (insns): Correct encoding of qadd, qdadd, qsub,
1937 + qdsub in Thumb-2 mode.
1938 + opcodes/
1939 + * arm-dis.c (thumb32_opcodes): Correct decoding for qadd, qdadd,
1940 + qsub, and qdsub.
1941 + gas/testsuite/
1942 + * gas/arm/thumb32.s (qadd): Add qadd, qdadd, qsub, and qdsub.
1943 + * gas/arm/thumb32.d: Likewise.
1944 +
1945 +2008-09-09 Nathan Sidwell <nathan@codesourcery.com>
1946 +
1947 + Issue #3318
1948 + ld/testsuite/
1949 + * ld-arm/mixed-lib.d, ld-arm/armthumb-lib.d: Loosen regexp.
1950 +
1951 +2008-09-08 Daniel Jacobowitz <dan@codesourcery.com>
1952 +
1953 + Issue #2348, #3206
1954 +
1955 + * release-notes-csl.xml: Add release note for DWARF 3 support.
1956 +
1957 + Backport from mainline:
1958 +
1959 + bfd/
1960 + 2008-09-08 H.J. Lu <hongjiu.lu@intel.com>
1961 + Daniel Jacobowitz <dan@codesourcery.com>
1962 +
1963 + PR ld/3191
1964 + * dwarf2.c (struct adjusted_section): Renamed from struct
1965 + loadable_section.
1966 + (struct dwarf2_debug): Adjust for renaming. Add version field.
1967 + (read_attribute_value): Correctly handle DW_FORM_ref_addr for
1968 + DWARF3.
1969 + (find_abstract_instance_name): Pass a pointer to
1970 + attribute instead of offset. For DW_FORM_ref_addr, get the
1971 + entry at the offset from the .debug_info section.
1972 + (scan_unit_for_symbols): Update.
1973 + (parse_comp_unit): Allow DWARF3. Save the version.
1974 + (unset_sections): Update for renaming.
1975 + (place_sections): Likewise. Set new VMAs for DWARF sections
1976 + also.
1977 +
1978 +2008-09-08 Nathan Sidwell <nathan@codesourcery.com>
1979 +
1980 + gas/
1981 + * doc/c-arm.texi (ARM Directives): Document .2byte, .4byte,
1982 + .8byte, .bss, .even, .extend, .ldouble, .packed, .secrel32
1983 + directives.
1984 +
1985 +2008-09-06 Nathan Sidwell <nathan@codesourcery.com>
1986 +
1987 + gas/
1988 + * config/m68k-parse.h (CPUCR): New register name.
1989 + * config/tc-m68k.c (mcf51qe_ctrl): Rename to ...
1990 + (mcf51_ctrl): ... here. Add CPUCR.
1991 + (mcf52259_ctrl, mcf53017_ctrl): New.
1992 + (mcf5307_ctrl): Reorder canonically.
1993 + (m68k_cpus): Add 51, 51ac, 51cn, 51em, 5225x, 5301x.
1994 + (m68k_ip): Add CPUCR case.
1995 + (init_table): Add CPUCR.
1996 +
1997 + opcodes/
1998 + * m68k-opc.c (m68k_opcodes): Add stldsr insn.
1999 +
2000 + gas/testsuite/
2001 + * gas/m68k/br-isac.s: Add stldsr test case
2002 + * gas/m68k/br-isac.d: Add stldsr test case
2003 +
2004 +2008-09-05 Nathan Sidwell <nathan@codesourcery.com>
2005 +
2006 + Issue #1441
2007 + * release-notes-csl.xml: Copy note for issue #2963.
2008 +
2009 + Issue #3213
2010 + gprof/
2011 + 2004-09-07 David Ung <davidu@mips.com>
2012 + * hist.c (hist_read_rec): Load profiling rate into hz_int.
2013 + (hist_write_hist): Write hz_int into file.
2014 + (print_header): Adjust header for total_time >= 100000.
2015 + (print_line): Use wider fields it total_time >= 100000.
2016 + (hist_print): Skip excluded symbols when finding the highest
2017 + execution time in order to calculate the scaling factor.
2018 + * gprof.h (hz): Now optionally a floating-point variable.
2019 + (hz_int): New variable, always integral.
2020 + * gprof.c (hz): Now optionally a floating-point variable.
2021 + (hz_int): New variable, always integral.
2022 + * gmon_io.c (gmon_out_read): Load profiling rate initially into
2023 + hz_int, not hz. Finally convert hz_int into floating-point hz
2024 + variable, where a negative hz_int is converted to a reciprocal to
2025 + handle cycles/count instead of counts/sec.
2026 + (gmon_out_write): Write hz_int to file, not hz.
2027 + * cg_print.c: (child_max): New variable to store maximum time
2028 + value.
2029 + (self_wid): New var to hold width of self time field in report.
2030 + (child_wid): New var to hold width of child time field.
2031 + (prec): New var to hold precision of time fields.
2032 + (print_header): Adjust headers for wider fields.
2033 + (print_cycle): Use child_wid, self_wid and prec to format output.
2034 + (print_members): Similarly.
2035 + (print_parents): Similarly.
2036 + (print_children): Similarly.
2037 + (print_line): Similarly.
2038 + (cg_print): Find maximum child time, then determine child/self
2039 + field widths and precision to cope with times >= 100000.
2040 +
2041 +2008-09-05 Nathan Sidwell <nathan@codesourcery.com>
2042 +
2043 + gas/
2044 + * doc/c-arm.texi (ARM Directives): Alphabetize.
2045 +
2046 +2008-09-05 Nathan Sidwell <nathan@codesourcery.com>
2047 +
2048 + Issue #1737
2049 + gas/
2050 + * doc/c-arm.texi (): Document -mwarn-deprecated.
2051 + * config/tc-arm.c (WARN_DEPRECATED): Remove. Replace with ...
2052 + (warn_on_deprecated): ... this.
2053 + (opcode_lookup, md_assemble): Check it before warning.
2054 + (arm_opts): Add m[no-]warn-deprecated.
2055 + (md_parse_option): Replace WARN_DEPRECATED with
2056 + warn_on_deprecated.
2057 +
2058 +2008-09-05 Daniel Jacobowitz <dan@codesourcery.com>
2059 +
2060 + Backport from mainline:
2061 +
2062 + binutils/
2063 + 2008-09-05 Daniel Jacobowitz <dan@codesourcery.com>
2064 +
2065 + * readelf.c (load_specific_debug_section): New function, from
2066 + load_debug_section.
2067 + (load_debug_section): Use load_specific_debug_section.
2068 + (display_debug_section): Use load_specific_debug_section. Check for
2069 + multiple sections with the same name.
2070 +
2071 +2008-09-04 Nathan Sidwell <nathan@codesourcery.com>
2072 +
2073 + Issue #3213
2074 + gprof/
2075 + Format changes extracted from David Ung's histogram patch.
2076 + * cg_print.c (print_header, print_line): Fix formatting.
2077 + * hist.c (read_histogram_header, hist_read_rec, hist_print,
2078 + find_histogram_for_pc): Likewise.
2079 +
2080 +2008-09-03 Nathan Froyd <froydnj@codesourcery.com>
2081 +
2082 + Issue #3614
2083 +
2084 + bfd/
2085 + * elf32-ppc.c (ppc_elf_relocate_section): Continue processing
2086 + relocations if the output section is NULL; this guards against
2087 + relocations against global undefined symbols bombing out.
2088 +
2089 +2008-09-02 Nathan Sidwell <nathan@codesourcery.com>
2090 +
2091 + Issue #3213
2092 + gprof/
2093 + 2005-10-12 Nigel Stephens <nigel@mips.com>
2094 + * mips.c (mips_find_call): Traverse MIPS16 functions, identifiable
2095 + by an odd address. Indicate in debug message when we're
2096 + traversing a mips16 function.
2097 + (mips_find_call): Use "restore" as end of function marker, not
2098 + "save".
2099 + * corefile.c (core_init): Set min_insn_size to 2 for MIPS.
2100 + (core_create_function_syms): Make the address of MIPS16 symbols
2101 + odd in the gprof symbol table, since after this point we can't
2102 + access the original bfd symbol information.
2103 +
2104 +2008-08-29 Julian Brown <julian@codesourcery.com>
2105 +
2106 + ld/
2107 + * ld.texinfo (--fix-janus-2cc): Document new option.
2108 +
2109 + bfd/
2110 + * elf32-arm.c (bfd_elf32_arm_janus_2cc_erratum_scan): Use correct
2111 + insn when checking for PC operand.
2112 +
2113 +2008-08-28 Julian Brown <julian@codesourcery.com>
2114 +
2115 + ld/
2116 + * emultempl/armelf.em (fix_janus_2cc): New variable.
2117 + (arm_elf_before_allocation): Call
2118 + bfd_elf32_arm_validate_janus_2cc_fix and
2119 + bfd_elf32_arm_janus_2cc_erratum_scan.
2120 + (arm_elf_after_allocation): Call bfd_elf32_arm_fix_veneer_locations
2121 + not bfd_elf32_arm_vfp11_fix_veneer_locations.
2122 + (arm_elf_create_output_section_statements): Add fix_janus_2cc
2123 + argument.
2124 + (PARSE_AND_LIST_PROLOGUE): Add OPTION_FIX_JANUS_2CC.
2125 + (PARSE_AND_LIST_LONGOPTS): Add fix-janus-2cc option.
2126 + (PARSE_AND_LIST_OPTIONS): Likewise. (PARSE_AND_LIST_CASES): Add
2127 + OPTION_FIX_JANUS_2CC case.
2128 + * emulparams/armelf.sh (OTHER_TEXT_SECTIONS): Add .janus_2cc_veneer
2129 + section.
2130 +
2131 + bfd/
2132 + * bfd-in.h (bfd_elf32_arm_validate_janus_2cc_fix): Add prototype.
2133 + (bfd_elf32_arm_janus_2cc_erratum_scan): Add prototype.
2134 + (bfd_elf32_arm_vfp11_fix_veneer_locations): Rename to...
2135 + (bfd_elf32_arm_fix_veneer_locations): This.
2136 + (bfd_elf32_arm_set_target_relocs): Update prototype.
2137 + * bfd-in2.h: Regenerate.
2138 + * elf32-arm.c (VFP11_ERRATUM_VENEER_ENTRY_NAME): Adjust format.
2139 + (JANUS_2CC_ERRATUM_VENEER_SECTION_NAME)
2140 + (JANUS_2CC_ERRATUM_VENEER_ENTRY_NAME, MAX_ERRATUM_SYMBOL_LENGTH):
2141 + New macros.
2142 + (elf32_vfp11_erratum_type): Rename to...
2143 + (elf32_cpu_erratum_type): This. Add Janus 2CC entries.
2144 + (elf32_vfp11_erratum_list): Rename to...
2145 + (elf32_cpu_erratum_list): This. Rename vfp_insn field to orig_insn.
2146 + (_arm_elf_section_data): Update type of erratumlist field.
2147 + (elf32_arm_link_hash_table): Add janus_2cc_erratum_glue_size,
2148 + fix_janus_2cc fields. Rename num_vfp11_fixes to num_errata_fixes.
2149 + (elf32_arm_link_hash_table_create): Initialise above fields.
2150 + (JANUS_2CC_ERRATUM_VENEER_SIZE): New macro.
2151 + (bfd_elf32_arm_allocate_interworking_sections): Initialise Janus
2152 + 2CC erratum veneer section.
2153 + (record_vfp11_erratum_veneer): Rename to...
2154 + (record_cpu_erratum_veneer): This. Add argument for type of erratum
2155 + to record. Expand to handle Janus 2CC erratum.
2156 + (bfd_elf32_arm_add_glue_sections_to_bfd): Make Janus 2CC erratum
2157 + veneer section.
2158 + (bfd_elf32_arm_validate_janus_2cc_fix): New.
2159 + (bfd_elf32_arm_vfp11_erratum_scan): Update for new type and field
2160 + names. Call record_cpu_erratum_veneer instead of
2161 + record_vfp11_erratum_veneer.
2162 + (bfd_elf32_arm_vfp11_fix_veneer_locations): Rename to...
2163 + (bfd_elf32_arm_fix_veneer_locations): This. Add Janus 2CC erratum
2164 + support.
2165 + (bfd_elf32_arm_janus_2cc_erratum_scan): New.
2166 + (bfd_elf32_arm_set_target_relocs): Add fix_janus_2cc option. Handle.
2167 + (elf32_arm_size_dynamic_sections): Call
2168 + bfd_elf32_arm_janus_2cc_erratum_scan.
2169 + (elf32_arm_write_section): Add Janus 2CC erratum support.
2170 +
2171 +2008-08-21 Nathan Sidwell <nathan@codesourcery.com>
2172 +
2173 + gas/
2174 + * config/tc-m68k.c (mcf52277_ctrl): New.
2175 + (m68k_cpus): Add 52274, 52277.
2176 +
2177 +2008-08-17 Catherine Moore <clm@codesourcery.com>
2178 +
2179 + bfd/
2180 + * elfxx-mips.c (_bfd_mips_elf_final_link): Write out the
2181 + non-pic to pic stubs.
2182 +
2183 +2008-08-08 Catherine Moore <clm@codesourcery.com>
2184 +
2185 + opcodes/
2186 + * mips-opc.c (jalx): Allow for ISA1 and above.
2187 +
2188 + gas/
2189 + * testsuite/gas/mips/mips-no-jalx.l: Remove.
2190 + * testsuite/gas/mips/mips-no-jalx.s: Remove.
2191 + * testsuite/gas/mips/mips.exp: Remove invocation of mips-no-jalx.
2192 +
2193 +
2194 +2008-08-03 Catherine Moore <clm@codesourcery.com>
2195 +
2196 + * release-notes-csl.xml: Add missing "/" to <formalpara>.
2197 + Change csl-target to csl_target. Change mips*- to mips*-*.
2198 +
2199 +2008-07-31 Kazu Hirata <kazu@codesourcery.com>
2200 +
2201 + Backport from mainline:
2202 + binutils/
2203 + 2008-04-28 M Thomas <mthomas@rhrk.uni-kl.de>
2204 + Nick Clifton <nickc@redhat.com>
2205 +
2206 + PR binutils/6449
2207 + * objdump.c (slurp_file): Open the file in binary mode.
2208 + * ar.c: Remove conditional definition of O_BINARY.
2209 + * bin2.c: Likewise.
2210 + * rename.c: Likewise.
2211 + * strings.c: Likewise.
2212 + * sysdep.h: Add conditional definition of O_BINARY.
2213 +
2214 +2008-07-29 Paul Brook <paul@codesourcery.com>
2215 + Mark Mitchell <mark@codesourcery.com>
2216 +
2217 + gas/
2218 + * config/tc-arm.c (do_t_mul): In Thumb-2 mode, use 16-bit encoding
2219 + of MUL when possible.
2220 + gas/testsuite/
2221 + * gas/arm/thumb2_mul.s: New file.
2222 + * gas/arm/thumb2_mul.d: Likewise.
2223 + * gas/arm/thumb2_mul-bad.s: Likewise.
2224 + * gas/arm/thumb2_mul-bad.d: Likewise.
2225 + * gas/arm/thumb2_mul-bad.l: Likewise.
2226 + * gas/arm/t16-bad.s: Add tests for"mul" with high registers.
2227 + * gas/arm/t16-bad.l: Update accordingly.
2228 +
2229 + * release-notes-csl.xml: Document.
2230 +
2231 +2008-07-28 Catherine Moore <clm@codesourcery.com>
2232 +
2233 + Issue #3380
2234 + * release-notes-csl.xml: Document.
2235 +
2236 + Issue #3166
2237 + * release-notes-csl.xml: Document.
2238 +
2239 +2008-07-28 Daniel Jacobowitz <dan@codesourcery.com>
2240 +
2241 + Issue #3380
2242 + bfd/
2243 + * elfxx-mips.c (mips_elf_calculate_relocation): Avoid generating
2244 + relocations for undefined weak symbols with non-default visibility.
2245 + (_bfd_mips_elf_check_relocs): Use possibly_dynamic_relocs for
2246 + global symbols in shared libraries.
2247 + (allocate_dynrelocs): New function.
2248 + (_bfd_mips_elf_adjust_dynamic_symbol): Do not handle
2249 + possibly_dynamic_relocs here.
2250 + (_bfd_mips_elf_size_dynamic_sections): Call allocate_dynrelocs.
2251 +
2252 +2008-07-27 Maxim Kuvyrkov <maxim@codesourcery.com>
2253 +
2254 + ld/testsuite/
2255 + * ld-m68k/got-multigot-12-13-14-34-35-ok.d: Update.
2256 + * ld-m68k/got-multigot-14-ok.d: Update.
2257 + * ld-m68k/m68k.exp: Update.
2258 + * ld-m68k/got-negative-12-13-14-34-ok.d: Update.
2259 + * ld-m68k/got-negative-14-ok.d: Update.
2260 +
2261 + gas/testsuite/
2262 + * gas/m68k/tls-1.s: New.
2263 +
2264 + gas/
2265 + * config/m68k-parse.h (enum pic_relocation): Add values for TLS
2266 + relocations.
2267 + * config/m68k-parse.y (yylex): Parse TLS relocations.
2268 + * config/tc-m68k.c (get_reloc_code, tc_m68k_fix_adjustable)
2269 + (tc_gen_reloc): Handle TLS relocations.
2270 +
2271 + include/elf/
2272 + * m68k.h: Map TLS relocations to numbers.
2273 +
2274 + bfd/
2275 + * bfd-in2.h: Regenerate.
2276 + * elf32-m68k.c (HOWTO): Add TLS relocations.
2277 + (reloc_map): Map BFD_RELOC_68K_TLS_* to R_68K_TLS_*.
2278 + (enum elf_m68k_got_offset_size): New enum.
2279 + (struct elf_m68k_got_entry: type) Move from nested union up.
2280 + (elf_m68k_reloc_got_type, elf_m68k_reloc_got_offset_size)
2281 + (elf_m68k_reloc_got_n_entries, elf_m68k_reloc_got_tls_p): New static
2282 + functions.
2283 + (struct elf_m68k_got): merge rel_8o_n_entries and rel_8o_16o_n_entries
2284 + fields into n_entries array.
2285 + (elf_m68k_init_got): Simplify, update all uses.
2286 + (elf_m68k_init_got_entry_key): Handle R_68K_TLS_LDM32 reloc.
2287 + (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT)
2288 + (ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): Adjust to handle 2-slot
2289 + GOT entries.
2290 + (elf_m68k_get_got_entry): Update.
2291 + (elf_m68k_update_got_entry_type): Rewrite to handle TLS GOT entries,
2292 + simplify.
2293 + (elf_m68k_remove_got_entry_type): Simplify.
2294 + (elf_m68k_add_entry_to_got, elf_m68k_can_merge_gots_1)
2295 + (elf_m68k_can_merge_gots): Update.
2296 + (struct elf_m68k_finalize_got_offsets_arg)
2297 + (elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets):
2298 + Rewrite to handle 2-slot GOT entries, simplify.
2299 + (elf_m68k_partition_multi_got_1, elf_m68k_partition_multi_got): Update.
2300 + (elf_m68k_remove_got_entry_type): Update.
2301 + (elf_m68k_check_relocs): Handle TLS relocations. Remove unnecessary
2302 + update of sgot->size and srelgot->size.
2303 + (elf_m68k_gc_sweep_hook): Update.
2304 + (elf_m68k_relocate_section): Add dummy handling of TLS relocations.
2305 + * reloc.c (BFD_RELOC_68K_TLS_*): Declare TLS relocations.
2306 + * libbfd.h (bfd_reloc_code_real_names): Add BFD_RELOC_68K_TLS_*.
2307 +
2308 +2008-07-27 Maxim Kuvyrkov <maxim@codesourcery.com>
2309 +
2310 + bfd/
2311 + * elf32-m68k.c: Apply cosmetic differences from FSF mainline.
2312 +
2313 +2008-07-26 Maxim Kuvyrkov <maxim@codesourcery.com>
2314 +
2315 + Backport:
2316 +
2317 + ld/testsuite/
2318 + 2008-07-11 H.J. Lu <hongjiu.lu@intel.com>
2319 +
2320 + * ld-m68k/got-12.s: Removed.
2321 + * ld-m68k/got-13.s: Likewise.
2322 + * ld-m68k/got-14.s: Likewise.
2323 + * ld-m68k/got-15.s: Likewise.
2324 + * ld-m68k/got-34.s: Likewise.
2325 + * ld-m68k/got-35.s: Likewise.
2326 + * ld-m68k/xgot-15.s: Likewise.
2327 +
2328 + * ld-m68k/got-multigot-12-13-14-34-35-ok.d: Remove #source
2329 + and expected relocations.
2330 + * ld-m68k/got-multigot-14-ok.d: Likewise.
2331 + * ld-m68k/got-negative-12-13-14-34-ok.d: Likewise.
2332 + * ld-m68k/got-negative-14-ok.d: Likewise.
2333 + * ld-m68k/got-single-12-ok.d: Likewise.
2334 + * ld-m68k/got-xgot-12-13-14-15-34-35-ok.d: Likewise.
2335 + * ld-m68k/got-xgot-15-ok.d: Likewise.
2336 +
2337 + * ld-m68k/got-multigot-15-er.d: Remove #source.
2338 + * ld-m68k/got-negative-12-13-14-35-er.d: Likewise.
2339 + * ld-m68k/got-negative-15-er.d: Likewise.
2340 + * ld-m68k/got-single-13-er.d: Likewise.
2341 +
2342 + * ld-m68k/m68k.exp: Move GOT tests to ...
2343 + * ld-m68k/m68k-got.exp: This. New.
2344 +
2345 +2008-07-26 Maxim Kuvyrkov <maxim@codesourcery.com>
2346 +
2347 + Backport:
2348 +
2349 + bfd/
2350 + 2008-06-29 Andreas Schwab <schwab@suse.de>
2351 + * elf32-m68k.c (elf_m68k_relocate_section): Don't ignore existing
2352 + addend on _GLOBAL_OFFSET_TABLE_.
2353 +
2354 + ld/testsuite/
2355 + 2008-06-29 Andreas Schwab <schwab@suse.de>
2356 + * ld-m68k/got-1.s: New file.
2357 + * ld-m68k/got-1.d: New dump test.
2358 + * ld-m68k/m68k.exp: Run it.
2359 +
2360 +2008-07-24 Joseph Myers <joseph@codesourcery.com>
2361 +
2362 + * config.sub: Allow mips64octeon* targets.
2363 +
2364 + NOT ASSIGNED TO FSF
2365 + COPYRIGHT CAVIUM
2366 + bfd/
2367 + * config.bfd: Handle mips64octeon*-*-elf*.
2368 +
2369 + gas/
2370 + * configure.tgt: Handle mips-wrs-elf*.
2371 +
2372 + ld/
2373 + * configure.tgt: Handle mips64octeon*-*-elf*.
2374 + * Makefile.am (ALL_EMULATIONS): Add Octeon emulations.
2375 + (eelf32ebocteon.c, eelf32elocteon.c, eelf32ebocteonn32.c,
2376 + eelf32elocteonn32.c, eelf64ebocteon.c, eelf64elocteon.c): New.
2377 + * Makefile.in: Regenerate.
2378 + * scripttempl/elf.sc: Add ${OCTEON_SPECIAL_SECTIONS}.
2379 + * emulparams/elf32ebocteon.sh, emulparams/elf32ebocteonn32.sh,
2380 + emulparams/elf32elocteon.sh, emulparams/elf32elocteonn32.sh,
2381 + emulparams/elf64ebocteon.sh, emulparams/elf64elocteon.sh,
2382 + emultempl/octeonelf.em: New.
2383 +
2384 +2008-07-18 Joseph Myers <joseph@codesourcery.com>
2385 +
2386 + Backport:
2387 +
2388 + bfd/
2389 + 2008-07-18 Joseph Myers <joseph@codesourcery.com>
2390 + * bfd-in.h (bfd_elf32_arm_set_target_relocs): Add new parameter.
2391 + * bfd-in2.h: Regenerate.
2392 + * elf32-arm.c (struct elf_arm_obj_tdata): Add field
2393 + no_wchar_size_warning.
2394 + (bfd_elf32_arm_set_target_relocs): Add new parameter
2395 + no_wchar_warn.
2396 + (elf32_arm_merge_eabi_attributes): Give a warning, not an error,
2397 + for conflicting wchar_t attributes. Do not warn if
2398 + --no-wchar-size-warning. Make diagnostic text more specific.
2399 +
2400 + ld/
2401 + 2008-07-18 Joseph Myers <joseph@codesourcery.com>
2402 + * ld.texinfo (--no-wchar-size-warning): Document new ARM option.
2403 + * emultempl/armelf.em (no_wchar_size_warning): New.
2404 + (arm_elf_create_output_section_statements): Pass
2405 + no_wchar_size_warning to arm_elf_create_output_section_statements.
2406 + (OPTION_NO_WCHAR_SIZE_WARNING): New.
2407 + (PARSE_AND_LIST_LONGOPTS): Add no-wchar-size-warning.
2408 + (PARSE_AND_LIST_OPTIONS): List --no-wchar-size-warning.
2409 + (PARSE_AND_LIST_ARGS_CASES): Handle --no-wchar-size-warning.
2410 +
2411 + ld/testsuite/
2412 + 2008-07-18 Joseph Myers <joseph@codesourcery.com>
2413 + * ld-arm/attr-merge-wchar-0.s,ld-arm/attr-merge-wchar-2.s,
2414 + ld-arm/attr-merge-wchar-4.s, ld-arm/attr-merge-wchar-00-nowarn.d,
2415 + ld-arm/attr-merge-wchar-00.d, ld-arm/attr-merge-wchar-02-nowarn.d,
2416 + ld-arm/attr-merge-wchar-02.d, ld-arm/attr-merge-wchar-04-nowarn.d,
2417 + ld-arm/attr-merge-wchar-04.d, ld-arm/attr-merge-wchar-20-nowarn.d,
2418 + ld-arm/attr-merge-wchar-20.d, ld-arm/attr-merge-wchar-22-nowarn.d,
2419 + ld-arm/attr-merge-wchar-22.d, ld-arm/attr-merge-wchar-24-nowarn.d,
2420 + ld-arm/attr-merge-wchar-24.d, ld-arm/attr-merge-wchar-40-nowarn.d,
2421 + ld-arm/attr-merge-wchar-40.d, ld-arm/attr-merge-wchar-42-nowarn.d,
2422 + ld-arm/attr-merge-wchar-42.d, ld-arm/attr-merge-wchar-44-nowarn.d,
2423 + ld-arm/attr-merge-wchar-44.d: New.
2424 + * ld-arm/arm-elf.exp: Run new tests.
2425 +
2426 +2008-07-10 Joseph Myers <joseph@codesourcery.com>
2427 +
2428 + config/
2429 + * mh-mingw (LDFLAGS): Append to rather than replacing previous
2430 + value.
2431 +
2432 +2008-07-08 Stan Shebs <stan@codesourcery.com>
2433 +
2434 + BE8 disassembly.
2435 + include/
2436 + * dis-asm.h (struct disassemble_info): Add endian_code field.
2437 + opcodes/
2438 + * dis-init.c (init_disassemble_info): Init endian_code field.
2439 + * arm-dis.c (print_insn): Disassemble code according to
2440 + setting of endian_code.
2441 + (print_insn_big_arm): Detect when BE8 extension flag has been set.
2442 + ld/testsuite/
2443 + * ld-arm/arm-elf.exp: Use objdump -d for arm-be8 test.
2444 + * ld-arm/arm-be8.d: Change to test disassembly.
2445 +
2446 +2008-07-02 Joseph Myers <joseph@codesourcery.com>
2447 +
2448 + ld/
2449 + * ld.h (args_type): Add error_poison_system_directories.
2450 + * ld.texinfo (--error-poison-system-directories): Document.
2451 + * ldfile.c (ldfile_add_library_path): Check
2452 + command_line.error_poison_system_directories.
2453 + * ldmain.c (main): Initialize
2454 + command_line.error_poison_system_directories.
2455 + * lexsup.c (enum option_values): Add
2456 + OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
2457 + (ld_options): Add --error-poison-system-directories.
2458 + (parse_args): Handle new option.
2459 +
2460 +2008-06-30 Joseph Myers <joseph@codesourcery.com>
2461 +
2462 + config/
2463 + * mh-mingw (BOOT_CFLAGS): Do not use -D__USE_MINGW_ACCESS.
2464 +
2465 +2008-06-14 Catherine Moore <clm@codesourcery.com>
2466 +
2467 + Issue #3166
2468 + bfd/
2469 + * elfxx-mips.c (bfd_mips_elf_maybe_create_non_pic_to_pic_stubs_section):
2470 + Set SEC_LINKER_CREATED for the stub section.
2471 +
2472 +2008-06-09 Paul Brook <paul@codesourcery.com>
2473 +
2474 + Backport from FSF.
2475 + bfd/
2476 + * elf32-arm.c (elf32_arm_merge_private_bfd_data): Allow BE8 shared
2477 + libraries.
2478 +
2479 +2008-06-06 Paul Brook <paul@codesourcery.com>
2480 +
2481 + Backport from FSF.
2482 + bfd/
2483 + * elf32-arm.c (elf32_arm_merge_private_bfd_data): Reject BE8 input.
2484 +
2485 +2008-06-03 Paul Brook <paul@codesourcery.com>
2486 +
2487 + Backport from FSF.
2488 + gas/
2489 + * config/tc-arm.c (do_t_rbit): Populate both rm fields.
2490 + gas/testsuite/
2491 + * gas/arm/thumb32.d: Update expected output.
2492 +
2493 +2008-06-02 Nathan Froyd <froydnj@codesourcery.com>
2494 +
2495 + ld/testsuite/
2496 + * ld-scripts/rgn-over8.s: Use .section .bss instead of .bss.
2497 +
2498 +2008-05-23 Paul Brook <paul@codesourcery.com>
2499 +
2500 + gas/
2501 + * config/tc-arm.c (arm_fix_adjustable): Don't adjust MOVW/MOVT
2502 + relocations.
2503 +
2504 + gas/testsuite/
2505 + * gas/arm/movw-local.d: New test.
2506 + * gas/arm/movw-local.s: New test.
2507 +
2508 +2008-05-23 Paul Brook <paul@codesourcery.com>
2509 +
2510 + Backport from FSF.
2511 + gas/
2512 + * config/tc-arm.c (parse_cond): Covert to lowercase before matching.
2513 +
2514 +2008-05-20 Nathan Froyd <froydnj@codesourcery.com>
2515 +
2516 + Backport from mainline:
2517 +
2518 + 2008-03-31 Edmar Wienskoski <edmar@freescale.com>
2519 + bfd/
2520 + * archures.c: Add bfd_mach_ppc_e500mc.
2521 + * bfd-in2.h: Regenerate.
2522 +
2523 + gas/
2524 + * config/tc-ppc.c (parse_cpu): Handle "e500mc". Extend "e500" to
2525 + accept e500mc instructions.
2526 + (md_show_usage): Document -me500mc.
2527 +
2528 + gas/testsuite/
2529 + * gas/ppc/e500mc.s, gas/ppc/e500mc.d: New test.
2530 + * gas/ppc/ppc.exp: Run the new test
2531 +
2532 + include/opcode/
2533 + * ppc.h: (PPC_OPCODE_E500MC): New.
2534 +
2535 + opcodes/
2536 + * ppc-dis.c (powerpc_dialect): Handle "e500mc". Extend "e500" to
2537 + accept Power E500MC instructions.
2538 + (print_ppc_disassembler_options): Document -Me500mc.
2539 + * ppc-opc.c: (DUIS, DUI, T): New.
2540 + (XRT, XRTRA): Likewise.
2541 + (E500MC): Likewise.
2542 + (powerpc_opcodes): Add new Power E500MC instructions.
2543 +
2544 +2008-05-15 Nathan Sidwell <nathan@codesourcery.com>
2545 +
2546 + ld/testsuite/
2547 + Backport 2008-05-02 H.J. Lu <hongjiu.lu@intel.com>
2548 + PR ld/6475
2549 + * ld-scripts/rgn-over8-ok.d: Accept any alignment.
2550 +
2551 +2008-05-09 Catherine Moore <clm@codesourcery.com>
2552 +
2553 + From binutils-mips:
2554 + Issue #2963
2555 + gas/
2556 + * config/tc-mips.c (mips_frob_file): Don't match MIPS16 relocs
2557 + with non-MIPS16 relocs.
2558 +
2559 + gas/testsuite/
2560 + * gas/mips/mips16-hilo-match.s: New test.
2561 + * gas/mips/mip16-hilo-match.d: New test output.
2562 + * gas/mips/mips.exp: Run mips16-hilo-match.
2563 +
2564 +2008-05-05 Catherine Moore <clm@codesourcery.com>
2565 +
2566 + From binutils-mips:
2567 + 2008-04-04 Catherine Moore <clm@codesourcery.com>
2568 + gas/testsuite/
2569 + * gas/mips/mips.exp (ulw2-eb-ilocks, elw2-el-ilocks, uld2-el,
2570 + uld2-eb, mips64): Disable for octeon.
2571 +
2572 +2008-04-29 Daniel Jacobowitz <dan@codesourcery.com>
2573 +
2574 + Issue #2950
2575 + * release-notes-csl.xml: Document Symbian relocation fix.
2576 +
2577 + Backport from FSF:
2578 + 2008-04-29 Daniel Jacobowitz <dan@codesourcery.com>
2579 + bfd/
2580 + * elf.c (_bfd_elf_get_dynamic_reloc_upper_bound)
2581 + (_bfd_elf_canonicalize_dynamic_reloc): Find dynamic relocations
2582 + even if they are not loaded.
2583 + * elflink.c (_bfd_elf_init_2_index_sections): Set data_index_section
2584 + first.
2585 +
2586 + 2008-04-29 Daniel Jacobowitz <dan@codesourcery.com>
2587 + ld/testsuite/
2588 + * ld-arm/symbian-seg1.s, ld-arm/symbian-seg1.d: New files.
2589 + * ld-arm/arm-elf.exp: Run symbian-seg1.
2590 +
2591 +2008-04-28 Nathan Sidwell <nathan@codesourcery.com>
2592 +
2593 + Issue #2928
2594 + * release-notes-csl.xml: Document.
2595 +
2596 + ld/
2597 + * ldlang.c (lang_size_sections_1): Don't check LMA overflow on
2598 + non-load sections.
2599 +
2600 + ld/testsuite/
2601 + * ld-scripts/rgn-over.exp: Allow -ok file names to pass.
2602 + * ld-scripts/rgn-over8.s: New.
2603 + * ld-scripts/rgn-over8.t: New.
2604 + * ld-scripts/rgn-over8-ok.d: New.
2605 +
2606 +2008-04-24 Maxim Kuvyrkov <maxim@codesourcery.com>
2607 +
2608 + * elfxx-mips.c (_bfd_mips_elf_check_relocs): Don't reject R_MIPS_HI16
2609 + relocations when they are a part of compound relocation.
2610 +
2611 +2008-04-07 Andrew Jenner <andrew@codesourcery.com>
2612 +
2613 + ld/
2614 + * emultempl/armelf.em: Correct formatting of help text for
2615 + --no-enum-size-warning option.
2616 +
2617 +2008-03-28 Catherine Moore <clm@codesourcery.com>
2618 +
2619 + Backport:
2620 + 2008-03-26 Daniel Jacobowitz <dan@codesourcery.com>
2621 + ld/testsuite/
2622 + * ld-elf/flags1.d: Adjust for MIPS text alignment.
2623 +
2624 +2008-03-28 Daniel Jacobowitz <dan@codesourcery.com>
2625 +
2626 + bfd/
2627 + * elfxx-mips.c (_bfd_mips_elf_create_nonpic_dynamic_sections): New.
2628 + (_bfd_mips_elf_create_dynamic_sections): Use it.
2629 + (_bfd_mips_elf_check_relocs): Likewise. Reject shared libraries with
2630 + non-PIC relocations.
2631 + (_bfd_mips_elf_merge_private_bfd_data): Skip dynamic objects.
2632 +
2633 +2008-03-28 Paul Brook <paul@codesourcery.com>
2634 +
2635 + Backport from FSF.
2636 + gas/
2637 + * config/tc-arm.c (parse_neon_mov): Parse register before immediate
2638 + to avoid spurious symbols.
2639 +
2640 +2008-03-27 Joseph Myers <joseph@codesourcery.com>
2641 +
2642 + ld/testsuite/
2643 + * ld-elfcomm/elfcomm.exp: Run $READELF not readelf.
2644 +
2645 +2008-03-27 Daniel Jacobowitz <dan@codesourcery.com>
2646 +
2647 + gas/
2648 + * config/tc-mips.c (md_begin): Disable -G for abicalls even without
2649 + PIC.
2650 +
2651 +2008-03-27 Nathan Sidwell <nathan@codesourcery.com>
2652 +
2653 + Issue #2742
2654 + gas/
2655 + * config/tc-m68k.c (md_convert_frag_1): Replace as_fatal with
2656 + as_bad_where.
2657 +
2658 +2008-03-26 Daniel Jacobowitz <dan@codesourcery.com>
2659 +
2660 + Issue #2682
2661 + bfd/
2662 + * elfxx-mips.c (mips_elf_record_got_page_entry): Update comment.
2663 + (_bfd_mips_elf_check_relocs): Update comments. Always call
2664 + mips_elf_record_got_page_entry for R_MIPS_GOT_PAGE.
2665 +
2666 +2008-03-26 Nathan Sidwell <nathan@codesourcery.com>
2667 +
2668 + Issue #2691
2669 + config/
2670 + * mt-sde (CFLAGS_FOR_TARGET, CXXFLAGS_FOR_TARGET): Replace
2671 + -minterlink-mips16 with -fno-optimize-sibling-calls.
2672 +
2673 + convert/
2674 + * Makefile.am (convert.o): Add convert.c.
2675 + * Makefile.in: Rebuilt.
2676 +
2677 +2008-03-25 Maxim Kuvyrkov <maxim@codesourcery.com>
2678 +
2679 + bfd/
2680 +
2681 + * elf.c (_bfd_elf_map_sections_to_segments): Check user's
2682 + mapping of section to segments.
2683 +
2684 +2008-03-24 Kazu Hirata <kazu@codesourcery.com>
2685 +
2686 + libiberty/
2687 + * cygpath.c (cygpath): Special-case the empty path.
2688 +
2689 +2008-03-20 Nathan Sidwell <nathan@codesourcery.com>
2690 +
2691 + convert/
2692 + * Makefile.am (convert.o): Fix dependency typo.
2693 + * Makefile.in: Rebuilt.
2694 +
2695 +2008-03-18 Daniel Jacobowitz <dan@codesourcery.com>
2696 +
2697 + libiberty/
2698 + * cygpath.c (chdir): New function.
2699 +
2700 +2008-03-14 Mark Shinwell <shinwell@codesourcery.com>
2701 + Daniel Jacobowitz <dan@codesourcery.com>
2702 + Catherine Moore <clm@codesourcery.com>
2703 +
2704 + bfd/
2705 + * bfd-in.h (bfd_mips_elf_set_non_pic): New prototype.
2706 + (bfd_mips_elf_check_non_pic): New prototype.
2707 + * bfd-in2.h: Regenerate.
2708 + * elf32-mips.c (elf_mips_copy_howto): New.
2709 + (elf_mips_jump_slot_howto): New.
2710 + (bfd_elf32_bfd_reloc_type_lookup): Handle BFD_RELOC_MIPS_COPY
2711 + and BFD_RELOC_MIPS_JUMP_SLOT.
2712 + (bfd_elf32_bfd_reloc_name_lookup): Handle new copy and jump slot
2713 + relocations.
2714 + (mips_elf32_rtype_to_howto): Likewise.
2715 + (elf_backend_want_plt_sym): Define. Remove definition in VxWorks
2716 + clause.
2717 + (elf_backend_plt_readonly): Likewise.
2718 + (elf_backend_write_section): Define.
2719 + (elf_backend_plt_sym_val): Define, except for VxWorks.
2720 + (mips_vxworks_copy_howto_rela): Delete.
2721 + (mips_vxworks_jump_slot_howto_rela): Delete.
2722 + (mips_vxworks_bfd_reloc_type_lookup): Delete.
2723 + (mips_vxworks_bfd_reloc_name_lookup): Delete.
2724 + (mips_vxworks_rtype_to_howto): Delete.
2725 + (elf_backend_got_symbol_offset): Remove legacy definition.
2726 + (elf_backend_want_dynbss): Remove unnecessary definition.
2727 + (bfd_elf32_bfd_reloc_type_lookup): Delete macro definition for
2728 + VxWorks.
2729 + (bfd_elf32_bfd_reloc_name_lookup): Likewise.
2730 + (elf_backend_mips_rtype_to_howto): Likewise.
2731 + (elf_backend_adjust_dynamic_symbol): Define to new function.
2732 + * elfxx-mips.c (mips_elf_link_hash_entry): Add plt_entry_offset and
2733 + has_non_pic_to_pic_stub members. Delete is_relocation_target
2734 + member.
2735 + (mips_elf_link_hash_table): Add is_non_pic, non_pic_bfd,
2736 + snonpictopic and large_plt_entry_size members. Update comments.
2737 + (NON_PIC_P): New.
2738 + (NON_PIC_TO_PIC_STUB_SECTION_NAME): New.
2739 + (MIPS_NONPIC_LARGE_PLT_THRESHOLD): New.
2740 + (mips_non_pic_exec_plt0_entry): New.
2741 + (mips_non_pic_exec_plt_entry): New.
2742 + (mips_non_pic_large_exec_plt_entry): New.
2743 + (mips_non_pic_to_pic_stub): New.
2744 + (mips_elf_link_hash_newfunc): Initialize new members.
2745 + (mips_elf_create_got_section): Don't create .got.plt for VxWorks.
2746 + (mips_elf_calculate_relocation): Handle cases for filling in
2747 + references to non-PIC to PIC call stubs and non-PIC PLT entries.
2748 + (_bfd_mips_elf_create_dynamic_sections): Create .plt, .rel.plt,
2749 + .dynbss and .rel.bss sections for non-PIC. Create .got.plt for
2750 + non-PIC and VxWorks.
2751 + (_bfd_mips_elf_check_relocs): Update comments. Check if we have
2752 + the first non-PIC file encountered during an executable link.
2753 + Don't add dynamic relocations for non-PIC. Remove
2754 + is_relocation_target assignment. Set non_got_ref as appropriate.
2755 + (mips_elf_next_plt_entry_size): New.
2756 + (mips_elf_create_old_style_stub): New.
2757 + (_bfd_mips_elf_adjust_dynamic_symbol): Call worker function to
2758 + handle VxWorks and non-PIC cases. Move code for creating old-style
2759 + .MIPS.stubs entries to mips_elf_create_old_style_stub.
2760 + (_bfd_mips_vxworks_adjust_dynamic_symbol): Rename to...
2761 + (_bfd_mips_plt_adjust_dynamic_symbol): ...this. New. Extend code
2762 + to handle the non-PIC ABI.
2763 + (mips_elf_maybe_create_non_pic_to_pic_stub): New.
2764 + (_bfd_mips_elf_always_size_sections): Identify symbols requiring
2765 + non-PIC to PIC call stubs. Allocate space for any such stubs.
2766 + (_bfd_mips_elf_size_dynamic_sections): Allocate space for delay slot
2767 + in a PLT section. Update comments. Add dynamic tags for non-PIC
2768 + if required.
2769 + (_bfd_mips_elf_finish_dynamic_symbol): Fill in .plt, .got.plt and
2770 + .rel.plt entries for symbols with PLT entries under non-PIC.
2771 + Tighten bound on h->plt.offset for old-style stubs. Emit copy
2772 + relocations if required.
2773 + (mips_non_pic_finish_plt): New.
2774 + (_bfd_mips_elf_finish_dynamic_sections): Handle DT_MIPS_PLTGOT
2775 + and DT_MIPS_RWPLT dynamic tags. Rework code handling DT_PLTGOT
2776 + dynamic tag. Adjust assertions for DT_PLTREL, DT_PLTRELSZ and
2777 + DT_JMPREL. Call mips_non_pic_finish_plt.
2778 + (_bfd_mips_elf_copy_indirect_symbol): Copy new members.
2779 + (_bfd_mips_elf_link_hash_table_create): Initialize new members.
2780 + (_bfd_mips_elf_merge_private_bfd_data): Remove extraneous
2781 + braces.
2782 + (_bfd_mips_elf_get_target_dtag): Handle DT_MIPS_PLTGOT and
2783 + DT_MIPS_RWPLT cases.
2784 + (_bfd_mips_elf_plt_sym_val): New.
2785 + (mips_elf_nonpic_stub): New.
2786 + (_bfd_mips_elf_begin_write_processing): New.
2787 + (bfd_mips_elf_maybe_create_non_pic_to_pic_stubs_section): New.
2788 + (_bfd_mips_post_process_headers): Set correct ABI version for
2789 + non-PIC.
2790 + * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Rename to...
2791 + (_bfd_mips_plt_adjust_dynamic_symbol): ...this. New prototype.
2792 + (_bfd_mips_nonpic_finish_dynamic_symbol): New.
2793 + (_bfd_mips_elf_plt_sym_val): New prototype.
2794 + (_bfd_mips_elf_begin_write_processing): New prototype.
2795 + (bfd_mips_elf_maybe_create_non_pic_to_pic_stubs_section): New
2796 + prototype.
2797 + (_bfd_mips_post_process_headers): New prototype.
2798 + (elf_backend_post_process_headers): Define.
2799 + (elf_backend_begin_write_processing): Define.
2800 + * elflink.c (_bfd_elf_merge_symbol): Correct typo.
2801 + * reloc.c (MIPS ELF relocation): Add reference to non-PIC.
2802 +
2803 + binutils/
2804 + * readelf.c (get_mips_dynamic_type): Handle DT_MIPS_PLTGOT
2805 + and DT_MIPS_RWPLT.
2806 + (get_mips_symbol_other): Handle STO_MIPS_PLT.
2807 +
2808 + gas/
2809 + * config/tc-mips.c (mips_nonpic_option): New.
2810 + (md_longopts): Add mnon-pic-abicalls entry.
2811 + (md_parse_option): Add OPTION_NON_PIC_ABICALLS case.
2812 + (mips_elf_final_processing): Check mips_nonpic_option.
2813 +
2814 + include/
2815 + * elf/mips.h (DT_MIPS_PLTGOT): New.
2816 + (DT_MIPS_RWPLT): New.
2817 + (STO_MIPS_PLT): New.
2818 +
2819 + ld/
2820 + * emulparams/elf32btsmip.sh: Update comment.
2821 + (GOT): Define.
2822 + (GOTPLT): Define.
2823 + (DATA_GOTPLT): Define.
2824 + * emulparams/elf32ebmipvxworks.sh (GOT): Unset.
2825 + (GOTPLT): Likewise.
2826 + (DATA_GOTPLT): Likewise.
2827 + * emulparams/elf32elmipvxworks.sh (GOT): Unset.
2828 + (GOTPLT): Likewise.
2829 + (DATA_GOTPLT): Likewise.
2830 + * emultempl/mipself.em: Include elfxx-mips.h.
2831 + (mips_after_open): New.
2832 + (LDEMUL_AFTER_OPEN): Define.
2833 + * scripttempl/elf.sc: Update comments. Handle DATA_GOT and
2834 + DATA_GOTPLT.
2835 +
2836 +2008-03-12 Nathan Sidwell <nathan@codesourcery.com>
2837 +
2838 + gas/
2839 + * config/tc-m68k.c (no_mac): New.
2840 + (m68k_extensions): Point to it for mac entry.
2841 + (m68k_set_extension): Allow for disabling different set of flags.
2842 +
2843 +2008-03-11 Catherine Moore <clm@codesourcery.com>
2844 +
2845 + bfd/
2846 + * elf.c ( _bfd_elf_print_private_bfd_data): Call
2847 + elf_backend_get_target_dtag if defined.
2848 + * elf32-mips.c (elf_backend_get_target_dtag): Define.
2849 + * elf64-mips.c: Likewise.
2850 + * elfn32-mips.c: Likewise.
2851 + * elfxx-mips.c (_bfd_mips_elf_get_target_dtag): New.
2852 + * elfxx-mips.h (_bfd_mips_elf_get_target_dtag): Declare.
2853 + * elf-bfd.h (elf_backend_get_target_dtag): Add prototype.
2854 + * elfxx-target.h (elf_backend_get_target_dtag): Add default.
2855 + (elf_backend_data): Add elf_backend_get_target_dtag.
2856 +
2857 +2008-03-11 Julian Brown <julian@codesourcery.com>
2858 +
2859 + Merge from MIPS:
2860 +
2861 + 2008-03-11 Thiemo Seufer <ths@mips.com>
2862 +
2863 + convert/
2864 + * bin.c, conv.texi, convert.c, elf.h, elfio.c, elfmips.h,
2865 + elfout.c, idtbin.c, lsifast.c, mipsflash.c, srec.c, stagbin.c:
2866 + Update license to GPL v3.
2867 +
2868 +2008-03-07 Julian Brown <julian@codesourcery.com>
2869 +
2870 + convert/
2871 + * convert.c (conv-version.h): Include.
2872 + (getopt.h): Include.
2873 + (usage): Add error argument. Print to stdout/stderr depending on
2874 + setting. Exit according to setting. Print bug URL.
2875 + (parselist): Add argument to usage() calls.
2876 + (long_opts): New array.
2877 + (main): Use getopt_long. Add argument to usage() invocations.
2878 + Handle --help, --version options.
2879 + * configure.ac (ACX_PKGVERSION, ACX_BUGURL): Add.
2880 + * Makefile.am (ACLOCAL_AMFLAGS): Add.
2881 + (conv_SOURCES): Add conv-version.h.
2882 + (conv-version.h): Add build rule.
2883 + (convert.c): Add dependency on conv-version.h.
2884 + * version.h: New.
2885 + * Makefile.in: Regenerate.
2886 + * configure.ac: Regenerate.
2887 + * aclocal.m4: Regenerate.
2888 +
2889 +2008-03-07 Julian Brown <julian@codesourcery.com>
2890 +
2891 + convert/
2892 + * Makefile.am (install-exec-local): Don't install "conv" binary with
2893 + no target triplet.
2894 + * Makefile.in: Regenerate.
2895 +
2896 +2008-03-06 Joseph Myers <joseph@codesourcery.com>
2897 +
2898 + ld/testsuite/
2899 + * lib/ld-lib.exp (check_gc_sections_available): Return 0 for
2900 + *-*-mingw*.
2901 +
2902 +2008-03-06 Maxim Kuvyrkov <maxim@codesourcery.com>
2903 +
2904 + bfd/
2905 +
2906 + * elf32-m68k.c (elf_m68k_get_bfd2got_entry): Handle search mode.
2907 + (elf_m68k_relocate_section): Fix to handle _GLOBAL_OFFSET_TABLE_
2908 + relocations in case of empty local/global GOT.
2909 +
2910 +2008-03-04 Mark Shinwell <shinwell@codesourcery.com>
2911 + Sandra Loosemore <sandra@codesourcery.com>
2912 +
2913 + bfd/
2914 + * elf32-arm.c (elf32_arm_final_link_relocate): Use correct formula
2915 + for sign-extending 16-bit offsets in MOVW/MOVT relocations.
2916 +
2917 +2008-03-02 Joseph Myers <joseph@codesourcery.com>
2918 +
2919 + ld/
2920 + * emulparams/m68kelf.sh (GENERATE_PIE_SCRIPT): Define.
2921 +
2922 +2008-02-29 Paul Brook <paul@codesourery.com>
2923 +
2924 + bfd/
2925 + * elf32-arm.c (insert_thumb_branch): Rewrite. Handle b.w.
2926 + (elf32_thumb_to_arm_stub): Adjust for new insert_thumb_branch.
2927 +
2928 + ld/testsuite/
2929 + * ld-arm/arm-app.r: Updated expected outpu for new test.
2930 + * ld-arm/arm-elf.exp (armeabitests): Add thumb2-b-interwork.
2931 + * ld-arm/thumb2-b-interwork.d: New test.
2932 + * ld-arm/thumb2-b-interwork.s: New test.
2933 +
2934 +2008-02-29 Julian Brown <julian@codesourcery.com>
2935 +
2936 + convert/
2937 + * config.h.in: Regenerate.
2938 +
2939 +2008-02-29 Julian Brown <julian@codesourcery.com>
2940 +
2941 + convert/
2942 + * convert.c (xmalloc): Remove (duplicate definition in libiberty).
2943 +
2944 +2008-02-28 Julian Brown <julian@codesourcery.com>
2945 +
2946 + * configure.ac (mips*-sde-elf*): Merge duplicated cases into one.
2947 + Test --with-newlib for !yes rather than no.
2948 + * Makefile.def (all-convert): Add dependency on libiberty to fix
2949 + parallel make.
2950 + * configure: Regenerate.
2951 + * Makefile.in: Regenerate.
2952 +
2953 + convert/
2954 + * Makefile.in: Disable HTML documentation, and HTML and PDF
2955 + documentation installation.
2956 + * Makefile.am: Regenerate.
2957 + * configure: Regenerate.
2958 + * aclocal.m4: Regenerate.
2959 +
2960 +2008-02-28 Julian Brown <julian@codesourcery.com>
2961 +
2962 + Revert: (moved to separate module)
2963 +
2964 + 2008-02-11 Julian Brown <julian@codesourcery.com>
2965 +
2966 + Merge from MIPS:
2967 +
2968 + * sdemdi: New directory. SDE/MDI glue.
2969 + * Makefile.def: Add sdemdi target module.
2970 +
2971 + sdemdi/
2972 + * ChangeLog: New.
2973 + * configure.ac: New.
2974 + * Makefile.am: New.
2975 + * config-ml.in: New.
2976 + * crt0.S: New.
2977 + * fileio.c: New.
2978 + * m32cache.S: New.
2979 + * mdi.h: New.
2980 + * mdilow.S: New.
2981 + * mdisyscall.S: New.
2982 + * mdixcpt.h: New.
2983 + * rtpxlite.c: New.
2984 + * rtpxliteasm.S: New.
2985 + * rtpxstub.c: New.
2986 + * sdemdi32.ld: New.
2987 + * sdemdi32hi.ld: New.
2988 + * sdemdi64.ld: New.
2989 + * sdemdi64hi.ld: New.
2990 + * simlow.S: New.
2991 +
2992 +2008-02-28 Maxim Kuvyrkov <maxim@codesourcery.com>
2993 +
2994 + Fix testcase to handle hack for SDElib below.
2995 + Don't push upstream.
2996 +
2997 + gas/testsuite/
2998 +
2999 + * gas/mips/set-arch.d: Expect ehb.
3000 +
3001 +2008-02-27 Paul Brook <paul@codesourcery.com>
3002 +
3003 + bfd/
3004 + * elf32-arm.c (elf32_arm_check_relocs): Only set h->needs_plt for
3005 + branch/call relocations.
3006 +
3007 + ld/testsuite/
3008 + * ld-arm/arm-elf.exp (armelftests): Add arm-app-movw.
3009 +
3010 +2008-02-27 Paul Brook <paul@codesourcery.com>
3011 +
3012 + ld/testsuite/
3013 + * ld-arm/arm-elf.exp (armelftests): Use arm.ld in movw-merge.
3014 +
3015 +2008-02-26 Joseph Myers <joseph@codesourcery.com>
3016 +
3017 + Backport:
3018 +
3019 + binutils/testsuite/
3020 + 2008-02-26 Joseph Myers <joseph@codesourcery.com>
3021 + * config/default.exp (gcc_gas_flag, dlltool_gas_flag): Define to
3022 + empty for testing an installed toolchain.
3023 +
3024 +2008-02-25 Sandra Loosemore <sandra@codesourcery.com>
3025 +
3026 + binutils/
3027 + Reapply:
3028 + 2006-05-17 Carlos O'Donell <carlos@codesourcery.com>
3029 +
3030 + * doc/binutils.texi: Use "Binutils Index" for index name.
3031 +
3032 +2008-02-23 Maxim Kuvyrkov <maxim@codesourcery.com>
3033 +
3034 + * release-notes-csl.xml (ColdFire multi-GOT support): Fix release
3035 + note to not include uClinux.
3036 +
3037 +2008-02-20 Mark Mitchell <mark@codesourcery.com>
3038 +
3039 + ld/testsuite/
3040 + * ld-elf/seg.d: Expect .reginfo section on MIPS.
3041 +
3042 +2008-02-16 Paul Brook <paul@codesourcery.com>
3043 +
3044 + Merged from //mirrors/binutils/trunk revision 193546.
3045 +
3046 +2008-02-11 Julian Brown <julian@codesourcery.com>
3047 +
3048 + Merge from MIPS:
3049 +
3050 + 2005-03-21 Maciej W. Rozycki <macro@mips.com>
3051 +
3052 + * config/tc-mips.c (append_insn): Disable swapping of MIPS16
3053 + branches as it breaks DWARF-2 line information.
3054 +
3055 +2008-02-11 Julian Brown <julian@codesourcery.com>
3056 +
3057 + Merge from MIPS:
3058 +
3059 + bfd/
3060 + * elfxx-mips.c (mips_elf_merge_obj_attributes): Add support for
3061 + -mips32r2 -mfp64.
3062 + * readelf.c (display_mips_gnu_attribute): Add 64-bit float tag support.
3063 +
3064 + include/
3065 + * elf/mips.h (Tag_GNU_MIPS_ABI_FP): Update comment.
3066 +
3067 + ld/testsuite/
3068 + * ld-mips-elf/mips-elf.exp: Add run-dump-tests for attr-gnu-4-04,
3069 + attr-gnu-4-05, attr-gnu-4-15, attr-gnu-4-24, attr-gnu-4-25,
3070 + attr-gnu-4-34, attr-gnu-4-35, attr-gnu-4-40, attr-gnu-4-42,
3071 + attr-gnu-4-43, attr-gnu-4-44, attr-gnu-4-45, attr-gnu-4-51.
3072 + * ld-mips-elf/attr-gnu-4-14.d: Fix warning.
3073 + * ld-mips-elf/attr-gnu-4-41.d: Likewise.
3074 + * ld-mips-elf/attr-gnu-4-5.s: New.
3075 + * ld-mips-elf/attr-gnu-4-04.d: New.
3076 + * ld-mips-elf/attr-gnu-4-05.d: New.
3077 + * ld-mips-elf/attr-gnu-4-15.d: New.
3078 + * ld-mips-elf/attr-gnu-4-24.d: New.
3079 + * ld-mips-elf/attr-gnu-4-25.d: New.
3080 + * ld-mips-elf/attr-gnu-4-34.d: New.
3081 + * ld-mips-elf/attr-gnu-4-35.d: New.
3082 + * ld-mips-elf/attr-gnu-4-40.d: New.
3083 + * ld-mips-elf/attr-gnu-4-42.d: New.
3084 + * ld-mips-elf/attr-gnu-4-43.d: New.
3085 + * ld-mips-elf/attr-gnu-4-44.d: New.
3086 + * ld-mips-elf/attr-gnu-4-45.d: New.
3087 + * ld-mips-elf/attr-gnu-4-51.d: New.
3088 +
3089 +2008-02-11 Julian Brown <julian@codesourcery.com>
3090 +
3091 + Merge from MIPS:
3092 +
3093 + 2004-09-09 Nigel Stephens <nigel@mips.com>
3094 +
3095 + bfd/
3096 + * ihex.c (ihex_write_object_contents): Truncate address to 32 bits
3097 + if the top 32 bits are a simple sign extension of the bottom.
3098 +
3099 +2008-02-11 Julian Brown <julian@codesourcery.com>
3100 +
3101 + Merge from MIPS:
3102 +
3103 + gas/
3104 + * config/tc-mips.c (OPTION_MIPS16E, OPTION_NOMIPS16E): Add
3105 + backward-compatibility options for SDE.
3106 + (OPTION_COMPAT_ARCH_BASE): Bump to +16.
3107 +
3108 +2008-02-11 Julian Brown <julian@codesourcery.com>
3109 +
3110 + Merge from MIPS:
3111 +
3112 + * sdemdi: New directory. SDE/MDI glue.
3113 + * Makefile.def: Add sdemdi target module.
3114 +
3115 + sdemdi/
3116 + * ChangeLog: New.
3117 + * configure.ac: New.
3118 + * Makefile.am: New.
3119 + * config-ml.in: New.
3120 + * crt0.S: New.
3121 + * fileio.c: New.
3122 + * m32cache.S: New.
3123 + * mdi.h: New.
3124 + * mdilow.S: New.
3125 + * mdisyscall.S: New.
3126 + * mdixcpt.h: New.
3127 + * rtpxlite.c: New.
3128 + * rtpxliteasm.S: New.
3129 + * rtpxstub.c: New.
3130 + * sdemdi32.ld: New.
3131 + * sdemdi32hi.ld: New.
3132 + * sdemdi64.ld: New.
3133 + * sdemdi64hi.ld: New.
3134 + * simlow.S: New.
3135 +
3136 +2008-02-11 Julian Brown <julian@codesourcery.com>
3137 +
3138 + Merge from MIPS:
3139 +
3140 + * convert: New directory. Elf to binary converter.
3141 +
3142 + convert/
3143 + * ChangeLog: New.
3144 + * Makefile.am: New.
3145 + * Makefile.def: New.
3146 + * acinclude.m4: New.
3147 + * configure.ac: New.
3148 + * convert.c: New.
3149 + * sysdep.h: New.
3150 + * srec.c: New.
3151 + * elf.h: New.
3152 + * stagbin.c: New.
3153 + * elfmips.h: New.
3154 + * alloca.c: New.
3155 + * bin.c: New.
3156 + * mipsflash.c: New.
3157 + * idtbin.c: New.
3158 + * elfout.c: New.
3159 + * lsifast.c: New.
3160 + * elfio.c: New.
3161 + * conv.1: New.
3162 + * conv.texi: New.
3163 +
3164 +2008-02-11 Julian Brown <julian@codesourcery.com>
3165 +
3166 + Merge from MIPS (This patch is a hack to make SDElib happy);
3167 + don't push upstream:
3168 +
3169 + 2004-10-06 David Ung <davidu@mips.com>
3170 +
3171 + * mips-opc.c: Change membership to I1 for instructions ssnop and
3172 + ehb.
3173 +
3174 +2008-02-11 Julian Brown <julian@codesourcery.com>
3175 +
3176 + Merge from MIPS:
3177 +
3178 + * config/mt-sde (CFLAGS_FOR_TARGET): Add -mno-gpopt.
3179 + (CXXFLAGS_FOR_TARGET): Likewise.
3180 + * configure.ac (mips*-sde-elf*): Remove libgloss and libiberty when not
3181 + building Newlib. Add sde-conv host tool and MDI glue library.
3182 + * configure: Regenerate.
3183 +
3184 +2008-02-11 Julian Brown <julian@codesourcery.com>
3185 +
3186 + Merge from MIPS/backport from FSF:
3187 +
3188 + 2007-09-14 Alan Modra <amodra@bigpond.net.au>
3189 +
3190 + bfd/
3191 + * opncls.c (find_separate_debug_file): Ensure bfd_set_error has
3192 + been called on all error return paths.
3193 + (bfd_fill_in_gnu_debuglink_section): Use bfd_malloc, not malloc.
3194 + Clear padding after filename
3195 +
3196 + 2007-09-14 Alan Modra <amodra@bigpond.net.au>
3197 +
3198 + bfd/
3199 + * format.c (bfd_check_format_matches): Record matching targets even
3200 + when "matching" is NULL to allow bfd_associated_vector matches.
3201 + Consolidate error return code. Consolidate ok return code. Always
3202 + restore original target and format on error.
3203 +
3204 +2008-02-02 Sandra Loosemore <sandra@codesourcery.com>
3205 +
3206 + * release-notes-csl.xml: Fix mistaken uses of &csl_prod; to use
3207 + &csl_sgxx; instead.
3208 +
3209 +2008-02-01 Maxim Kuvyrkov <maxim@codesourcery.com>
3210 +
3211 + ld/testsuite/
3212 +
3213 + * ld-m68k/got-12.s: Remove .ident.
3214 + * ld-m68k/got-13.s: Ditto.
3215 + * ld-m68k/got-14.s: Ditto.
3216 + * ld-m68k/got-15.s: Ditto.
3217 + * ld-m68k/got-34.s: Ditto.
3218 + * ld-m68k/got-35.s: Ditto.
3219 + * ld-m68k/xgot-15.s: Ditto.
3220 +
3221 +2008-02-01 Maxim Kuvyrkov <maxim@codesourcery.com>
3222 +
3223 + Add -mxgot tests to ld.
3224 +
3225 + ld/testsuite/
3226 +
3227 + * ld-m68k/xgot-15.s: New source.
3228 + * ld-m68k/got-xgot-15-ok.d: New test.
3229 + * ld-m68k/got-xgot-12-13-14-15-34-35-ok.d: New test.
3230 + * ld-m68k/m68k.exp: Run new tests.
3231 +
3232 +2008-01-29 Julian Brown <julian@codesourcery.com>
3233 +
3234 + gas/
3235 + * read.c (cons_worker): Report error if user tries to specify string
3236 + after .byte, etc. directive.
3237 +
3238 +2008-01-28 Paul Brook <paul@codesourcery.com>
3239 +
3240 + ld/
3241 + * emultempl/armelf.em (OPTION_FIX_V4BX_INTERWORKING): Define.
3242 + (PARSE_AND_LIST_LONGOPTS): Add fix-v4bx-interworking.
3243 + (PARSE_AND_LIST_OPTIONS): Ditto.
3244 + (PARSE_AND_LIST_ARGS_CASES): Handle OPTION_FIX_V4BX_INTERWORKING.
3245 + * emulparams/armelf.sh (OTHER_TEXT_SECTIONS): Add .v4_bx.
3246 + * emulparams/armelf_linux.sh (OTHER_TEXT_SECTIONS): Ditto.
3247 + * emulparams/armnto.sh (OTHER_TEXT_SECTIONS): Ditto.
3248 + * ld.texinfo: Document --fix-v4bx-interworking.
3249 +
3250 + ld/testsuite/
3251 + * ld-arm/armv4-bx.d: New test.
3252 + * ld-arm/armv4-bx.s: New test.
3253 + * ld-arm/arm.ld: Add .v4bx.
3254 + * ld-arm/arm-elf.exp: Add armv4-bx.
3255 +
3256 + gas/testsuite/
3257 + * gas/arm/thumb.d: Exclude EABI targets.
3258 + * gas/arm/arch4t.d: Exclude EABI targts.
3259 + * gas/arm/v4bx.d: New test.
3260 + * gas/arm/v4bx.s: New test.
3261 + * gas/arm/thumb-eabi.d: New test.
3262 + * gas/arm/arch4t-eabi.d: New test.
3263 +
3264 + gas/
3265 + * config/tc-arm.c (fix_v4bx): New variable.
3266 + (do_bx): Generate V4BX relocations.
3267 + (md_assemble): Allow bx on v4 codes when fix_v4bx.
3268 + (md_apply_fix): Handle BFD_RELOC_ARM_V4BX.
3269 + (tc_gen_reloc): Ditto.
3270 + (OPTION_FIX_V4BX): Define.
3271 + (md_longopts): Add fix-v4bx.
3272 + (md_parse_option): Handle OPTION_FIX_V4BX.
3273 + (md_show_usage): Document --fix-v4bx.
3274 + * doc/c-arm.texi: Document --fix-v4bx.
3275 +
3276 + bfd/
3277 + * reloc.c: Add BFD_RELOC_ARM_V4BX.
3278 + * elf32-arm.c (elf32_arm_reloc_map): Add BFD_RELOC_ARM_V4BX.
3279 + (ARM_BX_GLUE_SECTION_NAME, ARM_BX_GLUE_SECTION_NAME): Define.
3280 + (elf32_arm_link_hash_table): Add bx_glue_size and bx_glue_offset.
3281 + Update comment for fix_v4bx.
3282 + (elf32_arm_link_hash_table_create): Zero bx_glue_size and
3283 + bx_glue_offset.
3284 + (ARM_BX_VENEER_SIZE, armbx1_tst_insn, armbx2_moveq_insn,
3285 + armbx3_bx_insn): New.
3286 + (bfd_elf32_arm_allocate_interworking_sections): Allocate BX veneer
3287 + section.
3288 + (bfd_elf32_arm_add_glue_sections_to_bfd): Ditto.
3289 + (bfd_elf32_arm_process_before_allocation): Record BX veneers.
3290 + (record_arm_bx_glue, elf32_arm_bx_glue): New functions.
3291 + (elf32_arm_final_link_relocate): Handle BX veneers.
3292 + (elf32_arm_output_arch_local_syms): Output mapping symbol for .v4_bx.
3293 + * bfd-in2.h: Regenerate.
3294 + * libbfd.h: Regenerate.
3295 +
3296 +2008-01-28 Maxim Kuvyrkov <maxim@codesourcery.com>
3297 +
3298 + Handle weakdefs in copy_indirect hook.
3299 +
3300 + bfd/
3301 +
3302 + elf32-m68k.c (elf_m68k_copy_indirect_symbol): Handle weakdefs.
3303 +
3304 +2008-01-26 Maxim Kuvyrkov <maxim@codesourcery.com>
3305 +
3306 + Multi-GOT support for m68k.
3307 +
3308 + * release-notes-csl.xml: Document feature.
3309 +
3310 + bfd/
3311 +
3312 + * elf32-m68k.c (struct elf_m68k_link_hash_entry: got_entry_key,
3313 + glist): New fields.
3314 + (struct elf_m68k_got_entry_key, struct elf_m68k_got_entry,
3315 + struct elf_m68k_got, struct elf_m68k_bfd2got_entry,
3316 + struct elf_m68k_multi_got): New data structures.
3317 + (struct elf_m68k_link_hash_table: local_gp_p, use_neg_got_offsets_p,
3318 + allow_multigot_p, multi_got_): New fields.
3319 + (elf_m68k_multi_got): New macro.
3320 + (elf_m68k_link_hash_newfunc): Initialize new fields of
3321 + struct elf_m68k_link_hash_entry.
3322 + (elf_m68k_link_hash_table_create): Initialize new fields of
3323 + struct elf_m68k_link_hash_table.
3324 + (elf_m68k_link_hash_table_free): New static function implementing hook.
3325 + (elf_m68k_init_got, elf_m68k_clear_got, elf_m68k_create_empty_got): New
3326 + static functions for struct elf_m68k_got.
3327 + (elf_m68k_init_got_entry_key, elf_m68k_got_entry_hash,
3328 + elf_m68k_got_entry_eq): New static functions for
3329 + struct elf_m68k_got_entry.
3330 + (ELF_M68K_REL_8O_MAX_N_ENTRIES_IN_GOT,
3331 + ELF_M68K_REL_8O_16O_MAX_N_ENTRIES_IN_GOT): New macros.
3332 + (enum elf_m68k_get_entry_howto): New enum.
3333 + (elf_m68k_get_got_entry, elf_m68k_update_got_entry_type,
3334 + elf_m68k_remove_got_entry_type): New static functions for
3335 + struct elf_m68k_got_entry.
3336 + (elf_m68k_add_entry_to_got): New static function.
3337 + (elf_m68k_bfd2got_entry_hash, elf_m68k_bfd2got_entry_eq,
3338 + elf_m68k_bfd2got_entry_del, elf_m68k_get_bfd2got_entry): New static
3339 + functions for struct elf_m68k_bfd2got_entry.
3340 + (struct elf_m68k_can_merge_gots_arg, elf_m68k_can_merge_gots_1,
3341 + elf_m68k_can_merge_gots): New traversal.
3342 + (struct elf_m68k_merge_gots_arg, elf_m68k_merge_gots_1,
3343 + elf_m68k_merge_gots): Ditto.
3344 + (struct elf_m68k_finalize_got_offsets_arg,
3345 + elf_m68k_finalize_got_offsets_1, elf_m68k_finalize_got_offsets): Ditto.
3346 + (struct elf_m68k_partition_multi_got_arg,
3347 + elf_m68k_partition_multi_got_1, elf_m68k_init_symndx2h_1,
3348 + elf_m68k_partition_multi_got): Ditto.
3349 + (elf_m68k_find_got_entry_ptr, elf_m68k_remove_got_entry): New static
3350 + functions.
3351 + (elf_m68k_copy_indirect_symbol): New static function implementing
3352 + a hook.
3353 + (elf_m68k_check_relocs): Update to add entries to multi-GOT.
3354 + (elf_m68k_gc_sweep_hook): Update to remove entries from multi-GOT.
3355 + (elf_m68k_always_size_sections): Assign BFDs to GOTs.
3356 + (elf_m68k_relocate_section): Update to properly handle GOT relocations.
3357 + (elf_m68k_finish_dynamic_symbol): Update to traverse all GOT entries
3358 + of a global symbol.
3359 + (bfd_elf_m68k_set_target_options): New function.
3360 + (bfd_elf32_bfd_link_hash_table_free): Define hook.
3361 + (bfd_elf32_bfd_final_link): Change expansion to bfd_elf_final_link
3362 + to skip generic calculation of GOT offsets.
3363 + (elf_backend_copy_indirect_symbol): Define hook.
3364 +
3365 + * bfd-in.h (bfd_elf_m68k_set_target_options): Declare function.
3366 + * bfd-in2.h: Regenerate.
3367 +
3368 + ld/
3369 +
3370 + * configure.in (--enable-got): New option. Handle it.
3371 + * configure: Regenerate.
3372 + * config.in: Regenerate.
3373 +
3374 + * emultempl/m68kelf.em: (got_handling_target_default): New shell
3375 + variable.
3376 + (GOT_HANDLING_TARGET_DEFAULT): New macro.
3377 + (GOT_HANDLING_DEFAULT): New macro. Initialize it from configure
3378 + option if one was given.
3379 + (got_handling): New static variable.
3380 + (elf_m68k_create_output_section_statements): New static function
3381 + implementing hook.
3382 + (PARSE_AND_LIST_PROLOGUE): Define shell variable.
3383 + (OPTION_GOT): New macro.
3384 + (PARSE_AND_LIST_LONGOPTS): Define shell variable. Specify
3385 + --got option.
3386 + (got): New linker option.
3387 + (PARSE_AND_LIST_OPTIONS): Define shell variable. Print help string
3388 + for --got option.
3389 + (PARSE_AND_LIST_ARGS_CASES): Define shell variable. Handle --got
3390 + option.
3391 +
3392 + * ld.texinfo: Document --got=<type> option.
3393 + * gen-doc.texi: Add M68K.
3394 +
3395 + ld/testsuite/
3396 +
3397 + * ld-m68k/got-12.s: New file.
3398 + * ld-m68k/got-13.s: New file.
3399 + * ld-m68k/got-14.s: New file.
3400 + * ld-m68k/got-15.s: New file.
3401 + * ld-m68k/got-34.s: New file.
3402 + * ld-m68k/got-35.s: New file.
3403 + * ld-m68k/got-single-12-ok.d: New dump test.
3404 + * ld-m68k/got-single-13-er.d: New dump test.
3405 + * ld-m68k/got-negative-14-ok.d: New dump test.
3406 + * ld-m68k/got-negative-15-er.d: New dump test.
3407 + * ld-m68k/got-negative-12-13-14-34-ok.d: New dump test.
3408 + * ld-m68k/got-negative-12-13-14-35-er.d: New dump test.
3409 + * ld-m68k/got-multigot-14-ok.d: New dump test.
3410 + * ld-m68k/got-multigot-15-er.d: New dump test.
3411 + * ld-m68k/got-multigot-12-13-14-34-35-ok.d: New dump test.
3412 + * ld-m68k/m68k.exp: Run new tests.
3413 +
3414 +2008-01-25 Joseph Myers <joseph@codesourcery.com>
3415 +
3416 + include/
3417 + * libiberty.h (cygpath): Declare.
3418 +
3419 + libiberty/
3420 + * cygpath.c (cygpath): Remove static. Return int.
3421 + * pex-win32.c (pex_win32_open_read, pex_win32_open_write): Use
3422 + open not _open.
3423 +
3424 +2008-01-22 Paul Brook <paul@codesourcery.com>
3425 +
3426 + gas/
3427 + * config/tc-arm.c (arm_cpu_option_table): Add cortex-a9.
3428 +
3429 + gas/doc/
3430 + * c-arm.texi: Add cortex-a9.
3431 +
3432 +2008-01-22 Paul Brook <paul@codesourcery.com>
3433 +
3434 + bfd/
3435 + * elf32-arm.c (elf32_arm_relocate_section): Handle MOVW and MOVT
3436 + relocations. Improve safety check for other weird relocations.
3437 + * elf32-arm.c (elf32_arm_howto_table): Fix masks for MOVW/MOVT.
3438 +
3439 + ld/testsuite/
3440 + * ld-arm/arm-elf.exp: Add movw-merge.
3441 + * ld-arm/movw-merge.d: New test.
3442 + * ld-arm/movw-merge.s: New test.
3443 +
3444 +2008-01-09 Joseph Myers <joseph@codesourcery.com>
3445 +
3446 + * configure.ac (host_makefile_frag): Use config/mh-mingw on
3447 + *-mingw32*.
3448 + * configure: Regenerate.
3449 +
3450 + config/
3451 + * config/mh-mingw: New.
3452 +
3453 +2008-01-07 Joseph Myers <joseph@codesourcery.com>
3454 +
3455 + NOT ASSIGNED TO FSF
3456 + COPYRIGHT CAVIUM
3457 + Merge from Cavium binutils-2.16.1.diff.gz:
3458 +
3459 + gas/
3460 + * config/tc-mips.c (macro): Support M_SAA_AB and M_SAAD_AB.
3461 +
3462 + gas/testsuite/
3463 + * gas/mips/mips.exp: Add octeon_saa_saad test.
3464 + * gas/mips/octeon_saa_saad.d: New.
3465 + * gas/mips/octeon_saa_saad.s: New.
3466 +
3467 + include/opcode/
3468 + * mips.h (M_SAA_AB, M_SAAD_AB): New.
3469 +
3470 + opcodes/
3471 + * mips-opc.c (mips_builtin_opcodes): Add saa and saad
3472 + instructions.
3473 +
3474 +2008-01-03 Catherine Moore <clm@codesourcery.com>
3475 +
3476 + gas/
3477 + * config/tc-mips.c (mips_ip): Check operands on jalr instruction.
3478 +
3479 + gas/testsuite
3480 + * gas/mips/jalr.s: New test.
3481 + * gas/mips/jalr.l: New test output.
3482 + * gas/mips/mips.exp: Run new test.
3483 +
3484 +2007-12-19 Nathan Sidwell <nathan@codesourcery.com>
3485 +
3486 + Issue #2297
3487 + ld/testsuite/
3488 + * ld-elf/seg.t: New.
3489 + * ld-elf/seg.d: New.
3490 + * ld-elf/seg.s: New.
3491 +
3492 +2007-12-12 Paul Brook <paul@codesourcery.com>
3493 +
3494 + Backport from FSF.
3495 + 2007-09-15 Alan Modra <amodra@bigpond.net.au>
3496 + * configure.ac: Correct makeinfo version check.
3497 + * configure: Regenerate.
3498 +
3499 +2007-12-12 Paul Brook <paul@codesourcery.com>
3500 +
3501 + gas/
3502 + * doc/c-arm.texi: Document new VFP -mfpu= options.
3503 + * config/tc-arm.c (arm_option_cpu_value): Rename vfp3-d16 to
3504 + vfpv3-d16. Add vfpv2 and vfpv3.
3505 +
3506 + gas/testsuite/
3507 + * gas/arm/vfpv3-d16-bad.d: Rename vfp3-d16 to vfpv3-d16.
3508 +
3509 +2007-12-11 Paul Brook <paul@codesourcery.com>
3510 +
3511 + gas/
3512 + * config/tc-arm.c (fpu_vfp_ext_d32): New vairable.
3513 + (parse_vfp_reg_list, encode_arm_vfp_reg): Use it.
3514 + (arm_option_cpu_value): Add vfpv3-d16.
3515 + (aeabi_set_public_attributes): Handle Tag_VFP_arch=VFPV3-D16.
3516 +
3517 + gas/testsuite/
3518 + * gas/arm/vfpv3-d16-bad.d: New test.
3519 + * gas/arm/vfpv3-d16-bad.l: New test.
3520 +
3521 + include/opcode/
3522 + * arm.h (FPU_VFP_EXT_D32, FPU_VFP_V3D16, FPU_ARCH_VFP_V3D16): Define.
3523 +
3524 + binutils/
3525 + * readelf.c (arm_attr_tag_VFP_arch): Add "VFPv3-D16".
3526 +
3527 + bfd/
3528 + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Handle new
3529 + Tag_VFP_arch values.
3530 +
3531 +2007-12-10 Catherine Moore <clm@codesourcery.com>
3532 +
3533 + Issue #2285
3534 + bfd/
3535 + * elf.c (bfd_copy_private_symbol_data): Do not copy if
3536 + the shndx is zero.
3537 +
3538 + gas/testsuite/
3539 + * elf/elf.exp: Exceute symtab test.
3540 + * elf/symtab.s: New test.
3541 + * elf/symtab.d: New test output file.
3542 +
3543 + * release-notes-csl.xml: Document fix.
3544 +
3545 +2007-11-29 Mark Shinwell <shinwell@codesourcery.com>
3546 +
3547 + include/opcode/
3548 + * mips.h (INSN_LOONGSON_2E, INSN_LOONGSON_2F,
3549 + INSN_OCTEON): Rearrange masks so Loongson flags match
3550 + upstream.
3551 +
3552 +2007-11-28 Nathan Sidwell <nathan@codesourcery.com>
3553 +
3554 + Issue #2297
3555 + include/elf/
3556 + * internal.h (ELF_IS_SECTION_IN_SEGMENT): Adjust to cope with
3557 + segments at the end of memory.
3558 +
3559 +2007-11-13 Joseph Myers <joseph@codesourcery.com>
3560 +
3561 + Backport:
3562 + bfd/
3563 + 2007-11-05 Alan Modra <amodra@bigpond.net.au>
3564 + * merge.c (sec_merge_hash_lookup): Revert last change.
3565 + (record_section): Likewise.
3566 + (_bfd_merge_sections): Likewise.
3567 + (_bfd_merged_section_offset): Properly handle NULL secinfo.
3568 + (_bfd_add_merge_section): Allocate extra space for a zero
3569 + terminator on SEC_STRINGS sections.
3570 +
3571 + ld/testsuite/
3572 + 2007-11-05 Alan Modra <amodra@bigpond.net.au>
3573 + * ld-elf/merge3.d, ld-elf/merge3.s: Delete.
3574 +
3575 +2007-11-06 Paul Brook <paul@codesourcery.com>
3576 +
3577 + Backport from FSF.
3578 + gas/
3579 + * config/tc-arm.c (do_mull): Allow overlapping Rm for armv6.
3580 +
3581 + gas/testsuite/
3582 + * gas/arm/mul-overlap.s: Add umull and smlal.
3583 + * gas/arm/mul-overlap.l: Update expected results.
3584 +
3585 +2007-10-30 Joseph Myers <joseph@codesourcery.com>
3586 +
3587 + bfd/
3588 + * merge.c (sec_merge_hash_lookup): Add parameter sec_end. Check
3589 + for unterminated strings. All callers changed.
3590 + (_bfd_write_merged_section, _bfd_merged_section_offset): Handle
3591 + NULL secinfo from merge failures.
3592 +
3593 + ld/testsuite/
3594 + * ld-elf/merge3.d, ld-elf/merge3.s: New.
3595 +
3596 +2007-10-24 Joseph Myers <joseph@codesourcery.com>
3597 +
3598 + bfd/
3599 + * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Do not add
3600 + PT_NULL header when not linking.
3601 +
3602 +2007-10-18 Joseph Myers <joseph@codesourcery.com>
3603 +
3604 + NOT ASSIGNED TO FSF
3605 + COPYRIGHT RAZA
3606 + * config.sub (mipsisa64xlr, ipsisa64xlrel): Add new machine names.
3607 +
3608 + bfd/
3609 + * aoutx.h (NAME (aout, machine_type)): Handle bfd_mach_mips_xlr.
3610 + * archures.c (bfd_mach_mips_xlr): New.
3611 + * cpu-mips.c (I_xlr): New enum value.
3612 + (arch_info_struct): Add XLR entry.
3613 + * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_XLR.
3614 + (mips_set_isa_flags): Handle bfd_mach_mips_xlr.
3615 + (mips_mach_extensions): Add XLR entry.
3616 + * bfd-in2.h: Regenerate.
3617 +
3618 + binutils/
3619 + * readelf.c (get_machine_flags): Handle E_MIPS_MACH_XLR.
3620 +
3621 + gas/
3622 + * config/tc-mips.c (macro): Handle XLR instructions.
3623 + (mips_cpu_info_table): Add xlr.
3624 + * doc/c-mips.texi (MIPS architecture options): Add xlr to list of
3625 + -march options.
3626 +
3627 + gas/testsuite/
3628 + * gas/mips/xlr-ext.d, /gas/mips/xlr-ext.s: New.
3629 + * gas/mips/mips.exp (xlr): New arch.
3630 + (xlr-ext): Run test.
3631 +
3632 + include/elf/
3633 + * mips.h (E_MIPS_MACH_XLR): Define.
3634 +
3635 + include/opcode/
3636 + * mips.h (INSN_XLR, CPU_XLR): Define.
3637 + (OPCODE_IS_MEMBER): Handle XLR.
3638 + (M_MSGSND, M_MSGLD, M_MSGLD_T, M_MSGWAIT, M_MSGWAIT_T): Define
3639 + enum values.
3640 +
3641 + opcodes/
3642 + * mips-dis.c (mips_cp0_names_xlr, mips_cp0sel_names_xlr): New.
3643 + (mips_arch_choices): Add XLR entry.
3644 + * mips-opc.c (XLR): Define.
3645 + (mips_builtin_opcodes): Add XLR opcodes.
3646 +
3647 +2007-10-17 Nathan Sidwell <nathan@codesourcery.com>
3648 +
3649 + opcodes/
3650 + * m68k-opc.c (m68k_opcodes): Correct move sr and ccr masks for
3651 + coldfire.
3652 +
3653 + gas/testsuite/
3654 + * gas/m68k/mcf-movsr.s: New.
3655 + * gas/m68k/mcf-movsr.d: New.
3656 + * gas/m68k/all.exp: Add mcf-movsr test.
3657 +
3658 +2007-10-09 Daniel Jacobowitz <dan@codesourcery.com>
3659 +
3660 + bfd/
3661 + * elfxx-mips.c (mips_elf_sort_hash_table_f): Handle forced
3662 + local symbols specially.
3663 + (mips_elf_set_global_got_offset): Skip forced local symbols.
3664 +
3665 + Revert:
3666 + 2007-10-04 Joseph Myers <joseph@codesourcery.com>
3667 + bfd/
3668 + * elfxx-mips.c (struct mips_got_info): Add forced_local_count.
3669 + (struct mips_elf_hash_sort_data): Add forced_local and
3670 + prev_forced_local.
3671 + (mips_elf_sort_hash_table): Subtract g->forced_local_count in
3672 + computing hsd.min_got_dynindx. Initialize hsd.forced_local and
3673 + hsd.prev_forced_local. Set g->forced_local_count after sorting.
3674 + (mips_elf_sort_hash_table_f): Count forced-local symbols. Handle
3675 + them as unreferenced where allowed for in calculation of
3676 + min_got_dynindx.
3677 + (mips_elf_make_got_per_bfd, mips_elf_multi_got,
3678 + mips_elf_create_got_section): Initialize forced_local_count.
3679 + (_bfd_mips_elf_always_size_sections): Subtract forced_local_count
3680 + in calculating global_gotno.
3681 + (_bfd_mips_elf_final_link): Subtract forced_local_count in
3682 + assertion.
3683 + (mips_elf_set_global_got_offset): Check for forced-local symbols
3684 + before assigning global GOT offsets.
3685 +
3686 +2007-10-05 Daniel Jacobowitz <dan@codesourcery.com>
3687 +
3688 + * release-notes-csl.xml: Add lost </para>.
3689 +
3690 +2007-10-05 Carlos O'Donell <carlos@codesourcery.com>
3691 +
3692 + binutils/
3693 + * resrc.c (read_rc_file): Rename e to edit, and c to dir.
3694 + Pass dir to windres_add_include_dir. Add comments.
3695 + (close_input_stream): Check pclose error, and call fatal if
3696 + the preprocessor failed.
3697 + * windres.c (windres_add_include_dir): Assert that p is non-NULL,
3698 + and not an empty string.
3699 +
3700 +2007-10-04 Joseph Myers <joseph@codesourcery.com>
3701 +
3702 + bfd/
3703 + * elfxx-mips.c (struct mips_got_info): Add forced_local_count.
3704 + (struct mips_elf_hash_sort_data): Add forced_local and
3705 + prev_forced_local.
3706 + (mips_elf_sort_hash_table): Subtract g->forced_local_count in
3707 + computing hsd.min_got_dynindx. Initialize hsd.forced_local and
3708 + hsd.prev_forced_local. Set g->forced_local_count after sorting.
3709 + (mips_elf_sort_hash_table_f): Count forced-local symbols. Handle
3710 + them as unreferenced where allowed for in calculation of
3711 + min_got_dynindx.
3712 + (mips_elf_make_got_per_bfd, mips_elf_multi_got,
3713 + mips_elf_create_got_section): Initialize forced_local_count.
3714 + (_bfd_mips_elf_always_size_sections): Subtract forced_local_count
3715 + in calculating global_gotno.
3716 + (_bfd_mips_elf_final_link): Subtract forced_local_count in
3717 + assertion.
3718 + (mips_elf_set_global_got_offset): Check for forced-local symbols
3719 + before assigning global GOT offsets.
3720 +
3721 + ld/testsuite/
3722 + * ld-mips-elf/multi-got-hidden-1.d,
3723 + ld-mips-elf/multi-got-hidden-1.s,
3724 + ld-mips-elf/multi-got-hidden-2.d,
3725 + ld-mips-elf/multi-got-hidden-2.s: New.
3726 + * ld-mips-elf/mips-elf.exp: Run multi-got-hidden tests.
3727 +
3728 +2007-10-01 Carlos O'Donell <carlos@codesourcery.com>
3729 +
3730 + Backport:
3731 + binutils/
3732 + 2007-09-17 Alon Bar-Lev <alon.barlev@gmail.com>
3733 +
3734 + PR binutils/4987
3735 + * resrc.c: (read_rc_file): Move 'filename' default initialization
3736 + to start of function.
3737 +
3738 +2007-09-28 Carlos O'Donell <carlos@codesourcery.com>
3739 +
3740 + Backport:
3741 + gas/
3742 + 2007-09-24 Carlos O'Donell <carlos@codesourcery.com>
3743 + * config/tc-mips.c (s_align): Set max_alignment to 28.
3744 + gas/testsuite/
3745 + 2007-09-24 Carlos O'Donell <carlos@codesourcery.com>
3746 + * gas/mips/align.s, gas/mips/align.d: New test.
3747 + * gas/mips/mips.exp: Run it.
3748 +
3749 +2007-09-25 Paul Brook <paul@codesourcery.com>
3750 +
3751 + gas/
3752 + * config/tc-arm.c: Enforce register constraints on Thumb-1 add.
3753 +
3754 + gas/testsuite/
3755 + * gas/arm/t16-bad.s: Add low reg non flags setting add.
3756 + * gas/arm/t16-bad.l: Update expected output.
3757 + * gas/arm/archv6m.s: Add low reg non flags setting add.
3758 + * gas/arm/archv6m.d: Update expected output.
3759 +
3760 +2007-09-24 Daniel Jacobowitz <dan@codesourcery.com>
3761 +
3762 + Backport:
3763 + bfd/
3764 + 2007-09-24 Daniel Jacobowitz <dan@codesourcery.com>
3765 + * elf.c (assign_file_positions_for_load_sections): Trust
3766 + p_align_valid.
3767 + (copy_elf_program_header): Copy PT_NULL segments.
3768 +
3769 +2007-09-24 Daniel Jacobowitz <dan@codesourcery.com>
3770 +
3771 + gas/testsuite/
3772 + * gas/mips/loongson-2f.d: Specify a 64-bit ABI.
3773 + * gas/mips/loongson-2e.d: Likewise.
3774 +
3775 +2007-09-21 Joseph Myers <joseph@codesourcery.com>
3776 +
3777 + * release-notes-csl.xml: Add release notes for GOT patch.
3778 +
3779 + ld/testsuite/
3780 + * ld-mips-elf/got-page-3.d: Assemble with -mips3.
3781 +
3782 +2007-09-21 Joseph Myers <joseph@codesourcery.com>
3783 +
3784 + Backport from
3785 + <http://sourceware.org/ml/binutils/2007-09/msg00308.html>:
3786 +
3787 + bfd/
3788 + 2007-09-21 Richard Sandiford <rsandifo@nildram.co.uk>
3789 + * elfxx-mips.c (mips_got_page_range): New structure.
3790 + (mips_got_page_entry): Likewise.
3791 + (mips_got_info): Add page_gotno and got_page_entries fields.
3792 + (mips_elf_got_per_bfd_arg): Add max_pages field. Delete
3793 + primary_count and current_count fields.
3794 + (mips_got_page_entry_hash, mips_got_page_entry_eq): New functions.
3795 + (mips_elf_pages_for_range, mips_elf_record_got_page_entry): Likewise.
3796 + (mips_elf_get_got_for_bfd): New function, split out from
3797 + mips_elf_make_got_per_bfd. Initialize the page_gotno and
3798 + got_page_entries fields when creating a new GOT structure.
3799 + (mips_elf_make_got_pages_per_bfd): New function.
3800 + (mips_elf_merge_got_with): New function, split out from
3801 + mips_elf_make_got_per_bfd. Merge page entries as well as
3802 + non-page entries. Use the minimum of max_pages and the sum
3803 + of the page_gotnos to estimate the number of page entries.
3804 + (mips_elf_merge_gots): Use the minimum of max_pages and the
3805 + bfd's page_gotno to estimate the number of page entries.
3806 + Use the above functions.
3807 + (mips_elf_multi_got): Add page entries as well as non-page entries
3808 + to the individual per-bfd GOTs. Initialize got_per_bfd_arg.max_pages.
3809 + Initialize the page_gotno and got_page_entries fields when creating
3810 + a new primary GOT. Use the minimum of pages and page_gotno when
3811 + adding the number of pages entries to local_gotno.
3812 + (mips_elf_create_got_section): Initialize the page_gotno and
3813 + got_page_entries fields of the GOT structure.
3814 + (mips_elf_rel_relocation_p, mips_elf_read_rel_addend)
3815 + (mips_elf_add_lo16_rel_addend, mips_elf_get_section_contents): New
3816 + functions, split out from...
3817 + (_bfd_mips_elf_relocate_section): ...here.
3818 + (_bfd_mips_elf_check_relocs): Record GOT page entries too.
3819 + (_bfd_mips_relax_section): Use mips_elf_get_section_contents.
3820 + (_bfd_mips_elf_always_size_sections): Use the smaller of the
3821 + loadable_size- and page_gotno-derived estimates.
3822 +
3823 + ld/testsuite/
3824 + 2007-09-21 Richard Sandiford <rsandifo@nildram.co.uk>
3825 + Joseph Myers <joseph@codesourcery.com>
3826 + * ld-mips-elf/got-page-1.d, ld-mips-elf/got-page-1.s,
3827 + * ld-mips-elf/got-page-2.d, ld-mips-elf/got-page-2.s,
3828 + * ld-mips-elf/got-page-3.d, ld-mips-elf/got-page-3a.s,
3829 + * ld-mips-elf/got-page-3b.s, ld-mips-elf/got-page-3c.s,
3830 + * ld-mips-elf/got-page-1.ld: New tests.
3831 + * ld-mips-elf/mips-elf.exp: Run them.
3832 + * ld-mips-elf/multi-got-1.d, ld-mips-elf/multi-got-no-shared.d,
3833 + * ld-mips-elf/tls-hidden2-got.d, ld-mips-elf/tls-hidden2.d,
3834 + * ld-mips-elf/tls-hidden3.d, ld-mips-elf/tls-hidden3.got,
3835 + * ld-mips-elf/tls-hidden3.r, ld-mips-elf/tls-hidden4.got,
3836 + * ld-mips-elf/tls-hidden4.r, ld-mips-elf/tls-multi-got-1.d,
3837 + * ld-mips-elf/tls-multi-got-1.got, ld-mips-elf/tls-multi-got-1.r,
3838 + * ld-mips-elf/tlsbin-o32.d, ld-mips-elf/tlsbin-o32.got,
3839 + * ld-mips-elf/tlsdyn-o32-1.d, ld-mips-elf/tlsdyn-o32-1.got,
3840 + * ld-mips-elf/tlsdyn-o32-2.d, ld-mips-elf/tlsdyn-o32-2.got,
3841 + * ld-mips-elf/tlsdyn-o32-3.d, ld-mips-elf/tlsdyn-o32-3.got,
3842 + * ld-mips-elf/tlsdyn-o32.d, ld-mips-elf/tlsdyn-o32.got,
3843 + * ld-mips-elf/tlslib-o32-hidden.got, ld-mips-elf/tlslib-o32-ver.got,
3844 + * ld-mips-elf/tlslib-o32.d, ld-mips-elf/tlslib-o32.got: Update for
3845 + GOT allocation changes.
3846 +
3847 +2007-09-19 Daniel Jacobowitz <dan@codesourcery.com>
3848 +
3849 + ld/testsuite/
3850 + * ld-scripts/rgn-over.s: Use sections .txt and .dat.
3851 + * ld-scripts/rgn-over1.t, ld-scripts/rgn-over2.t,
3852 + ld-scripts/rgn-over3.t, ld-scripts/rgn-over4.t, ld-scripts/rgn-over5.t,
3853 + ld-scripts/rgn-over6.t, ld-scripts/rgn-over7.t: Discard other
3854 + sections. Handle changed names.
3855 + * ld-scripts/rgn-over1.d, ld-scripts/rgn-over2.d,
3856 + ld-scripts/rgn-over3.d, ld-scripts/rgn-over4.d, ld-scripts/rgn-over5.d,
3857 + ld-scripts/rgn-over6.d, ld-scripts/rgn-over7.d: Expect discarded
3858 + sections and changed names.
3859 +
3860 +2007-09-19 Daniel Jacobowitz <dan@codesourcery.com>
3861 +
3862 + bfd/
3863 + * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Make sure .got
3864 + will be output.
3865 +
3866 +2007-09-18 Maxim Kuvyrkov <maxim@codesourcery.com>
3867 +
3868 + * release-notes-csl.xml (ColdFire 51QE support): New.
3869 +
3870 +2007-09-07 Nathan Froyd <froydnj@codesourcery.com>
3871 +
3872 + gas/
3873 + * config/tc-ppc.c (parse_cpu): Handle -mpmr option.
3874 +
3875 +2007-08-31 Joseph Myers <joseph@codesourcery.com>
3876 +
3877 + Revert:
3878 + 2007-06-04 Joseph Myers <joseph@codesourcery.com>
3879 + bfd/
3880 + * elflink.c (bfd_elf_link_record_dynamic_symbol): Do not set
3881 + dynindx for indirect symbols.
3882 +
3883 +2007-08-30 Brooks Moses <brooks@codesourcery.com>
3884 +
3885 + Add files missing from 2007-08-20 merge from FSF trunk:
3886 + * ld/emultempl/cr16elf.em: New.
3887 + * ld/testsuite/ld-elf/dl2a.list: New.
3888 + * ld/testsuite/ld-ia64/merge1.d: New.
3889 + * ld/testsuite/ld-ia64/merge1.s: New.
3890 + * ld/testsuite/ld-ia64/merge2.d: New.
3891 + * ld/testsuite/ld-ia64/merge2.s: New.
3892 + * ld/testsuite/ld-ia64/merge3.d: New.
3893 + * ld/testsuite/ld-ia64/merge3.s: New.
3894 + * ld/testsuite/ld-ia64/merge4.d: New.
3895 + * ld/testsuite/ld-ia64/merge4.s: New.
3896 + * ld/testsuite/ld-ia64/merge5.d: New.
3897 + * ld/testsuite/ld-ia64/merge5.s: New.
3898 + * ld/testsuite/ld-pe/secrel_64.d: New.
3899 + * compile: New.
3900 + * lt~obsolete.m4: New.
3901 +
3902 +2007-08-30 Daniel Jacobowitz <dan@codesourcery.com>
3903 +
3904 + ld/testsuite/
3905 + * ld-elf/weak-dyn-1.rd: Resolve merge conflict.
3906 +
3907 +2007-08-29 Daniel Jacobowitz <dan@codesourcery.com>
3908 +
3909 + Issue #1771
3910 + Backport:
3911 + 2007-08-29 Daniel Jacobowitz <dan@codesourcery.com>
3912 + gas/
3913 + * dwarf2dbg.c (dwarf2_directive_loc): Emit duplicate .loc directives.
3914 +
3915 + gas/testsuite/
3916 + * gas/lns/lns-duplicate.d, gas/lns/lns-duplicate.s: New.
3917 + * gas/lns/lns.exp: Run lns-duplicate.
3918 +
3919 +2007-08-28 Mark Shinwell <shinwell@codesourcery.com>
3920 + Joseph Myers <joseph@codesourcery.com>
3921 +
3922 + ld/testsuite/
3923 + * ld-scripts/rgn-over1.d: Disallow space before "ld" at start of
3924 + line, not ":".
3925 + * ld-scripts/rgn-over2.d: Likewise.
3926 + * ld-scripts/rgn-over3.d: Likewise.
3927 + * ld-scripts/rgn-over4.d: Likewise.
3928 + * ld-scripts/rgn-over5.d: Likewise.
3929 + * ld-scripts/rgn-over6.d: Likewise.
3930 + * ld-scripts/rgn-over7.d: Likewise.
3931 +
3932 + Backport from FSF:
3933 +
3934 + bfd/
3935 + * elf32-arm.c (elf32_arm_compare_mapping): Compare first on vma,
3936 + then on type.
3937 +
3938 + binutils/testsuite/
3939 + * binutils-all/ar.exp (long_filenames): Delete temporary files on
3940 + the host.
3941 + * binutils-all/arm/objdump.exp: Only check "which $OBJDUMP" if
3942 + host is local.
3943 + * binutils-all/objcopy.exp: Use ${srecfile} to get the name of the
3944 + srec file to be passed to binutils_run.
3945 + (objcopy_test_readelf): Use remote_exec.
3946 + * binutils-all/readelf.exp (readelf_find_size): Use remote_exec.
3947 + (readelf_test): Likewise.
3948 + (readelf_wi_test): Likewise.
3949 + * lib/utils-lib.exp (run_dump_test): Only check "which $binary" if
3950 + host is local. Use remote_exec. Use $tempfile not
3951 + tmpdir/bintest.o.
3952 +
3953 + gas/
3954 + * as.c (main): Flush stderr before printing listings to ensure
3955 + consistent output order across platforms.
3956 +
3957 + gas/testsuite/
3958 + * lib/gas-defs.exp (gas_version): Use remote_* functions instead
3959 + of exec.
3960 + (gas_host_run): New.
3961 + (gas_run): Use gas_host_run.
3962 + (gas_start): Likewise.
3963 + (run_dump_test): Likewise.
3964 + (objdump): Use gas_host_run.
3965 + (objdump_start_no_subdir): Likewise.
3966 + * lib/gas-dg.exp (gas-dg-test): Use "remote_file host delete".
3967 + * lib/run: Remove.
3968 + * gas/macros/macros.exp: Download app4b.s to host.
3969 + * gas/i386/i386.exp (gas_64_check): Use gas_host_run.
3970 + (gas_32_check): Likewise.
3971 + * gas/maxq10/maxq10.exp (gas_64_check): Likewise
3972 + (gas_32_check): Likewise.
3973 + * gas/maxq20/maxq20.exp (gas_64_check): Likewise
3974 + (gas_32_check): Likewise.
3975 + * gas/sparc/sparc.exp (gas_64_check): Likewise.
3976 + * gas/cfi/cfi.exp: Likewise.
3977 + * gas/elf/elf.exp (run_list_test): Likewise. Use temporary file
3978 + for readelf output in place of pipe.
3979 + * gas/all/gas.exp: Download incbin.dat to host.
3980 + (do_comment): Allow \r\r\n.
3981 +
3982 + ld/
3983 + * ldlang.c (sort_sections_by_lma): Sort by internal id after lma
3984 + for stable sort.
3985 +
3986 + ld/testsuite/
3987 + * ld-elfcomm/elfcomm.exp: Use run_host_cmd. Only check "which
3988 + $CC" if host is local.
3989 + * ld-checks/checks.exp: Use run_host_cmd.
3990 + * ld-elf/exclude.exp: Likewise.
3991 + * ld-elf/elf.exp: Download merge.ld if host is remote.
3992 + * ld-elf/binutils.exp (binutils_test): Use remote_exec.
3993 + * ld-elf/tls_common.exp: Use run_host_cmd.
3994 + * lib/ld-lib.exp (ld_version): Only check "which $ld" if host is
3995 + local. Use remote_exec.
3996 + (run_host_cmd): New.
3997 + (run_host_cmd_yesno): New.
3998 + (default_ld_relocate): Use run_host_cmd_yesno.
3999 + (default_ld_link): Likewise.
4000 + (default_ld_simple_link): Use run_host_cmd.
4001 + (default_ld_compile): Only check "which $ccprog" if host is local.
4002 + Use remote_file and remote_exec.
4003 + (default_ld_assemble): Only check "which $as" if host is local.
4004 + Use run_host_cmd.
4005 + (default_ld_nm): Use remote_exec, remote_upload and remote_file.
4006 + (run_dump_test): Use remote_exec, remote_upload and remote_file.
4007 + Only check "which $binary" if host is local.
4008 + (run_ld_link_tests): Use remote_exec, remote_upload and
4009 + remote_file.
4010 + * ld-selective/selective.exp: Only check "which $CXX" if host is
4011 + local. Use remote_exec.
4012 + * ld-scripts/phdrs.exp: Only check "which $objdump" if host is
4013 + local. Use run_host_cmd.
4014 + * ld-scripts/phdrs2.exp: Likewise.
4015 + * ld-scripts/weak.exp: Likewise.
4016 + * ld-undefined/weak-undef.exp: Likewise.
4017 + * ld-scripts/crossref.exp: Only check "which $CC" if host is local.
4018 + Use run_host_cmd.
4019 + * ld-scripts/map-address.exp: Upload map_address.map if host is
4020 + remote.
4021 + * ld-srec/srec.exp (run_srec_tests): Use run_host_cmd. Only check
4022 + "which $CC" and "which $CXX" if host is local.
4023 + * ld-undefined/undefined.exp: Only check "which $CC" if host is
4024 + local. Use remote_file and run_host_cmd.
4025 + * config/default.exp: Use remote_exec to create tmpdir.
4026 +
4027 +2007-08-28 Nathan Sidwell <nathan@codesourcery.com>
4028 +
4029 + gas/
4030 + * config/tc-m68k.c (m68k_ip): Add mcfisa_c case.
4031 + (m68k_elf_final_processing): Add EF_M68K_CF_ISA_C_NODIV.
4032 +
4033 + include/elf/
4034 + * m68k.h (EF_M68K_CF_ISA_C_NODIV): New.
4035 +
4036 + bfd/
4037 + * elf32-m68k.c (elf32_m68k_object_p): Add EF_M68K_CF_ISA_C_NODIV.
4038 + (elf32_m68k_print_private_bfd_data): Likewise.
4039 +
4040 +2007-08-25 Mark Shinwell <shinwell@codesourcery.com>
4041 +
4042 + Add files missing from previous commit:
4043 + gas/testsuite/
4044 + * gas/mips/loongson-2e.d: New.
4045 + * gas/mips/loongson-2e.s: New.
4046 + * gas/mips/loongson-2f.d: New.
4047 + * gas/mips/loongson-2f.s: New.
4048 +
4049 +2007-08-25 Mark Shinwell <shinwell@codesourcery.com>
4050 +
4051 + * release-notes-csl.xml
4052 + (Loongson-2E and Loongson-2F processor support): New.
4053 +
4054 +2007-08-25 Mark Shinwell <shinwell@codesourcery.com>
4055 +
4056 + bfd/
4057 + * archures.c (bfd_mach_mips_loongson_2e): New.
4058 + (bfd_mach_mips_loongson_2f): New.
4059 + * bfd-in2.h (bfd_mach_mips_loongson_2e): New.
4060 + (bfd_mach_mips_loongson_2f): New.
4061 + * cpu-mips.c: Add I_loongson_2e and I_loongson_2f to
4062 + anonymous enum.
4063 + (arch_info_struct): Add Loongson-2E and Loongson-2F entries.
4064 + * elfxx-mips.c (_bfd_elf_mips_mach): Handle Loongson-2E
4065 + and Loongson-2F flags.
4066 + (mips_set_isa_flags): Likewise.
4067 + (mips_mach_extensions): Add Loongson-2E and Loongson-2F
4068 + entries.
4069 +
4070 + binutils/
4071 + * readelf.c (get_machine_flags): Handle Loongson-2E and -2F
4072 + flags.
4073 +
4074 + gas/
4075 + * config/tc-mips.c (mips_cpu_info_table): Add loongson2e
4076 + and loongson2f entries.
4077 + * doc/c-mips.texi: Document -march=loongson{2e,2f} options.
4078 +
4079 + gas/testsuite/
4080 + * gas/mips/mips.exp: Add loongson-2e and -2f tests.
4081 + * gas/mips/loongson-2e.d: New.
4082 + * gas/mips/loongson-2e.s: New.
4083 + * gas/mips/loongson-2f.d: New.
4084 + * gas/mips/loongson-2f.s: New.
4085 +
4086 + include/elf/
4087 + * mips.h (E_MIPS_MACH_LS2E): New.
4088 + (E_MIPS_MACH_LS2F): New.
4089 +
4090 + include/opcode/
4091 + * mips.h (INSN_LOONGSON_2E): New.
4092 + (INSN_LOONGSON_2F): New.
4093 + (CPU_LOONGSON_2E): New.
4094 + (CPU_LOONGSON_2F): New.
4095 + (OPCODE_IS_MEMBER): Update for Loongson-2E and -2F flags.
4096 +
4097 + opcodes/
4098 + * mips-dis.c (mips_arch_choices): Add Loongson-2E and -2F
4099 + entries.
4100 + * mips-opc.c (IL2E): New.
4101 + (IL2F): New.
4102 + (mips_builtin_opcodes): Add Loongson-2E and -2F instructions.
4103 + Allow movz and movn for Loongson-2E and -2F. Add movnz entry.
4104 + Move coprocessor encodings to the end of the table. Allow
4105 + certain MIPS V .ps instructions on the Loongson-2E and -2F.
4106 +
4107 +2007-08-24 Maxim Kuvyrkov <maxim@codesourcery.com>
4108 +
4109 + Rename 51QE to 51qe.
4110 +
4111 + binutils/
4112 +
4113 + * gas/config/tc-m68k.c (mcf51QE_ctrl): Rename to mcf51qe_ctrl.
4114 + (m68k_cpus): Update.
4115 +
4116 +2007-08-24 Mark Shinwell <shinwell@codesourcery.com>
4117 +
4118 + include/opcode/
4119 + * mips.h (INSN_ISA*): Redefine certain values as an
4120 + enumeration. Update comments.
4121 + (mips_isa_table): New.
4122 + (ISA_MIPS*): Redefine to match enumeration.
4123 + (OPCODE_IS_MEMBER): Modify to correctly test new INSN_ISA*
4124 + values.
4125 +
4126 + opcodes/
4127 + * mips-opc.c (I3_32, I3_33, I4_32, I4_33, I5_33): New.
4128 + (mips_builtin_opcodes): Use these new I* values.
4129 +
4130 +2007-08-23 Nathan Sidwell <nathan@codesourcery.com>
4131 +
4132 + bfd/
4133 + * archures.c: Add bfd_mach_mcf_isa_c_nodiv,
4134 + bfd_mach_mcf_isa_c_nodiv_mac & bfd_mach_mcf_isa_c_nodiv_emac.
4135 + * bfd/ieee.c (ieee_write_processor): Update coldfire architecture
4136 + list.
4137 + * bfd-in2.h: Rebuilt.
4138 + * cpu-m68k.c (arch_info_struct): Add isa_c nodiv architectures.
4139 + (m68k_arch_features): Likewise.
4140 +
4141 +2007-08-22 Daniel Jacobowitz <dan@codesourcery.com>
4142 +
4143 + * release-notes-csl.xml: Mention GDB support for MIPS -msoft-float
4144 + tags.
4145 +
4146 +2007-08-21 Maxim Kuvyrkov <maxim@codesourcery.com>
4147 +
4148 + Add ColdFire V1 devices.
4149 +
4150 + binutils/gas
4151 +
4152 + * config/tc-m68k.c (mcf51QE_ctrl): Define 51QE control registers.
4153 + (m68k_cpus): Define 51QE cpu.
4154 +
4155 +2007-08-20 Brooks Moses <brooks@codesourcery.com>
4156 +
4157 + Merged from //mirrors/binutils/trunk revision 179541.
4158 +
4159 +2007-08-16 Daniel Jacobowitz <dan@codesourcery.com>
4160 +
4161 + * release-notes-csl.xml: Mention MIPS linker warnings.
4162 +
4163 +2007-08-16 Daniel Jacobowitz <dan@codesourcery.com>
4164 +
4165 + ld/testsuite/
4166 + * ld-powerpc/attr-gnu-8-31.d, ld-powerpc/attr-gnu-8-1.s,
4167 + ld-powerpc/attr-gnu-8-11.d, ld-powerpc/attr-gnu-8-3.s: New.
4168 +
4169 + include/elf/
4170 + * ppc.h (Tag_GNU_Power_ABI_Vector): New.
4171 +
4172 + binutils/
4173 + * readelf.c (display_power_gnu_attribute): Handle
4174 + Tag_GNU_Power_ABI_Vector.
4175 +
4176 + bfd/
4177 + * elf32-ppc.c (ppc_elf_merge_obj_attributes): Handle
4178 + Tag_GNU_Power_ABI_Vector.
4179 +
4180 +2007-08-11 Richard Sandiford <richard@codesourcery.com>
4181 +
4182 + Backport from mainline:
4183 +
4184 + bfd/
4185 + 2007-08-11 Richard Sandiford <richard@codesourcery.com>
4186 +
4187 + * config.bfd (sh-*-vxworks): Define targ_underscore to "yes".
4188 +
4189 +2007-08-09 Paul Brook <paul@codesourcery.com>
4190 +
4191 + Backport from FSF.
4192 + gas/
4193 + * config/tc-arm.c (relaxed_symbol_addr): Compensate for alignment.
4194 +
4195 + gas/testsuite/
4196 + * gas/arm/relax_load_align.d: new test.
4197 + * gas/arm/relax_load_align.s: new test.
4198 +
4199 +2007-08-07 Kazu Hirata <kazu@codesourcery.com>
4200 +
4201 + Backport from mainline:
4202 + ld/testsuite/
4203 + 2007-05-17 Paul Brook <paul@codesourcery.com>
4204 + * ld-elf/multibss1.s: Use %nobits instead of @nobits.
4205 +
4206 +2007-08-03 Daniel Jacobowitz <dan@codesourcery.com>
4207 +
4208 + Backport from mainline:
4209 + ld/testsuite/
4210 + 2007-08-03 Daniel Jacobowitz <dan@codesourcery.com>
4211 + * ld-srec/srec.exp: XFAIL for powerpc*-*-*.
4212 +
4213 +2007-07-23 Richard Sandiford <richard@codesourcery.com>
4214 +
4215 + Backport from mainline:
4216 +
4217 + bfd/
4218 + 2007-07-23 Richard Sandiford <richard@codesourcery.com>
4219 +
4220 + * elflink.c (_bfd_elf_fix_symbol_flags): Only assert the type
4221 + of weakdef->root.type if weakdef has no regular definition.
4222 +
4223 + ld/testsuite/
4224 + 2007-07-23 Richard Sandiford <richard@codesourcery.com>
4225 +
4226 + * ld-elf/weak-dyn-1a.s, ld-elf/weak-dyn-1b.s, ld-elf/weak-dyn-1.ld,
4227 + * ld-elf/weak-dyn-1.rd: New test.
4228 + * ld-elf/elf.exp: Run it.
4229 +
4230 +2007-07-18 Zack Weinberg <zack@codesourcery.com>
4231 +
4232 + Issue 1494
4233 + ld/
4234 + * ldlang.c (lang_check_section_addresses): Also report size of
4235 + overflow for any overflowed memory regions.
4236 + (os_region_check): Diagnose an overflowed region only once per
4237 + region. Do not reset region->current on overflow.
4238 +
4239 + ld/testsuite/
4240 + * ld-scripts/rgn-over.exp: New driver.
4241 + * ld-scripts/rgn-over.s: New file.
4242 + * ld-scripts/rgn-over1.d, ld-scripts/rgn-over1.t
4243 + * ld-scripts/rgn-over2.d, ld-scripts/rgn-over2.t
4244 + * ld-scripts/rgn-over3.d, ld-scripts/rgn-over3.t
4245 + * ld-scripts/rgn-over4.d, ld-scripts/rgn-over4.t
4246 + * ld-scripts/rgn-over5.d, ld-scripts/rgn-over5.t
4247 + * ld-scripts/rgn-over6.d, ld-scripts/rgn-over6.t
4248 + * ld-scripts/rgn-over7.d, ld-scripts/rgn-over7.t:
4249 + New test cases.
4250 +
4251 +2007-07-13 Nathan Sidwell <nathan@codesourcery.com>
4252 +
4253 + ld/testsuite/
4254 + * ld-scripts/assert.t: Tweak to avoid relying on empty's VMA being
4255 + zero.
4256 +
4257 +2007-07-12 Nathan Sidwell <nathan@codesourcery.com>
4258 +
4259 + #1765
4260 + ld/
4261 + * scripttempl/pe.sc: Don't include .gcc_except_table and
4262 + .eh_frame on partial links.
4263 +
4264 +2007-07-09 Nathan Sidwell <nathan@codesourcery.com>
4265 +
4266 + Issue 1702
4267 + bfd/
4268 + * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't eliminate
4269 + copy relocs on vxworks.
4270 +
4271 +2007-07-05 Kazu Hirata <kazu@codesourcery.com>
4272 +
4273 + Issue 1775
4274 + gas/
4275 + * config/m68k-parse.h (m68k_register): Use MBO instead of MBB.
4276 + (last_movec_reg): Change to MBO.
4277 + * config/tc-m68k.c (fido_ctrl): Use MBO instead of MBB.
4278 + (m68k_ip): Use MBO instead of MBO.
4279 + (init_table): Use MBO instead of MBO. Add an entry for mbo.
4280 +
4281 + gas/testsuite/
4282 + * gas/m68k/fido.s: Add tests for %mbo.
4283 + * gas/m68k/fido.d: Update accordingly.
4284 +
4285 + opcodes/
4286 + * m68k-dis.c (print_insn_arg): Use %mbo instead of %mbb.
4287 +
4288 + * release-notes-csl.xml: Add a note for the addition of %mbo.
4289 +
4290 +2007-07-05 Nathan Sidwell <nathan@codesourcery.com>
4291 +
4292 + * opcodes/ppc-opc (PPC7450): New.
4293 + (powerpc_opcodes): Use it in dcba.
4294 +
4295 +2007-07-04 Richard Sandiford <richard@codesourcery.com>
4296 +
4297 + gas/
4298 + * config/tc-mips.c (mips_cpu_info_table): Add 74kf3_2.
4299 + * doc/c-mips.texi: Document it.
4300 +
4301 +2007-07-04 Richard Sandiford <richard@codesourcery.com>
4302 +
4303 + gas/
4304 + * config/tc-mips.c (mips_cpu_info_table): Add new entries for
4305 + {24k,24ke,34k,74k}f{2_1,1_1,x}.
4306 + * doc/c-mips.texi: Document them.
4307 +
4308 +2007-07-03 Joseph Myers <joseph@codesourcery.com>
4309 +
4310 + Backport from FSF:
4311 +
4312 + bfd/
4313 + * elf32-arm.c (elf32_arm_merge_eabi_attributes): Copy type from
4314 + input attributes if value has been copied.
4315 +
4316 + ld/testsuite/
4317 + * ld-arm/attr-merge-2a.s, ld-arm/attr-merge-2b.s,
4318 + ld-arm/attr-merge-2.attr: New.
4319 + * ld-arm/arm-elf.exp (armelftests): Add new test.
4320 +
4321 +2007-07-02 Nathan Froyd <froydnj@codesourcery.com>
4322 +
4323 + Backport from FSF:
4324 +
4325 + bfd/
4326 + * elf32-ppc.c (ppc_elf_info_to_howto): Check for invalid relocation
4327 + types.
4328 +
4329 +2007-07-02 Paul Brook <paul@codesourcery.com>
4330 +
4331 + Backport from FSF.
4332 + bfd/
4333 + * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Suppress
4334 + call veneers for call relocations against undefined symbols.
4335 + (elf32_arm_final_link_relocate): Turn call to undefined symbol
4336 + into a jump to the next instruction.
4337 +
4338 + ld/testuite/
4339 + * ld-arm/arm-elf.exp (armelftests): Add callweak.
4340 + * ld-arm/callweak.d: New test.
4341 + * ld-arm/callweak.s: New test.
4342 +
4343 +2007-07-02 Joseph Myers <joseph@codesourcery.com>
4344 +
4345 + Backport from FSF:
4346 +
4347 + bfd/
4348 + * elfxx-mips.c (mips_elf_calculate_relocation): Handle
4349 + R_MIPS_TLS_DTPREL32 and R_MIPS_TLS_DTPREL64.
4350 + * elf64-mips.c (mips_elf64_howto_table_rela): Support
4351 + R_MIPS_TLS_DTPREL64.
4352 +
4353 + gas/
4354 + * config/tc-mips.c (s_dtprelword, s_dtpreldword,
4355 + s_dtprel_internal): New.
4356 + (mips_pseudo_table): Add .dtprelword and .dtpreldword.
4357 + (md_apply_fix): Handle BFD_RELOC_MIPS_TLS_DTPREL32 and
4358 + BFD_RELOC_MIPS_TLS_DTPREL64.
4359 +
4360 +2007-06-29 Joseph Myers <joseph@codesourcery.com>
4361 +
4362 + Backport from FSF:
4363 +
4364 + bfd/
4365 + * elf32-ppc.c (ppc_elf_merge_obj_attributes): New.
4366 + (ppc_elf_merge_private_bfd_data): Call it.
4367 +
4368 + binutils/
4369 + * readelf.c (display_power_gnu_attribute, process_power_specific):
4370 + New.
4371 + (process_arch_specific): Call process_power_specific.
4372 +
4373 + include/elf/
4374 + * ppc.h (Tag_GNU_Power_ABI_FP): Define.
4375 +
4376 + ld/testsuite/
4377 + * ld-powerpc/attr-gnu-4-0.s, ld-powerpc/attr-gnu-4-00.d,
4378 + ld-powerpc/attr-gnu-4-01.d, ld-powerpc/attr-gnu-4-02.d,
4379 + ld-powerpc/attr-gnu-4-1.s, ld-powerpc/attr-gnu-4-10.d,
4380 + ld-powerpc/attr-gnu-4-11.d, ld-powerpc/attr-gnu-4-12.d,
4381 + ld-powerpc/attr-gnu-4-13.d, ld-powerpc/attr-gnu-4-2.s,
4382 + ld-powerpc/attr-gnu-4-20.d, ld-powerpc/attr-gnu-4-21.d,
4383 + ld-powerpc/attr-gnu-4-22.d, ld-powerpc/attr-gnu-4-3.s,
4384 + ld-powerpc/attr-gnu-4-31.d: New.
4385 + * ld-powerpc/powerpc.exp: Run these new tests.
4386 +
4387 +2007-06-29 Joseph Myers <joseph@codesourcery.com>
4388 +
4389 + Backport from FSF:
4390 +
4391 + gas/
4392 + * as.c (main): Only call create_obj_attrs_section if IS_ELF.
4393 +
4394 +2007-06-29 Joseph Myers <joseph@codesourcery.com>
4395 +
4396 + Backport from FSF:
4397 +
4398 + bfd/
4399 + * elfxx-mips.c (mips_elf_merge_obj_attributes): New.
4400 + (_bfd_mips_elf_merge_private_bfd_data): Call it.
4401 +
4402 + binutils/
4403 + * readelf.c (display_mips_gnu_attribute): New.
4404 + (process_mips_specific): Call process_attributes.
4405 +
4406 + include/elf/
4407 + * mips.h (Tag_GNU_MIPS_ABI_FP): Define.
4408 +
4409 + ld/testsuite/
4410 + * ld-mips-elf/attr-gnu-4-0.s, ld-mips-elf/attr-gnu-4-00.d,
4411 + ld-mips-elf/attr-gnu-4-01.d, ld-mips-elf/attr-gnu-4-02.d,
4412 + ld-mips-elf/attr-gnu-4-03.d, ld-mips-elf/attr-gnu-4-1.s,
4413 + ld-mips-elf/attr-gnu-4-10.d, ld-mips-elf/attr-gnu-4-11.d,
4414 + ld-mips-elf/attr-gnu-4-12.d, ld-mips-elf/attr-gnu-4-13.d,
4415 + ld-mips-elf/attr-gnu-4-14.d, ld-mips-elf/attr-gnu-4-2.s,
4416 + ld-mips-elf/attr-gnu-4-20.d, ld-mips-elf/attr-gnu-4-21.d,
4417 + ld-mips-elf/attr-gnu-4-22.d, ld-mips-elf/attr-gnu-4-23.d,
4418 + ld-mips-elf/attr-gnu-4-3.s, ld-mips-elf/attr-gnu-4-30.d,
4419 + ld-mips-elf/attr-gnu-4-31.d, ld-mips-elf/attr-gnu-4-32.d,
4420 + ld-mips-elf/attr-gnu-4-33.d, ld-mips-elf/attr-gnu-4-4.s,
4421 + ld-mips-elf/attr-gnu-4-41.d: New.
4422 + * ld-mips-elf/mips-elf.exp: Run these new tests.
4423 +
4424 +2007-06-29 Joseph Myers <joseph@codesourcery.com>
4425 +
4426 + Backport from FSF:
4427 +
4428 + bfd/
4429 + * elf-attrs.c: New.
4430 + * Makefile.am (BFD32_BACKENDS): Add elf-attrs.lo.
4431 + (BFD32_BACKENDS_CFILES): Add elf-attrs.c.
4432 + (elf-attrs.lo): Generate dependencies.
4433 + * Makefile.in: Regenerate.
4434 + * configure.in (elf): Add elf-attrs.lo.
4435 + * configure: Regenerate.
4436 + * elf-bfd.h (struct elf_backend_data): Add entries for object
4437 + attributes.
4438 + (NUM_KNOWN_OBJ_ATTRIBUTES, obj_attribute, obj_attribute_list,
4439 + OBJ_ATTR_PROC, OBJ_ATTR_GNU, OBJ_ATTR_FIRST, OBJ_ATTR_LAST,
4440 + Tag_NULL, Tag_File, Tag_Section, Tag_Symbol, Tag_compatibility):
4441 + New.
4442 + (struct elf_obj_tdata): Add entries for object attributes.
4443 + (elf_known_obj_attributes, elf_other_obj_attributes,
4444 + elf_known_obj_attributes_proc, elf_other_obj_attributes_proc):
4445 + New.
4446 + (bfd_elf_obj_attr_size, bfd_elf_set_obj_attr_contents,
4447 + bfd_elf_get_obj_attr_int, bfd_elf_add_obj_attr_int,
4448 + bfd_elf_add_proc_attr_int, bfd_elf_add_obj_attr_string,
4449 + bfd_elf_add_proc_attr_string, bfd_elf_add_obj_attr_compat,
4450 + bfd_elf_add_proc_attr_compat, _bfd_elf_attr_strdup,
4451 + _bfd_elf_copy_obj_attributes, _bfd_elf_obj_attrs_arg_type,
4452 + _bfd_elf_parse_attributes, _bfd_elf_merge_object_attributes): New.
4453 + * elf.c (_bfd_elf_copy_private_bfd_data): Copy object attributes.
4454 + (bfd_section_from_shdr): Handle attributes sections.
4455 + * elflink.c (bfd_elf_final_link): Handle attributes sections.
4456 + * elfxx-target.h (elf_backend_obj_attrs_vendor,
4457 + elf_backend_obj_attrs_section, elf_backend_obj_attrs_arg_type,
4458 + elf_backend_obj_attrs_section_type): New.
4459 + (elfNN_bed): Update.
4460 + * elf32-arm.c (NUM_KNOWN_ATTRIBUTES, aeabi_attribute,
4461 + aeabi_attribute_list): Remove.
4462 + (struct elf32_arm_obj_tdata): Remove object attributes fields.
4463 + (check_use_blx, bfd_elf32_arm_set_vfp11_fix, using_thumb2,
4464 + elf32_arm_copy_private_bfd_data, elf32_arm_merge_eabi_attributes):
4465 + Update for new object attributes interfaces.
4466 + (uleb128_size, is_default_attr, eabi_attr_size,
4467 + elf32_arm_eabi_attr_size, write_uleb128, write_eabi_attribute,
4468 + elf32_arm_set_eabi_attr_contents, elf32_arm_bfd_final_link,
4469 + elf32_arm_new_eabi_attr, elf32_arm_get_eabi_attr_int,
4470 + elf32_arm_add_eabi_attr_int, attr_strdup,
4471 + elf32_arm_add_eabi_attr_string, elf32_arm_add_eabi_attr_compat,
4472 + copy_eabi_attributes, elf32_arm_parse_attributes): Remove. Moved
4473 + to generic code in elf-attrs.c.
4474 + (elf32_arm_obj_attrs_arg_type): New.
4475 + (elf32_arm_fake_sections): Do not handle .ARM.attributes.
4476 + (elf32_arm_section_from_shdr): Do not handle SHT_ARM_ATTRIBUTES.
4477 + (bfd_elf32_bfd_final_link): Remove.
4478 + (elf_backend_obj_attrs_vendor, elf_backend_obj_attrs_section,
4479 + elf_backend_obj_attrs_arg_type,
4480 + elf_backend_obj_attrs_section_type): New.
4481 + * elf32-bfin.c (bfin_elf_copy_private_bfd_data): Copy object
4482 + attributes.
4483 + * elf32-frv.c (frv_elf_copy_private_bfd_data): Likewise.
4484 + * elf32-iq2000.c (iq2000_elf_copy_private_bfd_data): Likewise.
4485 + * elf32-mep.c (mep_elf_copy_private_bfd_data): Likewise.
4486 + * elf32-mt.c (mt_elf_copy_private_bfd_data): Likewise.
4487 + * elf32-sh.c (sh_elf_copy_private_data): Likewise.
4488 + * elf64-sh64.c (sh_elf64_copy_private_data_internal): Likewise.
4489 +
4490 + binutils/
4491 + * readelf.c (display_gnu_attribute): New.
4492 + (process_arm_specific): Rearrange as process_attributes.
4493 + (process_arm_specific): Replace by wrapper of process_attributes.
4494 +
4495 + gas/
4496 + * as.c (create_obj_attrs_section): New.
4497 + (main): Call create_obj_attrs_section for ELF.
4498 + * read.c (s_gnu_attribute, skip_whitespace, skip_past_char,
4499 + skip_past_comma, s_vendor_attribute): New.
4500 + (potable): Add gnu_attribute for ELF.
4501 + * read.h (s_vendor_attribute): Declare.
4502 + * config/tc-arm.c (s_arm_eabi_attribute): Replace by wrapper
4503 + round s_vendor_attribute.
4504 + (aeabi_set_public_attributes): Update for new attributes
4505 + interfaces.
4506 + (arm_md_end): Remove attributes contents setting now done
4507 + generically.
4508 +
4509 + include/elf/
4510 + * arm.h (elf32_arm_add_eabi_attr_int,
4511 + elf32_arm_add_eabi_attr_string, elf32_arm_add_eabi_attr_compat,
4512 + elf32_arm_get_eabi_attr_int, elf32_arm_set_eabi_attr_contents,
4513 + elf32_arm_eabi_attr_size, Tag_NULL, Tag_File, Tag_Section,
4514 + Tag_Symbol, Tag_compatibility): Remove.
4515 + * common.h (SHT_GNU_ATTRIBUTES): Define.
4516 +
4517 + ld/
4518 + * emulparams/armelf.sh (OTHER_SECTIONS): Remove .ARM.attributes.
4519 + (ATTRS_SECTIONS): Define.
4520 + * scripttempl/elf.sc, scripttempl/elf32sh-symbian.sc,
4521 + scripttempl/elf_chaos.sc, scripttempl/elfi370.sc,
4522 + scripttempl/elfxtensa.sc: Handle ATTRS_SECTIONS.
4523 +
4524 +2007-06-26 Paul Brook <paul@codesourcery.com>
4525 +
4526 + gas/
4527 + * config/tc-arm.c (parse_operands): Accept generic coprocessor regs
4528 + for OP_RVC.
4529 + (reg_names): Add fpinst, pfinst2, mvfr0 and mvfr1.
4530 +
4531 + gas/testsuite/
4532 + * gas/arm/vfp1xD.d: Add new fmrx/fmxr tests.
4533 + * gas/arm/vfp1xD.s: Ditto.
4534 + * gas/arm/vfp1xD_t2.d: Ditto.
4535 + * gas/arm/vfp1xD_t2.s: Ditto.
4536 +
4537 + opcodes/
4538 + * arm-dis.c (coprocessor_opcodes): Add fmxr/fmrx mvfr0/mvfr1.
4539 +
4540 +2007-06-26 Joseph Myers <joseph@codesourcery.com>
4541 +
4542 + * release-notes-csl.xml: Add release notes for attribute merging
4543 + fix.
4544 +
4545 +2007-06-26 Joseph Myers <joseph@codesourcery.com>
4546 +
4547 + bfd/
4548 + * elf32-arm.c (copy_eabi_attributes): Copy type of attributes.
4549 +
4550 + ld/testsuite/
4551 + * ld-arm/attr-merge.s, ld-arm/attr-merge.attr: New.
4552 + * ld-arm/arm-elf.exp (armelftests): Add new test.
4553 +
4554 +2007-06-25 Paul Brook <paul@codesourcery.com>
4555 +
4556 + gas/
4557 + * config/tc-arm.c (do_t_mov_cmp): Handle shift by register and
4558 + narrow shift by immediate.
4559 +
4560 + gas/testsuite/
4561 + * gas/arm/thumb32.s: Add tests for shift instructions.
4562 + * gas/arm/thumb32.d: Ditto.
4563 +
4564 +2007-06-25 Richard Sandiford <richard@codesourcery.com>
4565 +
4566 + Backport from mainline:
4567 +
4568 + bfd/
4569 + 2007-06-25 Richard Sandiford <richard@codesourcery.com>
4570 +
4571 + * elfxx-mips.c (mips_elf_calculate_relocation): Allow local stubs
4572 + to be used for calls from MIPS16 code.
4573 +
4574 + gas/
4575 + 2007-06-25 Richard Sandiford <richard@codesourcery.com>
4576 +
4577 + * config/tc-mips.h (TC_SYMFIELD_TYPE): New.
4578 + * config/tc-mips.c (append_insn): Record which symbols have
4579 + R_MIPS16_26 relocations against them.
4580 + (mips_fix_adjustable): Don't reduce relocations against such symbols.
4581 +
4582 + ld/testsuite/
4583 + 2007-06-25 Richard Sandiford <richard@codesourcery.com>
4584 +
4585 + * ld-mips-elf/mips16-local-stubs-1.s,
4586 + * ld-mips-elf/mips16-local-stubs-1.d: New tests.
4587 + * ld-mips-elf/mips-elf.exp: Run them.
4588 +
4589 +2007-06-18 Nathan Sidwell <nathan@codesourcery.com>
4590 +
4591 + Bug 1722
4592 + gas/testsuite/
4593 + * gas/m68k/mcf-coproc.d: New.
4594 + * gas/m68k/mcf-coproc.s: New.
4595 + * gas/m68k/all.exp: Add it.
4596 +
4597 + gas/
4598 + * config/tc-m68k.c (m68k_ip): Add j & K operand types.
4599 + (install_operand): Add E encoding.
4600 + (md_begin): Check and skip initial '.' arg character.
4601 + (get_num): Add 0..511 case.
4602 +
4603 + include/
4604 + * opcode/m68k.h: Document j K & E.
4605 +
4606 + opcodes/
4607 + * m68k-dis.c (fetch_arg): Add E. Replace length switch with
4608 + direct masking.
4609 + (print_ins_arg): Add j & K operand types.
4610 + (match_insn_m68k): Check and skip initial '.' arg character.
4611 + (m68k_scan_mask): Likewise.
4612 + * m68k-opc.c (m68k_opcodes): Add coprocessor instructions.
4613 +
4614 +2007-06-14 Nathan Sidwell <nathan@codesourcery.com>
4615 +
4616 + gas/
4617 + * config/tc-m68k.c (mcf52235_ctrl): Add cache registers.
4618 + (mcf5253_ctrl): Add RAMBAR, MBAR, MBAR2.
4619 + (mcf5407_ctrl): New.
4620 + (m68k_cpus): Adjust 5407 entry.
4621 +
4622 +2007-06-13 Joseph Myers <joseph@codesourcery.com>
4623 +
4624 + ld/
4625 + * config.in: Regenerate.
4626 + * ld.h (args_type): Add poison_system_directories.
4627 + * ld.texinfo (--no-poison-system-directories): Document.
4628 + * ldfile.c (ldfile_add_library_path): Check
4629 + command_line.poison_system_directories.
4630 + * ldmain.c (main): Initialize
4631 + command_line.poison_system_directories.
4632 + * lexsup.c (enum option_values): Add
4633 + OPTION_NO_POISON_SYSTEM_DIRECTORIES.
4634 + (ld_options): Add --no-poison-system-directories.
4635 + (parse_args): Handle new option.
4636 +
4637 +2007-06-13 Nathan Sidwell <nathan@codesourcery.com>
4638 +
4639 + ld/
4640 + * ldexp.c (foldname): ALIGNOF should not be divided by opb.
4641 +
4642 +2007-06-11 Julian Brown <julian@codesourcery.com>
4643 +
4644 + bfd/
4645 + * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Skip BFDs with
4646 + EXEC_P or DYNAMIC flags, and skip sections which are being linked
4647 + with --just-symbols (-R).
4648 +
4649 +2007-06-11 Nathan Sidwell <nathan@codesourcery.com>
4650 +
4651 + binutils/
4652 + * dwarf.c (decode_location_expression): Add DW_OP_form_tls_address.
4653 +
4654 + ld/
4655 + * ldlex.l, ldgram.y: Add ALIGNOF.
4656 + * ldexp.c (exp_print_token, foldname): Likewise.
4657 + * ld.texinfo: Likewise.
4658 +
4659 + ld/testsuite/
4660 + * ld-scripts/alignof.s: New.
4661 + * ld-scripts/alignof.t: New
4662 + * ld-scripts/alignof.exp: New.
4663 +
4664 +2007-06-06 Paul Brook <paul@codesourcery.com>
4665 +
4666 + Backport from FSF.
4667 + gas/
4668 + * config/tc-arm.c (s_align): Pad code sections appropriately.
4669 +
4670 + gas/testsuite/
4671 + * gas/arm/thumb.d: Update expected output.
4672 + * gas/arm/thumb2_relax.d: Ditto.
4673 +
4674 +2007-06-06 Joseph Myers <joseph@codesourcery.com>
4675 + Paul Brook <paul@codesourcery.com>
4676 +
4677 + gas/
4678 + * remap.c: New.
4679 + * as.h (remap_debug_filename, add_debug_prefix_map): Declare.
4680 + * as.c (show_usage): Document --debug-prefix-map option.
4681 + (parse_args): Handle --debug-prefix-map.
4682 + * dwarf2dbg.c (out_file_list, out_debug_info): Remap debug paths.
4683 + * stabs.c (stabs_generate_asm_file): Remap debug paths.
4684 + * Makefile.am (GAS_CFILES): Add remap.c
4685 + (GENERIC_OBJS): Add remap.o.
4686 + * Makefile.in: Regenerate.
4687 + * doc/as.texinfo (--debug-prefix-map): Document.
4688 +
4689 +2007-06-05 Paul Brook <paul@codesourcery.com>
4690 +
4691 + Backport from FSF.
4692 + gas/
4693 + * config/tc-arm.c (insns): Correct Thumb-2 ldrd/strd opcodes.
4694 +
4695 + gas/testsuite/
4696 + * gas/arm/thumb32.d: Add writeback addressing mode tests.
4697 + * gas/arm/thumb32.s: Update expected output.
4698 +
4699 + opcodes/
4700 + * arm-dis.c (thumb32_opcodes): Display writeback ldrd/strd addresses.
4701 +
4702 +2007-06-04 Joseph Myers <joseph@codesourcery.com>
4703 +
4704 + bfd/
4705 + * elflink.c (bfd_elf_link_record_dynamic_symbol): Do not set
4706 + dynindx for indirect symbols.
4707 +
4708 +2007-05-31 Paul Brook <paul@codesourcery.com>
4709 +
4710 + Backport from FSF.
4711 + gas/
4712 + * config/tc-arm.c (insns): Allow strex on M profile cores.
4713 +
4714 +2007-05-27 Nathan Sidwell <nathan@codesourcery.com>
4715 +
4716 + Bug 1652
4717 + gas/
4718 + * app.c (do_scrub_chars): Cope with \ at end of buffer.
4719 +
4720 + * release-notes-csl.xml: Document fix.
4721 +
4722 +2007-03-25 Paul Brook <paul@codesourcery.com>
4723 +
4724 + Backport from FSF.
4725 + gas/
4726 + * config/tc-arm.c (T2_SUBS_PC_LR): Define.
4727 + (do_t_add_sub): Correctly encode subs pc, lr, #const.
4728 + (do_t_mov_cmp): Correctly encode movs pc, lr.
4729 +
4730 + gas/testsulte/
4731 + * gas/arm/thumb32.s: Add tests for subs pc, lr.
4732 + * gas/arm/thumb32.d: Change error-output: to stderr:.
4733 + Update expected output.
4734 +
4735 +2007-05-24 Nathan Sidwell <nathan@codesourcery.com>
4736 +
4737 + ld/
4738 + * ldlex.l: ASSERT is recognized in SCRIPT env. NAMES cannot
4739 + contain commas in EXP env.
4740 + * ldgram.y (extern_name_list): Push to EXP env, move body to ...
4741 + (extern_name_list_body): ... here.
4742 + (script_file, ifile_list): Reformat.
4743 + (statement): Add ASSERT.
4744 +
4745 + ld/testsuite/
4746 + * ld/ld-scripts/assert.t: Add additional cases.
4747 + * ld-scripts/extern.t, ld-scripts/extern.s,
4748 + ld-scripts/extern.exp: New.
4749 +
4750 +2007-05-22 Paul Brook <paul@codesourcery.com>
4751 +
4752 + Backport from FSF.
4753 + ld/testsuite/
4754 + * ld-arm/arm-pic-veneer.d: Update expected output.
4755 + * ld-arm/arm-call.d: Ditto.
4756 +
4757 + bfd/
4758 + * elf32-arm.c (output_arch_syminfo): Replace plt_shndx and plt_offset
4759 + with sec and sec_shndx.
4760 + (elf32_arm_ouput_plt_map_sym): Use them.
4761 + (elf32_arm_output_arch_local_syms): Output mapping symbols for
4762 + interworking glue.
4763 +
4764 +2007-05-22 Paul Brook <paul@codesourcery.com>
4765 +
4766 + Backport from FSF.
4767 + bunutils/
4768 + * objdump.c (find_symbol_for_address): Merge section and target
4769 + specific filtering code.
4770 +
4771 + ld/testsuite/
4772 + * ld-arm-mixed-lib.d: Update expected output.
4773 + * ld-arm/arm-app.d: Ditto.
4774 + * ld-arm/mixed-app.d: Ditto.
4775 + * ld-arm/arm-lib-plt32.d: Ditto.
4776 + * ld-arm/arm-app-abs32.d: Ditto.
4777 + * ld-arm/mixed-app-v5.d: Ditto.
4778 + * ld-arm/armthumb-lib.d: Ditto.
4779 + * ld-arm/arm-lib.d: Ditto.
4780 +
4781 + gas/testsuite/
4782 + * gas/arm/backslash-at.d: Update expected output.
4783 +
4784 +2007-05-21 Richard Sandiford <richard@codesourcery.com>
4785 +
4786 + Backport from mainline:
4787 +
4788 + binutils/
4789 + 2007-05-21 Richard Sandiford <richard@codesourcery.com>
4790 +
4791 + * objdump.c (disassemble_bytes): Ignore disassembler_needs_relocs
4792 + for executables and shared libraries.
4793 +
4794 + ld/testsuite/
4795 + 2007-05-21 Richard Sandiford <richard@codesourcery.com>
4796 +
4797 + * ld-arm/emit-relocs1.d, ld-arm/emit-relocs1.s,
4798 + * ld-arm/emit-relocs1-vxworks.d: New tests.
4799 + * ld-arm/arm-elf.exp: Run them.
4800 + * ld-arm/vxworks1.dd: Expect proper branch targets.
4801 +
4802 +2007-05-18 Nathan Sidwell <nathan@codesourcery.com>
4803 +
4804 + gas/
4805 + * config/tc-m68k.c (LONG_BRANCH_VIA_COND): New.
4806 + (BRANCHBWPL, FRAG_VAR_SIZE): New.
4807 + (md_relax_table): Add BRANCHBWPL entries.
4808 + (m68k_ip): Choose BRANCHBWPL relaxation if necessary.
4809 + (md_assemble): Use FRAG_VAR_SIZE.
4810 + (md_convert_frag_1): Add BRANCHBWPL cases.
4811 + (md_estimate_size_before_relaz): Likewise.
4812 +
4813 + gas/testsuite/
4814 + * gas/m68k/br-isaa.d: Dump relocs too.
4815 + * gas/m68k/br-isab.d: Likewise.
4816 + * gas/m68k/br-isac.d: Likewise. Adjust for long branch relaxation.
4817 +
4818 +2007-05-18 Joseph Myers <joseph@codesourcery.com>
4819 +
4820 + * release-notes-csl.xml: Add release notes for .set change.
4821 +
4822 +2007-05-18 Joseph Myers <joseph@codesourcery.com>
4823 +
4824 + ld/testsuite/
4825 + * ld-elf/group.ld: Discard .reginfo.
4826 +
4827 +2007-05-18 Joseph Myers <joseph@codesourcery.com>
4828 +
4829 + gas/
4830 + * config/tc-mips.c (s_mipsset): Use generic s_set for directives
4831 + containing a comma.
4832 +
4833 +2007-05-18 Richard Sandiford <richard@codesourcery.com>
4834 +
4835 + Backport from mainline:
4836 +
4837 + ld/
4838 + 2007-05-18 Richard Sandiford <richard@codesourcery.com>
4839 +
4840 + * emulparams/elf32ebmipvxworks.sh (OTHER_READONLY_SECTIONS)
4841 + (OTHER_READWRITE_SECTIONS): Define. Add .rdata sections.
4842 +
4843 +2007-05-18 Paul Brook <paul@codesourcery.com>
4844 +
4845 + Backport from FSF:
4846 + bfd/
4847 + * elf32-arm.c (ARM2THUMB_V5_STATIC_GLUE_SIZE): Define.
4848 + (a2t1v5_ldr_insn, a2t1v5_ldr_insn): New.
4849 + (record_arm_to_thumb_glue): Add v5t non-pic glue.
4850 + (elf32_arm_create_thumb_stub): Ditto.
4851 +
4852 + ld/testsuite/
4853 + * ld-arm/arm-call.d: Update expected output.
4854 +
4855 +2007-05-16 Paul Brook <paul@codesourcery.com>
4856 +
4857 + bfd/
4858 + * elf32-arm.c (elf32_arm_link_hash_entry): Add
4859 + plt_maybe_thumb_refcount.
4860 + (elf32_arm_link_hash_newfunc): Set plt_maybe_thumb_refcount.
4861 + (elf32_arm_copy_indirect_symbol): Ditto.
4862 + (elf32_arm_adjust_dynamic_symbol): Ditto.
4863 + (bfd_elf32_arm_process_before_allocation): Handle R_ARM_THM_JUMP24.
4864 + (arm_add_to_rel): Ditto.
4865 + (elf32_arm_final_link_relocate): Merge R_ARM_THM_JUMP24 with
4866 + R_ARM_THM_CALL. Handle R_ARM_THM_JUMP19 against a PLT stub.
4867 + (elf32_arm_gc_sweep_hook): Call check_use_blx. Update plt counts
4868 + for R_ARM_THM_JUMP24 and R_ARM_THM_JUMP19.
4869 + (elf32_arm_check_relocs): Update plt counts for R_ARM_THM_JUMP24
4870 + and R_ARM_THM_JUMP19.
4871 + (allocate_dynrelocs): Use plt_maybe_thumb_refcount.
4872 + (elf32_arm_finish_dynamic_symbol): Ditto.
4873 + (elf32_arm_output_plt_map): Ditto.
4874 +
4875 +2007-05-16 Paul Brook <paul@codesourcery.com>
4876 +
4877 + * config/tc-arm.c (v7m_psrs): Add uppercase PSR names and xpsr.
4878 +
4879 +2007-05-16 Joseph Myers <joseph@codesourcery.com>
4880 +
4881 + binutils/testsuite/
4882 + * binutils-all/strip-3.d: Strip .pdr section.
4883 +
4884 +2007-05-16 Nathan Sidwell <nathan@codesourcery.com>
4885 +
4886 + ld/testsuite/
4887 + * ld-m68k-merge-error-1a.d: Mismatch is an error.
4888 + * ld-m68k-merge-error-1b.d: Likewise.
4889 + * ld-m68k-merge-error-1c.d: Likewise.
4890 + * ld-m68k-merge-error-1d.d: Likewise.
4891 + * ld-m68k-merge-error-1e.d: Likewise.
4892 +
4893 + gas/
4894 + * config/tc-m68k.c (md_apply_fix): Show value of out of range
4895 + fixups in error message.
4896 + (md_conver_frag_1): Propagate the fix source location and use
4897 + as_bad_where rather than fatal, for better error messages.
4898 +
4899 +2007-05-15 Richard Sandiford <richard@codesourcery.com>
4900 +
4901 + Backport from mainline:
4902 +
4903 + ld/testsuite/
4904 + 2007-05-15 Richard Sandiford <richard@codesourcery.com>
4905 +
4906 + * ld-arm/vxworks1.ld: Swap .bss and .data.
4907 + * ld-arm/vxworks1-lib.rd: Update accordingly.
4908 + * ld-arm/vxworks1-lib.td: New test.
4909 + * ld-arm/arm-elf.exp: Run it.
4910 +
4911 + * ld-i386/vxworks1.ld: Swap .bss and .data.
4912 + * ld-i386/vxworks1-lib.rd: Update accordingly.
4913 + * ld-i386/vxworks1-lib.td: New test.
4914 + * ld-i386/i386.exp: Run it.
4915 +
4916 + * ld-mips-elf/vxworks1.ld: Swap .bss and .data.
4917 + * ld-mips-elf/vxworks1-lib.rd: Update accordingly.
4918 + * ld-mips-elf/vxworks1.rd: Likewise.
4919 +
4920 + * ld-powerpc/vxworks1.ld: Swap .bss and .data.
4921 + * ld-powerpc/vxworks1-lib.rd: Update accordingly.
4922 + * ld-powerpc/vxworks1-lib.td: New test.
4923 + * ld-powerpc/powerpc.exp: Run it.
4924 +
4925 + * ld-sh/vxworks1.ld: Swap .bss and .data.
4926 + * ld-sh/vxworks1-lib.rd: Update accordingly.
4927 + * ld-sh/vxworks1-lib.td: New test.
4928 + * ld-sh/sh-vxworks.exp: Run it.
4929 +
4930 + * ld-sparc/vxworks1.ld: Swap .bss and .data.
4931 + * ld-sparc/vxworks1-lib.rd: Update accordingly.
4932 + * ld-sparc/vxworks1-lib.td: New test.
4933 + * ld-sparc/sparc.exp: Run it.
4934 +
4935 +2007-05-15 Richard Sandiford <richard@codesourcery.com>
4936 +
4937 + Backport from mainline:
4938 +
4939 + bfd/
4940 + 2007-05-15 Richard Sandiford <richard@codesourcery.com>
4941 +
4942 + * elfxx-mips.c (mips_elf_create_local_got_entry): Remove
4943 + input_section argument. Create .rela.dyn relocations against
4944 + symbol 0 rather than the section symbol.
4945 + (mips_elf_local_got_index): Remove input_section argument.
4946 + Update call to mips_elf_create_local_got_entry.
4947 + (mips_elf_got_page, mips_elf_got16_entry): Likewise.
4948 + (mips_elf_calculate_relocation): Update calls to
4949 + mips_elf_local_got_index, mips_elf_got16_entry and mips_elf_got_page.
4950 +
4951 + ld/testsuite/
4952 + 2007-05-15 Richard Sandiford <richard@codesourcery.com>
4953 +
4954 + * ld-mips-elf/vxworks1-lib.rd: Expect the GOT relocation to be
4955 + against symbol 0.
4956 +
4957 +2007-05-14 Richard Sandiford <richard@codesourcery.com>
4958 +
4959 + bfd/
4960 + * coff-rs6000.c (rs6000coff_vec, pmac_xcoff_vec): Initialize
4961 + _bfd_copy_link_hash_symbol_type.
4962 +
4963 +2007-05-14 Joseph Myers <joseph@codesourcery.com>
4964 +
4965 + Backport from mainline:
4966 + bfd/
4967 + 2007-05-12 Alan Modra <amodra@bigpond.net.au>
4968 + PR 4497
4969 + * elf-eh-frame.c (struct cie): Add "local_personality". Make
4970 + "personality" a union.
4971 + (cie_eq): Compare local_personality too. Adjust personality
4972 + comparison.
4973 + (_bfd_elf_discard_section_eh_frame): Check binding on personality
4974 + reloc sym to allow for bad symtab. Use stashed local syms rather
4975 + than reading personality local sym. Handle discarded sections.
4976 +
4977 +2007-05-14 Richard Sandiford <richard@codesourcery.com>
4978 +
4979 + Backport from mainline:
4980 +
4981 + ld/testsuite/
4982 + 2007-05-14 Richard Sandiford <richard@codesourcery.com>
4983 +
4984 + * ld-sh/vxworks1.dd: Remove hexadecimal prefixes from constant pool
4985 + contents. Consistently use "!" as the comment character.
4986 + Consistently use _PROCEDURE_LINKAGE_TABLE_ in the first PLT entry.
4987 + * ld-sh/vxworks1-le.dd: Likewise.
4988 + * ld-sh/vxworks1-lib.dd: Likewise.
4989 + * ld-sh/vxworks1-lib-le.dd: Likewise.
4990 + * ld-sh/vxworks3.dd: Likewise.
4991 + * ld-sh/vxworks3-le.dd: Likewise.
4992 +
4993 +2007-05-11 Paul Brook <paul@codesourcery.com>
4994 +
4995 + ld/
4996 + * ldexp.c (exp_fold_tree_1): Copy symbol type for simple
4997 + assignments.
4998 +
4999 + ld/testsuite/
5000 + * ld-arm/script-type.s: New test.
5001 + * ld-arm/arm-elf.exp: New test.
5002 + * ld-arm/script-type.ld: New test.
5003 +
5004 + bfd/
5005 + * elf-bfd.h (_bfd_elf_copy_link_hash_symbol_type): Add prototype.
5006 + * libbfd-in.h (_bfd_generic_copy_link_hash_symbol_type): Add
5007 + prototype.
5008 + * elflink.c (_bfd_elf_copy_link_hash_symbol_type): New function.
5009 + * linker.c (_bfd_generic_copy_link_hash_symbol_type): New
5010 + function.
5011 + * targets.c (BFD_JUMP_TABLE_LINK, struct bfd_target): Add
5012 + _copy_link_hash_symbol_type.
5013 + * aout-adobe.c (aout_32_bfd_copy_link_hash_symbol_type): Define.
5014 + * aout-target.h (MY_bfd_copy_link_hash_symbol_type): Define.
5015 + * aout-tic30.c (MY_bfd_copy_link_hash_symbol_type): Define.
5016 + * binary.c (binary_bfd_copy_link_hash_symbol_type): Define.
5017 + * bout.c (b_out_bfd_copy_link_hash_symbol_type): Define.
5018 + * coffcode.h (coff_bfd_copy_link_hash_symbol_type): Define.
5019 + * elfxx-target.h (bfd_elfNN_bfd_copy_link_hash_symbol_type): Define.
5020 + * i386msdos.c (msdos_bfd_copy_link_hash_symbol_type): Define.
5021 + * i386os9k.c (os9k_bfd_copy_link_hash_symbol_type): Define.
5022 + * ieee.c (ieee_bfd_copy_link_hash_symbol_type): Define.
5023 + * ihex.c (ihex_bfd_copy_link_hash_symbol_type): Define.
5024 + * libecoff.h (_bfd_ecoff_bfd_copy_link_hash_symbol_type): Define.
5025 + * mach-o.c (bfd_mach_o_bfd_copy_link_hash_symbol_type): Define.
5026 + * mmo.c (mmo_bfd_copy_link_hash_symbol_type): Define.
5027 + * nlm-target.h (nlm_bfd_copy_link_hash_symbol_type): Define.
5028 + * oasys.c (oasys_bfd_copy_link_hash_symbol_type): Define.
5029 + * pef.c (bfd_pef_bfd_copy_link_hash_symbol_type): Define.
5030 + * ppcboot.c (ppcboot_bfd_copy_link_hash_symbol_type): Define.
5031 + * som.c (som_bfd_copy_link_hash_symbol_type): Define.
5032 + * srec.c (srec_bfd_copy_link_hash_symbol_type): Define.
5033 + * tekhex.c (tekhex_bfd_copy_link_hash_symbol_type): Define.
5034 + * versados.c (versados_bfd_copy_link_hash_symbol_type): Define.
5035 + * vms.c (vms_bfd_copy_link_hash_symbol_type): Define.
5036 + * xsym.c (bfd_sym_bfd_copy_link_hash_symbol_type): Define.
5037 + * bfd-in2.h: Regenerate.
5038 + * libbfd.h: Regenerate.
5039 +
5040 +2007-05-11 Joseph Myers <joseph@codesourcery.com>
5041 +
5042 + Backport from mainline:
5043 + gas/
5044 + 2007-04-30 Alan Modra <amodra@bigpond.net.au>
5045 + PR 4436
5046 + * config/tc-ppc.c (ppc_insert_operand): Disable range check if
5047 + min > max.
5048 +
5049 + opcodes/
5050 + 2007-04-30 Alan Modra <amodra@bigpond.net.au>
5051 + PR 4436
5052 + * ppc-opc.c (powerpc_operands): Correct bitm for second entry of MBE.
5053 +
5054 + gas/
5055 + 2007-05-02 Alan Modra <amodra@bigpond.net.au>
5056 + PR 4448
5057 + * config/tc-ppc.c (ppc_insert_operand): Don't increase min for
5058 + PPC_OPERAND_PLUS1.
5059 +
5060 + include/opcode/
5061 + 2007-05-02 Alan Modra <amodra@bigpond.net.au>
5062 + * ppc.h (PPC_OPERAND_PLUS1): Update comment.
5063 +
5064 +2007-05-10 Carlos O'Donell <carlos@codesourcery.com>
5065 +
5066 + * Makefile.tpl: Add install-pdf to install target deps.
5067 + * Makefile.in: Regenerate.
5068 +
5069 +2007-05-10 Carlos O'Donell <carlos@codesourcery.com>
5070 +
5071 + bfd/
5072 + * configure.in: ACSUBST pdfdir.
5073 + * Makefile.am: Add install-pdf, install-pdf-am
5074 + and install-pdf-recursive targets. Define pdfdir.
5075 + * doc/Makefile.am: Define pdf__strip_dir. Add
5076 + install-pdf and install-pdf-am targets.
5077 + * po/Make-in: Add install-pdf target.
5078 + * configure: Regenerate.
5079 + * Makefile.in: Regenerate
5080 + * doc/Makefile.in: Regenerate.
5081 +
5082 + binutils/
5083 + * configure.in: ACSUBST pdfdir.
5084 + * Makefile.am: Add install-pdf, install-pdf-am,
5085 + and install-pdf-recursive targets.
5086 + * doc/Makefile.am: Define pdf__strip_dir. Add
5087 + install-pdf and install-pdf-am targets.
5088 + * po/Make-in: Add install-pdf target.
5089 + * configure: Regenerate.
5090 + * Makefile.in: Regenerate.
5091 + * doc/Makefile.in: Regenerate.
5092 +
5093 + etc/
5094 + * configure.in: ACSUBST pdfdir.
5095 + * configure: Regenerate.
5096 +
5097 + opcodes/
5098 + * Makefile.am: Add install-pdf target.
5099 + * po/Make-in: Add install-pdf target.
5100 + * Makefile.in: Regenerate.
5101 +
5102 + gas/
5103 + * configure.in: ACSUBST pdfdir.
5104 + * Makefile.am: Add install-pdf, install-pdf-am,
5105 + and install-pdf-recursive targets.
5106 + * doc/Makefile.am: Define pdf__strip_dir. Add
5107 + install-pdf and install-pdf-am targets.
5108 + * po/Make-in: Add install-pdf target.
5109 + * configure: Regenerate.
5110 + * Makefile.in: Regenerate.
5111 + * doc/Makefile.in: Regenerate.
5112 +
5113 + gprof/
5114 + * configure.in: ACSUBST pdfdir.
5115 + * Makefile.am: Add install-pdf, install-pdf-am,
5116 + and install-pdf-recursive targets. Define pdf__strip_dir.
5117 + * po/Make-in: Add install-pdf target.
5118 + * configure: Regenerate.
5119 + * Makefile.in: Regenerate.
5120 +
5121 + ld/
5122 + * configure.in: ACSUBST pdfdir.
5123 + * Makefile.am: Add install-pdf, install-pdf-am,
5124 + and install-pdf-recursive targets. Define pdf__strip_dir.
5125 + * po/Make-in: Add install-pdf target.
5126 + * configure: Regenerate.
5127 + * Makefile.in: Regenerate.
5128 +
5129 +2007-05-10 Kazu Hirata <kazu@codesourcery.com>
5130 +
5131 + Issue 1569
5132 + Backport from mainline:
5133 + bfd/
5134 + 2007-05-11 Alan Modra <amodra@bigpond.net.au>
5135 + PR 4454
5136 + * elf-eh-frame.c (struct cie): Make "personality" a bfd_vma.
5137 + (_bfd_elf_discard_section_eh_frame): Handle local syms on
5138 + personality relocation.
5139 +
5140 +2007-05-10 Nathan Sidwell <nathan@codesourcery.com>
5141 +
5142 + * Makefile.tpl: Add install-pdf to install target deps.
5143 + * Makefile.in: Regenerate.
5144 +
5145 +2007-05-10 Carlos O'Donell <carlos@codesourcery.com>
5146 +
5147 + bfd/
5148 + * configure.in: ACSUBST pdfdir.
5149 + * Makefile.am: Add install-pdf, install-pdf-am
5150 + and install-pdf-recursive targets. Define pdfdir.
5151 + * doc/Makefile.am: Define pdf__strip_dir. Add
5152 + install-pdf and install-pdf-am targets.
5153 + * po/Make-in: Add install-pdf target.
5154 + * configure: Regenerate.
5155 + * Makefile.in: Regenerate
5156 + * doc/Makefile.in: Regenerate.
5157 +
5158 + binutils/
5159 + * configure.in: ACSUBST pdfdir.
5160 + * Makefile.am: Add install-pdf, install-pdf-am,
5161 + and install-pdf-recursive targets.
5162 + * doc/Makefile.am: Define pdf__strip_dir. Add
5163 + install-pdf and install-pdf-am targets.
5164 + * po/Make-in: Add install-pdf target.
5165 + * configure: Regenerate.
5166 + * Makefile.in: Regenerate.
5167 + * doc/Makefile.in: Regenerate.
5168 +
5169 + etc/
5170 + * configure.in: ACSUBST pdfdir.
5171 + * configure: Regenerate.
5172 +
5173 + opcodes/
5174 + * Makefile.am: Add install-pdf target.
5175 + * po/Make-in: Add install-pdf target.
5176 + * Makefile.in: Regenerate.
5177 +
5178 + gas/
5179 + * configure.in: ACSUBST pdfdir.
5180 + * Makefile.am: Add install-pdf, install-pdf-am,
5181 + and install-pdf-recursive targets.
5182 + * doc/Makefile.am: Define pdf__strip_dir. Add
5183 + install-pdf and install-pdf-am targets.
5184 + * po/Make-in: Add install-pdf target.
5185 + * configure: Regenerate.
5186 + * Makefile.in: Regenerate.
5187 + * doc/Makefile.in: Regenerate.
5188 +
5189 + gprof/
5190 + * configure.in: ACSUBST pdfdir.
5191 + * Makefile.am: Add install-pdf, install-pdf-am,
5192 + and install-pdf-recursive targets. Define pdf__strip_dir.
5193 + * po/Make-in: Add install-pdf target.
5194 + * configure: Regenerate.
5195 + * Makefile.in: Regenerate.
5196 +
5197 + ld/
5198 + * configure.in: ACSUBST pdfdir.
5199 + * Makefile.am: Add install-pdf, install-pdf-am,
5200 + and install-pdf-recursive targets. Define pdf__strip_dir.
5201 + * po/Make-in: Add install-pdf target.
5202 + * configure: Regenerate.
5203 + * Makefile.in: Regenerate.
5204 +
5205 +2007-05-10 Richard Sandiford <richard@codesourcery.com>
5206 +
5207 + Backport from mainline:
5208 +
5209 + bfd/
5210 + 2007-05-10 Richard Sandiford <richard@codesourcery.com>
5211 +
5212 + * elf32-arm.c (elf32_arm_check_relocs): Don't create PLT entries
5213 + for R_ARM_ABS12 relocs.
5214 + (elf32_arm_finish_dynamic_symbol): Fix the loop that creates
5215 + non-shared VxWorks PLT entries.
5216 +
5217 + ld/testsuite/
5218 + 2007-05-10 Richard Sandiford <richard@codesourcery.com>
5219 +
5220 + * ld-arm/vxworks1-lib.dd: Expect "push" instead of stmdb and
5221 + "pop" instead of ldmia. Don't require specific symbolic addresses
5222 + for in-text addresses. Expect data to be rendered as .words rather
5223 + than disassembled.
5224 + * ld-arm/vxworks1.dd: Likewise.
5225 +
5226 +2007-05-10 Richard Sandiford <richard@codesourcery.com>
5227 +
5228 + Backport from mainline:
5229 +
5230 + bfd/
5231 + 2007-05-10 Richard Sandiford <richard@codesourcery.com>
5232 +
5233 + * elf.c (assign_file_positions_for_load_sections): Use p_memsz
5234 + rather than p_filesz to calculate the LMA of the end of a segment.
5235 +
5236 + ld/testsuite/
5237 + 2007-05-10 Richard Sandiford <richard@codesourcery.com>
5238 +
5239 + * ld-elf/multibss1.d, ld-elf/multibss1.s: New test.
5240 +
5241 +2007-05-10 Kazu Hirata <kazu@codesourcery.com>
5242 +
5243 + Issue 1569
5244 + Backport from mainline:
5245 + bfd/
5246 + 2007-05-11 Alan Modra <amodra@bigpond.net.au>
5247 + PR 4454
5248 + * elf-eh-frame.c (struct cie): Make "personality" a bfd_vma.
5249 + (_bfd_elf_discard_section_eh_frame): Handle local syms on
5250 + personality relocation.
5251 +
5252 +2007-05-09 Nathan Sidwell <nathan@codesourcery.com>
5253 +
5254 + * release-notes-csl.xml: Document fix.
5255 +
5256 + opcodes/
5257 + * m68k-opc.c (m68k_opcodes): Add wdebugl variants.
5258 +
5259 +2007-05-09 Kazu Hirata <kazu@codesourcery.com>
5260 +
5261 + * release-notes-csl.xml: Insert a blank line before the first
5262 + release note fragment.
5263 +
5264 +2007-05-04 Mark Shinwell <shinwell@codesourcery.com>
5265 +
5266 + * release-notes-csl.xml (ARM EABI compliance): New.
5267 +
5268 + gas/
5269 + * config/te-armeabi.h (EABI_DEFAULT): Use EF_ARM_EABI_VER5.
5270 + * config/te-armlinuxeabi.h (EABI_DEFAULT): Likewise.
5271 +
5272 +2007-05-04 Kazu Hirata <kazu@codesourcery.com>
5273 +
5274 + Backport from mainline:
5275 + gas/testsuite/
5276 + * gas/m68k/all.exp: Skip fmoveml on fido.
5277 +
5278 +2007-05-04 Mark Shinwell <shinwell@codesourcery.com>
5279 +
5280 + binutils/testsuite/
5281 + * binutils-all/strip-3.d: Strip .ARM.attributes section.
5282 +
5283 +2007-05-04 Mark Shinwell <shinwell@codesourcery.com>
5284 +
5285 + Merge from Sourcery G++ binutils 2.17:
5286 +
5287 + 2007-04-20 Mark Shinwell <shinwell@codesourcery.com>
5288 +
5289 + * release-notes-csl.xml (Conditional Thumb-2 branch
5290 + instructions): New.
5291 +
5292 + bfd/
5293 + * elf32-arm.c (elf32_arm_final_link_relocate): Correctly
5294 + handle the Thumb-2 JUMP19 relocation.
5295 +
5296 + ld/testsuite/
5297 + * ld-arm/arm-elf.exp: Add jump19 testcase.
5298 + * ld-arm/jump19.d: New.
5299 + * ld-arm/jump19.s: New.
5300 +
5301 +2007-05-04 Mark Shinwell <shinwell@codesourcery.com>
5302 +
5303 + Merge from Sourcery G++ binutils 2.17:
5304 +
5305 + 2007-04-20 Mark Shinwell <shinwell@codesourcery.com>
5306 +
5307 + * release-notes-csl.xml (Linking of non-ELF images): New.
5308 +
5309 + bfd/
5310 + * elf32-arm.c (bfd_elf32_arm_vfp11_erratum_scan): Don't
5311 + attempt to scan if the bfd doesn't correspond to an ELF image.
5312 + (bfd_elf32_arm_vfp11_fix_veneer_locations): Likewise.
5313 +
5314 +2007-05-03 Mark Shinwell <shinwell@codesourcery.com>
5315 +
5316 + Merge from Sourcery G++ binutils 2.17:
5317 +
5318 + 2007-04-27 Mark Shinwell <shinwell@codesourcery.com>
5319 +
5320 + gas/
5321 + * config/tc-arm.c (md_apply_fix): Generate more accurate
5322 + diagnostic when 8-bit immediate range is exceeded for
5323 + BFD_RELOC_ARM_OFFSET_IMM8.
5324 +
5325 +2007-05-03 Sandra Loosemore <sandra@codesourcery.com>
5326 +
5327 + bfd/
5328 + * elf32-arm.c (allocate_dynrelocs): Fix typo in comment.
5329 +
5330 +2007-05-03 Paul Brook <paul@codesourcery.com>
5331 +
5332 + Merge from CSL-2.17 branch.
5333 + 2007-04-17 Paul Brook <paul@codesourcery.com>
5334 + gas/
5335 + * config/tc-arm.c (arm_ext_msr): New variable.
5336 + (md_assemble): Allow v6-M 32-bit instructions without requiring
5337 + Thumb-2.
5338 + (insns): Use arm_ext_msr for Thumb MSR and MRS.
5339 + (cpu_arch): Add V6M. Fix numbering of V6K and V6T2.
5340 + gas/testsuite/
5341 + * gas/arm/archv6m.d: New test.
5342 + * gas/arm/archv6m.s: New test.
5343 + include/opcode/
5344 + * arm.h (ARM_EXT_THUMB_MSR): Define.
5345 + (ARM_AEXT_V6T2, ARM_AEXT_V6M): Use it.
5346 +
5347 + 2006-12-15 Paul Brook <paul@codesourcery.com>
5348 + gas/
5349 + * config/tc-arm.c (arm_ext_barrier, arm_ext_m): New.
5350 + (do_t_mrs): Use arm_ext_m.
5351 + (insns): Allow dmb, dsb and isb on ARMv6-M.
5352 + (arm_cpu_option_table): Add cortex-m1.
5353 + (arm_arch_option_table): Add armv6-m.
5354 + (aeabi_set_public_attributes): Use arm_ext_m.
5355 + include/
5356 + * opcode/arm.h (ARM_EXT_V6M, ARM_EXT_BARRIER, ARM_AEXT_V6M,
5357 + ARM_ARCH_V6M): Define.
5358 + (ARM_AEXT_V7_ARM, ARM_AEXT_V7M): Include ARM_EXT_BARRIER.
5359 +
5360 +2007-04-27 Mark Shinwell <shinwell@codesourcery.com>
5361 +
5362 + * release-notes-csl.xml (The \@ assembler pseudo-variable):
5363 + New.
5364 +
5365 + gas/
5366 + * app.c (do_scrub_chars): Don't damage \@ pseudo-variables.
5367 +
5368 + gas/testsuite/
5369 + * gas/arm/backslash-at.d: New.
5370 + * gas/arm/backslash-at.s: New.
5371 +
5372 +2007-04-25 Mark Mitchell <mark@codesourcery.com>
5373 +
5374 + libiberty/
5375 + * cygpath.c (<process.h>): Include it.
5376 + (cygpath_log): New variable.
5377 + (cygpath_log_msg_arg): New function.
5378 + (cygpath_log_msg): Likewise.
5379 + (cygpath_perror): Likewise.
5380 + (cygpath_close): Declare as prototyped function. Close the log
5381 + file.
5382 + (cygpath): Log interaction with cygpath. If cygpath dies
5383 + unexpectedly, restart it.
5384 + (set_errno_from_windows_code): Avoid signed/unsigned comparison.
5385 +
5386 +2007-04-23 Joseph Myers <joseph@codesourcery.com>
5387 +
5388 + Merge from Sourcery G++ binutils 2.17:
5389 +
5390 + 2007-01-24 Joseph Myers <joseph@codesourcery.com>
5391 + bfd/
5392 + * config.bfd (mips*el-*-linux*, mips*-*-linux*): Remove
5393 + ecoff_little_vec and ecoff_big_vec.
5394 +
5395 +2007-04-23 Sandra Loosemore <sandra@codesourcery.com>
5396 +
5397 + * release-notes-csl.xml (Binutils update): New.
5398 +
5399 +2007-04-23 Richard Sandiford <richard@codesourcery.com>
5400 +
5401 + gas/testsuite/
5402 + * gas/mips/ulh3.s, gas/mips/ulh3-el.d, gas/mips/ulh3-eb.d,
5403 + * gas/mips/octeon1.s, gas/mips/octeon1.l, gas/mips/octeon2.s,
5404 + * gas/mips/octeon2-un.d, gas/mips/octeon2-noun.d,
5405 + * gas/mips/octeon2-mix.d, gas/mips/octeon3.s,
5406 + * gas/mips/octeon3.d: New tests.
5407 + * gas/mips/mips.exp: Run them. Don't run ulh2 on mips32r2 targets.
5408 +
5409 +2007-04-23 Richard Sandiford <richard@codesourcery.com>
5410 +
5411 + Adapted from a patch by Cavium Networks.
5412 +
5413 + include/elf/
5414 + * mips.h (E_MIPS_MACH_OCTEON): New macro.
5415 +
5416 + include/opcode/
5417 + * mips.h: Document '^', ';' and 'y'.
5418 + (OP_MASK_BITIND, OP_SH_BITIND): New macros.
5419 + (INSN_OCTEON, CPU_OCTEON): Likewise.
5420 + (OPCODE_IS_MEMBER): Handle CPU_OCTEON.
5421 +
5422 + bfd/
5423 + * archures.c (bfd_mach_mips_octeon): Define.
5424 + * bfd-in2.h: Regenerate.
5425 + * cpu-mips.c (I_mipsocteon): Define.
5426 + (arch_info_struct): Add a "mips:octeon" entry.
5427 + * elfxx-mips.c (_bfd_elf_mips_mach): Handle E_MIPS_MACH_OCTEON.
5428 + (mips_set_isa_flags): Handle bfd_mach_mips_octeon.
5429 + (mips_mach_extensions): List bfd_mach_mips_octeon as an extension
5430 + of bfd_mach_mipsisa64.
5431 +
5432 + binutils/
5433 + * readelf.c (get_machine_flags): Handle E_MIPS_MACH_OCTEON.
5434 +
5435 + opcodes/
5436 + * mips-dis.c (octeon_use_unalign): New variable.
5437 + (mips_cp0_names_octeon, mips_cp0sel_names_octeon): New tables.
5438 + (mips_arch_choices): Add an octeon entry.
5439 + (parse_mips_dis_option): Handle octeon-useun and no-octeon-useun.
5440 + (print_insn_args): Handle '^' and 'y'.
5441 + (print_insn_mips): Skip aliases of uld, ulw, usd and usw when
5442 + unaligned octeon instructions are allowed. Print ldr, lwr,
5443 + sdr and swr as nops in that case.
5444 + (print_mips_disassembler_options): Print help for octeon-useun and
5445 + no-octeon-useun.
5446 + * mips-opc.c (IOCTEON): Define.
5447 + (mips_builtin_opcodes): Add Octeon baddu, bbit032, bbit0, bbit132,
5448 + bbit1, cins32, cins, dmul, dpop, exts32, exts, exts, mtm0, mtm1,
5449 + mtm2, mtp0, mtp1, mtp2, pop, seq, seqi, sne, snei, syncio,
5450 + synciobdma, syncioall, syncs, syncw, syncws, uld, ulw, usd, usw,
5451 + v3mulu, vmm0, vmulu, dmfc2 and dmtc2 instructions.
5452 +
5453 + gas/
5454 + * config/tc-mips.c (octeon_use_unalign): New variable.
5455 + (ISA_HAS_INS): New macro.
5456 + (CPU_HAS_DROR): Return true for CPU_OCTEON.
5457 + (CPU_HAS_INS): New macro.
5458 + (macro_build): Handle '^' and 'y'.
5459 + (macro2): Try to use "ins" instead of "sll" and "or" in the
5460 + implementation of ulh and ulhu. Treat uld, ulw, usd and usw
5461 + as normal stores if the Octeon unaligned instructions are allowed.
5462 + (validate_mips_insn): Handle '^', ';' and 'y'.
5463 + (mips_ip): Ignore the uld, ulw, usd and usw hardware instructions
5464 + unless they have been enabled. Refuse to assemble left/right stores
5465 + when uld, ulw, usd and usw are enabled. Handle '^', ';' and 'y'.
5466 + (OPTION_OCTEON_UNALIGNED, OPTION_NO_OCTEON_UNALIGNED): New macros.
5467 + (OPTION_ELF_BASE): Bump by two.
5468 + (md_longopts): Add -mocteon-useun and -mno-octeon-useun.
5469 + (md_parse_option): Handle them.
5470 + (mips_cpu_info_table): Add an "octeon" entry.
5471 + (md_show_usage): Mention -mocteon-useun and -mno-octeon-useun.
5472 +
5473 +2007-04-22 Mark Shinwell <shinwell@codesourcery.com>
5474 +
5475 + Merge from Sourcery G++ binutils 2.17:
5476 +
5477 + 2007-02-02 Mark Shinwell <shinwell@codesourcery.com>
5478 +
5479 + gas/
5480 + * config/tc-arm.c (arm_ext_marvell_f): New.
5481 + (do_marvell_div): New.
5482 + (insns): Add entries for Marvell-specific sdiv and udiv encodings.
5483 + (arm_cpu_option_table): Add marvell-f entry.
5484 + (arm_arch_option_table): Add marvell-f entry.
5485 + * include/opcode/arm.h (ARM_CEXT_MARVELL_F): New.
5486 + (ARM_ARCH_MARVELL_F): New.
5487 +
5488 + gas/testsuite/
5489 + * gas/arm/marvell-f-div.d: New.
5490 + * gas/arm/marvell-f-div.s: New.
5491 +
5492 + 2007-01-03 Mark Shinwell <shinwell@codesourcery.com>
5493 +
5494 + NOT ASSIGNED TO FSF
5495 + Port from Marvell compiler:
5496 + gas/
5497 + * config/tc-arm.c (arm_cpus): Add marvell-f entry.
5498 +
5499 +2007-04-20 Nathan Sidwell <nathan@codesourcery.com>
5500 +
5501 + gas/testsuite/
5502 + * gas/m68k/br-isaa.s: New.
5503 + * gas/m68k/br-isaa.d: New.
5504 + * gas/m68k/br-isab.s: New.
5505 + * gas/m68k/br-isab.d: New.
5506 + * gas/m68k/br-isac.s: New.
5507 + * gas/m68k/br-isac.d: New.
5508 + * gas/m68k/all.exp: Adjust.
5509 +
5510 + gas/
5511 + * config/tc-m68k.c (mcf54455_ctrl): New.
5512 + (HAVE_LONG_DISP, HAVE_LONG_CALL, HAVE_LONG_COND): New.
5513 + (m68k_archs): Add isac.
5514 + (m68k_cpus): Add 54455 family.
5515 + (m68k_ip): Split Bg into Bb, Bs, Bg.
5516 + (m68k_elf_final_processing): Add ISA_C.
5517 + * doc/c-m68k.texi (M680x0 Options): Add isac.
5518 +
5519 + include/opcode/
5520 + * m68k.h (mcfisa_c): New.
5521 + (mcfusp, mcf_mask): Adjust.
5522 +
5523 + bfd/
5524 + * archures.c (bfd_mach_mcf_isa_c, bfd_mach_mcf_isa_c_mac,
5525 + bfd_mach_mcf_isa_c_emac): New.
5526 + * elf32-m68k.c (ISAC_PLT_ENTRY_SIZE, elf_isac_plt0_entry,
5527 + elf_isac_plt_entry, elf_isac_plt_info): New.
5528 + (elf32_m68k_object_p): Add ISA_C.
5529 + (elf32_m68k_print_private_bfd_data): Print ISA_C.
5530 + (elf32_m68k_get_plt_info): Detect ISA_C.
5531 + * cpu-m68k.c (arch_info): Add ISAC.
5532 + (m68k_arch_features): Likewise,
5533 + (bfd_m68k_compatible): ISAs B & C are not compatible.
5534 +
5535 + opcodes/
5536 + * m68k-opc.c: Mark mcfisa_c instructions.
5537 +
5538 +2007-04-20 Joseph Myers <joseph@codesourcery.com>
5539 +
5540 + Merge from Sourcery G++ binutils 2.17:
5541 +
5542 + 2007-03-20 Joseph Myers <joseph@codesourcery.com>
5543 + Based on patch by Mark Hatle <mark.hatle@windriver.com>.
5544 + ld/
5545 + * configure.in (--enable-poison-system-directories): New option.
5546 + * configure, config.in: Regenerate.
5547 + * ldfile.c (ldfile_add_library_path): If
5548 + ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
5549 + /usr/lib, /usr/local/lib or /usr/X11R6/lib.
5550 +
5551 + Merge from Sourcery G++ binutils 2.17:
5552 +
5553 + 2007-03-22 Julian Brown <julian@codesourcery.com>
5554 + bfd/
5555 + * elf32-arm.c (bfd_elf32_arm_set_vfp11_fix): Default to fixing for
5556 + scalar code on pre-ARMv7.
5557 + ld/
5558 + * ld.texinfo: Document this default.
5559 +
5560 + Merge from Sourcery G++ binutils 2.17:
5561 +
5562 + 2007-03-23 Richard Sandiford <richard@codesourcery.com>
5563 + bfd/
5564 + From Phil Edwards <phil@codesourcery.com>:
5565 + * cache.c (bfd_cache_delete): Work around ClearCase bug.
5566 +
5567 + Merge from Sourcery G++ binutils 2.17:
5568 +
5569 + 2006-04-12 Carlos O'Donell <carlos@codesourcery.com>
5570 + * Makefile.tpl: Add install-html to install target deps.
5571 + * Makefile.in: Regenerate.
5572 +
5573 +2007-04-20 Mark Mitchell <mark@codesourcery.com>
5574 + Vladimir Prus <vladimir@codesourcery.com>
5575 + Carlos O'Donell <carlos@codesourcery.com>
5576 + Joseph Myers <joseph@codesourcery.com>
5577 +
5578 + libiberty/
5579 + * configure.ac: Add cygpath for mingw hosts.
5580 + * configure: Rebuilt.
5581 + * Makefile.in: Add cygpath.
5582 + * cygpath.c: New.
5583 +
5584 +2007-04-20 Joseph Myers <joseph@codesourcery.com>
5585 +
5586 + Merge from Sourcery G++ binutils 2.17:
5587 +
5588 + 2007-03-01 Joseph Myers <joseph@codesourcery.com>
5589 + gas/
5590 + * configure.in (mips64el-sicortex-linux-gnu): Set
5591 + mips_default_abi=N64_ABI.
5592 + * configure: Regenerate.
5593 +
5594 + 2007-02-20 Carlos O'Donell <carlos@codesourcery.com>
5595 + Issue #1271
5596 + ld/
5597 + * configure.tgt (mips64el-sicortex-linux-gnu): Set targ_emul to
5598 + elf64ltsmip, and set targ_extra_emuls appropriately.
5599 +
5600 +2007-04-20 Nathan Sidwell <nathan@codesourcery.com>
5601 +
5602 + gas/
5603 + * config/tc-m68k.c (mcf5253_ctrl): New.
5604 + (mcf52223_ctrl): New.
5605 + (m68k_cpus): Add 5253, 52221, 52223.
5606 +
5607 + gas/
5608 + * config/m68k-parse.h (RAMBAR_ALT): New.
5609 + * config/tc-m68k.c (mcf5206_ctrl, mcf5307_ctrl): New.
5610 + (mcf_ctrl, mcf5208_ctrl, mcf5210a_ctrl, mcf5213_ctrl, mcf52235_ctrl,
5611 + mcf5225_ctrl, mcf5235_ctrl, mcf5271_ctrl, mcf5275_ctrl,
5612 + mcf5282_ctrl, mcf5329_ctrl, mcf5373_ctrl, mcfv4e_ctrl,
5613 + mcf5475_ctrl, mcf5485_ctrl): Add RAMBAR synonym for
5614 + RAMBAR1.
5615 + (mcf5272_ctrl): Add RAMBAR0, replace add RAMBAR with RAMBAR_ALT.
5616 + (m68k_cpus): Adjust 5206, 5206e & 5307 entries.
5617 + (m68k_ip) <Case J>: Detect when RAMBAR_ALT should be used. Add it
5618 + to control register mapping.
5619 +
5620 + gas/testsuite/
5621 + * gas/m68k/ctrl-1.d, gas/m68k/ctrl-1.s: New.
5622 + * gas/m68k/ctrl-2.d, gas/m68k/ctrl-2.s: New.
5623 + * gas/m68k/all.exp: Add them.
5624 +
5625 + opcodes/
5626 + * m68k-dis.c (print_insn_arg): Show c04 as rambar0 and c05 as
5627 + rambar1.
5628 +
5629 +\f
5630 +Local Variables:
5631 +mode: change-log
5632 +change-log-default-name: "ChangeLog.csl"
5633 +End:
5634 --- a/Makefile.def
5635 +++ b/Makefile.def
5636 @@ -128,6 +128,7 @@ host_modules= { module= libtermcap; no_c
5637 missing=distclean;
5638 missing=maintainer-clean; };
5639 host_modules= { module= utils; no_check=true; };
5640 +host_modules= { module= convert; no_check=true; };
5641 host_modules= { module= gnattools; };
5642
5643 target_modules = { module= libstdc++-v3; lib_path=.libs; raw_cxx=true; };
5644 @@ -485,6 +486,9 @@ dependencies = { module=all-send-pr; on=
5645 dependencies = { module=all-tar; on=all-build-texinfo; };
5646 dependencies = { module=all-uudecode; on=all-build-texinfo; };
5647
5648 +// MIPS special
5649 +dependencies = { module=all-convert; on=all-libiberty; };
5650 +
5651 // Target modules. These can also have dependencies on the language
5652 // environment (e.g. on libstdc++). By default target modules depend
5653 // on libgcc and newlib/libgloss.
5654 --- a/Makefile.in
5655 +++ b/Makefile.in
5656 @@ -744,6 +744,7 @@ configure-host: \
5657 maybe-configure-tk \
5658 maybe-configure-libtermcap \
5659 maybe-configure-utils \
5660 + maybe-configure-convert \
5661 maybe-configure-gnattools
5662 .PHONY: configure-target
5663 configure-target: \
5664 @@ -903,6 +904,7 @@ all-host: maybe-all-guile
5665 all-host: maybe-all-tk
5666 all-host: maybe-all-libtermcap
5667 all-host: maybe-all-utils
5668 +all-host: maybe-all-convert
5669 all-host: maybe-all-gnattools
5670
5671 .PHONY: all-target
5672 @@ -1019,6 +1021,7 @@ info-host: maybe-info-guile
5673 info-host: maybe-info-tk
5674 info-host: maybe-info-libtermcap
5675 info-host: maybe-info-utils
5676 +info-host: maybe-info-convert
5677 info-host: maybe-info-gnattools
5678
5679 .PHONY: info-target
5680 @@ -1128,6 +1131,7 @@ dvi-host: maybe-dvi-guile
5681 dvi-host: maybe-dvi-tk
5682 dvi-host: maybe-dvi-libtermcap
5683 dvi-host: maybe-dvi-utils
5684 +dvi-host: maybe-dvi-convert
5685 dvi-host: maybe-dvi-gnattools
5686
5687 .PHONY: dvi-target
5688 @@ -1237,6 +1241,7 @@ pdf-host: maybe-pdf-guile
5689 pdf-host: maybe-pdf-tk
5690 pdf-host: maybe-pdf-libtermcap
5691 pdf-host: maybe-pdf-utils
5692 +pdf-host: maybe-pdf-convert
5693 pdf-host: maybe-pdf-gnattools
5694
5695 .PHONY: pdf-target
5696 @@ -1346,6 +1351,7 @@ html-host: maybe-html-guile
5697 html-host: maybe-html-tk
5698 html-host: maybe-html-libtermcap
5699 html-host: maybe-html-utils
5700 +html-host: maybe-html-convert
5701 html-host: maybe-html-gnattools
5702
5703 .PHONY: html-target
5704 @@ -1455,6 +1461,7 @@ TAGS-host: maybe-TAGS-guile
5705 TAGS-host: maybe-TAGS-tk
5706 TAGS-host: maybe-TAGS-libtermcap
5707 TAGS-host: maybe-TAGS-utils
5708 +TAGS-host: maybe-TAGS-convert
5709 TAGS-host: maybe-TAGS-gnattools
5710
5711 .PHONY: TAGS-target
5712 @@ -1564,6 +1571,7 @@ install-info-host: maybe-install-info-gu
5713 install-info-host: maybe-install-info-tk
5714 install-info-host: maybe-install-info-libtermcap
5715 install-info-host: maybe-install-info-utils
5716 +install-info-host: maybe-install-info-convert
5717 install-info-host: maybe-install-info-gnattools
5718
5719 .PHONY: install-info-target
5720 @@ -1673,6 +1681,7 @@ install-pdf-host: maybe-install-pdf-guil
5721 install-pdf-host: maybe-install-pdf-tk
5722 install-pdf-host: maybe-install-pdf-libtermcap
5723 install-pdf-host: maybe-install-pdf-utils
5724 +install-pdf-host: maybe-install-pdf-convert
5725 install-pdf-host: maybe-install-pdf-gnattools
5726
5727 .PHONY: install-pdf-target
5728 @@ -1782,6 +1791,7 @@ install-html-host: maybe-install-html-gu
5729 install-html-host: maybe-install-html-tk
5730 install-html-host: maybe-install-html-libtermcap
5731 install-html-host: maybe-install-html-utils
5732 +install-html-host: maybe-install-html-convert
5733 install-html-host: maybe-install-html-gnattools
5734
5735 .PHONY: install-html-target
5736 @@ -1891,6 +1901,7 @@ installcheck-host: maybe-installcheck-gu
5737 installcheck-host: maybe-installcheck-tk
5738 installcheck-host: maybe-installcheck-libtermcap
5739 installcheck-host: maybe-installcheck-utils
5740 +installcheck-host: maybe-installcheck-convert
5741 installcheck-host: maybe-installcheck-gnattools
5742
5743 .PHONY: installcheck-target
5744 @@ -2000,6 +2011,7 @@ mostlyclean-host: maybe-mostlyclean-guil
5745 mostlyclean-host: maybe-mostlyclean-tk
5746 mostlyclean-host: maybe-mostlyclean-libtermcap
5747 mostlyclean-host: maybe-mostlyclean-utils
5748 +mostlyclean-host: maybe-mostlyclean-convert
5749 mostlyclean-host: maybe-mostlyclean-gnattools
5750
5751 .PHONY: mostlyclean-target
5752 @@ -2109,6 +2121,7 @@ clean-host: maybe-clean-guile
5753 clean-host: maybe-clean-tk
5754 clean-host: maybe-clean-libtermcap
5755 clean-host: maybe-clean-utils
5756 +clean-host: maybe-clean-convert
5757 clean-host: maybe-clean-gnattools
5758
5759 .PHONY: clean-target
5760 @@ -2218,6 +2231,7 @@ distclean-host: maybe-distclean-guile
5761 distclean-host: maybe-distclean-tk
5762 distclean-host: maybe-distclean-libtermcap
5763 distclean-host: maybe-distclean-utils
5764 +distclean-host: maybe-distclean-convert
5765 distclean-host: maybe-distclean-gnattools
5766
5767 .PHONY: distclean-target
5768 @@ -2327,6 +2341,7 @@ maintainer-clean-host: maybe-maintainer-
5769 maintainer-clean-host: maybe-maintainer-clean-tk
5770 maintainer-clean-host: maybe-maintainer-clean-libtermcap
5771 maintainer-clean-host: maybe-maintainer-clean-utils
5772 +maintainer-clean-host: maybe-maintainer-clean-convert
5773 maintainer-clean-host: maybe-maintainer-clean-gnattools
5774
5775 .PHONY: maintainer-clean-target
5776 @@ -2490,6 +2505,7 @@ check-host: \
5777 maybe-check-tk \
5778 maybe-check-libtermcap \
5779 maybe-check-utils \
5780 + maybe-check-convert \
5781 maybe-check-gnattools
5782
5783 .PHONY: check-target
5784 @@ -2625,6 +2641,7 @@ install-host-nogcc: \
5785 maybe-install-tk \
5786 maybe-install-libtermcap \
5787 maybe-install-utils \
5788 + maybe-install-convert \
5789 maybe-install-gnattools
5790
5791 .PHONY: install-host
5792 @@ -2701,6 +2718,7 @@ install-host: \
5793 maybe-install-tk \
5794 maybe-install-libtermcap \
5795 maybe-install-utils \
5796 + maybe-install-convert \
5797 maybe-install-gnattools
5798
5799 .PHONY: install-target
5800 @@ -42242,6 +42260,424 @@ maintainer-clean-utils:
5801
5802
5803
5804 +.PHONY: configure-convert maybe-configure-convert
5805 +maybe-configure-convert:
5806 +@if gcc-bootstrap
5807 +configure-convert: stage_current
5808 +@endif gcc-bootstrap
5809 +@if convert
5810 +maybe-configure-convert: configure-convert
5811 +configure-convert:
5812 + @: $(MAKE); $(unstage)
5813 + @r=`${PWD_COMMAND}`; export r; \
5814 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
5815 + test ! -f $(HOST_SUBDIR)/convert/Makefile || exit 0; \
5816 + $(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/convert ; \
5817 + $(HOST_EXPORTS) \
5818 + echo Configuring in $(HOST_SUBDIR)/convert; \
5819 + cd "$(HOST_SUBDIR)/convert" || exit 1; \
5820 + case $(srcdir) in \
5821 + /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
5822 + *) topdir=`echo $(HOST_SUBDIR)/convert/ | \
5823 + sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
5824 + esac; \
5825 + srcdiroption="--srcdir=$${topdir}/convert"; \
5826 + libsrcdir="$$s/convert"; \
5827 + $(SHELL) $${libsrcdir}/configure \
5828 + $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
5829 + --target=${target_alias} $${srcdiroption} \
5830 + || exit 1
5831 +@endif convert
5832 +
5833 +
5834 +
5835 +
5836 +
5837 +.PHONY: all-convert maybe-all-convert
5838 +maybe-all-convert:
5839 +@if gcc-bootstrap
5840 +all-convert: stage_current
5841 +@endif gcc-bootstrap
5842 +@if convert
5843 +TARGET-convert=all
5844 +maybe-all-convert: all-convert
5845 +all-convert: configure-convert
5846 + @: $(MAKE); $(unstage)
5847 + @r=`${PWD_COMMAND}`; export r; \
5848 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
5849 + $(HOST_EXPORTS) \
5850 + (cd $(HOST_SUBDIR)/convert && \
5851 + $(MAKE) $(FLAGS_TO_PASS) $(TARGET-convert))
5852 +@endif convert
5853 +
5854 +
5855 +
5856 +
5857 +.PHONY: check-convert maybe-check-convert
5858 +maybe-check-convert:
5859 +@if convert
5860 +maybe-check-convert: check-convert
5861 +
5862 +check-convert:
5863 +
5864 +@endif convert
5865 +
5866 +.PHONY: install-convert maybe-install-convert
5867 +maybe-install-convert:
5868 +@if convert
5869 +maybe-install-convert: install-convert
5870 +
5871 +install-convert: installdirs
5872 + @: $(MAKE); $(unstage)
5873 + @r=`${PWD_COMMAND}`; export r; \
5874 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
5875 + $(HOST_EXPORTS) \
5876 + (cd $(HOST_SUBDIR)/convert && \
5877 + $(MAKE) $(FLAGS_TO_PASS) install)
5878 +
5879 +@endif convert
5880 +
5881 +# Other targets (info, dvi, pdf, etc.)
5882 +
5883 +.PHONY: maybe-info-convert info-convert
5884 +maybe-info-convert:
5885 +@if convert
5886 +maybe-info-convert: info-convert
5887 +
5888 +info-convert: \
5889 + configure-convert
5890 + @: $(MAKE); $(unstage)
5891 + @[ -f ./convert/Makefile ] || exit 0; \
5892 + r=`${PWD_COMMAND}`; export r; \
5893 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
5894 + $(HOST_EXPORTS) \
5895 + for flag in $(EXTRA_HOST_FLAGS) ; do \
5896 + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
5897 + done; \
5898 + echo "Doing info in convert" ; \
5899 + (cd $(HOST_SUBDIR)/convert && \
5900 + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
5901 + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
5902 + "RANLIB=$${RANLIB}" \
5903 + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
5904 + info) \
5905 + || exit 1
5906 +
5907 +@endif convert
5908 +
5909 +.PHONY: maybe-dvi-convert dvi-convert
5910 +maybe-dvi-convert:
5911 +@if convert
5912 +maybe-dvi-convert: dvi-convert
5913 +
5914 +dvi-convert: \
5915 + configure-convert
5916 + @: $(MAKE); $(unstage)
5917 + @[ -f ./convert/Makefile ] || exit 0; \
5918 + r=`${PWD_COMMAND}`; export r; \
5919 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
5920 + $(HOST_EXPORTS) \
5921 + for flag in $(EXTRA_HOST_FLAGS) ; do \
5922 + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
5923 + done; \
5924 + echo "Doing dvi in convert" ; \
5925 + (cd $(HOST_SUBDIR)/convert && \
5926 + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
5927 + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
5928 + "RANLIB=$${RANLIB}" \
5929 + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
5930 + dvi) \
5931 + || exit 1
5932 +
5933 +@endif convert
5934 +
5935 +.PHONY: maybe-pdf-convert pdf-convert
5936 +maybe-pdf-convert:
5937 +@if convert
5938 +maybe-pdf-convert: pdf-convert
5939 +
5940 +pdf-convert: \
5941 + configure-convert
5942 + @: $(MAKE); $(unstage)
5943 + @[ -f ./convert/Makefile ] || exit 0; \
5944 + r=`${PWD_COMMAND}`; export r; \
5945 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
5946 + $(HOST_EXPORTS) \
5947 + for flag in $(EXTRA_HOST_FLAGS) ; do \
5948 + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
5949 + done; \
5950 + echo "Doing pdf in convert" ; \
5951 + (cd $(HOST_SUBDIR)/convert && \
5952 + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
5953 + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
5954 + "RANLIB=$${RANLIB}" \
5955 + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
5956 + pdf) \
5957 + || exit 1
5958 +
5959 +@endif convert
5960 +
5961 +.PHONY: maybe-html-convert html-convert
5962 +maybe-html-convert:
5963 +@if convert
5964 +maybe-html-convert: html-convert
5965 +
5966 +html-convert: \
5967 + configure-convert
5968 + @: $(MAKE); $(unstage)
5969 + @[ -f ./convert/Makefile ] || exit 0; \
5970 + r=`${PWD_COMMAND}`; export r; \
5971 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
5972 + $(HOST_EXPORTS) \
5973 + for flag in $(EXTRA_HOST_FLAGS) ; do \
5974 + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
5975 + done; \
5976 + echo "Doing html in convert" ; \
5977 + (cd $(HOST_SUBDIR)/convert && \
5978 + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
5979 + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
5980 + "RANLIB=$${RANLIB}" \
5981 + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
5982 + html) \
5983 + || exit 1
5984 +
5985 +@endif convert
5986 +
5987 +.PHONY: maybe-TAGS-convert TAGS-convert
5988 +maybe-TAGS-convert:
5989 +@if convert
5990 +maybe-TAGS-convert: TAGS-convert
5991 +
5992 +TAGS-convert: \
5993 + configure-convert
5994 + @: $(MAKE); $(unstage)
5995 + @[ -f ./convert/Makefile ] || exit 0; \
5996 + r=`${PWD_COMMAND}`; export r; \
5997 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
5998 + $(HOST_EXPORTS) \
5999 + for flag in $(EXTRA_HOST_FLAGS) ; do \
6000 + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
6001 + done; \
6002 + echo "Doing TAGS in convert" ; \
6003 + (cd $(HOST_SUBDIR)/convert && \
6004 + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
6005 + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
6006 + "RANLIB=$${RANLIB}" \
6007 + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
6008 + TAGS) \
6009 + || exit 1
6010 +
6011 +@endif convert
6012 +
6013 +.PHONY: maybe-install-info-convert install-info-convert
6014 +maybe-install-info-convert:
6015 +@if convert
6016 +maybe-install-info-convert: install-info-convert
6017 +
6018 +install-info-convert: \
6019 + configure-convert \
6020 + info-convert
6021 + @: $(MAKE); $(unstage)
6022 + @[ -f ./convert/Makefile ] || exit 0; \
6023 + r=`${PWD_COMMAND}`; export r; \
6024 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
6025 + $(HOST_EXPORTS) \
6026 + for flag in $(EXTRA_HOST_FLAGS) ; do \
6027 + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
6028 + done; \
6029 + echo "Doing install-info in convert" ; \
6030 + (cd $(HOST_SUBDIR)/convert && \
6031 + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
6032 + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
6033 + "RANLIB=$${RANLIB}" \
6034 + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
6035 + install-info) \
6036 + || exit 1
6037 +
6038 +@endif convert
6039 +
6040 +.PHONY: maybe-install-pdf-convert install-pdf-convert
6041 +maybe-install-pdf-convert:
6042 +@if convert
6043 +maybe-install-pdf-convert: install-pdf-convert
6044 +
6045 +install-pdf-convert: \
6046 + configure-convert \
6047 + pdf-convert
6048 + @: $(MAKE); $(unstage)
6049 + @[ -f ./convert/Makefile ] || exit 0; \
6050 + r=`${PWD_COMMAND}`; export r; \
6051 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
6052 + $(HOST_EXPORTS) \
6053 + for flag in $(EXTRA_HOST_FLAGS) ; do \
6054 + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
6055 + done; \
6056 + echo "Doing install-pdf in convert" ; \
6057 + (cd $(HOST_SUBDIR)/convert && \
6058 + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
6059 + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
6060 + "RANLIB=$${RANLIB}" \
6061 + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
6062 + install-pdf) \
6063 + || exit 1
6064 +
6065 +@endif convert
6066 +
6067 +.PHONY: maybe-install-html-convert install-html-convert
6068 +maybe-install-html-convert:
6069 +@if convert
6070 +maybe-install-html-convert: install-html-convert
6071 +
6072 +install-html-convert: \
6073 + configure-convert \
6074 + html-convert
6075 + @: $(MAKE); $(unstage)
6076 + @[ -f ./convert/Makefile ] || exit 0; \
6077 + r=`${PWD_COMMAND}`; export r; \
6078 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
6079 + $(HOST_EXPORTS) \
6080 + for flag in $(EXTRA_HOST_FLAGS) ; do \
6081 + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
6082 + done; \
6083 + echo "Doing install-html in convert" ; \
6084 + (cd $(HOST_SUBDIR)/convert && \
6085 + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
6086 + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
6087 + "RANLIB=$${RANLIB}" \
6088 + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
6089 + install-html) \
6090 + || exit 1
6091 +
6092 +@endif convert
6093 +
6094 +.PHONY: maybe-installcheck-convert installcheck-convert
6095 +maybe-installcheck-convert:
6096 +@if convert
6097 +maybe-installcheck-convert: installcheck-convert
6098 +
6099 +installcheck-convert: \
6100 + configure-convert
6101 + @: $(MAKE); $(unstage)
6102 + @[ -f ./convert/Makefile ] || exit 0; \
6103 + r=`${PWD_COMMAND}`; export r; \
6104 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
6105 + $(HOST_EXPORTS) \
6106 + for flag in $(EXTRA_HOST_FLAGS) ; do \
6107 + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
6108 + done; \
6109 + echo "Doing installcheck in convert" ; \
6110 + (cd $(HOST_SUBDIR)/convert && \
6111 + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
6112 + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
6113 + "RANLIB=$${RANLIB}" \
6114 + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
6115 + installcheck) \
6116 + || exit 1
6117 +
6118 +@endif convert
6119 +
6120 +.PHONY: maybe-mostlyclean-convert mostlyclean-convert
6121 +maybe-mostlyclean-convert:
6122 +@if convert
6123 +maybe-mostlyclean-convert: mostlyclean-convert
6124 +
6125 +mostlyclean-convert:
6126 + @: $(MAKE); $(unstage)
6127 + @[ -f ./convert/Makefile ] || exit 0; \
6128 + r=`${PWD_COMMAND}`; export r; \
6129 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
6130 + $(HOST_EXPORTS) \
6131 + for flag in $(EXTRA_HOST_FLAGS) ; do \
6132 + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
6133 + done; \
6134 + echo "Doing mostlyclean in convert" ; \
6135 + (cd $(HOST_SUBDIR)/convert && \
6136 + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
6137 + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
6138 + "RANLIB=$${RANLIB}" \
6139 + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
6140 + mostlyclean) \
6141 + || exit 1
6142 +
6143 +@endif convert
6144 +
6145 +.PHONY: maybe-clean-convert clean-convert
6146 +maybe-clean-convert:
6147 +@if convert
6148 +maybe-clean-convert: clean-convert
6149 +
6150 +clean-convert:
6151 + @: $(MAKE); $(unstage)
6152 + @[ -f ./convert/Makefile ] || exit 0; \
6153 + r=`${PWD_COMMAND}`; export r; \
6154 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
6155 + $(HOST_EXPORTS) \
6156 + for flag in $(EXTRA_HOST_FLAGS) ; do \
6157 + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
6158 + done; \
6159 + echo "Doing clean in convert" ; \
6160 + (cd $(HOST_SUBDIR)/convert && \
6161 + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
6162 + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
6163 + "RANLIB=$${RANLIB}" \
6164 + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
6165 + clean) \
6166 + || exit 1
6167 +
6168 +@endif convert
6169 +
6170 +.PHONY: maybe-distclean-convert distclean-convert
6171 +maybe-distclean-convert:
6172 +@if convert
6173 +maybe-distclean-convert: distclean-convert
6174 +
6175 +distclean-convert:
6176 + @: $(MAKE); $(unstage)
6177 + @[ -f ./convert/Makefile ] || exit 0; \
6178 + r=`${PWD_COMMAND}`; export r; \
6179 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
6180 + $(HOST_EXPORTS) \
6181 + for flag in $(EXTRA_HOST_FLAGS) ; do \
6182 + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
6183 + done; \
6184 + echo "Doing distclean in convert" ; \
6185 + (cd $(HOST_SUBDIR)/convert && \
6186 + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
6187 + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
6188 + "RANLIB=$${RANLIB}" \
6189 + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
6190 + distclean) \
6191 + || exit 1
6192 +
6193 +@endif convert
6194 +
6195 +.PHONY: maybe-maintainer-clean-convert maintainer-clean-convert
6196 +maybe-maintainer-clean-convert:
6197 +@if convert
6198 +maybe-maintainer-clean-convert: maintainer-clean-convert
6199 +
6200 +maintainer-clean-convert:
6201 + @: $(MAKE); $(unstage)
6202 + @[ -f ./convert/Makefile ] || exit 0; \
6203 + r=`${PWD_COMMAND}`; export r; \
6204 + s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
6205 + $(HOST_EXPORTS) \
6206 + for flag in $(EXTRA_HOST_FLAGS) ; do \
6207 + eval `echo "$$flag" | sed -e "s|^\([^=]*\)=\(.*\)|\1='\2'; export \1|"`; \
6208 + done; \
6209 + echo "Doing maintainer-clean in convert" ; \
6210 + (cd $(HOST_SUBDIR)/convert && \
6211 + $(MAKE) $(BASE_FLAGS_TO_PASS) "AR=$${AR}" "AS=$${AS}" \
6212 + "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
6213 + "RANLIB=$${RANLIB}" \
6214 + "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" "WINDMC=$${WINDMC}" \
6215 + maintainer-clean) \
6216 + || exit 1
6217 +
6218 +@endif convert
6219 +
6220 +
6221 +
6222 .PHONY: configure-gnattools maybe-configure-gnattools
6223 maybe-configure-gnattools:
6224 @if gcc-bootstrap
6225 @@ -55724,6 +56160,7 @@ all-sed: maybe-all-build-texinfo
6226 all-send-pr: maybe-all-prms
6227 all-tar: maybe-all-build-texinfo
6228 all-uudecode: maybe-all-build-texinfo
6229 +all-convert: maybe-all-libiberty
6230 configure-target-boehm-gc: maybe-configure-target-qthreads
6231 configure-target-boehm-gc: maybe-all-target-libstdc++-v3
6232 configure-target-fastjar: maybe-configure-target-zlib
6233 --- a/bfd/aout-adobe.c
6234 +++ b/bfd/aout-adobe.c
6235 @@ -467,6 +467,8 @@ aout_adobe_sizeof_headers (bfd *ignore_a
6236 #define aout_32_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
6237 #define aout_32_bfd_link_add_symbols _bfd_generic_link_add_symbols
6238 #define aout_32_bfd_link_just_syms _bfd_generic_link_just_syms
6239 +#define aout_32_bfd_copy_link_hash_symbol_type \
6240 + _bfd_generic_copy_link_hash_symbol_type
6241 #define aout_32_bfd_final_link _bfd_generic_final_link
6242 #define aout_32_bfd_link_split_section _bfd_generic_link_split_section
6243
6244 --- a/bfd/aout-target.h
6245 +++ b/bfd/aout-target.h
6246 @@ -520,6 +520,10 @@ MY_bfd_final_link (bfd *abfd, struct bfd
6247 #ifndef MY_bfd_link_just_syms
6248 #define MY_bfd_link_just_syms _bfd_generic_link_just_syms
6249 #endif
6250 +#ifndef MY_bfd_copy_link_hash_symbol_type
6251 +#define MY_bfd_copy_link_hash_symbol_type \
6252 + _bfd_generic_copy_link_hash_symbol_type
6253 +#endif
6254 #ifndef MY_bfd_link_split_section
6255 #define MY_bfd_link_split_section _bfd_generic_link_split_section
6256 #endif
6257 --- a/bfd/aout-tic30.c
6258 +++ b/bfd/aout-tic30.c
6259 @@ -977,6 +977,10 @@ tic30_aout_set_arch_mach (bfd *abfd,
6260 #ifndef MY_bfd_link_just_syms
6261 #define MY_bfd_link_just_syms _bfd_generic_link_just_syms
6262 #endif
6263 +#ifndef MY_bfd_copy_link_hash_symbol_type
6264 +#define MY_bfd_copy_link_hash_symbol_type \
6265 + _bfd_generic_copy_link_hash_symbol_type
6266 +#endif
6267 #ifndef MY_bfd_link_split_section
6268 #define MY_bfd_link_split_section _bfd_generic_link_split_section
6269 #endif
6270 --- a/bfd/bfd-in.h
6271 +++ b/bfd/bfd-in.h
6272 @@ -821,10 +821,19 @@ extern void bfd_elf32_arm_init_maps
6273 extern void bfd_elf32_arm_set_vfp11_fix
6274 (bfd *, struct bfd_link_info *);
6275
6276 +extern void bfd_elf32_arm_validate_janus_2cc_fix
6277 + (bfd *, struct bfd_link_info *);
6278 +
6279 +extern void bfd_elf32_arm_set_cortex_a8_fix
6280 + (bfd *, struct bfd_link_info *);
6281 +
6282 extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
6283 (bfd *, struct bfd_link_info *);
6284
6285 -extern void bfd_elf32_arm_vfp11_fix_veneer_locations
6286 +extern bfd_boolean bfd_elf32_arm_janus_2cc_erratum_scan
6287 + (bfd *, struct bfd_link_info *);
6288 +
6289 +extern void bfd_elf32_arm_fix_veneer_locations
6290 (bfd *, struct bfd_link_info *);
6291
6292 /* ARM Interworking support. Called from linker. */
6293 @@ -856,7 +865,7 @@ extern bfd_boolean bfd_elf32_arm_process
6294
6295 void bfd_elf32_arm_set_target_relocs
6296 (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix,
6297 - int, int, int);
6298 + int, int, int, int, int);
6299
6300 extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
6301 (bfd *, struct bfd_link_info *);
6302 @@ -894,7 +903,11 @@ extern bfd_boolean elf32_arm_size_stubs
6303 struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void));
6304 extern bfd_boolean elf32_arm_build_stubs
6305 (struct bfd_link_info *);
6306 -
6307 +
6308 +/* ARM unwind section editing support. */
6309 +extern bfd_boolean elf32_arm_fix_exidx_coverage
6310 + (struct bfd_section **, unsigned int, struct bfd_link_info *);
6311 +
6312 /* TI COFF load page support. */
6313 extern void bfd_ticoff_set_section_load_page
6314 (struct bfd_section *, int);
6315 --- a/bfd/bfd-in2.h
6316 +++ b/bfd/bfd-in2.h
6317 @@ -828,10 +828,19 @@ extern void bfd_elf32_arm_init_maps
6318 extern void bfd_elf32_arm_set_vfp11_fix
6319 (bfd *, struct bfd_link_info *);
6320
6321 +extern void bfd_elf32_arm_validate_janus_2cc_fix
6322 + (bfd *, struct bfd_link_info *);
6323 +
6324 +extern void bfd_elf32_arm_set_cortex_a8_fix
6325 + (bfd *, struct bfd_link_info *);
6326 +
6327 extern bfd_boolean bfd_elf32_arm_vfp11_erratum_scan
6328 (bfd *, struct bfd_link_info *);
6329
6330 -extern void bfd_elf32_arm_vfp11_fix_veneer_locations
6331 +extern bfd_boolean bfd_elf32_arm_janus_2cc_erratum_scan
6332 + (bfd *, struct bfd_link_info *);
6333 +
6334 +extern void bfd_elf32_arm_fix_veneer_locations
6335 (bfd *, struct bfd_link_info *);
6336
6337 /* ARM Interworking support. Called from linker. */
6338 @@ -863,7 +872,7 @@ extern bfd_boolean bfd_elf32_arm_process
6339
6340 void bfd_elf32_arm_set_target_relocs
6341 (bfd *, struct bfd_link_info *, int, char *, int, int, bfd_arm_vfp11_fix,
6342 - int, int, int);
6343 + int, int, int, int, int);
6344
6345 extern bfd_boolean bfd_elf32_arm_get_bfd_for_interworking
6346 (bfd *, struct bfd_link_info *);
6347 @@ -901,7 +910,11 @@ extern bfd_boolean elf32_arm_size_stubs
6348 struct bfd_section * (*) (const char *, struct bfd_section *), void (*) (void));
6349 extern bfd_boolean elf32_arm_build_stubs
6350 (struct bfd_link_info *);
6351 -
6352 +
6353 +/* ARM unwind section editing support. */
6354 +extern bfd_boolean elf32_arm_fix_exidx_coverage
6355 + (struct bfd_section **, unsigned int, struct bfd_link_info *);
6356 +
6357 /* TI COFF load page support. */
6358 extern void bfd_ticoff_set_section_load_page
6359 (struct bfd_section *, int);
6360 @@ -5406,6 +5419,7 @@ typedef struct bfd_target
6361 NAME##_bfd_link_hash_table_free, \
6362 NAME##_bfd_link_add_symbols, \
6363 NAME##_bfd_link_just_syms, \
6364 + NAME##_bfd_copy_link_hash_symbol_type, \
6365 NAME##_bfd_final_link, \
6366 NAME##_bfd_link_split_section, \
6367 NAME##_bfd_gc_sections, \
6368 @@ -5436,6 +5450,12 @@ typedef struct bfd_target
6369 /* Indicate that we are only retrieving symbol values from this section. */
6370 void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
6371
6372 + /* Copy the symbol type of a linker hash table entry. */
6373 +#define bfd_copy_link_hash_symbol_type(b, t, f) \
6374 + BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
6375 + void (*_bfd_copy_link_hash_symbol_type)
6376 + (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
6377 +
6378 /* Do a link based on the link_order structures attached to each
6379 section of the BFD. */
6380 bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
6381 --- a/bfd/binary.c
6382 +++ b/bfd/binary.c
6383 @@ -319,6 +319,8 @@ binary_sizeof_headers (bfd *abfd ATTRIBU
6384 #define binary_bfd_link_hash_table_create _bfd_generic_link_hash_table_create
6385 #define binary_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
6386 #define binary_bfd_link_just_syms _bfd_generic_link_just_syms
6387 +#define binary_bfd_copy_link_hash_symbol_type \
6388 + _bfd_generic_copy_link_hash_symbol_type
6389 #define binary_bfd_link_add_symbols _bfd_generic_link_add_symbols
6390 #define binary_bfd_final_link _bfd_generic_final_link
6391 #define binary_bfd_link_split_section _bfd_generic_link_split_section
6392 --- a/bfd/bout.c
6393 +++ b/bfd/bout.c
6394 @@ -1382,6 +1382,8 @@ b_out_bfd_get_relocated_section_contents
6395 #define b_out_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
6396 #define b_out_bfd_link_add_symbols _bfd_generic_link_add_symbols
6397 #define b_out_bfd_link_just_syms _bfd_generic_link_just_syms
6398 +#define b_out_bfd_copy_link_hash_symbol_type \
6399 + _bfd_generic_copy_link_hash_symbol_type
6400 #define b_out_bfd_final_link _bfd_generic_final_link
6401 #define b_out_bfd_link_split_section _bfd_generic_link_split_section
6402 #define b_out_bfd_gc_sections bfd_generic_gc_sections
6403 --- a/bfd/cache.c
6404 +++ b/bfd/cache.c
6405 @@ -120,6 +120,13 @@ bfd_cache_delete (bfd *abfd)
6406
6407 if (fclose ((FILE *) abfd->iostream) == 0)
6408 ret = TRUE;
6409 + /* ClearCase has an entertaining bug where close will fail and set
6410 + errno to EROFS when applied to any file in a read-only view, even
6411 + if the file was opened for reading. Detect this situation and
6412 + ignore the error. */
6413 + else if (errno == EROFS && (abfd->direction == no_direction
6414 + || abfd->direction == read_direction))
6415 + ret = TRUE;
6416 else
6417 {
6418 ret = FALSE;
6419 --- a/bfd/coff-arm.c
6420 +++ b/bfd/coff-arm.c
6421 @@ -2208,7 +2208,7 @@ coff_arm_merge_private_bfd_data (bfd * i
6422 {
6423 _bfd_error_handler
6424 /* xgettext: c-format */
6425 - (_("ERROR: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d"),
6426 + (_("error: %B is compiled for APCS-%d, whereas %B is compiled for APCS-%d"),
6427 ibfd, obfd,
6428 APCS_26_FLAG (ibfd) ? 26 : 32,
6429 APCS_26_FLAG (obfd) ? 26 : 32
6430 @@ -2224,10 +2224,10 @@ coff_arm_merge_private_bfd_data (bfd * i
6431
6432 if (APCS_FLOAT_FLAG (ibfd))
6433 /* xgettext: c-format */
6434 - msg = _("ERROR: %B passes floats in float registers, whereas %B passes them in integer registers");
6435 + msg = _("error: %B passes floats in float registers, whereas %B passes them in integer registers");
6436 else
6437 /* xgettext: c-format */
6438 - msg = _("ERROR: %B passes floats in integer registers, whereas %B passes them in float registers");
6439 + msg = _("error: %B passes floats in integer registers, whereas %B passes them in float registers");
6440
6441 _bfd_error_handler (msg, ibfd, obfd);
6442
6443 @@ -2241,10 +2241,10 @@ coff_arm_merge_private_bfd_data (bfd * i
6444
6445 if (PIC_FLAG (ibfd))
6446 /* xgettext: c-format */
6447 - msg = _("ERROR: %B is compiled as position independent code, whereas target %B is absolute position");
6448 + msg = _("error: %B is compiled as position independent code, whereas target %B is absolute position");
6449 else
6450 /* xgettext: c-format */
6451 - msg = _("ERROR: %B is compiled as absolute position code, whereas target %B is position independent");
6452 + msg = _("error: %B is compiled as absolute position code, whereas target %B is position independent");
6453 _bfd_error_handler (msg, ibfd, obfd);
6454
6455 bfd_set_error (bfd_error_wrong_format);
6456 --- a/bfd/coff-rs6000.c
6457 +++ b/bfd/coff-rs6000.c
6458 @@ -4212,6 +4212,7 @@ const bfd_target rs6000coff_vec =
6459 _bfd_generic_link_hash_table_free,
6460 _bfd_xcoff_bfd_link_add_symbols,
6461 _bfd_generic_link_just_syms,
6462 + _bfd_generic_copy_link_hash_symbol_type,
6463 _bfd_xcoff_bfd_final_link,
6464 _bfd_generic_link_split_section,
6465 bfd_generic_gc_sections,
6466 @@ -4464,6 +4465,7 @@ const bfd_target pmac_xcoff_vec =
6467 _bfd_generic_link_hash_table_free,
6468 _bfd_xcoff_bfd_link_add_symbols,
6469 _bfd_generic_link_just_syms,
6470 + _bfd_generic_copy_link_hash_symbol_type,
6471 _bfd_xcoff_bfd_final_link,
6472 _bfd_generic_link_split_section,
6473 bfd_generic_gc_sections,
6474 --- a/bfd/coff64-rs6000.c
6475 +++ b/bfd/coff64-rs6000.c
6476 @@ -2762,6 +2762,7 @@ const bfd_target rs6000coff64_vec =
6477 _bfd_generic_link_hash_table_free,
6478 _bfd_xcoff_bfd_link_add_symbols,
6479 _bfd_generic_link_just_syms,
6480 + _bfd_generic_copy_link_hash_symbol_type,
6481 _bfd_xcoff_bfd_final_link,
6482 _bfd_generic_link_split_section,
6483 bfd_generic_gc_sections,
6484 @@ -3015,6 +3016,7 @@ const bfd_target aix5coff64_vec =
6485 _bfd_generic_link_hash_table_free,
6486 _bfd_xcoff_bfd_link_add_symbols,
6487 _bfd_generic_link_just_syms,
6488 + _bfd_generic_copy_link_hash_symbol_type,
6489 _bfd_xcoff_bfd_final_link,
6490 _bfd_generic_link_split_section,
6491 bfd_generic_gc_sections,
6492 --- a/bfd/coffcode.h
6493 +++ b/bfd/coffcode.h
6494 @@ -5169,6 +5169,8 @@ dummy_reloc16_extra_cases (bfd *abfd ATT
6495 #endif /* ! defined (coff_relocate_section) */
6496
6497 #define coff_bfd_link_just_syms _bfd_generic_link_just_syms
6498 +#define coff_bfd_copy_link_hash_symbol_type \
6499 + _bfd_generic_copy_link_hash_symbol_type
6500 #define coff_bfd_link_split_section _bfd_generic_link_split_section
6501
6502 #ifndef coff_start_final_link
6503 --- a/bfd/config.bfd
6504 +++ b/bfd/config.bfd
6505 @@ -959,6 +959,10 @@ case "${targ}" in
6506 targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
6507 want64=true
6508 ;;
6509 + mips64octeon*-*-elf*)
6510 + targ_defvec=bfd_elf32_tradbigmips_vec
6511 + targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
6512 + ;;
6513 mips*el-*-elf* | mips*el-*-vxworks* | mips*-*-chorus*)
6514 targ_defvec=bfd_elf32_littlemips_vec
6515 targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
6516 @@ -1000,12 +1004,12 @@ case "${targ}" in
6517 #endif
6518 mips*el-*-linux*)
6519 targ_defvec=bfd_elf32_tradlittlemips_vec
6520 - targ_selvecs="bfd_elf32_tradbigmips_vec ecoff_little_vec ecoff_big_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec"
6521 + targ_selvecs="bfd_elf32_tradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec"
6522 want64=true
6523 ;;
6524 mips*-*-linux*)
6525 targ_defvec=bfd_elf32_tradbigmips_vec
6526 - targ_selvecs="bfd_elf32_tradlittlemips_vec ecoff_big_vec ecoff_little_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec"
6527 + targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf32_ntradbigmips_vec bfd_elf64_tradbigmips_vec bfd_elf32_ntradlittlemips_vec bfd_elf64_tradlittlemips_vec"
6528 want64=true
6529 ;;
6530 #ifdef BFD64
6531 --- a/bfd/cpu-arm.c
6532 +++ b/bfd/cpu-arm.c
6533 @@ -187,7 +187,7 @@ bfd_arm_merge_machines (bfd *ibfd, bfd *
6534 || out == bfd_mach_arm_iWMMXt2))
6535 {
6536 _bfd_error_handler (_("\
6537 -ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"),
6538 +error: %B is compiled for the EP9312, whereas %B is compiled for XScale"),
6539 ibfd, obfd);
6540 bfd_set_error (bfd_error_wrong_format);
6541 return FALSE;
6542 @@ -198,7 +198,7 @@ ERROR: %B is compiled for the EP9312, wh
6543 || in == bfd_mach_arm_iWMMXt2))
6544 {
6545 _bfd_error_handler (_("\
6546 -ERROR: %B is compiled for the EP9312, whereas %B is compiled for XScale"),
6547 +error: %B is compiled for the EP9312, whereas %B is compiled for XScale"),
6548 obfd, ibfd);
6549 bfd_set_error (bfd_error_wrong_format);
6550 return FALSE;
6551 --- a/bfd/dwarf2.c
6552 +++ b/bfd/dwarf2.c
6553 @@ -417,48 +417,47 @@ read_section (bfd * abfd,
6554 bfd_boolean section_is_compressed = FALSE;
6555
6556 /* read_section is a noop if the section has already been read. */
6557 - if (*section_buffer)
6558 - return TRUE;
6559 -
6560 - msec = bfd_get_section_by_name (abfd, section_name);
6561 - if (! msec && compressed_section_name)
6562 - {
6563 - msec = bfd_get_section_by_name (abfd, compressed_section_name);
6564 - section_is_compressed = TRUE;
6565 - }
6566 - if (! msec)
6567 + if (!*section_buffer)
6568 {
6569 - (*_bfd_error_handler) (_("Dwarf Error: Can't find %s section."), section_name);
6570 - bfd_set_error (bfd_error_bad_value);
6571 - return FALSE;
6572 - }
6573 + msec = bfd_get_section_by_name (abfd, section_name);
6574 + if (! msec && compressed_section_name)
6575 + {
6576 + msec = bfd_get_section_by_name (abfd, compressed_section_name);
6577 + section_is_compressed = TRUE;
6578 + }
6579 + if (! msec)
6580 + {
6581 + (*_bfd_error_handler) (_("Dwarf Error: Can't find %s section."), section_name);
6582 + bfd_set_error (bfd_error_bad_value);
6583 + return FALSE;
6584 + }
6585
6586 - if (syms)
6587 - {
6588 - *section_size = msec->size;
6589 - *section_buffer
6590 - = bfd_simple_get_relocated_section_contents (abfd, msec, NULL, syms);
6591 - if (! *section_buffer)
6592 - return FALSE;
6593 - }
6594 - else
6595 - {
6596 *section_size = msec->rawsize ? msec->rawsize : msec->size;
6597 - *section_buffer = bfd_malloc (*section_size);
6598 - if (! *section_buffer)
6599 - return FALSE;
6600 - if (! bfd_get_section_contents (abfd, msec, *section_buffer,
6601 - 0, *section_size))
6602 - return FALSE;
6603 - }
6604 + if (syms)
6605 + {
6606 + *section_buffer
6607 + = bfd_simple_get_relocated_section_contents (abfd, msec, NULL, syms);
6608 + if (! *section_buffer)
6609 + return FALSE;
6610 + }
6611 + else
6612 + {
6613 + *section_buffer = bfd_malloc (*section_size);
6614 + if (! *section_buffer)
6615 + return FALSE;
6616 + if (! bfd_get_section_contents (abfd, msec, *section_buffer,
6617 + 0, *section_size))
6618 + return FALSE;
6619 + }
6620
6621 - if (section_is_compressed)
6622 - {
6623 - if (! bfd_uncompress_section_contents (section_buffer, section_size))
6624 + if (section_is_compressed)
6625 {
6626 - (*_bfd_error_handler) (_("Dwarf Error: unable to decompress %s section."), compressed_section_name);
6627 - bfd_set_error (bfd_error_bad_value);
6628 - return FALSE;
6629 + if (! bfd_uncompress_section_contents (section_buffer, section_size))
6630 + {
6631 + (*_bfd_error_handler) (_("Dwarf Error: unable to decompress %s section."), compressed_section_name);
6632 + bfd_set_error (bfd_error_bad_value);
6633 + return FALSE;
6634 + }
6635 }
6636 }
6637
6638 --- a/bfd/elf-attrs.c
6639 +++ b/bfd/elf-attrs.c
6640 @@ -564,7 +564,7 @@ _bfd_elf_merge_object_attributes (bfd *i
6641 if (in_attr->i > 0 && strcmp (in_attr->s, "gnu") != 0)
6642 {
6643 _bfd_error_handler
6644 - (_("ERROR: %B: Must be processed by '%s' toolchain"),
6645 + (_("error: %B: Must be processed by '%s' toolchain"),
6646 ibfd, in_attr->s);
6647 return FALSE;
6648 }
6649 @@ -572,7 +572,7 @@ _bfd_elf_merge_object_attributes (bfd *i
6650 if (in_attr->i != out_attr->i
6651 || (in_attr->i != 0 && strcmp (in_attr->s, out_attr->s) != 0))
6652 {
6653 - _bfd_error_handler (_("ERROR: %B: Object tag '%d, %s' is "
6654 + _bfd_error_handler (_("error: %B: Object tag '%d, %s' is "
6655 "incompatible with tag '%d, %s'"),
6656 ibfd,
6657 in_attr->i, in_attr->s ? in_attr->s : "",
6658 --- a/bfd/elf-bfd.h
6659 +++ b/bfd/elf-bfd.h
6660 @@ -1705,6 +1705,8 @@ extern asection *_bfd_elf_check_kept_sec
6661 (asection *, struct bfd_link_info *);
6662 extern void _bfd_elf_link_just_syms
6663 (asection *, struct bfd_link_info *);
6664 +extern void _bfd_elf_copy_link_hash_symbol_type
6665 + (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
6666 extern bfd_boolean _bfd_elf_copy_private_header_data
6667 (bfd *, bfd *);
6668 extern bfd_boolean _bfd_elf_copy_private_symbol_data
6669 --- a/bfd/elf32-arm.c
6670 +++ b/bfd/elf32-arm.c
6671 @@ -20,6 +20,8 @@
6672 MA 02110-1301, USA. */
6673
6674 #include "sysdep.h"
6675 +#include <limits.h>
6676 +
6677 #include "bfd.h"
6678 #include "libiberty.h"
6679 #include "libbfd.h"
6680 @@ -61,6 +63,11 @@
6681
6682 static struct elf_backend_data elf32_arm_vxworks_bed;
6683
6684 +static bfd_boolean elf32_arm_write_section (bfd *output_bfd,
6685 + struct bfd_link_info *link_info,
6686 + asection *sec,
6687 + bfd_byte *contents);
6688 +
6689 /* Note: code such as elf32_arm_reloc_type_lookup expect to use e.g.
6690 R_ARM_PC24 as an index into this, and find the R_ARM_PC24 HOWTO
6691 in that slot. */
6692 @@ -1881,7 +1888,8 @@ typedef unsigned short int insn16;
6693 interworkable. */
6694 #define INTERWORK_FLAG(abfd) \
6695 (EF_ARM_EABI_VERSION (elf_elfheader (abfd)->e_flags) >= EF_ARM_EABI_VER4 \
6696 - || (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK))
6697 + || (elf_elfheader (abfd)->e_flags & EF_ARM_INTERWORK) \
6698 + || ((abfd)->flags & BFD_LINKER_CREATED))
6699
6700 /* The linker script knows the section names for placement.
6701 The entry_names are used to do simple name mangling on the stubs.
6702 @@ -1894,7 +1902,12 @@ typedef unsigned short int insn16;
6703 #define ARM2THUMB_GLUE_ENTRY_NAME "__%s_from_arm"
6704
6705 #define VFP11_ERRATUM_VENEER_SECTION_NAME ".vfp11_veneer"
6706 -#define VFP11_ERRATUM_VENEER_ENTRY_NAME "__vfp11_veneer_%x"
6707 +#define VFP11_ERRATUM_VENEER_ENTRY_NAME "__vfp11_veneer_%x%s"
6708 +
6709 +#define JANUS_2CC_ERRATUM_VENEER_SECTION_NAME ".janus_2cc_veneer"
6710 +#define JANUS_2CC_ERRATUM_VENEER_ENTRY_NAME "__janus_2cc_veneer_%x%s"
6711 +
6712 +#define MAX_ERRATUM_SYMBOL_LENGTH 64
6713
6714 #define ARM_BX_GLUE_SECTION_NAME ".v4_bx"
6715 #define ARM_BX_GLUE_ENTRY_NAME "__bx_r%d"
6716 @@ -2010,53 +2023,129 @@ static const bfd_vma elf32_arm_symbian_p
6717 #define THM2_MAX_FWD_BRANCH_OFFSET (((1 << 24) - 2) + 4)
6718 #define THM2_MAX_BWD_BRANCH_OFFSET (-(1 << 24) + 4)
6719
6720 -static const bfd_vma arm_long_branch_stub[] =
6721 +enum stub_insn_type
6722 {
6723 - 0xe51ff004, /* ldr pc, [pc, #-4] */
6724 - 0x00000000, /* dcd R_ARM_ABS32(X) */
6725 + THUMB16_TYPE = 1,
6726 + THUMB32_TYPE,
6727 + ARM_TYPE,
6728 + DATA_TYPE
6729 + };
6730 +
6731 +#define THUMB16_INSN(X) {(X), THUMB16_TYPE, R_ARM_NONE, 0}
6732 +/* A bit of a hack. A Thumb conditional branch, in which the proper condition
6733 + is inserted in arm_build_one_stub(). */
6734 +#define THUMB16_BCOND_INSN(X) {(X), THUMB16_TYPE, R_ARM_NONE, 1}
6735 +#define THUMB32_INSN(X) {(X), THUMB32_TYPE, R_ARM_NONE, 0}
6736 +#define THUMB32_B_INSN(X, Z) {(X), THUMB32_TYPE, R_ARM_THM_JUMP24, (Z)}
6737 +#define ARM_INSN(X) {(X), ARM_TYPE, R_ARM_NONE, 0}
6738 +#define ARM_REL_INSN(X, Z) {(X), ARM_TYPE, R_ARM_JUMP24, (Z)}
6739 +#define DATA_WORD(X,Y,Z) {(X), DATA_TYPE, (Y), (Z)}
6740 +
6741 +typedef struct
6742 +{
6743 + bfd_vma data;
6744 + enum stub_insn_type type;
6745 + unsigned int reloc_type;
6746 + int reloc_addend;
6747 +} insn_sequence;
6748 +
6749 +/* Arm/Thumb -> Arm/Thumb long branch stub. On V5T and above, use blx
6750 + to reach the stub if necessary. */
6751 +static const insn_sequence elf32_arm_stub_long_branch_any_any[] =
6752 + {
6753 + ARM_INSN(0xe51ff004), /* ldr pc, [pc, #-4] */
6754 + DATA_WORD(0, R_ARM_ABS32, 0), /* dcd R_ARM_ABS32(X) */
6755 + };
6756 +
6757 +/* V4T Arm -> Thumb long branch stub. Used on V4T where blx is not
6758 + available. */
6759 +static const insn_sequence elf32_arm_stub_long_branch_v4t_arm_thumb[] =
6760 + {
6761 + ARM_INSN(0xe59fc000), /* ldr ip, [pc, #0] */
6762 + ARM_INSN(0xe12fff1c), /* bx ip */
6763 + DATA_WORD(0, R_ARM_ABS32, 0), /* dcd R_ARM_ABS32(X) */
6764 + };
6765 +
6766 +/* Thumb -> Thumb long branch stub. Used on architectures which
6767 + support only this mode, or on V4T where it is expensive to switch
6768 + to ARM. */
6769 +static const insn_sequence elf32_arm_stub_long_branch_thumb_only[] =
6770 + {
6771 + THUMB16_INSN(0xb401), /* push {r0} */
6772 + THUMB16_INSN(0x4802), /* ldr r0, [pc, #8] */
6773 + THUMB16_INSN(0x4684), /* mov ip, r0 */
6774 + THUMB16_INSN(0xbc01), /* pop {r0} */
6775 + THUMB16_INSN(0x4760), /* bx ip */
6776 + THUMB16_INSN(0xbf00), /* nop */
6777 + DATA_WORD(0, R_ARM_ABS32, 0), /* dcd R_ARM_ABS32(X) */
6778 + };
6779 +
6780 +/* V4T Thumb -> ARM long branch stub. Used on V4T where blx is not
6781 + available. */
6782 +static const insn_sequence elf32_arm_stub_long_branch_v4t_thumb_arm[] =
6783 + {
6784 + THUMB16_INSN(0x4778), /* bx pc */
6785 + THUMB16_INSN(0x46c0), /* nop */
6786 + ARM_INSN(0xe51ff004), /* ldr pc, [pc, #-4] */
6787 + DATA_WORD(0, R_ARM_ABS32, 0), /* dcd R_ARM_ABS32(X) */
6788 };
6789
6790 -static const bfd_vma arm_thumb_v4t_long_branch_stub[] =
6791 +/* V4T Thumb -> ARM short branch stub. Shorter variant of the above
6792 + one, when the destination is close enough. */
6793 +static const insn_sequence elf32_arm_stub_short_branch_v4t_thumb_arm[] =
6794 {
6795 - 0xe59fc000, /* ldr ip, [pc, #0] */
6796 - 0xe12fff1c, /* bx ip */
6797 - 0x00000000, /* dcd R_ARM_ABS32(X) */
6798 + THUMB16_INSN(0x4778), /* bx pc */
6799 + THUMB16_INSN(0x46c0), /* nop */
6800 + ARM_REL_INSN(0xea000000, -8), /* b (X-8) */
6801 };
6802
6803 -static const bfd_vma arm_thumb_thumb_long_branch_stub[] =
6804 +/* ARM/Thumb -> ARM long branch stub, PIC. On V5T and above, use
6805 + blx to reach the stub if necessary. */
6806 +static const insn_sequence elf32_arm_stub_long_branch_any_arm_pic[] =
6807 {
6808 - 0x4e02b540, /* push {r6, lr} */
6809 - /* ldr r6, [pc, #8] */
6810 - 0x473046fe, /* mov lr, pc */
6811 - /* bx r6 */
6812 - 0xbf00bd40, /* pop {r6, pc} */
6813 - /* nop */
6814 - 0x00000000, /* dcd R_ARM_ABS32(X) */
6815 + ARM_INSN(0xe59fc000), /* ldr r12, [pc] */
6816 + ARM_INSN(0xe08ff00c), /* add pc, pc, ip */
6817 + DATA_WORD(0, R_ARM_REL32, -4), /* dcd R_ARM_REL32(X-4) */
6818 };
6819
6820 -static const bfd_vma arm_thumb_arm_v4t_long_branch_stub[] =
6821 +/* ARM/Thumb -> Thumb long branch stub, PIC. On V5T and above, use
6822 + blx to reach the stub if necessary. We can not add into pc;
6823 + it is not guaranteed to mode switch (different in ARMv6 and
6824 + ARMv7). */
6825 +static const insn_sequence elf32_arm_stub_long_branch_any_thumb_pic[] =
6826 + {
6827 + ARM_INSN(0xe59fc004), /* ldr r12, [pc, #4] */
6828 + ARM_INSN(0xe08fc00c), /* add ip, pc, ip */
6829 + ARM_INSN(0xe12fff1c), /* bx ip */
6830 + DATA_WORD(0, R_ARM_REL32, 0), /* dcd R_ARM_REL32(X) */
6831 + };
6832 +
6833 +/* Cortex-A8 erratum-workaround stubs. */
6834 +
6835 +/* Stub used for conditional branches (which may be beyond +/-1MB away, so we
6836 + can't use a conditional branch to reach this stub). */
6837 +
6838 +static const insn_sequence elf32_arm_stub_a8_veneer_b_cond[] =
6839 {
6840 - 0x4e03b540, /* push {r6, lr} */
6841 - /* ldr r6, [pc, #12] */
6842 - 0x473046fe, /* mov lr, pc */
6843 - /* bx r6 */
6844 - 0xe8bd4040, /* pop {r6, pc} */
6845 - 0xe12fff1e, /* bx lr */
6846 - 0x00000000, /* dcd R_ARM_ABS32(X) */
6847 + THUMB16_BCOND_INSN(0xd001), /* b<cond>.n true. */
6848 + THUMB32_B_INSN(0xf000b800, -4), /* b.w insn_after_original_branch. */
6849 + THUMB32_B_INSN(0xf000b800, -4) /* b.w original_branch_dest. */
6850 };
6851
6852 -static const bfd_vma arm_thumb_arm_v4t_short_branch_stub[] =
6853 +/* Stub used for b.w and bl.w instructions. */
6854 +
6855 +static const insn_sequence elf32_arm_stub_a8_veneer_b[] =
6856 {
6857 - 0x46c04778, /* bx pc */
6858 - /* nop */
6859 - 0xea000000, /* b (X) */
6860 + THUMB32_B_INSN(0xf000b800, -4)
6861 };
6862
6863 -static const bfd_vma arm_pic_long_branch_stub[] =
6864 +/* Stub used for Thumb-2 blx.w instructions. We modified the original blx.w
6865 + instruction to point to this stub, which switches to ARM mode. Jump to the
6866 + real destination using an ARM-mode branch. */
6867 +
6868 +static const insn_sequence elf32_arm_stub_a8_veneer_blx[] =
6869 {
6870 - 0xe59fc000, /* ldr r12, [pc] */
6871 - 0xe08ff00c, /* add pc, pc, ip */
6872 - 0x00000000, /* dcd R_ARM_REL32(X) */
6873 + ARM_REL_INSN(0xea000000, -8)
6874 };
6875
6876 /* Section name for stubs is the associated section name plus this
6877 @@ -2066,12 +2155,17 @@ static const bfd_vma arm_pic_long_branch
6878 enum elf32_arm_stub_type
6879 {
6880 arm_stub_none,
6881 - arm_stub_long_branch,
6882 - arm_thumb_v4t_stub_long_branch,
6883 - arm_thumb_thumb_stub_long_branch,
6884 - arm_thumb_arm_v4t_stub_long_branch,
6885 - arm_thumb_arm_v4t_stub_short_branch,
6886 - arm_stub_pic_long_branch,
6887 + arm_stub_long_branch_any_any,
6888 + arm_stub_long_branch_v4t_arm_thumb,
6889 + arm_stub_long_branch_thumb_only,
6890 + arm_stub_long_branch_v4t_thumb_arm,
6891 + arm_stub_short_branch_v4t_thumb_arm,
6892 + arm_stub_long_branch_any_arm_pic,
6893 + arm_stub_long_branch_any_thumb_pic,
6894 + arm_stub_a8_veneer_b_cond,
6895 + arm_stub_a8_veneer_b,
6896 + arm_stub_a8_veneer_bl,
6897 + arm_stub_a8_veneer_blx
6898 };
6899
6900 struct elf32_arm_stub_hash_entry
6901 @@ -2090,7 +2184,21 @@ struct elf32_arm_stub_hash_entry
6902 bfd_vma target_value;
6903 asection *target_section;
6904
6905 + /* Offset to apply to relocation referencing target_value. */
6906 + bfd_vma target_addend;
6907 +
6908 + /* The instruction which caused this stub to be generated (only valid for
6909 + Cortex-A8 erratum workaround stubs at present). */
6910 + unsigned long orig_insn;
6911 +
6912 + /* The stub type. */
6913 enum elf32_arm_stub_type stub_type;
6914 + /* Its encoding size in bytes. */
6915 + int stub_size;
6916 + /* Its template. */
6917 + const insn_sequence *stub_template;
6918 + /* The size of the template (number of entries). */
6919 + int stub_template_size;
6920
6921 /* The symbol table entry, if any, that this was derived from. */
6922 struct elf32_arm_link_hash_entry *h;
6923 @@ -2124,43 +2232,111 @@ typedef enum
6924 {
6925 VFP11_ERRATUM_BRANCH_TO_ARM_VENEER,
6926 VFP11_ERRATUM_BRANCH_TO_THUMB_VENEER,
6927 + JANUS_2CC_ERRATUM_BRANCH_TO_ARM_VENEER,
6928 VFP11_ERRATUM_ARM_VENEER,
6929 - VFP11_ERRATUM_THUMB_VENEER
6930 + VFP11_ERRATUM_THUMB_VENEER,
6931 + JANUS_2CC_ERRATUM_ARM_VENEER
6932 }
6933 -elf32_vfp11_erratum_type;
6934 +elf32_cpu_erratum_type;
6935
6936 -typedef struct elf32_vfp11_erratum_list
6937 +typedef struct elf32_cpu_erratum_list
6938 {
6939 - struct elf32_vfp11_erratum_list *next;
6940 + struct elf32_cpu_erratum_list *next;
6941 bfd_vma vma;
6942 union
6943 {
6944 struct
6945 {
6946 - struct elf32_vfp11_erratum_list *veneer;
6947 - unsigned int vfp_insn;
6948 + struct elf32_cpu_erratum_list *veneer;
6949 + unsigned int orig_insn;
6950 } b;
6951 struct
6952 {
6953 - struct elf32_vfp11_erratum_list *branch;
6954 + struct elf32_cpu_erratum_list *branch;
6955 unsigned int id;
6956 } v;
6957 } u;
6958 - elf32_vfp11_erratum_type type;
6959 + elf32_cpu_erratum_type type;
6960 +}
6961 +elf32_cpu_erratum_list;
6962 +
6963 +typedef enum
6964 +{
6965 + DELETE_EXIDX_ENTRY,
6966 + INSERT_EXIDX_CANTUNWIND_AT_END
6967 }
6968 -elf32_vfp11_erratum_list;
6969 +arm_unwind_edit_type;
6970 +
6971 +/* A (sorted) list of edits to apply to an unwind table. */
6972 +typedef struct arm_unwind_table_edit
6973 +{
6974 + arm_unwind_edit_type type;
6975 + /* Note: we sometimes want to insert an unwind entry corresponding to a
6976 + section different from the one we're currently writing out, so record the
6977 + (text) section this edit relates to here. */
6978 + asection *linked_section;
6979 + unsigned int index;
6980 + struct arm_unwind_table_edit *next;
6981 +}
6982 +arm_unwind_table_edit;
6983
6984 typedef struct _arm_elf_section_data
6985 {
6986 + /* Information about mapping symbols. */
6987 struct bfd_elf_section_data elf;
6988 unsigned int mapcount;
6989 unsigned int mapsize;
6990 elf32_arm_section_map *map;
6991 + /* Information about CPU errata. */
6992 unsigned int erratumcount;
6993 - elf32_vfp11_erratum_list *erratumlist;
6994 + elf32_cpu_erratum_list *erratumlist;
6995 + /* Information about unwind tables. */
6996 + union
6997 + {
6998 + /* Unwind info attached to a text section. */
6999 + struct
7000 + {
7001 + asection *arm_exidx_sec;
7002 + } text;
7003 +
7004 + /* Unwind info attached to an .ARM.exidx section. */
7005 + struct
7006 + {
7007 + arm_unwind_table_edit *unwind_edit_list;
7008 + arm_unwind_table_edit *unwind_edit_tail;
7009 + } exidx;
7010 + } u;
7011 }
7012 _arm_elf_section_data;
7013
7014 +/* A fix which might be required for Cortex-A8 Thumb-2 branch/TLB erratum.
7015 + These fixes are subject to a relaxation procedure (in elf32_arm_size_stubs),
7016 + so may be created multiple times: we use an array of these entries whilst
7017 + relaxing which we can refresh easily, then create stubs for each potentially
7018 + erratum-triggering instruction once we've settled on a solution. */
7019 +
7020 +struct a8_erratum_fix {
7021 + bfd *input_bfd;
7022 + asection *section;
7023 + bfd_vma offset;
7024 + bfd_vma addend;
7025 + unsigned long orig_insn;
7026 + char *stub_name;
7027 + enum elf32_arm_stub_type stub_type;
7028 +};
7029 +
7030 +/* A table of relocs applied to branches which might trigger Cortex-A8
7031 + erratum. */
7032 +
7033 +struct a8_erratum_reloc {
7034 + bfd_vma from;
7035 + bfd_vma destination;
7036 + unsigned int r_type;
7037 + unsigned char st_type;
7038 + const char *sym_name;
7039 + bfd_boolean non_a8_stub;
7040 +};
7041 +
7042 #define elf32_arm_section_data(sec) \
7043 ((_arm_elf_section_data *) elf_section_data (sec))
7044
7045 @@ -2295,6 +2471,16 @@ struct elf32_arm_link_hash_table
7046 veneers. */
7047 bfd_size_type vfp11_erratum_glue_size;
7048
7049 + /* The size in bytes of the section containing glue for Janus 2CC erratum
7050 + veneers. */
7051 + bfd_size_type janus_2cc_erratum_glue_size;
7052 +
7053 + /* A table of fix locations for Cortex-A8 Thumb-2 branch/TLB erratum. This
7054 + holds Cortex-A8 erratum fix locations between elf32_arm_size_stubs() and
7055 + elf32_arm_write_section(). */
7056 + struct a8_erratum_fix *a8_erratum_fixes;
7057 + unsigned int num_a8_erratum_fixes;
7058 +
7059 /* An arbitrary input BFD chosen to hold the glue sections. */
7060 bfd * bfd_of_glue_owner;
7061
7062 @@ -2313,6 +2499,15 @@ struct elf32_arm_link_hash_table
7063 2 = Generate v4 interworing stubs. */
7064 int fix_v4bx;
7065
7066 + /* Whether we should fix/report Janus 2CC errata for ARM/Thumb. */
7067 + int fix_janus_2cc;
7068 +
7069 + /* Whether we should fix the Cortex-A8 Thumb-2 branch/TLB erratum. */
7070 + int fix_cortex_a8;
7071 +
7072 + /* Global counter for the number of fixes we have emitted. */
7073 + int num_errata_fixes;
7074 +
7075 /* Nonzero if the ARM/Thumb BLX instructions are available for use. */
7076 int use_blx;
7077
7078 @@ -2459,6 +2654,9 @@ stub_hash_newfunc (struct bfd_hash_entry
7079 eh->target_value = 0;
7080 eh->target_section = NULL;
7081 eh->stub_type = arm_stub_none;
7082 + eh->stub_size = 0;
7083 + eh->stub_template = NULL;
7084 + eh->stub_template_size = 0;
7085 eh->h = NULL;
7086 eh->id_sec = NULL;
7087 }
7088 @@ -2648,7 +2846,10 @@ elf32_arm_link_hash_table_create (bfd *a
7089 memset (ret->bx_glue_offset, 0, sizeof (ret->bx_glue_offset));
7090 ret->vfp11_fix = BFD_ARM_VFP11_FIX_NONE;
7091 ret->vfp11_erratum_glue_size = 0;
7092 - ret->num_vfp11_fixes = 0;
7093 + ret->fix_janus_2cc = 0;
7094 + ret->fix_cortex_a8 = 0;
7095 + ret->janus_2cc_erratum_glue_size = 0;
7096 + ret->num_errata_fixes = 0;
7097 ret->bfd_of_glue_owner = NULL;
7098 ret->byteswap_code = 0;
7099 ret->target1_is_rel = 0;
7100 @@ -2731,9 +2932,9 @@ arm_stub_is_thumb (enum elf32_arm_stub_t
7101 {
7102 switch (stub_type)
7103 {
7104 - case arm_thumb_thumb_stub_long_branch:
7105 - case arm_thumb_arm_v4t_stub_long_branch:
7106 - case arm_thumb_arm_v4t_stub_short_branch:
7107 + case arm_stub_long_branch_thumb_only:
7108 + case arm_stub_long_branch_v4t_thumb_arm:
7109 + case arm_stub_short_branch_v4t_thumb_arm:
7110 return TRUE;
7111 case arm_stub_none:
7112 BFD_FAIL ();
7113 @@ -2806,20 +3007,27 @@ arm_type_of_stub (struct bfd_link_info *
7114 if (!thumb_only)
7115 {
7116 stub_type = (info->shared | globals->pic_veneer)
7117 + /* PIC stubs. */
7118 ? ((globals->use_blx)
7119 - ? arm_stub_pic_long_branch
7120 + /* V5T and above. */
7121 + ? arm_stub_long_branch_any_thumb_pic
7122 + /* not yet supported on V4T. */
7123 : arm_stub_none)
7124 - : (globals->use_blx)
7125 - ? arm_stub_long_branch
7126 - : arm_stub_none;
7127 +
7128 + /* non-PIC stubs. */
7129 + : ((globals->use_blx)
7130 + /* V5T and above. */
7131 + ? arm_stub_long_branch_any_any
7132 + /* V4T. */
7133 + : arm_stub_long_branch_thumb_only);
7134 }
7135 else
7136 {
7137 stub_type = (info->shared | globals->pic_veneer)
7138 + /* PIC stub not yet supported on V4T. */
7139 ? arm_stub_none
7140 - : (globals->use_blx)
7141 - ? arm_thumb_thumb_stub_long_branch
7142 - : arm_stub_none;
7143 + /* non-PIC stub. */
7144 + : arm_stub_long_branch_thumb_only;
7145 }
7146 }
7147 else
7148 @@ -2836,18 +3044,25 @@ arm_type_of_stub (struct bfd_link_info *
7149 }
7150
7151 stub_type = (info->shared | globals->pic_veneer)
7152 + /* PIC stubs. */
7153 ? ((globals->use_blx)
7154 - ? arm_stub_pic_long_branch
7155 + /* V5T and above. */
7156 + ? arm_stub_long_branch_any_arm_pic
7157 + /* not yet supported on V4T. */
7158 : arm_stub_none)
7159 - : (globals->use_blx)
7160 - ? arm_stub_long_branch
7161 - : arm_thumb_arm_v4t_stub_long_branch;
7162 +
7163 + /* non-PIC stubs. */
7164 + : ((globals->use_blx)
7165 + /* V5T and above. */
7166 + ? arm_stub_long_branch_any_any
7167 + /* V4T. */
7168 + : arm_stub_long_branch_v4t_thumb_arm);
7169
7170 /* Handle v4t short branches. */
7171 - if ((stub_type == arm_thumb_arm_v4t_stub_long_branch)
7172 + if ((stub_type == arm_stub_long_branch_v4t_thumb_arm)
7173 && (branch_offset <= THM_MAX_FWD_BRANCH_OFFSET)
7174 && (branch_offset >= THM_MAX_BWD_BRANCH_OFFSET))
7175 - stub_type = arm_thumb_arm_v4t_stub_short_branch;
7176 + stub_type = arm_stub_short_branch_v4t_thumb_arm;
7177 }
7178 }
7179 }
7180 @@ -2863,7 +3078,7 @@ arm_type_of_stub (struct bfd_link_info *
7181 {
7182 (*_bfd_error_handler)
7183 (_("%B(%s): warning: interworking not enabled.\n"
7184 - " first occurrence: %B: Thumb call to ARM"),
7185 + " first occurrence: %B: ARM call to Thumb"),
7186 sym_sec->owner, input_bfd, name);
7187 }
7188
7189 @@ -2874,10 +3089,14 @@ arm_type_of_stub (struct bfd_link_info *
7190 || !globals->use_blx)
7191 {
7192 stub_type = (info->shared | globals->pic_veneer)
7193 - ? arm_stub_pic_long_branch
7194 - : (globals->use_blx)
7195 - ? arm_stub_long_branch
7196 - : arm_thumb_v4t_stub_long_branch;
7197 + /* PIC stubs. */
7198 + ? arm_stub_long_branch_any_thumb_pic
7199 + /* non-PIC stubs. */
7200 + : ((globals->use_blx)
7201 + /* V5T and above. */
7202 + ? arm_stub_long_branch_any_any
7203 + /* V4T. */
7204 + : arm_stub_long_branch_v4t_arm_thumb);
7205 }
7206 }
7207 else
7208 @@ -2887,8 +3106,10 @@ arm_type_of_stub (struct bfd_link_info *
7209 || (branch_offset < ARM_MAX_BWD_BRANCH_OFFSET))
7210 {
7211 stub_type = (info->shared | globals->pic_veneer)
7212 - ? arm_stub_pic_long_branch
7213 - : arm_stub_long_branch;
7214 + /* PIC stubs. */
7215 + ? arm_stub_long_branch_any_arm_pic
7216 + /* non-PIC stubs. */
7217 + : arm_stub_long_branch_any_any;
7218 }
7219 }
7220 }
7221 @@ -3064,10 +3285,16 @@ put_thumb_insn (struct elf32_arm_link_ha
7222 bfd_putb16 (val, ptr);
7223 }
7224
7225 +static bfd_reloc_status_type elf32_arm_final_link_relocate
7226 + (reloc_howto_type *, bfd *, bfd *, asection *, bfd_byte *,
7227 + Elf_Internal_Rela *, bfd_vma, struct bfd_link_info *, asection *,
7228 + const char *, int, struct elf_link_hash_entry *, bfd_boolean *, char **);
7229 +
7230 static bfd_boolean
7231 arm_build_one_stub (struct bfd_hash_entry *gen_entry,
7232 void * in_arg)
7233 {
7234 +#define MAXRELOCS 2
7235 struct elf32_arm_stub_hash_entry *stub_entry;
7236 struct bfd_link_info *info;
7237 struct elf32_arm_link_hash_table *htab;
7238 @@ -3078,9 +3305,12 @@ arm_build_one_stub (struct bfd_hash_entr
7239 bfd_vma sym_value;
7240 int template_size;
7241 int size;
7242 - const bfd_vma *template;
7243 + const insn_sequence *template;
7244 int i;
7245 struct elf32_arm_link_hash_table * globals;
7246 + int stub_reloc_idx[MAXRELOCS] = {-1, -1};
7247 + int stub_reloc_offset[MAXRELOCS] = {0, 0};
7248 + int nrelocs = 0;
7249
7250 /* Massage our args to the form they really have. */
7251 stub_entry = (struct elf32_arm_stub_hash_entry *) gen_entry;
7252 @@ -3106,102 +3336,229 @@ arm_build_one_stub (struct bfd_hash_entr
7253 + stub_entry->target_section->output_offset
7254 + stub_entry->target_section->output_section->vma);
7255
7256 - switch (stub_entry->stub_type)
7257 - {
7258 - case arm_stub_long_branch:
7259 - template = arm_long_branch_stub;
7260 - template_size = (sizeof (arm_long_branch_stub) / sizeof (bfd_vma)) * 4;
7261 - break;
7262 - case arm_thumb_v4t_stub_long_branch:
7263 - template = arm_thumb_v4t_long_branch_stub;
7264 - template_size = (sizeof (arm_thumb_v4t_long_branch_stub) / sizeof (bfd_vma)) * 4;
7265 - break;
7266 - case arm_thumb_thumb_stub_long_branch:
7267 - template = arm_thumb_thumb_long_branch_stub;
7268 - template_size = (sizeof (arm_thumb_thumb_long_branch_stub) / sizeof (bfd_vma)) * 4;
7269 - break;
7270 - case arm_thumb_arm_v4t_stub_long_branch:
7271 - template = arm_thumb_arm_v4t_long_branch_stub;
7272 - template_size = (sizeof (arm_thumb_arm_v4t_long_branch_stub) / sizeof (bfd_vma)) * 4;
7273 - break;
7274 - case arm_thumb_arm_v4t_stub_short_branch:
7275 - template = arm_thumb_arm_v4t_short_branch_stub;
7276 - template_size = (sizeof(arm_thumb_arm_v4t_short_branch_stub) / sizeof (bfd_vma)) * 4;
7277 - break;
7278 - case arm_stub_pic_long_branch:
7279 - template = arm_pic_long_branch_stub;
7280 - template_size = (sizeof (arm_pic_long_branch_stub) / sizeof (bfd_vma)) * 4;
7281 - break;
7282 - default:
7283 - BFD_FAIL ();
7284 - return FALSE;
7285 - }
7286 + template = stub_entry->stub_template;
7287 + template_size = stub_entry->stub_template_size;
7288
7289 size = 0;
7290 - for (i = 0; i < (template_size / 4); i++)
7291 + for (i = 0; i < template_size; i++)
7292 {
7293 - /* A 0 pattern is a placeholder, every other pattern is an
7294 - instruction. */
7295 - if (template[i] != 0)
7296 - put_arm_insn (globals, stub_bfd, template[i], loc + size);
7297 - else
7298 - bfd_put_32 (stub_bfd, template[i], loc + size);
7299 + switch (template[i].type)
7300 + {
7301 + case THUMB16_TYPE:
7302 + {
7303 + bfd_vma data = template[i].data;
7304 + if (template[i].reloc_addend != 0)
7305 + {
7306 + /* We've borrowed the reloc_addend field to mean we should
7307 + insert a condition code into this (Thumb-1 branch)
7308 + instruction. See THUMB16_BCOND_INSN. */
7309 + BFD_ASSERT ((data & 0xff00) == 0xd000);
7310 + data |= ((stub_entry->orig_insn >> 22) & 0xf) << 8;
7311 + }
7312 + put_thumb_insn (globals, stub_bfd, data, loc + size);
7313 + size += 2;
7314 + }
7315 + break;
7316 +
7317 + case THUMB32_TYPE:
7318 + put_thumb_insn (globals, stub_bfd, (template[i].data >> 16) & 0xffff,
7319 + loc + size);
7320 + put_thumb_insn (globals, stub_bfd, template[i].data & 0xffff,
7321 + loc + size + 2);
7322 + if (template[i].reloc_type != R_ARM_NONE)
7323 + {
7324 + stub_reloc_idx[nrelocs] = i;
7325 + stub_reloc_offset[nrelocs++] = size;
7326 + }
7327 + size += 4;
7328 + break;
7329 +
7330 + case ARM_TYPE:
7331 + put_arm_insn (globals, stub_bfd, template[i].data, loc + size);
7332 + /* Handle cases where the target is encoded within the
7333 + instruction. */
7334 + if (template[i].reloc_type == R_ARM_JUMP24)
7335 + {
7336 + stub_reloc_idx[nrelocs] = i;
7337 + stub_reloc_offset[nrelocs++] = size;
7338 + }
7339 + size += 4;
7340 + break;
7341 +
7342 + case DATA_TYPE:
7343 + bfd_put_32 (stub_bfd, template[i].data, loc + size);
7344 + stub_reloc_idx[nrelocs] = i;
7345 + stub_reloc_offset[nrelocs++] = size;
7346 + size += 4;
7347 + break;
7348
7349 - size += 4;
7350 + default:
7351 + BFD_FAIL ();
7352 + return FALSE;
7353 + }
7354 }
7355 +
7356 stub_sec->size += size;
7357
7358 + /* Stub size has already been computed in arm_size_one_stub. Check
7359 + consistency. */
7360 + BFD_ASSERT (size == stub_entry->stub_size);
7361 +
7362 /* Destination is Thumb. Force bit 0 to 1 to reflect this. */
7363 if (stub_entry->st_type == STT_ARM_TFUNC)
7364 sym_value |= 1;
7365
7366 - switch (stub_entry->stub_type)
7367 + /* Assume there is at least one and at most MAXRELOCS entries to relocate
7368 + in each stub. */
7369 + BFD_ASSERT (nrelocs != 0 && nrelocs <= MAXRELOCS);
7370 +
7371 + for (i = 0; i < nrelocs; i++)
7372 + if (template[stub_reloc_idx[i]].reloc_type == R_ARM_THM_JUMP24
7373 + || template[stub_reloc_idx[i]].reloc_type == R_ARM_THM_JUMP19
7374 + || template[stub_reloc_idx[i]].reloc_type == R_ARM_THM_CALL
7375 + || template[stub_reloc_idx[i]].reloc_type == R_ARM_THM_XPC22)
7376 + {
7377 + Elf_Internal_Rela rel;
7378 + bfd_boolean unresolved_reloc;
7379 + char *error_message;
7380 + int sym_flags
7381 + = (template[stub_reloc_idx[i]].reloc_type != R_ARM_THM_XPC22)
7382 + ? STT_ARM_TFUNC : 0;
7383 + bfd_vma points_to = sym_value + stub_entry->target_addend;
7384 +
7385 + rel.r_offset = stub_entry->stub_offset + stub_reloc_offset[i];
7386 + rel.r_info = ELF32_R_INFO (0, template[stub_reloc_idx[i]].reloc_type);
7387 + rel.r_addend = template[stub_reloc_idx[i]].reloc_addend;
7388 +
7389 + if (stub_entry->stub_type == arm_stub_a8_veneer_b_cond && i == 0)
7390 + /* The first relocation in the elf32_arm_stub_a8_veneer_b_cond[]
7391 + template should refer back to the instruction after the original
7392 + branch. */
7393 + points_to = sym_value;
7394 +
7395 + /* Note: _bfd_final_link_relocate doesn't handle these relocations
7396 + properly. We should probably use this function unconditionally,
7397 + rather than only for certain relocations listed in the enclosing
7398 + conditional. Attempt to avoid perturbing existing code too much
7399 + pending more testing. */
7400 + elf32_arm_final_link_relocate (elf32_arm_howto_from_type
7401 + (template[stub_reloc_idx[i]].reloc_type),
7402 + stub_bfd, info->output_bfd, stub_sec, stub_sec->contents, &rel,
7403 + points_to, info, stub_entry->target_section, "", sym_flags,
7404 + (struct elf_link_hash_entry *) stub_entry, &unresolved_reloc,
7405 + &error_message);
7406 + }
7407 + else
7408 + {
7409 + _bfd_final_link_relocate (elf32_arm_howto_from_type
7410 + (template[stub_reloc_idx[i]].reloc_type), stub_bfd, stub_sec,
7411 + stub_sec->contents, stub_entry->stub_offset + stub_reloc_offset[i],
7412 + sym_value + stub_entry->target_addend,
7413 + template[stub_reloc_idx[i]].reloc_addend);
7414 + }
7415 +
7416 + return TRUE;
7417 +#undef MAXRELOCS
7418 +}
7419 +
7420 +/* Calculate the template, template size and instruction size for a stub.
7421 + Return value is the instruction size. */
7422 +
7423 +static unsigned int
7424 +find_stub_size_and_template (enum elf32_arm_stub_type stub_type,
7425 + const insn_sequence **stub_template,
7426 + int *stub_template_size)
7427 +{
7428 + const insn_sequence *template = NULL;
7429 + int template_size = 0, i;
7430 + unsigned int size;
7431 +
7432 + switch (stub_type)
7433 {
7434 - case arm_stub_long_branch:
7435 - _bfd_final_link_relocate (elf32_arm_howto_from_type (R_ARM_ABS32),
7436 - stub_bfd, stub_sec, stub_sec->contents,
7437 - stub_entry->stub_offset + 4, sym_value, 0);
7438 + case arm_stub_long_branch_any_any:
7439 + template = elf32_arm_stub_long_branch_any_any;
7440 + template_size = sizeof (elf32_arm_stub_long_branch_any_any)
7441 + / sizeof (insn_sequence);
7442 break;
7443 - case arm_thumb_v4t_stub_long_branch:
7444 - _bfd_final_link_relocate (elf32_arm_howto_from_type (R_ARM_ABS32),
7445 - stub_bfd, stub_sec, stub_sec->contents,
7446 - stub_entry->stub_offset + 8, sym_value, 0);
7447 + case arm_stub_long_branch_v4t_arm_thumb:
7448 + template = elf32_arm_stub_long_branch_v4t_arm_thumb;
7449 + template_size = sizeof (elf32_arm_stub_long_branch_v4t_arm_thumb)
7450 + / sizeof (insn_sequence);
7451 break;
7452 - case arm_thumb_thumb_stub_long_branch:
7453 - _bfd_final_link_relocate (elf32_arm_howto_from_type (R_ARM_ABS32),
7454 - stub_bfd, stub_sec, stub_sec->contents,
7455 - stub_entry->stub_offset + 12, sym_value, 0);
7456 + case arm_stub_long_branch_thumb_only:
7457 + template = elf32_arm_stub_long_branch_thumb_only;
7458 + template_size = sizeof (elf32_arm_stub_long_branch_thumb_only)
7459 + / sizeof (insn_sequence);
7460 break;
7461 - case arm_thumb_arm_v4t_stub_long_branch:
7462 - _bfd_final_link_relocate (elf32_arm_howto_from_type (R_ARM_ABS32),
7463 - stub_bfd, stub_sec, stub_sec->contents,
7464 - stub_entry->stub_offset + 16, sym_value, 0);
7465 + case arm_stub_long_branch_v4t_thumb_arm:
7466 + template = elf32_arm_stub_long_branch_v4t_thumb_arm;
7467 + template_size = sizeof (elf32_arm_stub_long_branch_v4t_thumb_arm)
7468 + / sizeof (insn_sequence);
7469 break;
7470 - case arm_thumb_arm_v4t_stub_short_branch:
7471 - {
7472 - long int rel_offset;
7473 - static const insn32 t2a3_b_insn = 0xea000000;
7474 -
7475 - rel_offset = sym_value - (stub_addr + 8 + 4);
7476 -
7477 - put_arm_insn (globals, stub_bfd,
7478 - (bfd_vma) t2a3_b_insn | ((rel_offset >> 2) & 0x00FFFFFF),
7479 - loc + 4);
7480 - }
7481 + case arm_stub_short_branch_v4t_thumb_arm:
7482 + template = elf32_arm_stub_short_branch_v4t_thumb_arm;
7483 + template_size = sizeof (elf32_arm_stub_short_branch_v4t_thumb_arm)
7484 + / sizeof (insn_sequence);
7485 break;
7486 -
7487 - case arm_stub_pic_long_branch:
7488 - /* We want the value relative to the address 8 bytes from the
7489 - start of the stub. */
7490 - _bfd_final_link_relocate (elf32_arm_howto_from_type (R_ARM_REL32),
7491 - stub_bfd, stub_sec, stub_sec->contents,
7492 - stub_entry->stub_offset + 8, sym_value, 0);
7493 + case arm_stub_long_branch_any_arm_pic:
7494 + template = elf32_arm_stub_long_branch_any_arm_pic;
7495 + template_size = sizeof (elf32_arm_stub_long_branch_any_arm_pic)
7496 + / sizeof (insn_sequence);
7497 break;
7498 - default:
7499 + case arm_stub_long_branch_any_thumb_pic:
7500 + template = elf32_arm_stub_long_branch_any_thumb_pic;
7501 + template_size = sizeof (elf32_arm_stub_long_branch_any_thumb_pic)
7502 + / sizeof (insn_sequence);
7503 break;
7504 + case arm_stub_a8_veneer_b_cond:
7505 + template = elf32_arm_stub_a8_veneer_b_cond;
7506 + template_size = sizeof (elf32_arm_stub_a8_veneer_b_cond)
7507 + / sizeof (insn_sequence);
7508 + break;
7509 + case arm_stub_a8_veneer_b:
7510 + case arm_stub_a8_veneer_bl:
7511 + template = elf32_arm_stub_a8_veneer_b;
7512 + template_size = sizeof (elf32_arm_stub_a8_veneer_b)
7513 + / sizeof (insn_sequence);
7514 + break;
7515 + case arm_stub_a8_veneer_blx:
7516 + template = elf32_arm_stub_a8_veneer_blx;
7517 + template_size = sizeof (elf32_arm_stub_a8_veneer_blx)
7518 + / sizeof (insn_sequence);
7519 + break;
7520 + default:
7521 + BFD_FAIL ();
7522 + return 0;
7523 }
7524
7525 - return TRUE;
7526 + size = 0;
7527 + for (i = 0; i < template_size; i++)
7528 + {
7529 + switch (template[i].type)
7530 + {
7531 + case THUMB16_TYPE:
7532 + size += 2;
7533 + break;
7534 +
7535 + case ARM_TYPE:
7536 + case THUMB32_TYPE:
7537 + case DATA_TYPE:
7538 + size += 4;
7539 + break;
7540 +
7541 + default:
7542 + BFD_FAIL ();
7543 + return 0;
7544 + }
7545 + }
7546 +
7547 + if (stub_template)
7548 + *stub_template = template;
7549 +
7550 + if (stub_template_size)
7551 + *stub_template_size = template_size;
7552 +
7553 + return size;
7554 }
7555
7556 /* As above, but don't actually build the stub. Just bump offset so
7557 @@ -3213,52 +3570,24 @@ arm_size_one_stub (struct bfd_hash_entry
7558 {
7559 struct elf32_arm_stub_hash_entry *stub_entry;
7560 struct elf32_arm_link_hash_table *htab;
7561 - const bfd_vma *template;
7562 + const insn_sequence *template;
7563 int template_size;
7564 int size;
7565 - int i;
7566
7567 /* Massage our args to the form they really have. */
7568 stub_entry = (struct elf32_arm_stub_hash_entry *) gen_entry;
7569 htab = (struct elf32_arm_link_hash_table *) in_arg;
7570
7571 - switch (stub_entry->stub_type)
7572 - {
7573 - case arm_stub_long_branch:
7574 - template = arm_long_branch_stub;
7575 - template_size = (sizeof (arm_long_branch_stub) / sizeof (bfd_vma)) * 4;
7576 - break;
7577 - case arm_thumb_v4t_stub_long_branch:
7578 - template = arm_thumb_v4t_long_branch_stub;
7579 - template_size = (sizeof (arm_thumb_v4t_long_branch_stub) / sizeof (bfd_vma)) * 4;
7580 - break;
7581 - case arm_thumb_thumb_stub_long_branch:
7582 - template = arm_thumb_thumb_long_branch_stub;
7583 - template_size = (sizeof (arm_thumb_thumb_long_branch_stub) / sizeof (bfd_vma)) * 4;
7584 - break;
7585 - case arm_thumb_arm_v4t_stub_long_branch:
7586 - template = arm_thumb_arm_v4t_long_branch_stub;
7587 - template_size = (sizeof (arm_thumb_arm_v4t_long_branch_stub) / sizeof (bfd_vma)) * 4;
7588 - break;
7589 - case arm_thumb_arm_v4t_stub_short_branch:
7590 - template = arm_thumb_arm_v4t_short_branch_stub;
7591 - template_size = (sizeof(arm_thumb_arm_v4t_short_branch_stub) / sizeof (bfd_vma)) * 4;
7592 - break;
7593 - case arm_stub_pic_long_branch:
7594 - template = arm_pic_long_branch_stub;
7595 - template_size = (sizeof (arm_pic_long_branch_stub) / sizeof (bfd_vma)) * 4;
7596 - break;
7597 - default:
7598 - BFD_FAIL ();
7599 - return FALSE;
7600 - break;
7601 - }
7602 + size = find_stub_size_and_template (stub_entry->stub_type, &template,
7603 + &template_size);
7604 +
7605 + stub_entry->stub_size = size;
7606 + stub_entry->stub_template = template;
7607 + stub_entry->stub_template_size = template_size;
7608
7609 - size = 0;
7610 - for (i = 0; i < (template_size / 4); i++)
7611 - size += 4;
7612 size = (size + 7) & ~7;
7613 stub_entry->stub_sec->size += size;
7614 +
7615 return TRUE;
7616 }
7617
7618 @@ -3355,12 +3684,12 @@ elf32_arm_next_input_section (struct bfd
7619 {
7620 asection **list = htab->input_list + isec->output_section->index;
7621
7622 - if (*list != bfd_abs_section_ptr)
7623 + if (*list != bfd_abs_section_ptr && (isec->flags & SEC_CODE) != 0)
7624 {
7625 /* Steal the link_sec pointer for our list. */
7626 #define PREV_SEC(sec) (htab->stub_group[(sec)->id].link_sec)
7627 /* This happens to make the list in reverse order,
7628 - which is what we want. */
7629 + which we reverse later. */
7630 PREV_SEC (isec) = *list;
7631 *list = isec;
7632 }
7633 @@ -3369,7 +3698,7 @@ elf32_arm_next_input_section (struct bfd
7634
7635 /* See whether we can group stub sections together. Grouping stub
7636 sections may result in fewer stubs. More importantly, we need to
7637 - put all .init* and .fini* stubs at the beginning of the .init or
7638 + put all .init* and .fini* stubs at the end of the .init or
7639 .fini output sections respectively, because glibc splits the
7640 _init and _fini functions into multiple parts. Putting a stub in
7641 the middle of a function is not a good idea. */
7642 @@ -3377,68 +3706,104 @@ elf32_arm_next_input_section (struct bfd
7643 static void
7644 group_sections (struct elf32_arm_link_hash_table *htab,
7645 bfd_size_type stub_group_size,
7646 - bfd_boolean stubs_always_before_branch)
7647 + bfd_boolean stubs_always_after_branch)
7648 {
7649 - asection **list = htab->input_list + htab->top_index;
7650 + asection **list = htab->input_list;
7651
7652 do
7653 {
7654 asection *tail = *list;
7655 + asection *head;
7656 + asection *tp;
7657
7658 if (tail == bfd_abs_section_ptr)
7659 continue;
7660
7661 - while (tail != NULL)
7662 + /* Reverse the list: we must avoid placing stubs at the
7663 + beginning of the section because the beginning of the text
7664 + section may be required for an interrupt vector in bare metal
7665 + code. */
7666 +#define NEXT_SEC PREV_SEC
7667 + head = tail;
7668 + tp = NULL;
7669 + while (head != NULL)
7670 + {
7671 + asection *h = PREV_SEC (head);
7672 + NEXT_SEC (head) = tp;
7673 + if (h == NULL)
7674 + break;
7675 + tp = head;
7676 + head = h;
7677 + }
7678 +
7679 + while (head != NULL)
7680 {
7681 asection *curr;
7682 - asection *prev;
7683 + asection *next;
7684 bfd_size_type total;
7685
7686 - curr = tail;
7687 - total = tail->size;
7688 - while ((prev = PREV_SEC (curr)) != NULL
7689 - && ((total += curr->output_offset - prev->output_offset)
7690 + curr = head;
7691 + total = head->size;
7692 + while ((next = NEXT_SEC (curr)) != NULL
7693 + && ((total += next->output_offset - curr->output_offset)
7694 < stub_group_size))
7695 - curr = prev;
7696 + curr = next;
7697
7698 - /* OK, the size from the start of CURR to the end is less
7699 + /* OK, the size from the start to the start of CURR is less
7700 than stub_group_size and thus can be handled by one stub
7701 - section. (Or the tail section is itself larger than
7702 + section. (Or the head section is itself larger than
7703 stub_group_size, in which case we may be toast.)
7704 We should really be keeping track of the total size of
7705 stubs added here, as stubs contribute to the final output
7706 section size. */
7707 do
7708 {
7709 - prev = PREV_SEC (tail);
7710 + next = NEXT_SEC (head);
7711 /* Set up this stub group. */
7712 - htab->stub_group[tail->id].link_sec = curr;
7713 + htab->stub_group[head->id].link_sec = curr;
7714 }
7715 - while (tail != curr && (tail = prev) != NULL);
7716 + while (head != curr && (head = next) != NULL);
7717
7718 /* But wait, there's more! Input sections up to stub_group_size
7719 - bytes before the stub section can be handled by it too. */
7720 - if (!stubs_always_before_branch)
7721 + bytes after the stub section can be handled by it too. */
7722 + if (!stubs_always_after_branch)
7723 {
7724 total = 0;
7725 - while (prev != NULL
7726 - && ((total += tail->output_offset - prev->output_offset)
7727 + while (next != NULL
7728 + && ((total += next->output_offset - head->output_offset)
7729 < stub_group_size))
7730 {
7731 - tail = prev;
7732 - prev = PREV_SEC (tail);
7733 - htab->stub_group[tail->id].link_sec = curr;
7734 + head = next;
7735 + next = NEXT_SEC (head);
7736 + htab->stub_group[head->id].link_sec = curr;
7737 }
7738 }
7739 - tail = prev;
7740 + head = next;
7741 }
7742 }
7743 - while (list-- != htab->input_list);
7744 + while (list++ != htab->input_list + htab->top_index);
7745
7746 free (htab->input_list);
7747 #undef PREV_SEC
7748 +#undef NEXT_SEC
7749 +}
7750 +
7751 +static int
7752 +a8_reloc_compare (const void *a, const void *b)
7753 +{
7754 + const struct a8_erratum_reloc *ra = a, *rb = b;
7755 +
7756 + if (ra->from < rb->from)
7757 + return -1;
7758 + else if (ra->from > rb->from)
7759 + return 1;
7760 + else
7761 + return 0;
7762 }
7763
7764 +static struct elf_link_hash_entry *find_thumb_glue (struct bfd_link_info *,
7765 + const char *, char **);
7766 +
7767 /* Determine and set the size of the stub section for a final link.
7768
7769 The basic idea here is to examine all the relocations looking for
7770 @@ -3454,9 +3819,22 @@ elf32_arm_size_stubs (bfd *output_bfd,
7771 void (*layout_sections_again) (void))
7772 {
7773 bfd_size_type stub_group_size;
7774 - bfd_boolean stubs_always_before_branch;
7775 + bfd_boolean stubs_always_after_branch;
7776 bfd_boolean stub_changed = 0;
7777 struct elf32_arm_link_hash_table *htab = elf32_arm_hash_table (info);
7778 + struct a8_erratum_fix *a8_fixes = NULL;
7779 + unsigned int num_a8_fixes = 0, prev_num_a8_fixes = 0, a8_fix_table_size = 10;
7780 + struct a8_erratum_reloc *a8_relocs = NULL;
7781 + unsigned int num_a8_relocs = 0, a8_reloc_table_size = 10;
7782 + unsigned int i;
7783 +
7784 + if (htab->fix_cortex_a8)
7785 + {
7786 + a8_fixes = bfd_zmalloc (sizeof (struct a8_erratum_fix)
7787 + * a8_fix_table_size);
7788 + a8_relocs = bfd_zmalloc (sizeof (struct a8_erratum_reloc)
7789 + * a8_reloc_table_size);
7790 + }
7791
7792 /* Propagate mach to stub bfd, because it may not have been
7793 finalized when we created stub_bfd. */
7794 @@ -3467,7 +3845,14 @@ elf32_arm_size_stubs (bfd *output_bfd,
7795 htab->stub_bfd = stub_bfd;
7796 htab->add_stub_section = add_stub_section;
7797 htab->layout_sections_again = layout_sections_again;
7798 - stubs_always_before_branch = group_size < 0;
7799 + stubs_always_after_branch = group_size < 0;
7800 +
7801 + /* The Cortex-A8 erratum fix depends on stubs not being in the same 4K page
7802 + as the first half of a 32-bit branch straddling two 4K pages. This is a
7803 + crude way of enforcing that. */
7804 + if (htab->fix_cortex_a8)
7805 + stubs_always_after_branch = 1;
7806 +
7807 if (group_size < 0)
7808 stub_group_size = -group_size;
7809 else
7810 @@ -3487,13 +3872,16 @@ elf32_arm_size_stubs (bfd *output_bfd,
7811 stub_group_size = 4170000;
7812 }
7813
7814 - group_sections (htab, stub_group_size, stubs_always_before_branch);
7815 + group_sections (htab, stub_group_size, stubs_always_after_branch);
7816
7817 while (1)
7818 {
7819 bfd *input_bfd;
7820 unsigned int bfd_indx;
7821 asection *stub_sec;
7822 + unsigned int i;
7823 +
7824 + num_a8_fixes = 0;
7825
7826 for (input_bfd = info->input_bfds, bfd_indx = 0;
7827 input_bfd != NULL;
7828 @@ -3503,6 +3891,8 @@ elf32_arm_size_stubs (bfd *output_bfd,
7829 asection *section;
7830 Elf_Internal_Sym *local_syms = NULL;
7831
7832 + num_a8_relocs = 0;
7833 +
7834 /* We'll need the symbol table in a second. */
7835 symtab_hdr = &elf_tdata (input_bfd)->symtab_hdr;
7836 if (symtab_hdr->sh_info == 0)
7837 @@ -3551,6 +3941,7 @@ elf32_arm_size_stubs (bfd *output_bfd,
7838 char *stub_name;
7839 const asection *id_sec;
7840 unsigned char st_type;
7841 + bfd_boolean created_stub = FALSE;
7842
7843 r_type = ELF32_R_TYPE (irela->r_info);
7844 r_indx = ELF32_R_SYM (irela->r_info);
7845 @@ -3564,9 +3955,14 @@ elf32_arm_size_stubs (bfd *output_bfd,
7846 goto error_ret_free_local;
7847 }
7848
7849 - /* Only look for stubs on call instructions. */
7850 - if ((r_type != (unsigned int) R_ARM_CALL)
7851 - && (r_type != (unsigned int) R_ARM_THM_CALL))
7852 + /* Only look for stubs on call or Thumb-2 call/branch
7853 + instructions. */
7854 + if (r_type != (unsigned int) R_ARM_CALL
7855 + && r_type != (unsigned int) R_ARM_THM_CALL
7856 + && r_type != (unsigned int) R_ARM_THM_JUMP24
7857 + && r_type != (unsigned int) R_ARM_THM_JUMP19
7858 + && r_type != (unsigned int) R_ARM_THM_CALL
7859 + && r_type != (unsigned int) R_ARM_THM_XPC22)
7860 continue;
7861
7862 /* Now determine the call target, its name, value,
7863 @@ -3648,79 +4044,393 @@ elf32_arm_size_stubs (bfd *output_bfd,
7864 sym_name = hash->root.root.root.string;
7865 }
7866
7867 - /* Determine what (if any) linker stub is needed. */
7868 - stub_type = arm_type_of_stub (info, section, irela, st_type,
7869 - hash, destination, sym_sec,
7870 - input_bfd, sym_name);
7871 - if (stub_type == arm_stub_none)
7872 - continue;
7873 + /* Only look for stubs on call instructions. */
7874 + if (r_type == (unsigned int) R_ARM_CALL
7875 + || r_type == (unsigned int) R_ARM_THM_CALL)
7876 + do
7877 + {
7878 + /* Determine what (if any) linker stub is needed. */
7879 + stub_type = arm_type_of_stub (info, section, irela,
7880 + st_type, hash,
7881 + destination, sym_sec,
7882 + input_bfd, sym_name);
7883 + if (stub_type == arm_stub_none)
7884 + break;
7885 +
7886 + /* Support for grouping stub sections. */
7887 + id_sec = htab->stub_group[section->id].link_sec;
7888 +
7889 + /* Get the name of this stub. */
7890 + stub_name = elf32_arm_stub_name (id_sec, sym_sec, hash,
7891 + irela);
7892 + if (!stub_name)
7893 + goto error_ret_free_internal;
7894
7895 - /* Support for grouping stub sections. */
7896 - id_sec = htab->stub_group[section->id].link_sec;
7897 + /* We've either created a stub for this reloc already,
7898 + or we are about to. */
7899 + created_stub = TRUE;
7900 +
7901 + stub_entry = arm_stub_hash_lookup
7902 + (&htab->stub_hash_table, stub_name,
7903 + FALSE, FALSE);
7904 + if (stub_entry != NULL)
7905 + {
7906 + /* The proper stub has already been created. */
7907 + free (stub_name);
7908 + break;
7909 + }
7910 +
7911 + stub_entry = elf32_arm_add_stub (stub_name, section,
7912 + htab);
7913 + if (stub_entry == NULL)
7914 + {
7915 + free (stub_name);
7916 + goto error_ret_free_internal;
7917 + }
7918
7919 - /* Get the name of this stub. */
7920 - stub_name = elf32_arm_stub_name (id_sec, sym_sec, hash, irela);
7921 - if (!stub_name)
7922 - goto error_ret_free_internal;
7923 -
7924 - stub_entry = arm_stub_hash_lookup (&htab->stub_hash_table,
7925 - stub_name,
7926 - FALSE, FALSE);
7927 - if (stub_entry != NULL)
7928 - {
7929 - /* The proper stub has already been created. */
7930 - free (stub_name);
7931 - continue;
7932 - }
7933 + stub_entry->target_value = sym_value;
7934 + stub_entry->target_section = sym_sec;
7935 + stub_entry->stub_type = stub_type;
7936 + stub_entry->h = hash;
7937 + stub_entry->st_type = st_type;
7938 +
7939 + if (sym_name == NULL)
7940 + sym_name = "unnamed";
7941 + stub_entry->output_name
7942 + = bfd_alloc (htab->stub_bfd,
7943 + sizeof (THUMB2ARM_GLUE_ENTRY_NAME)
7944 + + strlen (sym_name));
7945 + if (stub_entry->output_name == NULL)
7946 + {
7947 + free (stub_name);
7948 + goto error_ret_free_internal;
7949 + }
7950
7951 - stub_entry = elf32_arm_add_stub (stub_name, section, htab);
7952 - if (stub_entry == NULL)
7953 - {
7954 - free (stub_name);
7955 - goto error_ret_free_internal;
7956 - }
7957 + /* For historical reasons, use the existing names for
7958 + ARM-to-Thumb and Thumb-to-ARM stubs. */
7959 + if (r_type == (unsigned int) R_ARM_THM_CALL
7960 + && st_type != STT_ARM_TFUNC)
7961 + sprintf (stub_entry->output_name,
7962 + THUMB2ARM_GLUE_ENTRY_NAME, sym_name);
7963 + else if (r_type == (unsigned int) R_ARM_CALL
7964 + && st_type == STT_ARM_TFUNC)
7965 + sprintf (stub_entry->output_name,
7966 + ARM2THUMB_GLUE_ENTRY_NAME, sym_name);
7967 + else
7968 + sprintf (stub_entry->output_name, STUB_ENTRY_NAME,
7969 + sym_name);
7970
7971 - stub_entry->target_value = sym_value;
7972 - stub_entry->target_section = sym_sec;
7973 - stub_entry->stub_type = stub_type;
7974 - stub_entry->h = hash;
7975 - stub_entry->st_type = st_type;
7976 -
7977 - if (sym_name == NULL)
7978 - sym_name = "unnamed";
7979 - stub_entry->output_name
7980 - = bfd_alloc (htab->stub_bfd,
7981 - sizeof (THUMB2ARM_GLUE_ENTRY_NAME)
7982 - + strlen (sym_name));
7983 - if (stub_entry->output_name == NULL)
7984 + stub_changed = TRUE;
7985 + }
7986 + while (0);
7987 +
7988 + /* Look for relocations which might trigger Cortex-A8
7989 + erratum. */
7990 + if (htab->fix_cortex_a8
7991 + && (r_type == (unsigned int) R_ARM_THM_JUMP24
7992 + || r_type == (unsigned int) R_ARM_THM_JUMP19
7993 + || r_type == (unsigned int) R_ARM_THM_CALL
7994 + || r_type == (unsigned int) R_ARM_THM_XPC22))
7995 {
7996 - free (stub_name);
7997 - goto error_ret_free_internal;
7998 + bfd_vma from = section->output_section->vma
7999 + + section->output_offset
8000 + + irela->r_offset;
8001 +
8002 + if ((from & 0xfff) == 0xffe)
8003 + {
8004 + /* Found a candidate. Note we haven't checked the
8005 + destination is within 4K here: if we do so (and
8006 + don't create an entry in a8_relocs) we can't tell
8007 + that a branch should have been relocated when
8008 + scanning later. */
8009 + if (num_a8_relocs == a8_reloc_table_size)
8010 + {
8011 + a8_reloc_table_size *= 2;
8012 + a8_relocs = bfd_realloc (a8_relocs,
8013 + sizeof (struct a8_erratum_reloc)
8014 + * a8_reloc_table_size);
8015 + }
8016 +
8017 + a8_relocs[num_a8_relocs].from = from;
8018 + a8_relocs[num_a8_relocs].destination = destination;
8019 + a8_relocs[num_a8_relocs].r_type = r_type;
8020 + a8_relocs[num_a8_relocs].st_type = st_type;
8021 + a8_relocs[num_a8_relocs].sym_name = sym_name;
8022 + a8_relocs[num_a8_relocs].non_a8_stub = created_stub;
8023 +
8024 + num_a8_relocs++;
8025 + }
8026 }
8027 -
8028 - /* For historical reasons, use the existing names for
8029 - ARM-to-Thumb and Thumb-to-ARM stubs. */
8030 - if (r_type == (unsigned int) R_ARM_THM_CALL
8031 - && st_type != STT_ARM_TFUNC)
8032 - sprintf (stub_entry->output_name, THUMB2ARM_GLUE_ENTRY_NAME,
8033 - sym_name);
8034 - else if (r_type == (unsigned int) R_ARM_CALL
8035 - && st_type == STT_ARM_TFUNC)
8036 - sprintf (stub_entry->output_name, ARM2THUMB_GLUE_ENTRY_NAME,
8037 - sym_name);
8038 - else
8039 - sprintf (stub_entry->output_name, STUB_ENTRY_NAME,
8040 - sym_name);
8041 -
8042 - stub_changed = TRUE;
8043 }
8044
8045 /* We're done with the internal relocs, free them. */
8046 if (elf_section_data (section)->relocs == NULL)
8047 free (internal_relocs);
8048 }
8049 +
8050 + if (!htab->fix_cortex_a8)
8051 + continue;
8052 +
8053 + /* Sort relocs which might apply to Cortex-A8 erratum. */
8054 + qsort (a8_relocs, num_a8_relocs, sizeof (struct a8_erratum_reloc),
8055 + &a8_reloc_compare);
8056 +
8057 + /* Scan for branches which might trigger Cortex-A8 erratum. */
8058 + for (section = input_bfd->sections;
8059 + section != NULL;
8060 + section = section->next)
8061 + {
8062 + bfd_byte *contents = NULL;
8063 + struct _arm_elf_section_data *sec_data;
8064 + unsigned int span;
8065 + bfd_vma base_vma;
8066 +
8067 + if (elf_section_type (section) != SHT_PROGBITS
8068 + || (elf_section_flags (section) & SHF_EXECINSTR) == 0
8069 + || (section->flags & SEC_EXCLUDE) != 0
8070 + || (section->sec_info_type == ELF_INFO_TYPE_JUST_SYMS)
8071 + || (section->output_section == bfd_abs_section_ptr))
8072 + continue;
8073 +
8074 + base_vma = section->output_section->vma
8075 + + section->output_offset;
8076 +
8077 + if (elf_section_data (section)->this_hdr.contents != NULL)
8078 + contents = elf_section_data (section)->this_hdr.contents;
8079 + else if (! bfd_malloc_and_get_section (input_bfd, section,
8080 + &contents))
8081 + goto error_ret_free_local;
8082 +
8083 + sec_data = elf32_arm_section_data (section);
8084 +
8085 + for (span = 0; span < sec_data->mapcount; span++)
8086 + {
8087 + unsigned int span_start = sec_data->map[span].vma;
8088 + unsigned int span_end = (span == sec_data->mapcount - 1)
8089 + ? section->size : sec_data->map[span + 1].vma;
8090 + unsigned int i;
8091 + char span_type = sec_data->map[span].type;
8092 + bfd_boolean last_was_32bit = FALSE;
8093 +
8094 + if (span_type != 't')
8095 + continue;
8096 +
8097 + /* Span is entirely within a single 4KB region: skip
8098 + scanning. */
8099 + if (((base_vma + span_start) & ~0xfff)
8100 + == ((base_vma + span_end) & ~0xfff))
8101 + continue;
8102 +
8103 + /* Scan for 32-bit Thumb-2 branches which span two 4K
8104 + regions, where:
8105 +
8106 + * The opcode is BLX.W, BL.W, B.W, Bcc.W
8107 + * The branch target is in the same 4KB region as the
8108 + first half of the branch.
8109 + * The instruction before the branch is a 32-bit
8110 + length non-branch instruction.
8111 + */
8112 +
8113 + for (i = span_start; i < span_end;)
8114 + {
8115 + unsigned int insn = bfd_getl16 (&contents[i]);
8116 + bfd_boolean insn_32bit = FALSE;
8117 +
8118 + if ((insn & 0xe000) == 0xe000
8119 + && (insn & 0x1800) != 0x0000)
8120 + insn_32bit = TRUE;
8121 +
8122 + if (((base_vma + i) & 0xfff) == 0xffe
8123 + && insn_32bit && last_was_32bit)
8124 + {
8125 + bfd_vma offset;
8126 + bfd_boolean is_blx = FALSE, is_b = FALSE;
8127 + bfd_boolean is_bl = FALSE, force_target_arm = FALSE;
8128 + bfd_boolean force_target_thumb = FALSE;
8129 + bfd_vma target;
8130 + enum elf32_arm_stub_type stub_type = arm_stub_none;
8131 + struct a8_erratum_reloc key, *found;
8132 +
8133 + key.from = base_vma + i;
8134 + found = bsearch (&key, a8_relocs, num_a8_relocs,
8135 + sizeof (struct a8_erratum_reloc),
8136 + &a8_reloc_compare);
8137 +
8138 + if (found)
8139 + {
8140 + char *error_message = NULL;
8141 + struct elf_link_hash_entry *entry;
8142 +
8143 + /* We don't care about the error returned from
8144 + this function, only if there is glue or
8145 + not. */
8146 + entry = find_thumb_glue (info, found->sym_name,
8147 + &error_message);
8148 +
8149 + if (entry)
8150 + found->non_a8_stub = TRUE;
8151 +
8152 + if (found->r_type == R_ARM_THM_CALL
8153 + && found->st_type != STT_ARM_TFUNC)
8154 + force_target_arm = TRUE;
8155 + else if (found->r_type == R_ARM_THM_CALL
8156 + && found->st_type == STT_ARM_TFUNC)
8157 + force_target_thumb = TRUE;
8158 + }
8159 +
8160 + /* Load the rest of the insn (in manual-friendly
8161 + order). */
8162 + insn = (insn << 16)
8163 + | bfd_getl16 (&contents[i + 2]);
8164 +
8165 + /* Check if we have an offending branch
8166 + instruction. */
8167 +
8168 + /* Encoding T4: B<c>.W. */
8169 + is_b = (insn & 0xf800d000) == 0xf0009000;
8170 + /* Encoding T1: BL<c>.W. */
8171 + is_bl = (insn & 0xf800d000) == 0xf000d000;
8172 + /* Encoding T2: BLX<c>.W. */
8173 + is_blx = (insn & 0xf800d000) == 0xf000c000;
8174 +
8175 + if (found && found->non_a8_stub)
8176 + /* We've already made a stub for this instruction,
8177 + e.g. it's a long branch or a Thumb->ARM stub.
8178 + Assume that stub will suffice to work around the
8179 + A8 erratum (see setting of always_after_branch
8180 + above). */
8181 + ;
8182 + else if ((insn & 0xf800d000) == 0xf0008000
8183 + && (insn & 0x07f00000) != 0x03800000)
8184 + {
8185 + /* Encoding T3: B<c>.W (not permitted in IT
8186 + block). */
8187 + offset = (insn & 0x7ff) << 1;
8188 + offset |= (insn & 0x3f0000) >> 4;
8189 + offset |= (insn & 0x2000) ? 0x40000 : 0;
8190 + offset |= (insn & 0x800) ? 0x80000 : 0;
8191 + offset |= (insn & 0x4000000) ? 0x100000 : 0;
8192 + if (offset & 0x100000)
8193 + offset |= ~0xfffff;
8194 + stub_type = arm_stub_a8_veneer_b_cond;
8195 + }
8196 + else if (is_b || is_bl || is_blx)
8197 + {
8198 + int s = (insn & 0x4000000) != 0;
8199 + int j1 = (insn & 0x2000) != 0;
8200 + int j2 = (insn & 0x800) != 0;
8201 + int i1 = !(j1 ^ s);
8202 + int i2 = !(j2 ^ s);
8203 +
8204 + offset = (insn & 0x7ff) << 1;
8205 + offset |= (insn & 0x3ff0000) >> 4;
8206 + offset |= i2 << 22;
8207 + offset |= i1 << 23;
8208 + offset |= s << 24;
8209 + if (offset & 0x1000000)
8210 + offset |= ~0xffffff;
8211 +
8212 + if (is_blx)
8213 + offset &= ~3u;
8214 +
8215 + stub_type = is_blx ? arm_stub_a8_veneer_blx :
8216 + is_bl ? arm_stub_a8_veneer_bl :
8217 + arm_stub_a8_veneer_b;
8218 + }
8219 +
8220 + if (stub_type != arm_stub_none)
8221 + {
8222 + bfd_vma pc_for_insn = base_vma + i + 4;
8223 +
8224 + /* The original instruction is a BL, but the
8225 + target is an ARM instruction. If we were not
8226 + making a stub, the BL would have been
8227 + converted to a BLX. Use the BLX stub instead
8228 + in that case. */
8229 + if (htab->use_blx && force_target_arm
8230 + && stub_type == arm_stub_a8_veneer_bl)
8231 + {
8232 + stub_type = arm_stub_a8_veneer_blx;
8233 + is_blx = TRUE;
8234 + is_bl = FALSE;
8235 + }
8236 + /* Conversely, if the original instruction was
8237 + BLX but the target is Thumb mode, use the BL
8238 + stub. */
8239 + else if (force_target_thumb
8240 + && stub_type == arm_stub_a8_veneer_blx)
8241 + {
8242 + stub_type = arm_stub_a8_veneer_bl;
8243 + is_blx = FALSE;
8244 + is_bl = TRUE;
8245 + }
8246 +
8247 + if (is_blx)
8248 + pc_for_insn &= ~3u;
8249 +
8250 + /* If we found a relocation, use the proper
8251 + destination, not the offset in the
8252 + (unrelocated) instruction. Note this is
8253 + always done if we switched the stub type
8254 + above. */
8255 + if (found)
8256 + offset = found->destination - pc_for_insn;
8257 +
8258 + target = pc_for_insn + offset;
8259 +
8260 + /* The BLX stub is ARM-mode code. Adjust the
8261 + offset to take the different PC value (+8
8262 + instead of +4) into account. */
8263 + if (stub_type == arm_stub_a8_veneer_blx)
8264 + offset += 4;
8265 +
8266 + if (((base_vma + i) & ~0xfff)
8267 + == (target & ~0xfff))
8268 + {
8269 + char *stub_name;
8270 +
8271 + if (num_a8_fixes == a8_fix_table_size)
8272 + {
8273 + a8_fix_table_size *= 2;
8274 + a8_fixes = bfd_realloc (a8_fixes,
8275 + sizeof (struct a8_erratum_fix)
8276 + * a8_fix_table_size);
8277 + }
8278 +
8279 + stub_name = bfd_malloc (8 + 1 + 8 + 1);
8280 + if (stub_name != NULL)
8281 + sprintf (stub_name, "%x:%x",
8282 + section->id, i);
8283 +
8284 + a8_fixes[num_a8_fixes].input_bfd
8285 + = input_bfd;
8286 + a8_fixes[num_a8_fixes].section = section;
8287 + a8_fixes[num_a8_fixes].offset = i;
8288 + a8_fixes[num_a8_fixes].addend = offset;
8289 + a8_fixes[num_a8_fixes].orig_insn = insn;
8290 + a8_fixes[num_a8_fixes].stub_name
8291 + = stub_name;
8292 + a8_fixes[num_a8_fixes].stub_type
8293 + = stub_type;
8294 +
8295 + num_a8_fixes++;
8296 + }
8297 + }
8298 + }
8299 +
8300 + i += insn_32bit ? 4 : 2;
8301 + last_was_32bit = insn_32bit;
8302 + }
8303 + }
8304 +
8305 + if (elf_section_data (section)->this_hdr.contents == NULL)
8306 + free (contents);
8307 + }
8308 }
8309
8310 + if (htab->fix_cortex_a8 && num_a8_fixes != prev_num_a8_fixes)
8311 + stub_changed = TRUE;
8312 +
8313 if (!stub_changed)
8314 break;
8315
8316 @@ -3729,13 +4439,113 @@ elf32_arm_size_stubs (bfd *output_bfd,
8317 for (stub_sec = htab->stub_bfd->sections;
8318 stub_sec != NULL;
8319 stub_sec = stub_sec->next)
8320 - stub_sec->size = 0;
8321 + {
8322 + /* Ignore non-stub sections. */
8323 + if (!strstr (stub_sec->name, STUB_SUFFIX))
8324 + continue;
8325 +
8326 + stub_sec->size = 0;
8327 + }
8328
8329 bfd_hash_traverse (&htab->stub_hash_table, arm_size_one_stub, htab);
8330
8331 + /* Add Cortex-A8 erratum veneers to stub section sizes too. */
8332 + if (htab->fix_cortex_a8)
8333 + for (i = 0; i < num_a8_fixes; i++)
8334 + {
8335 + unsigned int section_id = a8_fixes[i].section->id;
8336 + asection *link_sec = htab->stub_group[section_id].link_sec;
8337 + asection *stub_sec = htab->stub_group[section_id].stub_sec;
8338 +
8339 + /* Copied from elf32_arm_add_stub! Refactor. */
8340 + if (stub_sec == NULL)
8341 + {
8342 + stub_sec = htab->stub_group[link_sec->id].stub_sec;
8343 + if (stub_sec == NULL)
8344 + {
8345 + size_t namelen;
8346 + bfd_size_type len;
8347 + char *s_name;
8348 +
8349 + namelen = strlen (link_sec->name);
8350 + len = namelen + sizeof (STUB_SUFFIX);
8351 + s_name = bfd_alloc (htab->stub_bfd, len);
8352 + if (s_name == NULL)
8353 + goto error_ret_free_local;
8354 +
8355 + memcpy (s_name, link_sec->name, namelen);
8356 + memcpy (s_name + namelen, STUB_SUFFIX,
8357 + sizeof (STUB_SUFFIX));
8358 + stub_sec = (*htab->add_stub_section) (s_name, link_sec);
8359 + if (stub_sec == NULL)
8360 + goto error_ret_free_local;
8361 + htab->stub_group[link_sec->id].stub_sec = stub_sec;
8362 + }
8363 + htab->stub_group[section_id].stub_sec = stub_sec;
8364 + }
8365 +
8366 + stub_sec->size
8367 + += find_stub_size_and_template (a8_fixes[i].stub_type, NULL,
8368 + NULL);
8369 + }
8370 +
8371 /* Ask the linker to do its stuff. */
8372 (*htab->layout_sections_again) ();
8373 stub_changed = FALSE;
8374 + prev_num_a8_fixes = num_a8_fixes;
8375 + }
8376 +
8377 + /* Add stubs for Cortex-A8 erratum fixes now. */
8378 + if (htab->fix_cortex_a8)
8379 + {
8380 + for (i = 0; i < num_a8_fixes; i++)
8381 + {
8382 + struct elf32_arm_stub_hash_entry *stub_entry;
8383 + char *stub_name = a8_fixes[i].stub_name;
8384 + asection *section = a8_fixes[i].section;
8385 + unsigned int section_id = a8_fixes[i].section->id;
8386 + asection *link_sec = htab->stub_group[section_id].link_sec;
8387 + asection *stub_sec = htab->stub_group[section_id].stub_sec;
8388 + const insn_sequence *template;
8389 + int template_size, size = 0;
8390 +
8391 + stub_entry = arm_stub_hash_lookup (&htab->stub_hash_table, stub_name,
8392 + TRUE, FALSE);
8393 + if (stub_entry == NULL)
8394 + {
8395 + (*_bfd_error_handler) (_("%s: cannot create stub entry %s"),
8396 + section->owner,
8397 + stub_name);
8398 + return FALSE;
8399 + }
8400 +
8401 + stub_entry->stub_sec = stub_sec;
8402 + stub_entry->stub_offset = 0;
8403 + stub_entry->id_sec = link_sec;
8404 + stub_entry->stub_type = a8_fixes[i].stub_type;
8405 + stub_entry->target_section = a8_fixes[i].section;
8406 + stub_entry->target_value = a8_fixes[i].offset;
8407 + stub_entry->target_addend = a8_fixes[i].addend;
8408 + stub_entry->orig_insn = a8_fixes[i].orig_insn;
8409 + stub_entry->st_type = STT_ARM_TFUNC;
8410 +
8411 + size = find_stub_size_and_template (a8_fixes[i].stub_type, &template,
8412 + &template_size);
8413 +
8414 + stub_entry->stub_size = size;
8415 + stub_entry->stub_template = template;
8416 + stub_entry->stub_template_size = template_size;
8417 + }
8418 +
8419 + /* Stash the Cortex-A8 erratum fix array for use later in
8420 + elf32_arm_write_section(). */
8421 + htab->a8_erratum_fixes = a8_fixes;
8422 + htab->num_a8_erratum_fixes = num_a8_fixes;
8423 + }
8424 + else
8425 + {
8426 + htab->a8_erratum_fixes = NULL;
8427 + htab->num_a8_erratum_fixes = 0;
8428 }
8429
8430 return TRUE;
8431 @@ -3913,6 +4723,7 @@ static const insn16 t2a2_noop_insn = 0x4
8432 static const insn32 t2a3_b_insn = 0xea000000;
8433
8434 #define VFP11_ERRATUM_VENEER_SIZE 8
8435 +#define JANUS_2CC_ERRATUM_VENEER_SIZE 12
8436
8437 #define ARM_BX_VENEER_SIZE 12
8438 static const insn32 armbx1_tst_insn = 0xe3100001;
8439 @@ -3927,7 +4738,16 @@ arm_allocate_glue_section_space (bfd * a
8440 bfd_byte * contents;
8441
8442 if (size == 0)
8443 - return;
8444 + {
8445 + /* Do not include empty glue sections in the output. */
8446 + if (abfd != NULL)
8447 + {
8448 + s = bfd_get_section_by_name (abfd, name);
8449 + if (s != NULL)
8450 + s->flags |= SEC_EXCLUDE;
8451 + }
8452 + return;
8453 + }
8454
8455 BFD_ASSERT (abfd != NULL);
8456
8457 @@ -3964,6 +4784,10 @@ bfd_elf32_arm_allocate_interworking_sect
8458 globals->bx_glue_size,
8459 ARM_BX_GLUE_SECTION_NAME);
8460
8461 + arm_allocate_glue_section_space (globals->bfd_of_glue_owner,
8462 + globals->janus_2cc_erratum_glue_size,
8463 + JANUS_2CC_ERRATUM_VENEER_SECTION_NAME);
8464 +
8465 return TRUE;
8466 }
8467
8468 @@ -4208,16 +5032,16 @@ elf32_arm_section_map_add (asection *sec
8469 }
8470 }
8471
8472 -
8473 -/* Record information about a VFP11 denorm-erratum veneer. Only ARM-mode
8474 - veneers are handled for now. */
8475 +/* Record information about a CPU erratum veneer. Only ARM-mode veneers are
8476 + handled for now. */
8477
8478 static bfd_vma
8479 -record_vfp11_erratum_veneer (struct bfd_link_info *link_info,
8480 - elf32_vfp11_erratum_list *branch,
8481 - bfd *branch_bfd,
8482 - asection *branch_sec,
8483 - unsigned int offset)
8484 +record_cpu_erratum_veneer (struct bfd_link_info *link_info,
8485 + elf32_cpu_erratum_list *branch,
8486 + bfd *branch_bfd,
8487 + asection *branch_sec,
8488 + unsigned int offset,
8489 + elf32_cpu_erratum_type erratum_type)
8490 {
8491 asection *s;
8492 struct elf32_arm_link_hash_table *hash_table;
8493 @@ -4227,27 +5051,43 @@ record_vfp11_erratum_veneer (struct bfd_
8494 bfd_vma val;
8495 struct _arm_elf_section_data *sec_data;
8496 int errcount;
8497 - elf32_vfp11_erratum_list *newerr;
8498 -
8499 + elf32_cpu_erratum_list *newerr;
8500 + const char *veneer_section_name;
8501 + const char *veneer_entry_name;
8502 +
8503 + switch (erratum_type)
8504 + {
8505 + case VFP11_ERRATUM_ARM_VENEER:
8506 + veneer_section_name = VFP11_ERRATUM_VENEER_SECTION_NAME;
8507 + veneer_entry_name = VFP11_ERRATUM_VENEER_ENTRY_NAME;
8508 + break;
8509 +
8510 + case JANUS_2CC_ERRATUM_ARM_VENEER:
8511 + veneer_section_name = JANUS_2CC_ERRATUM_VENEER_SECTION_NAME;
8512 + veneer_entry_name = JANUS_2CC_ERRATUM_VENEER_ENTRY_NAME;
8513 + break;
8514 +
8515 + default:
8516 + abort ();
8517 + }
8518 +
8519 hash_table = elf32_arm_hash_table (link_info);
8520
8521 BFD_ASSERT (hash_table != NULL);
8522 BFD_ASSERT (hash_table->bfd_of_glue_owner != NULL);
8523
8524 s = bfd_get_section_by_name
8525 - (hash_table->bfd_of_glue_owner, VFP11_ERRATUM_VENEER_SECTION_NAME);
8526 + (hash_table->bfd_of_glue_owner, veneer_section_name);
8527
8528 sec_data = elf32_arm_section_data (s);
8529
8530 BFD_ASSERT (s != NULL);
8531
8532 - tmp_name = bfd_malloc ((bfd_size_type) strlen
8533 - (VFP11_ERRATUM_VENEER_ENTRY_NAME) + 10);
8534 + tmp_name = bfd_malloc (MAX_ERRATUM_SYMBOL_LENGTH);
8535
8536 BFD_ASSERT (tmp_name);
8537
8538 - sprintf (tmp_name, VFP11_ERRATUM_VENEER_ENTRY_NAME,
8539 - hash_table->num_vfp11_fixes);
8540 + sprintf (tmp_name, veneer_entry_name, hash_table->num_errata_fixes, "");
8541
8542 myh = elf_link_hash_lookup
8543 (&(hash_table)->root, tmp_name, FALSE, FALSE, FALSE);
8544 @@ -4255,7 +5095,21 @@ record_vfp11_erratum_veneer (struct bfd_
8545 BFD_ASSERT (myh == NULL);
8546
8547 bh = NULL;
8548 - val = hash_table->vfp11_erratum_glue_size;
8549 +
8550 + switch (erratum_type)
8551 + {
8552 + case VFP11_ERRATUM_ARM_VENEER:
8553 + val = hash_table->vfp11_erratum_glue_size;
8554 + break;
8555 +
8556 + case JANUS_2CC_ERRATUM_ARM_VENEER:
8557 + val = hash_table->janus_2cc_erratum_glue_size;
8558 + break;
8559 +
8560 + default:
8561 + abort ();
8562 + }
8563 +
8564 _bfd_generic_link_add_one_symbol (link_info, hash_table->bfd_of_glue_owner,
8565 tmp_name, BSF_FUNCTION | BSF_LOCAL, s, val,
8566 NULL, TRUE, FALSE, &bh);
8567 @@ -4266,20 +5120,19 @@ record_vfp11_erratum_veneer (struct bfd_
8568
8569 /* Link veneer back to calling location. */
8570 errcount = ++(sec_data->erratumcount);
8571 - newerr = bfd_zmalloc (sizeof (elf32_vfp11_erratum_list));
8572 + newerr = bfd_zmalloc (sizeof (elf32_cpu_erratum_list));
8573
8574 - newerr->type = VFP11_ERRATUM_ARM_VENEER;
8575 + newerr->type = erratum_type;
8576 newerr->vma = -1;
8577 newerr->u.v.branch = branch;
8578 - newerr->u.v.id = hash_table->num_vfp11_fixes;
8579 + newerr->u.v.id = hash_table->num_errata_fixes;
8580 branch->u.b.veneer = newerr;
8581
8582 newerr->next = sec_data->erratumlist;
8583 sec_data->erratumlist = newerr;
8584
8585 /* A symbol for the return from the veneer. */
8586 - sprintf (tmp_name, VFP11_ERRATUM_VENEER_ENTRY_NAME "_r",
8587 - hash_table->num_vfp11_fixes);
8588 + sprintf (tmp_name, veneer_entry_name, hash_table->num_errata_fixes, "_r");
8589
8590 myh = elf_link_hash_lookup
8591 (&(hash_table)->root, tmp_name, FALSE, FALSE, FALSE);
8592 @@ -4300,7 +5153,10 @@ record_vfp11_erratum_veneer (struct bfd_
8593
8594 /* Generate a mapping symbol for the veneer section, and explicitly add an
8595 entry for that symbol to the code/data map for the section. */
8596 - if (hash_table->vfp11_erratum_glue_size == 0)
8597 + if ((erratum_type == VFP11_ERRATUM_ARM_VENEER
8598 + && hash_table->vfp11_erratum_glue_size == 0)
8599 + || (erratum_type == JANUS_2CC_ERRATUM_ARM_VENEER
8600 + && hash_table->janus_2cc_erratum_glue_size == 0))
8601 {
8602 bh = NULL;
8603 /* FIXME: Creates an ARM symbol. Thumb mode will need attention if it
8604 @@ -4321,19 +5177,31 @@ record_vfp11_erratum_veneer (struct bfd_
8605 elf32_arm_section_map_add (s, 'a', 0);
8606 }
8607
8608 - s->size += VFP11_ERRATUM_VENEER_SIZE;
8609 - hash_table->vfp11_erratum_glue_size += VFP11_ERRATUM_VENEER_SIZE;
8610 - hash_table->num_vfp11_fixes++;
8611 + switch (erratum_type)
8612 + {
8613 + case VFP11_ERRATUM_ARM_VENEER:
8614 + s->size += VFP11_ERRATUM_VENEER_SIZE;
8615 + hash_table->vfp11_erratum_glue_size += VFP11_ERRATUM_VENEER_SIZE;
8616 + break;
8617 +
8618 + case JANUS_2CC_ERRATUM_ARM_VENEER:
8619 + s->size += JANUS_2CC_ERRATUM_VENEER_SIZE;
8620 + hash_table->janus_2cc_erratum_glue_size += JANUS_2CC_ERRATUM_VENEER_SIZE;
8621 + break;
8622 +
8623 + default:
8624 + abort ();
8625 + }
8626 +
8627 + hash_table->num_errata_fixes++;
8628
8629 /* The offset of the veneer. */
8630 return val;
8631 }
8632
8633 -/* Note: we do not include the flag SEC_LINKER_CREATED, as that
8634 - would prevent elf_link_input_bfd() from processing the contents
8635 - of the section. */
8636 #define ARM_GLUE_SECTION_FLAGS \
8637 - (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE | SEC_READONLY)
8638 + (SEC_ALLOC | SEC_LOAD | SEC_HAS_CONTENTS | SEC_IN_MEMORY | SEC_CODE \
8639 + | SEC_READONLY | SEC_LINKER_CREATED)
8640
8641 /* Create a fake section for use by the ARM backend of the linker. */
8642
8643 @@ -4372,10 +5240,6 @@ bfd_elf32_arm_add_glue_sections_to_bfd (
8644 if (info->relocatable)
8645 return TRUE;
8646
8647 - /* Linker stubs don't need glue. */
8648 - if (!strcmp (abfd->filename, "linker stubs"))
8649 - return TRUE;
8650 -
8651 return arm_make_glue_section (abfd, ARM2THUMB_GLUE_SECTION_NAME)
8652 && arm_make_glue_section (abfd, THUMB2ARM_GLUE_SECTION_NAME)
8653 && arm_make_glue_section (abfd, VFP11_ERRATUM_VENEER_SECTION_NAME)
8654 @@ -4648,6 +5512,47 @@ bfd_elf32_arm_init_maps (bfd *abfd)
8655 }
8656
8657
8658 +/* Check we're not doing applying the (invasive) Janus 2CC erratum fix
8659 + unnecessarily. */
8660 +
8661 +void
8662 +bfd_elf32_arm_validate_janus_2cc_fix (bfd *obfd,
8663 + struct bfd_link_info *link_info)
8664 +{
8665 + struct elf32_arm_link_hash_table *globals = elf32_arm_hash_table (link_info);
8666 + obj_attribute *out_attr = elf_known_obj_attributes_proc (obfd);
8667 +
8668 + /* Janus 2CC is archv4t. We should never need the fix on higher architecture
8669 + versions, so emit an error in that case. */
8670 + if (globals->fix_janus_2cc
8671 + && out_attr[Tag_CPU_arch].i >= TAG_CPU_ARCH_V5T)
8672 + (*_bfd_error_handler) (_("%B: error: Janus 2CC erratum workaround cannot "
8673 + "be used with selected target architecture"), obfd);
8674 +}
8675 +
8676 +
8677 +/* Auto-select enabling of Cortex-A8 erratum fix if the user didn't explicitly
8678 + say what they wanted. */
8679 +
8680 +void
8681 +bfd_elf32_arm_set_cortex_a8_fix (bfd *obfd ATTRIBUTE_UNUSED,
8682 + struct bfd_link_info *link_info)
8683 +{
8684 + struct elf32_arm_link_hash_table *globals = elf32_arm_hash_table (link_info);
8685 + obj_attribute *out_attr = elf_known_obj_attributes_proc (obfd);
8686 +
8687 + if (globals->fix_cortex_a8 == -1)
8688 + {
8689 + /* Turn on Cortex-A8 erratum workaround for ARMv7-A. */
8690 + if (out_attr[Tag_CPU_arch].i == TAG_CPU_ARCH_V7
8691 + && (out_attr[Tag_CPU_arch_profile].i == 'A'
8692 + || out_attr[Tag_CPU_arch_profile].i == 0))
8693 + globals->fix_cortex_a8 = 1;
8694 + else
8695 + globals->fix_cortex_a8 = 0;
8696 + }
8697 +}
8698 +
8699 void
8700 bfd_elf32_arm_set_vfp11_fix (bfd *obfd, struct bfd_link_info *link_info)
8701 {
8702 @@ -4671,10 +5576,10 @@ bfd_elf32_arm_set_vfp11_fix (bfd *obfd,
8703 }
8704 }
8705 else if (globals->vfp11_fix == BFD_ARM_VFP11_FIX_DEFAULT)
8706 - /* For earlier architectures, we might need the workaround, but do not
8707 - enable it by default. If users is running with broken hardware, they
8708 - must enable the erratum fix explicitly. */
8709 - globals->vfp11_fix = BFD_ARM_VFP11_FIX_NONE;
8710 + /* For earlier architectures, we might need the workaround. The compiler
8711 + only generates scalar code at present, so this should be sufficient in
8712 + most cases. */
8713 + globals->vfp11_fix = BFD_ARM_VFP11_FIX_SCALAR;
8714 }
8715
8716
8717 @@ -5112,13 +6017,13 @@ bfd_elf32_arm_vfp11_erratum_scan (bfd *a
8718
8719 if (state == 3)
8720 {
8721 - elf32_vfp11_erratum_list *newerr
8722 - = bfd_zmalloc (sizeof (elf32_vfp11_erratum_list));
8723 + elf32_cpu_erratum_list *newerr
8724 + = bfd_zmalloc (sizeof (elf32_cpu_erratum_list));
8725 int errcount;
8726
8727 errcount = ++(elf32_arm_section_data (sec)->erratumcount);
8728
8729 - newerr->u.b.vfp_insn = veneer_of_insn;
8730 + newerr->u.b.orig_insn = veneer_of_insn;
8731
8732 switch (span_type)
8733 {
8734 @@ -5130,8 +6035,9 @@ bfd_elf32_arm_vfp11_erratum_scan (bfd *a
8735 abort ();
8736 }
8737
8738 - record_vfp11_erratum_veneer (link_info, newerr, abfd, sec,
8739 - first_fmac);
8740 + record_cpu_erratum_veneer (link_info, newerr, abfd, sec,
8741 + first_fmac,
8742 + VFP11_ERRATUM_ARM_VENEER);
8743
8744 newerr->vma = -1;
8745
8746 @@ -5165,8 +6071,8 @@ error_return:
8747 after sections have been laid out, using specially-named symbols. */
8748
8749 void
8750 -bfd_elf32_arm_vfp11_fix_veneer_locations (bfd *abfd,
8751 - struct bfd_link_info *link_info)
8752 +bfd_elf32_arm_fix_veneer_locations (bfd *abfd,
8753 + struct bfd_link_info *link_info)
8754 {
8755 asection *sec;
8756 struct elf32_arm_link_hash_table *globals;
8757 @@ -5181,13 +6087,12 @@ bfd_elf32_arm_vfp11_fix_veneer_locations
8758
8759 globals = elf32_arm_hash_table (link_info);
8760
8761 - tmp_name = bfd_malloc ((bfd_size_type) strlen
8762 - (VFP11_ERRATUM_VENEER_ENTRY_NAME) + 10);
8763 + tmp_name = bfd_malloc (MAX_ERRATUM_SYMBOL_LENGTH);
8764
8765 for (sec = abfd->sections; sec != NULL; sec = sec->next)
8766 {
8767 struct _arm_elf_section_data *sec_data = elf32_arm_section_data (sec);
8768 - elf32_vfp11_erratum_list *errnode = sec_data->erratumlist;
8769 + elf32_cpu_erratum_list *errnode = sec_data->erratumlist;
8770
8771 for (; errnode != NULL; errnode = errnode->next)
8772 {
8773 @@ -5200,7 +6105,7 @@ bfd_elf32_arm_vfp11_fix_veneer_locations
8774 case VFP11_ERRATUM_BRANCH_TO_THUMB_VENEER:
8775 /* Find veneer symbol. */
8776 sprintf (tmp_name, VFP11_ERRATUM_VENEER_ENTRY_NAME,
8777 - errnode->u.b.veneer->u.v.id);
8778 + errnode->u.b.veneer->u.v.id, "");
8779
8780 myh = elf_link_hash_lookup
8781 (&(globals)->root, tmp_name, FALSE, FALSE, TRUE);
8782 @@ -5216,11 +6121,30 @@ bfd_elf32_arm_vfp11_fix_veneer_locations
8783 errnode->u.b.veneer->vma = vma;
8784 break;
8785
8786 + case JANUS_2CC_ERRATUM_BRANCH_TO_ARM_VENEER:
8787 + /* Find veneer symbol. */
8788 + sprintf (tmp_name, JANUS_2CC_ERRATUM_VENEER_ENTRY_NAME,
8789 + errnode->u.b.veneer->u.v.id, "");
8790 +
8791 + myh = elf_link_hash_lookup
8792 + (&(globals)->root, tmp_name, FALSE, FALSE, TRUE);
8793 +
8794 + if (myh == NULL)
8795 + (*_bfd_error_handler) (_("%B: unable to find Janus 2CC veneer "
8796 + "`%s'"), abfd, tmp_name);
8797 +
8798 + vma = myh->root.u.def.section->output_section->vma
8799 + + myh->root.u.def.section->output_offset
8800 + + myh->root.u.def.value;
8801 +
8802 + errnode->u.b.veneer->vma = vma;
8803 + break;
8804 +
8805 case VFP11_ERRATUM_ARM_VENEER:
8806 case VFP11_ERRATUM_THUMB_VENEER:
8807 /* Find return location. */
8808 - sprintf (tmp_name, VFP11_ERRATUM_VENEER_ENTRY_NAME "_r",
8809 - errnode->u.v.id);
8810 + sprintf (tmp_name, VFP11_ERRATUM_VENEER_ENTRY_NAME,
8811 + errnode->u.v.id, "_r");
8812
8813 myh = elf_link_hash_lookup
8814 (&(globals)->root, tmp_name, FALSE, FALSE, TRUE);
8815 @@ -5236,6 +6160,25 @@ bfd_elf32_arm_vfp11_fix_veneer_locations
8816 errnode->u.v.branch->vma = vma;
8817 break;
8818
8819 + case JANUS_2CC_ERRATUM_ARM_VENEER:
8820 + /* Find return location. */
8821 + sprintf (tmp_name, JANUS_2CC_ERRATUM_VENEER_ENTRY_NAME,
8822 + errnode->u.v.id, "_r");
8823 +
8824 + myh = elf_link_hash_lookup
8825 + (&(globals)->root, tmp_name, FALSE, FALSE, TRUE);
8826 +
8827 + if (myh == NULL)
8828 + (*_bfd_error_handler) (_("%B: unable to find Janus 2CC veneer "
8829 + "`%s'"), abfd, tmp_name);
8830 +
8831 + vma = myh->root.u.def.section->output_section->vma
8832 + + myh->root.u.def.section->output_offset
8833 + + myh->root.u.def.value;
8834 +
8835 + errnode->u.v.branch->vma = vma;
8836 + break;
8837 +
8838 default:
8839 abort ();
8840 }
8841 @@ -5246,6 +6189,183 @@ bfd_elf32_arm_vfp11_fix_veneer_locations
8842 }
8843
8844
8845 +/* Look for instruction sequences which can trigger the Janus 2CC shifter
8846 + erratum. Any instruction which uses a register-specified shift, which is
8847 + not followed by a NOP instruction, is susceptible.
8848 +
8849 + NOTE: This function is only meant to work for architecture v4t, as
8850 + implemented by Janus 2CC (see bfd_elf32_arm_validate_janus_2cc_fix).
8851 + Instruction encodings for later architectures (e.g. ARM blx, Thumb-2) will
8852 + not be handled correctly. */
8853 +
8854 +bfd_boolean
8855 +bfd_elf32_arm_janus_2cc_erratum_scan (bfd *abfd,
8856 + struct bfd_link_info *link_info)
8857 +{
8858 + asection *sec;
8859 + bfd_byte *contents = NULL;
8860 + struct elf32_arm_link_hash_table *globals = elf32_arm_hash_table (link_info);
8861 +
8862 + /* Don't do anything if Janus 2CC fix is not enabled. */
8863 + if (!globals->fix_janus_2cc)
8864 + return TRUE;
8865 +
8866 + /* If we are only performing a partial link do not bother
8867 + to construct any glue. */
8868 + if (link_info->relocatable)
8869 + return TRUE;
8870 +
8871 + /* Skip if this bfd does not correspond to an ELF image. */
8872 + if (! is_arm_elf (abfd))
8873 + return TRUE;
8874 +
8875 + /* Skip this BFD if it corresponds to an executable or dynamic object. */
8876 + if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0)
8877 + return TRUE;
8878 +
8879 + for (sec = abfd->sections; sec != NULL; sec = sec->next)
8880 + {
8881 + unsigned int i, next_i, span, veneer_of_insn = 0;
8882 + struct _arm_elf_section_data *sec_data;
8883 +
8884 + /* If we don't have executable progbits, we're not interested in this
8885 + section. Also skip if section is to be excluded. */
8886 + if (elf_section_type (sec) != SHT_PROGBITS
8887 + || (elf_section_flags (sec) & SHF_EXECINSTR) == 0
8888 + || (sec->flags & SEC_EXCLUDE) != 0
8889 + || sec->sec_info_type == ELF_INFO_TYPE_JUST_SYMS
8890 + || sec->output_section == bfd_abs_section_ptr
8891 + || strcmp (sec->name, JANUS_2CC_ERRATUM_VENEER_SECTION_NAME) == 0)
8892 + continue;
8893 +
8894 + sec_data = elf32_arm_section_data (sec);
8895 +
8896 + if (sec_data->mapcount == 0)
8897 + continue;
8898 +
8899 + if (elf_section_data (sec)->this_hdr.contents != NULL)
8900 + contents = elf_section_data (sec)->this_hdr.contents;
8901 + else if (! bfd_malloc_and_get_section (abfd, sec, &contents))
8902 + goto error_return;
8903 +
8904 + qsort (sec_data->map, sec_data->mapcount, sizeof (elf32_arm_section_map),
8905 + elf32_arm_compare_mapping);
8906 +
8907 + for (span = 0; span < sec_data->mapcount; span++)
8908 + {
8909 + unsigned int span_start = sec_data->map[span].vma;
8910 + unsigned int span_end = (span == sec_data->mapcount - 1)
8911 + ? sec->size : sec_data->map[span + 1].vma;
8912 + char span_type = sec_data->map[span].type;
8913 + int state = 0;
8914 +
8915 + switch (span_type)
8916 + {
8917 + case 'a':
8918 + for (i = span_start; i < span_end;)
8919 + {
8920 + unsigned int insn = bfd_get_32 (abfd, contents + i);
8921 +
8922 + next_i = i + 4;
8923 +
8924 + switch (state)
8925 + {
8926 + case 0:
8927 + /* Data processing insn with register shift. */
8928 + if (((insn & 0x0e000090) == 0x00000010)
8929 + && ((insn & 0x0ff000f0) != 0x01200010)) /* bx. */
8930 + {
8931 + veneer_of_insn = insn;
8932 + state = 1;
8933 + }
8934 + break;
8935 +
8936 + case 1:
8937 + /* Not a NOP (only accept mov r0, r0). */
8938 + if ((insn & 0x0fffffff) != 0x01a00000)
8939 + {
8940 + elf32_cpu_erratum_list *newerr;
8941 + int errcount;
8942 +
8943 + /* Lose if Rd, Rn or Rm is PC. Don't bother
8944 + checking Rs. */
8945 + if ((veneer_of_insn & 0x000f0000) == 0x000f0000
8946 + || (veneer_of_insn & 0x0000f000) == 0x0000f000
8947 + || (veneer_of_insn & 0x0000000f) == 0x0000000f)
8948 + (*_bfd_error_handler) (_("%B(%A+0x%lx): error: ARM "
8949 + "instruction sequence using PC triggers "
8950 + "Janus 2CC erratum (must be fixed manually)"),
8951 + abfd, sec, i);
8952 +
8953 + newerr
8954 + = bfd_zmalloc (sizeof (elf32_cpu_erratum_list));
8955 +
8956 + errcount
8957 + = ++(elf32_arm_section_data (sec)->erratumcount);
8958 +
8959 + newerr->u.b.orig_insn = veneer_of_insn;
8960 + newerr->type = JANUS_2CC_ERRATUM_BRANCH_TO_ARM_VENEER;
8961 +
8962 + record_cpu_erratum_veneer (link_info, newerr, abfd,
8963 + sec, i - 4, JANUS_2CC_ERRATUM_ARM_VENEER);
8964 +
8965 + newerr->vma = -1;
8966 +
8967 + newerr->next = sec_data->erratumlist;
8968 + sec_data->erratumlist = newerr;
8969 + /* Re-scan current instruction in case of adjacent
8970 + trigger insns. */
8971 + next_i = i;
8972 + }
8973 + state = 0;
8974 + break;
8975 + }
8976 +
8977 + i = next_i;
8978 + }
8979 + break;
8980 +
8981 + case 't':
8982 + for (i = span_start; i < span_end; i += 2)
8983 + {
8984 + unsigned short insn = bfd_get_16 (abfd, contents + i);
8985 +
8986 + switch (state)
8987 + {
8988 + case 0:
8989 + if (((insn & 0xffc0) == 0x4100) /* ASR. */
8990 + || ((insn & 0xffc0) == 0x4080) /* LSL. */
8991 + || ((insn & 0xffc0) == 0x40c0) /* LSR. */
8992 + || ((insn & 0xffc0) == 0x41c0)) /* ROR. */
8993 + state = 1;
8994 + break;
8995 +
8996 + case 1:
8997 + /* Not a NOP (only accept cpy r8, r8). */
8998 + if (insn != 0x46c0)
8999 + (*_bfd_error_handler) (_("%B(%A+0x%lx): error: Thumb "
9000 + "instruction sequence triggers Janus 2CC erratum "
9001 + "(must be fixed manually)"),
9002 + abfd, sec, i);
9003 + state = 0;
9004 + break;
9005 + }
9006 + }
9007 + break;
9008 +
9009 + default:
9010 + ;
9011 + }
9012 + }
9013 + }
9014 +
9015 + return TRUE;
9016 +
9017 +error_return:
9018 + return FALSE;
9019 +}
9020 +
9021 +
9022 /* Set target relocation values needed during linking. */
9023
9024 void
9025 @@ -5257,7 +6377,8 @@ bfd_elf32_arm_set_target_relocs (struct
9026 int use_blx,
9027 bfd_arm_vfp11_fix vfp11_fix,
9028 int no_enum_warn, int no_wchar_warn,
9029 - int pic_veneer)
9030 + int pic_veneer, int fix_janus_2cc,
9031 + int fix_cortex_a8)
9032 {
9033 struct elf32_arm_link_hash_table *globals;
9034
9035 @@ -5279,6 +6400,8 @@ bfd_elf32_arm_set_target_relocs (struct
9036 globals->use_blx |= use_blx;
9037 globals->vfp11_fix = vfp11_fix;
9038 globals->pic_veneer = pic_veneer;
9039 + globals->fix_janus_2cc = fix_janus_2cc;
9040 + globals->fix_cortex_a8 = fix_cortex_a8;
9041
9042 BFD_ASSERT (is_arm_elf (output_bfd));
9043 elf_arm_tdata (output_bfd)->no_enum_size_warning = no_enum_warn;
9044 @@ -7933,72 +9056,378 @@ elf32_arm_relocate_section (bfd *
9045 ELF_ST_TYPE (sym->st_info)), h,
9046 &unresolved_reloc, &error_message);
9047
9048 - /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
9049 - because such sections are not SEC_ALLOC and thus ld.so will
9050 - not process them. */
9051 - if (unresolved_reloc
9052 - && !((input_section->flags & SEC_DEBUGGING) != 0
9053 - && h->def_dynamic))
9054 + /* Dynamic relocs are not propagated for SEC_DEBUGGING sections
9055 + because such sections are not SEC_ALLOC and thus ld.so will
9056 + not process them. */
9057 + if (unresolved_reloc
9058 + && !((input_section->flags & SEC_DEBUGGING) != 0
9059 + && h->def_dynamic))
9060 + {
9061 + (*_bfd_error_handler)
9062 + (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
9063 + input_bfd,
9064 + input_section,
9065 + (long) rel->r_offset,
9066 + howto->name,
9067 + h->root.root.string);
9068 + return FALSE;
9069 + }
9070 +
9071 + if (r != bfd_reloc_ok)
9072 + {
9073 + switch (r)
9074 + {
9075 + case bfd_reloc_overflow:
9076 + /* If the overflowing reloc was to an undefined symbol,
9077 + we have already printed one error message and there
9078 + is no point complaining again. */
9079 + if ((! h ||
9080 + h->root.type != bfd_link_hash_undefined)
9081 + && (!((*info->callbacks->reloc_overflow)
9082 + (info, (h ? &h->root : NULL), name, howto->name,
9083 + (bfd_vma) 0, input_bfd, input_section,
9084 + rel->r_offset))))
9085 + return FALSE;
9086 + break;
9087 +
9088 + case bfd_reloc_undefined:
9089 + if (!((*info->callbacks->undefined_symbol)
9090 + (info, name, input_bfd, input_section,
9091 + rel->r_offset, TRUE)))
9092 + return FALSE;
9093 + break;
9094 +
9095 + case bfd_reloc_outofrange:
9096 + error_message = _("out of range");
9097 + goto common_error;
9098 +
9099 + case bfd_reloc_notsupported:
9100 + error_message = _("unsupported relocation");
9101 + goto common_error;
9102 +
9103 + case bfd_reloc_dangerous:
9104 + /* error_message should already be set. */
9105 + goto common_error;
9106 +
9107 + default:
9108 + error_message = _("unknown error");
9109 + /* Fall through. */
9110 +
9111 + common_error:
9112 + BFD_ASSERT (error_message != NULL);
9113 + if (!((*info->callbacks->reloc_dangerous)
9114 + (info, error_message, input_bfd, input_section,
9115 + rel->r_offset)))
9116 + return FALSE;
9117 + break;
9118 + }
9119 + }
9120 + }
9121 +
9122 + return TRUE;
9123 +}
9124 +
9125 +/* Add a new unwind edit to the list described by HEAD, TAIL. If INDEX is zero,
9126 + adds the edit to the start of the list. (The list must be built in order of
9127 + ascending INDEX: the function's callers are primarily responsible for
9128 + maintaining that condition). */
9129 +
9130 +static void
9131 +add_unwind_table_edit (arm_unwind_table_edit **head,
9132 + arm_unwind_table_edit **tail,
9133 + arm_unwind_edit_type type,
9134 + asection *linked_section,
9135 + unsigned int index)
9136 +{
9137 + arm_unwind_table_edit *new_edit = xmalloc (sizeof (arm_unwind_table_edit));
9138 +
9139 + new_edit->type = type;
9140 + new_edit->linked_section = linked_section;
9141 + new_edit->index = index;
9142 +
9143 + if (index > 0)
9144 + {
9145 + new_edit->next = NULL;
9146 +
9147 + if (*tail)
9148 + (*tail)->next = new_edit;
9149 +
9150 + (*tail) = new_edit;
9151 +
9152 + if (!*head)
9153 + (*head) = new_edit;
9154 + }
9155 + else
9156 + {
9157 + new_edit->next = *head;
9158 +
9159 + if (!*tail)
9160 + *tail = new_edit;
9161 +
9162 + *head = new_edit;
9163 + }
9164 +}
9165 +
9166 +static _arm_elf_section_data *get_arm_elf_section_data (asection *);
9167 +
9168 +/* Increase the size of EXIDX_SEC by ADJUST bytes. ADJUST mau be negative. */
9169 +static void
9170 +adjust_exidx_size(asection *exidx_sec, int adjust)
9171 +{
9172 + asection *out_sec;
9173 +
9174 + if (!exidx_sec->rawsize)
9175 + exidx_sec->rawsize = exidx_sec->size;
9176 +
9177 + bfd_set_section_size (exidx_sec->owner, exidx_sec, exidx_sec->size + adjust);
9178 + out_sec = exidx_sec->output_section;
9179 + /* Adjust size of output section. */
9180 + bfd_set_section_size (out_sec->owner, out_sec, out_sec->size +adjust);
9181 +}
9182 +
9183 +/* Insert an EXIDX_CANTUNWIND marker at the end of a section. */
9184 +static void
9185 +insert_cantunwind_after(asection *text_sec, asection *exidx_sec)
9186 +{
9187 + struct _arm_elf_section_data *exidx_arm_data;
9188 +
9189 + exidx_arm_data = get_arm_elf_section_data (exidx_sec);
9190 + add_unwind_table_edit (
9191 + &exidx_arm_data->u.exidx.unwind_edit_list,
9192 + &exidx_arm_data->u.exidx.unwind_edit_tail,
9193 + INSERT_EXIDX_CANTUNWIND_AT_END, text_sec, UINT_MAX);
9194 +
9195 + adjust_exidx_size(exidx_sec, 8);
9196 +}
9197 +
9198 +/* Scan .ARM.exidx tables, and create a list describing edits which should be
9199 + made to those tables, such that:
9200 +
9201 + 1. Regions without unwind data are marked with EXIDX_CANTUNWIND entries.
9202 + 2. Duplicate entries are merged together (EXIDX_CANTUNWIND, or unwind
9203 + codes which have been inlined into the index).
9204 +
9205 + The edits are applied when the tables are written
9206 + (in elf32_arm_write_section).
9207 +*/
9208 +
9209 +bfd_boolean
9210 +elf32_arm_fix_exidx_coverage (asection **text_section_order,
9211 + unsigned int num_text_sections,
9212 + struct bfd_link_info *info)
9213 +{
9214 + bfd *inp;
9215 + unsigned int last_second_word = 0, i;
9216 + asection *last_exidx_sec = NULL;
9217 + asection *last_text_sec = NULL;
9218 + int last_unwind_type = -1;
9219 +
9220 + /* Walk over all EXIDX sections, and create backlinks from the corrsponding
9221 + text sections. */
9222 + for (inp = info->input_bfds; inp != NULL; inp = inp->link_next)
9223 + {
9224 + asection *sec;
9225 +
9226 + for (sec = inp->sections; sec != NULL; sec = sec->next)
9227 + {
9228 + struct bfd_elf_section_data *elf_sec = elf_section_data (sec);
9229 + Elf_Internal_Shdr *hdr = &elf_sec->this_hdr;
9230 +
9231 + if (hdr->sh_type != SHT_ARM_EXIDX)
9232 + continue;
9233 +
9234 + if (elf_sec->linked_to)
9235 + {
9236 + Elf_Internal_Shdr *linked_hdr
9237 + = &elf_section_data (elf_sec->linked_to)->this_hdr;
9238 + struct _arm_elf_section_data *linked_sec_arm_data
9239 + = get_arm_elf_section_data (linked_hdr->bfd_section);
9240 +
9241 + if (linked_sec_arm_data == NULL)
9242 + continue;
9243 +
9244 + /* Link this .ARM.exidx section back from the text section it
9245 + describes. */
9246 + linked_sec_arm_data->u.text.arm_exidx_sec = sec;
9247 + }
9248 + }
9249 + }
9250 +
9251 + /* Walk all text sections in order of increasing VMA. Eilminate duplicate
9252 + index table entries (EXIDX_CANTUNWIND and inlined unwind opcodes),
9253 + and add EXIDX_CANTUNWIND entries for sections with no unwind table data.
9254 + */
9255 +
9256 + for (i = 0; i < num_text_sections; i++)
9257 + {
9258 + asection *sec = text_section_order[i];
9259 + asection *exidx_sec;
9260 + struct _arm_elf_section_data *arm_data = get_arm_elf_section_data (sec);
9261 + struct _arm_elf_section_data *exidx_arm_data;
9262 + bfd_byte *contents = NULL;
9263 + int deleted_exidx_bytes = 0;
9264 + bfd_vma j;
9265 + arm_unwind_table_edit *unwind_edit_head = NULL;
9266 + arm_unwind_table_edit *unwind_edit_tail = NULL;
9267 + Elf_Internal_Shdr *hdr;
9268 + bfd *ibfd;
9269 +
9270 + if (arm_data == NULL)
9271 + continue;
9272 +
9273 + exidx_sec = arm_data->u.text.arm_exidx_sec;
9274 + if (exidx_sec == NULL)
9275 {
9276 - (*_bfd_error_handler)
9277 - (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
9278 - input_bfd,
9279 - input_section,
9280 - (long) rel->r_offset,
9281 - howto->name,
9282 - h->root.root.string);
9283 - return FALSE;
9284 + /* Section has no unwind data. */
9285 + if (last_unwind_type == 0 || !last_exidx_sec)
9286 + continue;
9287 +
9288 + /* Ignore zero sized sections. */
9289 + if (sec->size == 0)
9290 + continue;
9291 +
9292 + insert_cantunwind_after(last_text_sec, last_exidx_sec);
9293 + last_unwind_type = 0;
9294 + continue;
9295 }
9296
9297 - if (r != bfd_reloc_ok)
9298 + if (bfd_is_abs_section (exidx_sec->output_section))
9299 + /* The linker script probably has /DISCARD/ for this section. */
9300 + continue;
9301 +
9302 + hdr = &elf_section_data (exidx_sec)->this_hdr;
9303 + if (hdr->sh_type != SHT_ARM_EXIDX)
9304 + continue;
9305 +
9306 + exidx_arm_data = get_arm_elf_section_data (exidx_sec);
9307 + if (exidx_arm_data == NULL)
9308 + continue;
9309 +
9310 + ibfd = exidx_sec->owner;
9311 +
9312 + if (hdr->contents != NULL)
9313 + contents = hdr->contents;
9314 + else if (! bfd_malloc_and_get_section (ibfd, exidx_sec, &contents))
9315 + /* An error? */
9316 + continue;
9317 +
9318 + for (j = 0; j < hdr->sh_size; j += 8)
9319 {
9320 - switch (r)
9321 + unsigned int second_word = bfd_get_32 (ibfd, contents + j + 4);
9322 + int unwind_type;
9323 + int elide = 0;
9324 +
9325 + /* An EXIDX_CANTUNWIND entry. */
9326 + if (second_word == 1)
9327 {
9328 - case bfd_reloc_overflow:
9329 - /* If the overflowing reloc was to an undefined symbol,
9330 - we have already printed one error message and there
9331 - is no point complaining again. */
9332 - if ((! h ||
9333 - h->root.type != bfd_link_hash_undefined)
9334 - && (!((*info->callbacks->reloc_overflow)
9335 - (info, (h ? &h->root : NULL), name, howto->name,
9336 - (bfd_vma) 0, input_bfd, input_section,
9337 - rel->r_offset))))
9338 - return FALSE;
9339 - break;
9340 + if (last_unwind_type == 0)
9341 + elide = 1;
9342 + unwind_type = 0;
9343 + }
9344 + /* Inlined unwinding data. Merge if equal to previous. */
9345 + else if ((second_word & 0x80000000) != 0)
9346 + {
9347 + if (last_second_word == second_word && last_unwind_type == 1)
9348 + elide = 1;
9349 + unwind_type = 1;
9350 + last_second_word = second_word;
9351 + }
9352 + /* Normal table entry. In theory we could merge these too,
9353 + but duplicate entries are likely to be much less common. */
9354 + else
9355 + unwind_type = 2;
9356
9357 - case bfd_reloc_undefined:
9358 - if (!((*info->callbacks->undefined_symbol)
9359 - (info, name, input_bfd, input_section,
9360 - rel->r_offset, TRUE)))
9361 - return FALSE;
9362 - break;
9363 + if (elide)
9364 + {
9365 + add_unwind_table_edit (&unwind_edit_head, &unwind_edit_tail,
9366 + DELETE_EXIDX_ENTRY, NULL, j / 8);
9367
9368 - case bfd_reloc_outofrange:
9369 - error_message = _("out of range");
9370 - goto common_error;
9371 + deleted_exidx_bytes += 8;
9372 + }
9373
9374 - case bfd_reloc_notsupported:
9375 - error_message = _("unsupported relocation");
9376 - goto common_error;
9377 + last_unwind_type = unwind_type;
9378 + }
9379
9380 - case bfd_reloc_dangerous:
9381 - /* error_message should already be set. */
9382 - goto common_error;
9383 + /* Free contents if we allocated it ourselves. */
9384 + if (contents != hdr->contents)
9385 + free (contents);
9386
9387 - default:
9388 - error_message = _("unknown error");
9389 - /* Fall through. */
9390 + /* Record edits to be applied later (in elf32_arm_write_section). */
9391 + exidx_arm_data->u.exidx.unwind_edit_list = unwind_edit_head;
9392 + exidx_arm_data->u.exidx.unwind_edit_tail = unwind_edit_tail;
9393 +
9394 + if (deleted_exidx_bytes > 0)
9395 + adjust_exidx_size(exidx_sec, -deleted_exidx_bytes);
9396 +
9397 + last_exidx_sec = exidx_sec;
9398 + last_text_sec = sec;
9399 + }
9400
9401 - common_error:
9402 - BFD_ASSERT (error_message != NULL);
9403 - if (!((*info->callbacks->reloc_dangerous)
9404 - (info, error_message, input_bfd, input_section,
9405 - rel->r_offset)))
9406 - return FALSE;
9407 - break;
9408 - }
9409 - }
9410 + /* Add terminating CANTUNWIND entry. */
9411 + if (last_exidx_sec && last_unwind_type != 0)
9412 + insert_cantunwind_after(last_text_sec, last_exidx_sec);
9413 +
9414 + return TRUE;
9415 +}
9416 +
9417 +static bfd_boolean
9418 +elf32_arm_output_glue_section (struct bfd_link_info *info, bfd *obfd,
9419 + bfd *ibfd, const char *name)
9420 +{
9421 + asection *sec, *osec;
9422 +
9423 + sec = bfd_get_section_by_name (ibfd, name);
9424 + if (sec == NULL || (sec->flags & SEC_EXCLUDE) != 0)
9425 + return TRUE;
9426 +
9427 + osec = sec->output_section;
9428 + if (elf32_arm_write_section (obfd, info, sec, sec->contents))
9429 + return TRUE;
9430 +
9431 + if (! bfd_set_section_contents (obfd, osec, sec->contents,
9432 + sec->output_offset, sec->size))
9433 + return FALSE;
9434 +
9435 + return TRUE;
9436 +}
9437 +
9438 +static bfd_boolean
9439 +elf32_arm_final_link (bfd *abfd, struct bfd_link_info *info)
9440 +{
9441 + struct elf32_arm_link_hash_table *globals = elf32_arm_hash_table (info);
9442 +
9443 + /* Invoke the regular ELF backend linker to do all the work. */
9444 + if (!bfd_elf_final_link (abfd, info))
9445 + return FALSE;
9446 +
9447 + /* Write out any glue sections now that we have created all the
9448 + stubs. */
9449 + if (globals->bfd_of_glue_owner != NULL)
9450 + {
9451 + if (! elf32_arm_output_glue_section (info, abfd,
9452 + globals->bfd_of_glue_owner,
9453 + ARM2THUMB_GLUE_SECTION_NAME))
9454 + return FALSE;
9455 +
9456 + if (! elf32_arm_output_glue_section (info, abfd,
9457 + globals->bfd_of_glue_owner,
9458 + THUMB2ARM_GLUE_SECTION_NAME))
9459 + return FALSE;
9460 +
9461 + if (! elf32_arm_output_glue_section (info, abfd,
9462 + globals->bfd_of_glue_owner,
9463 + VFP11_ERRATUM_VENEER_SECTION_NAME))
9464 + return FALSE;
9465 +
9466 + if (! elf32_arm_output_glue_section (info, abfd,
9467 + globals->bfd_of_glue_owner,
9468 + JANUS_2CC_ERRATUM_VENEER_SECTION_NAME))
9469 + return FALSE;
9470 +
9471 + if (! elf32_arm_output_glue_section (info, abfd,
9472 + globals->bfd_of_glue_owner,
9473 + ARM_BX_GLUE_SECTION_NAME))
9474 + return FALSE;
9475 }
9476
9477 return TRUE;
9478 @@ -8329,7 +9758,7 @@ tag_cpu_arch_combine (bfd *ibfd, int old
9479
9480 if (oldtag >= MAX_TAG_CPU_ARCH || newtag >= MAX_TAG_CPU_ARCH)
9481 {
9482 - _bfd_error_handler (_("ERROR: %B: Unknown CPU architecture"), ibfd);
9483 + _bfd_error_handler (_("error: %B: Unknown CPU architecture"), ibfd);
9484 return -1;
9485 }
9486
9487 @@ -8367,7 +9796,7 @@ tag_cpu_arch_combine (bfd *ibfd, int old
9488
9489 if (result == -1)
9490 {
9491 - _bfd_error_handler (_("ERROR: %B: Conflicting CPU architectures %d/%d"),
9492 + _bfd_error_handler (_("error: %B: Conflicting CPU architectures %d/%d"),
9493 ibfd, oldtag, newtag);
9494 return -1;
9495 }
9496 @@ -8395,6 +9824,12 @@ elf32_arm_merge_eabi_attributes (bfd *ib
9497 int i;
9498 bfd_boolean result = TRUE;
9499
9500 + /* Skip the linker stubs file. This preserves previous behavior
9501 + of accepting unknown attributes in the first input file - but
9502 + is that a bug? */
9503 + if (ibfd->flags & BFD_LINKER_CREATED)
9504 + return TRUE;
9505 +
9506 if (!elf_known_obj_attributes_proc (obfd)[0].i)
9507 {
9508 /* This is the first object. Copy the attributes. */
9509 @@ -8418,7 +9853,7 @@ elf32_arm_merge_eabi_attributes (bfd *ib
9510 else if (in_attr[Tag_ABI_FP_number_model].i != 0)
9511 {
9512 _bfd_error_handler
9513 - (_("ERROR: %B uses VFP register arguments, %B does not"),
9514 + (_("error: %B uses VFP register arguments, %B does not"),
9515 ibfd, obfd);
9516 result = FALSE;
9517 }
9518 @@ -8534,7 +9969,7 @@ elf32_arm_merge_eabi_attributes (bfd *ib
9519 binaries in the toolchain have had the attributes set
9520 properly.
9521 _bfd_error_handler
9522 - (_("ERROR: %B: 8-byte data alignment conflicts with %B"),
9523 + (_("error: %B: 8-byte data alignment conflicts with %B"),
9524 obfd, ibfd);
9525 result = FALSE; */
9526 }
9527 @@ -8568,7 +10003,7 @@ elf32_arm_merge_eabi_attributes (bfd *ib
9528 else
9529 {
9530 _bfd_error_handler
9531 - (_("ERROR: %B: Conflicting architecture profiles %c/%c"),
9532 + (_("error: %B: Conflicting architecture profiles %c/%c"),
9533 ibfd,
9534 in_attr[i].i ? in_attr[i].i : '0',
9535 out_attr[i].i ? out_attr[i].i : '0');
9536 @@ -8601,7 +10036,7 @@ elf32_arm_merge_eabi_attributes (bfd *ib
9537 && in_attr[i].i != AEABI_R9_unused)
9538 {
9539 _bfd_error_handler
9540 - (_("ERROR: %B: Conflicting use of R9"), ibfd);
9541 + (_("error: %B: Conflicting use of R9"), ibfd);
9542 result = FALSE;
9543 }
9544 if (out_attr[i].i == AEABI_R9_unused)
9545 @@ -8613,7 +10048,7 @@ elf32_arm_merge_eabi_attributes (bfd *ib
9546 && out_attr[Tag_ABI_PCS_R9_use].i != AEABI_R9_unused)
9547 {
9548 _bfd_error_handler
9549 - (_("ERROR: %B: SB relative addressing conflicts with use of R9"),
9550 + (_("error: %B: SB relative addressing conflicts with use of R9"),
9551 ibfd);
9552 result = FALSE;
9553 }
9554 @@ -8669,7 +10104,7 @@ elf32_arm_merge_eabi_attributes (bfd *ib
9555 if (in_attr[i].i != out_attr[i].i)
9556 {
9557 _bfd_error_handler
9558 - (_("ERROR: %B uses iWMMXt register arguments, %B does not"),
9559 + (_("error: %B uses iWMMXt register arguments, %B does not"),
9560 ibfd, obfd);
9561 result = FALSE;
9562 }
9563 @@ -8691,7 +10126,7 @@ elf32_arm_merge_eabi_attributes (bfd *ib
9564 if (in_attr[i].i != out_attr[i].i)
9565 {
9566 _bfd_error_handler
9567 - (_("ERROR: fp16 format mismatch between %B and %B"),
9568 + (_("error: fp16 format mismatch between %B and %B"),
9569 ibfd, obfd);
9570 result = FALSE;
9571 }
9572 @@ -8895,7 +10330,7 @@ elf32_arm_merge_private_bfd_data (bfd *
9573 && !(ibfd->flags & DYNAMIC)
9574 && (in_flags & EF_ARM_BE8))
9575 {
9576 - _bfd_error_handler (_("ERROR: %B is already in final BE8 format"),
9577 + _bfd_error_handler (_("error: %B is already in final BE8 format"),
9578 ibfd);
9579 return FALSE;
9580 }
9581 @@ -8971,7 +10406,7 @@ elf32_arm_merge_private_bfd_data (bfd *
9582 EF_ARM_EABI_VERSION (out_flags)))
9583 {
9584 _bfd_error_handler
9585 - (_("ERROR: Source object %B has EABI version %d, but target %B has EABI version %d"),
9586 + (_("error: Source object %B has EABI version %d, but target %B has EABI version %d"),
9587 ibfd, obfd,
9588 (in_flags & EF_ARM_EABIMASK) >> 24,
9589 (out_flags & EF_ARM_EABIMASK) >> 24);
9590 @@ -8987,7 +10422,7 @@ elf32_arm_merge_private_bfd_data (bfd *
9591 if ((in_flags & EF_ARM_APCS_26) != (out_flags & EF_ARM_APCS_26))
9592 {
9593 _bfd_error_handler
9594 - (_("ERROR: %B is compiled for APCS-%d, whereas target %B uses APCS-%d"),
9595 + (_("error: %B is compiled for APCS-%d, whereas target %B uses APCS-%d"),
9596 ibfd, obfd,
9597 in_flags & EF_ARM_APCS_26 ? 26 : 32,
9598 out_flags & EF_ARM_APCS_26 ? 26 : 32);
9599 @@ -8998,11 +10433,11 @@ elf32_arm_merge_private_bfd_data (bfd *
9600 {
9601 if (in_flags & EF_ARM_APCS_FLOAT)
9602 _bfd_error_handler
9603 - (_("ERROR: %B passes floats in float registers, whereas %B passes them in integer registers"),
9604 + (_("error: %B passes floats in float registers, whereas %B passes them in integer registers"),
9605 ibfd, obfd);
9606 else
9607 _bfd_error_handler
9608 - (_("ERROR: %B passes floats in integer registers, whereas %B passes them in float registers"),
9609 + (_("error: %B passes floats in integer registers, whereas %B passes them in float registers"),
9610 ibfd, obfd);
9611
9612 flags_compatible = FALSE;
9613 @@ -9012,11 +10447,11 @@ elf32_arm_merge_private_bfd_data (bfd *
9614 {
9615 if (in_flags & EF_ARM_VFP_FLOAT)
9616 _bfd_error_handler
9617 - (_("ERROR: %B uses VFP instructions, whereas %B does not"),
9618 + (_("error: %B uses VFP instructions, whereas %B does not"),
9619 ibfd, obfd);
9620 else
9621 _bfd_error_handler
9622 - (_("ERROR: %B uses FPA instructions, whereas %B does not"),
9623 + (_("error: %B uses FPA instructions, whereas %B does not"),
9624 ibfd, obfd);
9625
9626 flags_compatible = FALSE;
9627 @@ -9026,11 +10461,11 @@ elf32_arm_merge_private_bfd_data (bfd *
9628 {
9629 if (in_flags & EF_ARM_MAVERICK_FLOAT)
9630 _bfd_error_handler
9631 - (_("ERROR: %B uses Maverick instructions, whereas %B does not"),
9632 + (_("error: %B uses Maverick instructions, whereas %B does not"),
9633 ibfd, obfd);
9634 else
9635 _bfd_error_handler
9636 - (_("ERROR: %B does not use Maverick instructions, whereas %B does"),
9637 + (_("error: %B does not use Maverick instructions, whereas %B does"),
9638 ibfd, obfd);
9639
9640 flags_compatible = FALSE;
9641 @@ -9049,11 +10484,11 @@ elf32_arm_merge_private_bfd_data (bfd *
9642 {
9643 if (in_flags & EF_ARM_SOFT_FLOAT)
9644 _bfd_error_handler
9645 - (_("ERROR: %B uses software FP, whereas %B uses hardware FP"),
9646 + (_("error: %B uses software FP, whereas %B uses hardware FP"),
9647 ibfd, obfd);
9648 else
9649 _bfd_error_handler
9650 - (_("ERROR: %B uses hardware FP, whereas %B uses software FP"),
9651 + (_("error: %B uses hardware FP, whereas %B uses software FP"),
9652 ibfd, obfd);
9653
9654 flags_compatible = FALSE;
9655 @@ -9644,12 +11079,12 @@ elf32_arm_check_relocs (bfd *abfd, struc
9656 return FALSE;
9657
9658 /* BPABI objects never have dynamic relocations mapped. */
9659 - if (! htab->symbian_p)
9660 + if (htab->symbian_p)
9661 {
9662 flagword flags;
9663
9664 flags = bfd_get_section_flags (dynobj, sreloc);
9665 - flags |= (SEC_LOAD | SEC_ALLOC);
9666 + flags &= ~(SEC_LOAD | SEC_ALLOC);
9667 bfd_set_section_flags (dynobj, sreloc, flags);
9668 }
9669 }
9670 @@ -10541,12 +11976,16 @@ elf32_arm_size_dynamic_sections (bfd * o
9671 bfd_elf32_arm_init_maps (ibfd);
9672
9673 if (!bfd_elf32_arm_process_before_allocation (ibfd, info)
9674 - || !bfd_elf32_arm_vfp11_erratum_scan (ibfd, info))
9675 + || !bfd_elf32_arm_vfp11_erratum_scan (ibfd, info)
9676 + || !bfd_elf32_arm_janus_2cc_erratum_scan (ibfd, info))
9677 /* xgettext:c-format */
9678 _bfd_error_handler (_("Errors encountered processing file %s"),
9679 ibfd->filename);
9680 }
9681
9682 + /* Allocate space for the glue sections now that we've sized them. */
9683 + bfd_elf32_arm_allocate_interworking_sections (info);
9684 +
9685 /* The check_relocs and adjust_dynamic_symbol entry points have
9686 determined the sizes of the various dynamic sections. Allocate
9687 memory for them. */
9688 @@ -11634,6 +13073,11 @@ arm_map_one_stub (struct bfd_hash_entry
9689 bfd_vma addr;
9690 char *stub_name;
9691 output_arch_syminfo *osi;
9692 + const insn_sequence *template;
9693 + enum stub_insn_type prev_type;
9694 + int size;
9695 + int i;
9696 + enum map_symbol_type sym_type;
9697
9698 /* Massage our args to the form they really have. */
9699 stub_entry = (struct elf32_arm_stub_hash_entry *) gen_entry;
9700 @@ -11652,58 +13096,74 @@ arm_map_one_stub (struct bfd_hash_entry
9701 addr = (bfd_vma) stub_entry->stub_offset;
9702 stub_name = stub_entry->output_name;
9703
9704 - switch (stub_entry->stub_type)
9705 + template = stub_entry->stub_template;
9706 + switch (template[0].type)
9707 {
9708 - case arm_stub_long_branch:
9709 - if (!elf32_arm_output_stub_sym (osi, stub_name, addr, 8))
9710 - return FALSE;
9711 - if (!elf32_arm_output_map_sym (osi, ARM_MAP_ARM, addr))
9712 - return FALSE;
9713 - if (!elf32_arm_output_map_sym (osi, ARM_MAP_DATA, addr + 4))
9714 - return FALSE;
9715 - break;
9716 - case arm_thumb_v4t_stub_long_branch:
9717 - if (!elf32_arm_output_stub_sym (osi, stub_name, addr, 12))
9718 - return FALSE;
9719 - if (!elf32_arm_output_map_sym (osi, ARM_MAP_ARM, addr))
9720 - return FALSE;
9721 - if (!elf32_arm_output_map_sym (osi, ARM_MAP_DATA, addr + 8))
9722 - return FALSE;
9723 - break;
9724 - case arm_thumb_thumb_stub_long_branch:
9725 - if (!elf32_arm_output_stub_sym (osi, stub_name, addr | 1, 16))
9726 - return FALSE;
9727 - if (!elf32_arm_output_map_sym (osi, ARM_MAP_THUMB, addr))
9728 - return FALSE;
9729 - if (!elf32_arm_output_map_sym (osi, ARM_MAP_DATA, addr + 12))
9730 - return FALSE;
9731 - break;
9732 - case arm_thumb_arm_v4t_stub_long_branch:
9733 - if (!elf32_arm_output_stub_sym (osi, stub_name, addr | 1, 20))
9734 - return FALSE;
9735 - if (!elf32_arm_output_map_sym (osi, ARM_MAP_THUMB, addr))
9736 - return FALSE;
9737 - if (!elf32_arm_output_map_sym (osi, ARM_MAP_ARM, addr + 8))
9738 - return FALSE;
9739 - if (!elf32_arm_output_map_sym (osi, ARM_MAP_DATA, addr + 16))
9740 + case ARM_TYPE:
9741 + if (!elf32_arm_output_stub_sym (osi, stub_name, addr, stub_entry->stub_size))
9742 return FALSE;
9743 break;
9744 - case arm_thumb_arm_v4t_stub_short_branch:
9745 - if (!elf32_arm_output_stub_sym (osi, stub_name, addr | 1, 8))
9746 - return FALSE;
9747 - if (!elf32_arm_output_map_sym (osi, ARM_MAP_ARM, addr + 4))
9748 - return FALSE;
9749 - break;
9750 - case arm_stub_pic_long_branch:
9751 - if (!elf32_arm_output_stub_sym (osi, stub_name, addr, 12))
9752 - return FALSE;
9753 - if (!elf32_arm_output_map_sym (osi, ARM_MAP_ARM, addr))
9754 - return FALSE;
9755 - if (!elf32_arm_output_map_sym (osi, ARM_MAP_DATA, addr + 8))
9756 + case THUMB16_TYPE:
9757 + case THUMB32_TYPE:
9758 + if (!elf32_arm_output_stub_sym (osi, stub_name, addr | 1,
9759 + stub_entry->stub_size))
9760 return FALSE;
9761 break;
9762 default:
9763 BFD_FAIL ();
9764 + return FALSE;
9765 + }
9766 +
9767 + prev_type = DATA_TYPE;
9768 + size = 0;
9769 + for (i = 0; i < stub_entry->stub_template_size; i++)
9770 + {
9771 + switch (template[i].type)
9772 + {
9773 + case ARM_TYPE:
9774 + sym_type = ARM_MAP_ARM;
9775 + break;
9776 +
9777 + case THUMB16_TYPE:
9778 + case THUMB32_TYPE:
9779 + sym_type = ARM_MAP_THUMB;
9780 + break;
9781 +
9782 + case DATA_TYPE:
9783 + sym_type = ARM_MAP_DATA;
9784 + break;
9785 +
9786 + default:
9787 + BFD_FAIL ();
9788 + return FALSE;
9789 + }
9790 +
9791 + if (template[i].type != prev_type)
9792 + {
9793 + prev_type = template[i].type;
9794 + if (!elf32_arm_output_map_sym (osi, sym_type, addr + size))
9795 + return FALSE;
9796 + }
9797 +
9798 + switch (template[i].type)
9799 + {
9800 + case ARM_TYPE:
9801 + case THUMB32_TYPE:
9802 + size += 4;
9803 + break;
9804 +
9805 + case THUMB16_TYPE:
9806 + size += 2;
9807 + break;
9808 +
9809 + case DATA_TYPE:
9810 + size += 4;
9811 + break;
9812 +
9813 + default:
9814 + BFD_FAIL ();
9815 + return FALSE;
9816 + }
9817 }
9818
9819 return TRUE;
9820 @@ -11885,6 +13345,150 @@ elf32_arm_compare_mapping (const void *
9821 return 0;
9822 }
9823
9824 +/* Add OFFSET to lower 31 bits of ADDR, leaving other bits unmodified. */
9825 +
9826 +static unsigned long
9827 +offset_prel31 (unsigned long addr, bfd_vma offset)
9828 +{
9829 + return (addr & ~0x7ffffffful) | ((addr + offset) & 0x7ffffffful);
9830 +}
9831 +
9832 +/* Copy an .ARM.exidx table entry, adding OFFSET to (applied) PREL31
9833 + relocations. */
9834 +
9835 +static void
9836 +copy_exidx_entry (bfd *output_bfd, bfd_byte *to, bfd_byte *from, bfd_vma offset)
9837 +{
9838 + unsigned long first_word = bfd_get_32 (output_bfd, from);
9839 + unsigned long second_word = bfd_get_32 (output_bfd, from + 4);
9840 +
9841 + /* High bit of first word is supposed to be zero. */
9842 + if ((first_word & 0x80000000ul) == 0)
9843 + first_word = offset_prel31 (first_word, offset);
9844 +
9845 + /* If the high bit of the first word is clear, and the bit pattern is not 0x1
9846 + (EXIDX_CANTUNWIND), this is an offset to an .ARM.extab entry. */
9847 + if ((second_word != 0x1) && ((second_word & 0x80000000ul) == 0))
9848 + second_word = offset_prel31 (second_word, offset);
9849 +
9850 + bfd_put_32 (output_bfd, first_word, to);
9851 + bfd_put_32 (output_bfd, second_word, to + 4);
9852 +}
9853 +
9854 +/* Data for make_branch_to_a8_stub(). */
9855 +
9856 +struct a8_branch_to_stub_data {
9857 + asection *writing_section;
9858 + bfd_byte *contents;
9859 +};
9860 +
9861 +
9862 +/* Helper to insert branches to Cortex-A8 erratum stubs in the right
9863 + places for a particular section. */
9864 +
9865 +static bfd_boolean
9866 +make_branch_to_a8_stub (struct bfd_hash_entry *gen_entry,
9867 + void *in_arg)
9868 +{
9869 + struct elf32_arm_stub_hash_entry *stub_entry;
9870 + struct a8_branch_to_stub_data *data;
9871 + bfd_byte *contents;
9872 + unsigned long branch_insn;
9873 + bfd_vma veneered_insn_loc, veneer_entry_loc;
9874 + bfd_signed_vma branch_offset;
9875 + bfd *abfd;
9876 + unsigned int index;
9877 +
9878 + stub_entry = (struct elf32_arm_stub_hash_entry *) gen_entry;
9879 + data = (struct a8_branch_to_stub_data *) in_arg;
9880 +
9881 + if (stub_entry->target_section != data->writing_section
9882 + || stub_entry->stub_type < arm_stub_a8_veneer_b_cond)
9883 + return TRUE;
9884 +
9885 + contents = data->contents;
9886 +
9887 + veneered_insn_loc = stub_entry->target_section->output_section->vma
9888 + + stub_entry->target_section->output_offset
9889 + + stub_entry->target_value;
9890 +
9891 + veneer_entry_loc = stub_entry->stub_sec->output_section->vma
9892 + + stub_entry->stub_sec->output_offset
9893 + + stub_entry->stub_offset;
9894 +
9895 + if (stub_entry->stub_type == arm_stub_a8_veneer_blx)
9896 + veneered_insn_loc &= ~3u;
9897 +
9898 + branch_offset = veneer_entry_loc - veneered_insn_loc - 4;
9899 +
9900 + abfd = stub_entry->target_section->owner;
9901 + index = stub_entry->target_value;
9902 +
9903 + /* We attempt to avoid this condition by setting stubs_always_after_branch
9904 + in elf32_arm_size_stubs if we've enabled the Cortex-A8 erratum workaround.
9905 + This check is just to be on the safe side... */
9906 + if ((veneered_insn_loc & ~0xfff) == (veneer_entry_loc & ~0xfff))
9907 + {
9908 + (*_bfd_error_handler) (_("%B: error: Cortex-A8 erratum stub is "
9909 + "allocated in unsafe location"), abfd);
9910 + return FALSE;
9911 + }
9912 +
9913 + switch (stub_entry->stub_type)
9914 + {
9915 + case arm_stub_a8_veneer_b:
9916 + case arm_stub_a8_veneer_b_cond:
9917 + branch_insn = 0xf0009000;
9918 + goto jump24;
9919 +
9920 + case arm_stub_a8_veneer_blx:
9921 + branch_insn = 0xf000e800;
9922 + goto jump24;
9923 +
9924 + case arm_stub_a8_veneer_bl:
9925 + {
9926 + unsigned int i1, j1, i2, j2, s;
9927 +
9928 + branch_insn = 0xf000d000;
9929 +
9930 + jump24:
9931 + if (branch_offset < -16777216 || branch_offset > 16777214)
9932 + {
9933 + /* There's not much we can do apart from complain if this
9934 + happens. */
9935 + (*_bfd_error_handler) (_("%B: error: Cortex-A8 erratum stub out "
9936 + "of range (input file too large)"), abfd);
9937 + return FALSE;
9938 + }
9939 +
9940 + /* i1 = not(j1 eor s), so:
9941 + not i1 = j1 eor s
9942 + j1 = (not i1) eor s. */
9943 +
9944 + branch_insn |= (branch_offset >> 1) & 0x7ff;
9945 + branch_insn |= ((branch_offset >> 12) & 0x3ff) << 16;
9946 + i2 = (branch_offset >> 22) & 1;
9947 + i1 = (branch_offset >> 23) & 1;
9948 + s = (branch_offset >> 24) & 1;
9949 + j1 = (!i1) ^ s;
9950 + j2 = (!i2) ^ s;
9951 + branch_insn |= j2 << 11;
9952 + branch_insn |= j1 << 13;
9953 + branch_insn |= s << 26;
9954 + }
9955 + break;
9956 +
9957 + default:
9958 + BFD_FAIL ();
9959 + return FALSE;
9960 + }
9961 +
9962 + bfd_put_16 (abfd, (branch_insn >> 16) & 0xffff, &contents[index]);
9963 + bfd_put_16 (abfd, branch_insn & 0xffff, &contents[index + 2]);
9964 +
9965 + return TRUE;
9966 +}
9967 +
9968
9969 /* Do code byteswapping. Return FALSE afterwards so that the section is
9970 written out as normal. */
9971 @@ -11895,16 +13499,16 @@ elf32_arm_write_section (bfd *output_bfd
9972 asection *sec,
9973 bfd_byte *contents)
9974 {
9975 - int mapcount, errcount;
9976 + unsigned int mapcount, errcount;
9977 _arm_elf_section_data *arm_data;
9978 struct elf32_arm_link_hash_table *globals = elf32_arm_hash_table (link_info);
9979 elf32_arm_section_map *map;
9980 - elf32_vfp11_erratum_list *errnode;
9981 + elf32_cpu_erratum_list *errnode;
9982 bfd_vma ptr;
9983 bfd_vma end;
9984 bfd_vma offset = sec->output_section->vma + sec->output_offset;
9985 bfd_byte tmp;
9986 - int i;
9987 + unsigned int i;
9988
9989 /* If this section has not been allocated an _arm_elf_section_data
9990 structure then we cannot record anything. */
9991 @@ -11928,11 +13532,12 @@ elf32_arm_write_section (bfd *output_bfd
9992 switch (errnode->type)
9993 {
9994 case VFP11_ERRATUM_BRANCH_TO_ARM_VENEER:
9995 + case JANUS_2CC_ERRATUM_BRANCH_TO_ARM_VENEER:
9996 {
9997 bfd_vma branch_to_veneer;
9998 /* Original condition code of instruction, plus bit mask for
9999 ARM B instruction. */
10000 - unsigned int insn = (errnode->u.b.vfp_insn & 0xf0000000)
10001 + unsigned int insn = (errnode->u.b.orig_insn & 0xf0000000)
10002 | 0x0a000000;
10003
10004 /* The instruction is before the label. */
10005 @@ -11970,7 +13575,7 @@ elf32_arm_write_section (bfd *output_bfd
10006 "range"), output_bfd);
10007
10008 /* Original instruction. */
10009 - insn = errnode->u.v.branch->u.b.vfp_insn;
10010 + insn = errnode->u.v.branch->u.b.orig_insn;
10011 contents[endianflip ^ index] = insn & 0xff;
10012 contents[endianflip ^ (index + 1)] = (insn >> 8) & 0xff;
10013 contents[endianflip ^ (index + 2)] = (insn >> 16) & 0xff;
10014 @@ -11985,12 +13590,136 @@ elf32_arm_write_section (bfd *output_bfd
10015 }
10016 break;
10017
10018 + case JANUS_2CC_ERRATUM_ARM_VENEER:
10019 + {
10020 + bfd_vma branch_from_veneer;
10021 + unsigned int insn;
10022 +
10023 + branch_from_veneer = errnode->u.v.branch->vma - errnode->vma
10024 + - 16;
10025 +
10026 + if ((signed) branch_from_veneer < -(1 << 25)
10027 + || (signed) branch_from_veneer >= (1 << 25))
10028 + (*_bfd_error_handler) (_("%B: error: Janus 2CC veneer out of "
10029 + "range"), output_bfd);
10030 +
10031 + bfd_put_32 (output_bfd, errnode->u.v.branch->u.b.orig_insn,
10032 + contents + index);
10033 +
10034 + /* nop, mov r0, r0. */
10035 + bfd_put_32 (output_bfd, 0xe1a00000, contents + index + 4);
10036 +
10037 + insn = 0xea000000 | ((branch_from_veneer >> 2) & 0xffffff);
10038 + bfd_put_32 (output_bfd, insn, contents + index + 8);
10039 + }
10040 + break;
10041 +
10042 default:
10043 abort ();
10044 }
10045 }
10046 }
10047
10048 + if (arm_data->elf.this_hdr.sh_type == SHT_ARM_EXIDX)
10049 + {
10050 + arm_unwind_table_edit *edit_node
10051 + = arm_data->u.exidx.unwind_edit_list;
10052 + /* Now, sec->size is the size of the section we will write. The original
10053 + size (before we merged duplicate entries and inserted EXIDX_CANTUNWIND
10054 + markers) was sec->rawsize. (This isn't the case if we perform no
10055 + edits, then rawsize will be zero and we should use size). */
10056 + bfd_byte *edited_contents = bfd_malloc (sec->size);
10057 + unsigned int input_size = sec->rawsize ? sec->rawsize : sec->size;
10058 + unsigned int in_index, out_index;
10059 + bfd_vma add_to_offsets = 0;
10060 +
10061 + for (in_index = 0, out_index = 0; in_index * 8 < input_size || edit_node;)
10062 + {
10063 + if (edit_node)
10064 + {
10065 + unsigned int edit_index = edit_node->index;
10066 +
10067 + if (in_index < edit_index && in_index * 8 < input_size)
10068 + {
10069 + copy_exidx_entry (output_bfd, edited_contents + out_index * 8,
10070 + contents + in_index * 8, add_to_offsets);
10071 + out_index++;
10072 + in_index++;
10073 + }
10074 + else if (in_index == edit_index
10075 + || (in_index * 8 >= input_size
10076 + && edit_index == UINT_MAX))
10077 + {
10078 + switch (edit_node->type)
10079 + {
10080 + case DELETE_EXIDX_ENTRY:
10081 + in_index++;
10082 + add_to_offsets += 8;
10083 + break;
10084 +
10085 + case INSERT_EXIDX_CANTUNWIND_AT_END:
10086 + {
10087 + asection *text_sec = edit_node->linked_section;
10088 + bfd_vma text_offset = text_sec->output_section->vma
10089 + + text_sec->output_offset
10090 + + text_sec->size;
10091 + bfd_vma exidx_offset = offset + out_index * 8;
10092 + unsigned long prel31_offset;
10093 +
10094 + /* Note: this is meant to be equivalent to an
10095 + R_ARM_PREL31 relocation. These synthetic
10096 + EXIDX_CANTUNWIND markers are not relocated by the
10097 + usual BFD method. */
10098 + prel31_offset = (text_offset - exidx_offset)
10099 + & 0x7ffffffful;
10100 +
10101 + /* First address we can't unwind. */
10102 + bfd_put_32 (output_bfd, prel31_offset,
10103 + &edited_contents[out_index * 8]);
10104 +
10105 + /* Code for EXIDX_CANTUNWIND. */
10106 + bfd_put_32 (output_bfd, 0x1,
10107 + &edited_contents[out_index * 8 + 4]);
10108 +
10109 + out_index++;
10110 + add_to_offsets -= 8;
10111 + }
10112 + break;
10113 + }
10114 +
10115 + edit_node = edit_node->next;
10116 + }
10117 + }
10118 + else
10119 + {
10120 + /* No more edits, copy remaining entries verbatim. */
10121 + copy_exidx_entry (output_bfd, edited_contents + out_index * 8,
10122 + contents + in_index * 8, add_to_offsets);
10123 + out_index++;
10124 + in_index++;
10125 + }
10126 + }
10127 +
10128 + if (!(sec->flags & SEC_EXCLUDE) && !(sec->flags & SEC_NEVER_LOAD))
10129 + bfd_set_section_contents (output_bfd, sec->output_section,
10130 + edited_contents,
10131 + (file_ptr) sec->output_offset, sec->size);
10132 +
10133 + return TRUE;
10134 + }
10135 +
10136 + /* Fix code to point to Cortex-A8 erratum stubs. */
10137 + if (globals->fix_cortex_a8)
10138 + {
10139 + struct a8_branch_to_stub_data data;
10140 +
10141 + data.writing_section = sec;
10142 + data.contents = contents;
10143 +
10144 + bfd_hash_traverse (&globals->stub_hash_table, make_branch_to_a8_stub,
10145 + &data);
10146 + }
10147 +
10148 if (mapcount == 0)
10149 return FALSE;
10150
10151 @@ -12267,6 +13996,7 @@ const struct elf_size_info elf32_arm_siz
10152 #define bfd_elf32_bfd_is_target_special_symbol elf32_arm_is_target_special_symbol
10153 #define bfd_elf32_close_and_cleanup elf32_arm_close_and_cleanup
10154 #define bfd_elf32_bfd_free_cached_info elf32_arm_bfd_free_cached_info
10155 +#define bfd_elf32_bfd_final_link elf32_arm_final_link
10156
10157 #define elf_backend_get_symbol_type elf32_arm_get_symbol_type
10158 #define elf_backend_gc_mark_hook elf32_arm_gc_mark_hook
10159 --- a/bfd/elf32-mips.c
10160 +++ b/bfd/elf32-mips.c
10161 @@ -1662,6 +1662,15 @@ static const struct ecoff_debug_swap mip
10162 #define elf_backend_plt_readonly 1
10163 #define elf_backend_plt_sym_val _bfd_mips_elf_plt_sym_val
10164
10165 +/* Most MIPS ELF files do not contain a traditional PLT; only VxWorks
10166 + and non-PIC dynamic executables do. These settings only affect
10167 + _bfd_elf_create_dynamic_sections, which is only called when we
10168 + do want a traditional PLT. */
10169 +#undef elf_backend_want_plt_sym
10170 +#define elf_backend_want_plt_sym 1
10171 +#undef elf_backend_plt_readonly
10172 +#define elf_backend_plt_readonly 1
10173 +
10174 #define elf_backend_discard_info _bfd_mips_elf_discard_info
10175 #define elf_backend_ignore_discarded_relocs \
10176 _bfd_mips_elf_ignore_discarded_relocs
10177 @@ -1686,6 +1695,8 @@ static const struct ecoff_debug_swap mip
10178 #define bfd_elf32_bfd_print_private_bfd_data \
10179 _bfd_mips_elf_print_private_bfd_data
10180
10181 +#define elf_backend_plt_sym_val _bfd_mips_elf_plt_sym_val
10182 +
10183 /* Support for SGI-ish mips targets. */
10184 #define TARGET_LITTLE_SYM bfd_elf32_littlemips_vec
10185 #define TARGET_LITTLE_NAME "elf32-littlemips"
10186 @@ -1789,6 +1800,7 @@ mips_vxworks_final_write_processing (bfd
10187 #undef elf_backend_additional_program_headers
10188 #undef elf_backend_modify_segment_map
10189 #undef elf_backend_symbol_processing
10190 +#undef elf_backend_plt_sym_val
10191 /* NOTE: elf_backend_rela_normal is not defined for MIPS. */
10192
10193 #include "elf32-target.h"
10194 --- a/bfd/elflink.c
10195 +++ b/bfd/elflink.c
10196 @@ -12502,3 +12502,15 @@ _bfd_elf_make_dynamic_reloc_section (ase
10197
10198 return reloc_sec;
10199 }
10200 +
10201 +/* Copy the ELF symbol type associated with a linker hash entry. */
10202 +void
10203 +_bfd_elf_copy_link_hash_symbol_type (bfd *abfd ATTRIBUTE_UNUSED,
10204 + struct bfd_link_hash_entry * hdest,
10205 + struct bfd_link_hash_entry * hsrc)
10206 +{
10207 + struct elf_link_hash_entry *ehdest = (struct elf_link_hash_entry *)hdest;
10208 + struct elf_link_hash_entry *ehsrc = (struct elf_link_hash_entry *)hsrc;
10209 +
10210 + ehdest->type = ehsrc->type;
10211 +}
10212 --- a/bfd/elfxx-mips.c
10213 +++ b/bfd/elfxx-mips.c
10214 @@ -677,6 +677,11 @@ static bfd *reldyn_sorting_bfd;
10215 /* Nonzero if ABFD is using NewABI conventions. */
10216 #define NEWABI_P(abfd) (ABI_N32_P (abfd) || ABI_64_P (abfd))
10217
10218 +/* Nonzero if ABFD is a non-PIC object. */
10219 +#define NON_PIC_P(abfd) \
10220 + (((elf_elfheader (abfd)->e_flags & EF_MIPS_PIC) == 0) \
10221 + && ((elf_elfheader (abfd)->e_flags & EF_MIPS_CPIC) == EF_MIPS_CPIC))
10222 +
10223 /* The IRIX compatibility level we are striving for. */
10224 #define IRIX_COMPAT(abfd) \
10225 (get_elf_backend_data (abfd)->elf_backend_mips_irix_compat (abfd))
10226 @@ -689,6 +694,9 @@ static bfd *reldyn_sorting_bfd;
10227 #define MIPS_ELF_OPTIONS_SECTION_NAME(abfd) \
10228 (NEWABI_P (abfd) ? ".MIPS.options" : ".options")
10229
10230 +/* The name of the section holding non-PIC to PIC call stubs. */
10231 +#define NON_PIC_TO_PIC_STUB_SECTION_NAME ".MIPS.pic_stubs"
10232 +
10233 /* True if NAME is the recognized name of any SHT_MIPS_OPTIONS section.
10234 Some IRIX system files do not use MIPS_ELF_OPTIONS_SECTION_NAME. */
10235 #define MIPS_ELF_OPTIONS_SECTION_NAME_P(NAME) \
10236 @@ -6256,11 +6264,6 @@ _bfd_mips_elf_section_processing (bfd *a
10237 hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
10238 hdr->sh_type = SHT_PROGBITS;
10239 }
10240 - else if (strcmp (name, ".sbss") == 0)
10241 - {
10242 - hdr->sh_flags |= SHF_ALLOC | SHF_WRITE | SHF_MIPS_GPREL;
10243 - hdr->sh_type = SHT_NOBITS;
10244 - }
10245 else if (strcmp (name, ".srdata") == 0)
10246 {
10247 hdr->sh_flags |= SHF_ALLOC | SHF_MIPS_GPREL;
10248 @@ -7587,7 +7590,9 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s
10249
10250 /* We need a stub, not a plt entry for the undefined
10251 function. But we record it as if it needs plt. See
10252 - _bfd_elf_adjust_dynamic_symbol. */
10253 + _bfd_elf_adjust_dynamic_symbol. Note that these relocations
10254 + are always used for PIC calls, even when using the new
10255 + non-PIC ABI. */
10256 h->needs_plt = 1;
10257 h->type = STT_FUNC;
10258 }
10259 @@ -7693,6 +7698,8 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s
10260 case R_MIPS_32:
10261 case R_MIPS_REL32:
10262 case R_MIPS_64:
10263 + if (h != NULL)
10264 + h->non_got_ref = TRUE;
10265 /* In VxWorks executables, references to external symbols
10266 are handled using copy relocs or PLT stubs, so there's
10267 no need to add a .rela.dyn entry for this relocation. */
10268 @@ -7748,11 +7755,21 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s
10269 case R_MIPS_GPREL16:
10270 case R_MIPS_LITERAL:
10271 case R_MIPS_GPREL32:
10272 + if (h != NULL
10273 + && (r_type == R_MIPS_GPREL16 || r_type == R_MIPS_GPREL32))
10274 + h->non_got_ref = TRUE;
10275 +
10276 if (SGI_COMPAT (abfd))
10277 mips_elf_hash_table (info)->compact_rel_size +=
10278 sizeof (Elf32_External_crinfo);
10279 break;
10280
10281 + case R_MIPS_HI16:
10282 + case R_MIPS_LO16:
10283 + if (h != NULL && strcmp (h->root.root.string, "_gp_disp") != 0)
10284 + h->non_got_ref = TRUE;
10285 + break;
10286 +
10287 /* This relocation describes the C++ object vtable hierarchy.
10288 Reconstruct it for later use during GC. */
10289 case R_MIPS_GNU_VTINHERIT:
10290 @@ -7775,20 +7792,20 @@ _bfd_mips_elf_check_relocs (bfd *abfd, s
10291
10292 /* We must not create a stub for a symbol that has relocations
10293 related to taking the function's address. This doesn't apply to
10294 - VxWorks, where CALL relocs refer to a .got.plt entry instead of
10295 - a normal .got entry. */
10296 + VxWorks or the non-PIC ABI, where CALL relocs refer to a
10297 + .got.plt entry instead of a normal .got entry. */
10298 if (!htab->is_vxworks && h != NULL)
10299 switch (r_type)
10300 {
10301 - default:
10302 - ((struct mips_elf_link_hash_entry *) h)->no_fn_stub = TRUE;
10303 - break;
10304 case R_MIPS16_CALL16:
10305 case R_MIPS_CALL16:
10306 case R_MIPS_CALL_HI16:
10307 case R_MIPS_CALL_LO16:
10308 case R_MIPS_JALR:
10309 break;
10310 + default:
10311 + ((struct mips_elf_link_hash_entry *) h)->no_fn_stub = TRUE;
10312 + break;
10313 }
10314
10315 /* See if this reloc would need to refer to a MIPS16 hard-float stub,
10316 @@ -12471,7 +12488,9 @@ _bfd_mips_elf_merge_private_bfd_data (bf
10317 break;
10318 }
10319 }
10320 - if (null_input_bfd)
10321 + /* Dynamic objects normally have no sections, and do not reach
10322 + here - but they might if used as DYNOBJ. */
10323 + if (null_input_bfd || (ibfd->flags & DYNAMIC) != 0)
10324 return TRUE;
10325
10326 ok = TRUE;
10327 --- a/bfd/elfxx-mips.h
10328 +++ b/bfd/elfxx-mips.h
10329 @@ -63,6 +63,9 @@ extern bfd_boolean _bfd_mips_elf_finish_
10330 extern bfd_boolean _bfd_mips_vxworks_finish_dynamic_symbol
10331 (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
10332 Elf_Internal_Sym *);
10333 +extern bfd_boolean _bfd_mips_nonpic_finish_dynamic_symbol
10334 + (bfd *, struct bfd_link_info *, struct elf_link_hash_entry *,
10335 + Elf_Internal_Sym *);
10336 extern bfd_boolean _bfd_mips_elf_finish_dynamic_sections
10337 (bfd *, struct bfd_link_info *);
10338 extern void _bfd_mips_elf_final_write_processing
10339 @@ -153,6 +156,15 @@ extern const struct bfd_elf_special_sect
10340
10341 extern bfd_boolean _bfd_mips_elf_common_definition (Elf_Internal_Sym *);
10342
10343 +extern bfd_vma _bfd_mips_elf_plt_sym_val
10344 + (bfd_vma, const asection *, const arelent *);
10345 +extern void _bfd_mips_elf_begin_write_processing
10346 + (bfd *abfd, struct bfd_link_info *link_info);
10347 +extern bfd_boolean bfd_mips_elf_maybe_create_non_pic_to_pic_stubs_section
10348 + (struct bfd_link_info *);
10349 +extern void _bfd_mips_post_process_headers
10350 + (bfd *abfd, struct bfd_link_info *link_info);
10351 +
10352 #define elf_backend_common_definition _bfd_mips_elf_common_definition
10353 #define elf_backend_name_local_section_symbols \
10354 _bfd_mips_elf_name_local_section_symbols
10355 --- a/bfd/elfxx-target.h
10356 +++ b/bfd/elfxx-target.h
10357 @@ -256,6 +256,11 @@
10358 #define bfd_elfNN_bfd_link_just_syms _bfd_elf_link_just_syms
10359 #endif
10360
10361 +#ifndef bfd_elfNN_bfd_copy_link_hash_symbol_type
10362 +#define bfd_elfNN_bfd_copy_link_hash_symbol_type \
10363 + _bfd_elf_copy_link_hash_symbol_type
10364 +#endif
10365 +
10366 #ifndef bfd_elfNN_bfd_link_split_section
10367 #define bfd_elfNN_bfd_link_split_section _bfd_generic_link_split_section
10368 #endif
10369 --- a/bfd/i386msdos.c
10370 +++ b/bfd/i386msdos.c
10371 @@ -152,6 +152,8 @@ msdos_set_section_contents (bfd *abfd,
10372 #define msdos_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10373 #define msdos_bfd_link_add_symbols _bfd_generic_link_add_symbols
10374 #define msdos_bfd_link_just_syms _bfd_generic_link_just_syms
10375 +#define msdos_bfd_copy_link_hash_symbol_type \
10376 + _bfd_generic_copy_link_hash_symbol_type
10377 #define msdos_bfd_final_link _bfd_generic_final_link
10378 #define msdos_bfd_link_split_section _bfd_generic_link_split_section
10379 #define msdos_set_arch_mach _bfd_generic_set_arch_mach
10380 --- a/bfd/i386os9k.c
10381 +++ b/bfd/i386os9k.c
10382 @@ -176,6 +176,8 @@ os9k_sizeof_headers (bfd *abfd ATTRIBUTE
10383 #define os9k_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10384 #define os9k_bfd_link_add_symbols _bfd_generic_link_add_symbols
10385 #define os9k_bfd_link_just_syms _bfd_generic_link_just_syms
10386 +#define os9k_bfd_copy_link_hash_symbol_type \
10387 + _bfd_generic_copy_link_hash_symbol_type
10388 #define os9k_bfd_final_link _bfd_generic_final_link
10389 #define os9k_bfd_link_split_section _bfd_generic_link_split_section
10390
10391 --- a/bfd/ieee.c
10392 +++ b/bfd/ieee.c
10393 @@ -3774,6 +3774,8 @@ ieee_sizeof_headers (bfd *abfd ATTRIBUTE
10394 #define ieee_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10395 #define ieee_bfd_link_add_symbols _bfd_generic_link_add_symbols
10396 #define ieee_bfd_link_just_syms _bfd_generic_link_just_syms
10397 +#define ieee_bfd_copy_link_hash_symbol_type \
10398 + _bfd_generic_copy_link_hash_symbol_type
10399 #define ieee_bfd_final_link _bfd_generic_final_link
10400 #define ieee_bfd_link_split_section _bfd_generic_link_split_section
10401
10402 --- a/bfd/ihex.c
10403 +++ b/bfd/ihex.c
10404 @@ -770,6 +770,14 @@ ihex_write_object_contents (bfd *abfd)
10405 bfd_size_type count;
10406
10407 where = l->where;
10408 +
10409 + /* If the top 32 bits of a 64-bit address are simply a sign-extension
10410 + of the bottom 32 bits, then simply truncate the address to 32 bits. */
10411 + if (sizeof (bfd_vma) * 8 > 32
10412 + && ((where & ~(bfd_vma)0x7fffffff) == 0
10413 + || (where & ~(bfd_vma)0x7fffffff) == ~(bfd_vma)0x7fffffff))
10414 + where &= (bfd_vma)0xffffffffUL;
10415 +
10416 p = l->data;
10417 count = l->size;
10418
10419 @@ -937,6 +945,8 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE
10420 #define ihex_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10421 #define ihex_bfd_link_add_symbols _bfd_generic_link_add_symbols
10422 #define ihex_bfd_link_just_syms _bfd_generic_link_just_syms
10423 +#define ihex_bfd_copy_link_hash_symbol_type \
10424 + _bfd_generic_copy_link_hash_symbol_type
10425 #define ihex_bfd_final_link _bfd_generic_final_link
10426 #define ihex_bfd_link_split_section _bfd_generic_link_split_section
10427
10428 --- a/bfd/libbfd-in.h
10429 +++ b/bfd/libbfd-in.h
10430 @@ -410,6 +410,9 @@ extern bfd_boolean _bfd_generic_set_sect
10431 ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
10432 #define _bfd_nolink_bfd_link_just_syms \
10433 ((void (*) (asection *, struct bfd_link_info *)) bfd_void)
10434 +#define _bfd_nolink_bfd_copy_link_hash_symbol_type \
10435 + ((void (*) (bfd *, struct bfd_link_hash_entry *, \
10436 + struct bfd_link_hash_entry *)) bfd_void)
10437 #define _bfd_nolink_bfd_final_link \
10438 ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
10439 #define _bfd_nolink_bfd_link_split_section \
10440 @@ -521,6 +524,10 @@ extern bfd_boolean _bfd_generic_link_add
10441 extern void _bfd_generic_link_just_syms
10442 (asection *, struct bfd_link_info *);
10443
10444 +/* Generic routine that does nothing. */
10445 +extern void _bfd_generic_copy_link_hash_symbol_type
10446 + (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
10447 +
10448 /* Generic link routine. */
10449 extern bfd_boolean _bfd_generic_final_link
10450 (bfd *, struct bfd_link_info *);
10451 --- a/bfd/libbfd.h
10452 +++ b/bfd/libbfd.h
10453 @@ -415,6 +415,9 @@ extern bfd_boolean _bfd_generic_set_sect
10454 ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
10455 #define _bfd_nolink_bfd_link_just_syms \
10456 ((void (*) (asection *, struct bfd_link_info *)) bfd_void)
10457 +#define _bfd_nolink_bfd_copy_link_hash_symbol_type \
10458 + ((void (*) (bfd *, struct bfd_link_hash_entry *, \
10459 + struct bfd_link_hash_entry *)) bfd_void)
10460 #define _bfd_nolink_bfd_final_link \
10461 ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) bfd_false)
10462 #define _bfd_nolink_bfd_link_split_section \
10463 @@ -526,6 +529,10 @@ extern bfd_boolean _bfd_generic_link_add
10464 extern void _bfd_generic_link_just_syms
10465 (asection *, struct bfd_link_info *);
10466
10467 +/* Generic routine that does nothing. */
10468 +extern void _bfd_generic_copy_link_hash_symbol_type
10469 + (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
10470 +
10471 /* Generic link routine. */
10472 extern bfd_boolean _bfd_generic_final_link
10473 (bfd *, struct bfd_link_info *);
10474 --- a/bfd/libecoff.h
10475 +++ b/bfd/libecoff.h
10476 @@ -310,6 +310,8 @@ extern struct bfd_link_hash_table *_bfd_
10477 extern bfd_boolean _bfd_ecoff_bfd_link_add_symbols
10478 (bfd *, struct bfd_link_info *);
10479 #define _bfd_ecoff_bfd_link_just_syms _bfd_generic_link_just_syms
10480 +#define _bfd_ecoff_bfd_copy_link_hash_symbol_type \
10481 + _bfd_generic_copy_link_hash_symbol_type
10482 extern bfd_boolean _bfd_ecoff_bfd_final_link
10483 (bfd *, struct bfd_link_info *);
10484
10485 --- a/bfd/linker.c
10486 +++ b/bfd/linker.c
10487 @@ -795,6 +795,17 @@ _bfd_generic_link_just_syms (asection *s
10488 sec->output_offset = sec->vma;
10489 }
10490
10491 +/* Copy the type of a symbol assiciated with a linker hast table entry.
10492 + Override this so that symbols created in linker scripts get their
10493 + type from the RHS of the assignment.
10494 + The default implementation does nothing. */
10495 +void
10496 +_bfd_generic_copy_link_hash_symbol_type (bfd *abfd ATTRIBUTE_UNUSED,
10497 + struct bfd_link_hash_entry * hdest ATTRIBUTE_UNUSED,
10498 + struct bfd_link_hash_entry * hsrc ATTRIBUTE_UNUSED)
10499 +{
10500 +}
10501 +
10502 /* Add symbols from an object file to the global hash table. */
10503
10504 static bfd_boolean
10505 --- a/bfd/mach-o.c
10506 +++ b/bfd/mach-o.c
10507 @@ -60,6 +60,8 @@
10508 #define bfd_mach_o_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10509 #define bfd_mach_o_bfd_link_add_symbols _bfd_generic_link_add_symbols
10510 #define bfd_mach_o_bfd_link_just_syms _bfd_generic_link_just_syms
10511 +#define bfd_mach_o_bfd_copy_link_hash_symbol_type \
10512 + _bfd_generic_copy_link_hash_symbol_type
10513 #define bfd_mach_o_bfd_final_link _bfd_generic_final_link
10514 #define bfd_mach_o_bfd_link_split_section _bfd_generic_link_split_section
10515 #define bfd_mach_o_set_arch_mach bfd_default_set_arch_mach
10516 --- a/bfd/mmo.c
10517 +++ b/bfd/mmo.c
10518 @@ -3199,6 +3199,8 @@ mmo_write_object_contents (bfd *abfd)
10519 #define mmo_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10520 #define mmo_bfd_link_add_symbols _bfd_generic_link_add_symbols
10521 #define mmo_bfd_link_just_syms _bfd_generic_link_just_syms
10522 +#define mmo_bfd_copy_link_hash_symbol_type \
10523 + _bfd_generic_copy_link_hash_symbol_type
10524 #define mmo_bfd_final_link _bfd_generic_final_link
10525 #define mmo_bfd_link_split_section _bfd_generic_link_split_section
10526
10527 --- a/bfd/nlm-target.h
10528 +++ b/bfd/nlm-target.h
10529 @@ -53,6 +53,8 @@
10530 #define nlm_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10531 #define nlm_bfd_link_add_symbols _bfd_generic_link_add_symbols
10532 #define nlm_bfd_link_just_syms _bfd_generic_link_just_syms
10533 +#define nlm_bfd_copy_link_hash_symbol_type \
10534 + _bfd_generic_copy_link_hash_symbol_type
10535 #define nlm_bfd_final_link _bfd_generic_final_link
10536 #define nlm_bfd_link_split_section _bfd_generic_link_split_section
10537
10538 --- a/bfd/oasys.c
10539 +++ b/bfd/oasys.c
10540 @@ -1202,6 +1202,8 @@ oasys_sizeof_headers (bfd *abfd ATTRIBUT
10541 #define oasys_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10542 #define oasys_bfd_link_add_symbols _bfd_generic_link_add_symbols
10543 #define oasys_bfd_link_just_syms _bfd_generic_link_just_syms
10544 +#define oasys_bfd_copy_link_hash_symbol_type \
10545 + _bfd_generic_copy_link_hash_symbol_type
10546 #define oasys_bfd_final_link _bfd_generic_final_link
10547 #define oasys_bfd_link_split_section _bfd_generic_link_split_section
10548
10549 --- a/bfd/pef.c
10550 +++ b/bfd/pef.c
10551 @@ -56,6 +56,8 @@
10552 #define bfd_pef_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10553 #define bfd_pef_bfd_link_add_symbols _bfd_generic_link_add_symbols
10554 #define bfd_pef_bfd_link_just_syms _bfd_generic_link_just_syms
10555 +#define bfd_pef_bfd_copy_link_hash_symbol_type \
10556 + _bfd_generic_copy_link_hash_symbol_type
10557 #define bfd_pef_bfd_final_link _bfd_generic_final_link
10558 #define bfd_pef_bfd_link_split_section _bfd_generic_link_split_section
10559 #define bfd_pef_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
10560 --- a/bfd/ppcboot.c
10561 +++ b/bfd/ppcboot.c
10562 @@ -479,6 +479,8 @@ ppcboot_bfd_print_private_bfd_data (abfd
10563 #define ppcboot_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10564 #define ppcboot_bfd_link_add_symbols _bfd_generic_link_add_symbols
10565 #define ppcboot_bfd_link_just_syms _bfd_generic_link_just_syms
10566 +#define ppcboot_bfd_copy_link_hash_symbol_type \
10567 + _bfd_generic_copy_link_hash_symbol_type
10568 #define ppcboot_bfd_final_link _bfd_generic_final_link
10569 #define ppcboot_bfd_link_split_section _bfd_generic_link_split_section
10570 #define ppcboot_get_section_contents_in_window \
10571 --- a/bfd/simple.c
10572 +++ b/bfd/simple.c
10573 @@ -210,7 +210,8 @@ bfd_simple_get_relocated_section_content
10574 data = NULL;
10575 if (outbuf == NULL)
10576 {
10577 - data = bfd_malloc (sec->size);
10578 + bfd_size_type amt = sec->rawsize > sec->size ? sec->rawsize : sec->size;
10579 + data = bfd_malloc (amt);
10580 if (data == NULL)
10581 return NULL;
10582 outbuf = data;
10583 --- a/bfd/som.c
10584 +++ b/bfd/som.c
10585 @@ -6366,6 +6366,8 @@ som_bfd_link_split_section (bfd *abfd AT
10586 #define som_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10587 #define som_bfd_link_add_symbols _bfd_generic_link_add_symbols
10588 #define som_bfd_link_just_syms _bfd_generic_link_just_syms
10589 +#define som_bfd_copy_link_hash_symbol_type \
10590 + _bfd_generic_copy_link_hash_symbol_type
10591 #define som_bfd_final_link _bfd_generic_final_link
10592 #define som_bfd_gc_sections bfd_generic_gc_sections
10593 #define som_bfd_merge_sections bfd_generic_merge_sections
10594 --- a/bfd/srec.c
10595 +++ b/bfd/srec.c
10596 @@ -1259,6 +1259,8 @@ srec_print_symbol (bfd *abfd,
10597 #define srec_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10598 #define srec_bfd_link_add_symbols _bfd_generic_link_add_symbols
10599 #define srec_bfd_link_just_syms _bfd_generic_link_just_syms
10600 +#define srec_bfd_copy_link_hash_symbol_type \
10601 + _bfd_generic_copy_link_hash_symbol_type
10602 #define srec_bfd_final_link _bfd_generic_final_link
10603 #define srec_bfd_link_split_section _bfd_generic_link_split_section
10604
10605 --- a/bfd/targets.c
10606 +++ b/bfd/targets.c
10607 @@ -435,6 +435,7 @@ BFD_JUMP_TABLE macros.
10608 . NAME##_bfd_link_hash_table_free, \
10609 . NAME##_bfd_link_add_symbols, \
10610 . NAME##_bfd_link_just_syms, \
10611 +. NAME##_bfd_copy_link_hash_symbol_type, \
10612 . NAME##_bfd_final_link, \
10613 . NAME##_bfd_link_split_section, \
10614 . NAME##_bfd_gc_sections, \
10615 @@ -465,6 +466,12 @@ BFD_JUMP_TABLE macros.
10616 . {* Indicate that we are only retrieving symbol values from this section. *}
10617 . void (*_bfd_link_just_syms) (asection *, struct bfd_link_info *);
10618 .
10619 +. {* Copy the symbol type of a linker hash table entry. *}
10620 +.#define bfd_copy_link_hash_symbol_type(b, t, f) \
10621 +. BFD_SEND (b, _bfd_copy_link_hash_symbol_type, (b, t, f))
10622 +. void (*_bfd_copy_link_hash_symbol_type)
10623 +. (bfd *, struct bfd_link_hash_entry *, struct bfd_link_hash_entry *);
10624 +.
10625 . {* Do a link based on the link_order structures attached to each
10626 . section of the BFD. *}
10627 . bfd_boolean (*_bfd_final_link) (bfd *, struct bfd_link_info *);
10628 --- a/bfd/tekhex.c
10629 +++ b/bfd/tekhex.c
10630 @@ -947,6 +947,8 @@ tekhex_print_symbol (bfd *abfd,
10631 #define tekhex_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10632 #define tekhex_bfd_link_add_symbols _bfd_generic_link_add_symbols
10633 #define tekhex_bfd_link_just_syms _bfd_generic_link_just_syms
10634 +#define tekhex_bfd_copy_link_hash_symbol_type \
10635 + _bfd_generic_copy_link_hash_symbol_type
10636 #define tekhex_bfd_final_link _bfd_generic_final_link
10637 #define tekhex_bfd_link_split_section _bfd_generic_link_split_section
10638 #define tekhex_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
10639 --- a/bfd/versados.c
10640 +++ b/bfd/versados.c
10641 @@ -812,6 +812,8 @@ versados_canonicalize_reloc (bfd *abfd,
10642 #define versados_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10643 #define versados_bfd_link_add_symbols _bfd_generic_link_add_symbols
10644 #define versados_bfd_link_just_syms _bfd_generic_link_just_syms
10645 +#define versados_bfd_copy_link_hash_symbol_type \
10646 + _bfd_generic_copy_link_hash_symbol_type
10647 #define versados_bfd_final_link _bfd_generic_final_link
10648 #define versados_bfd_link_split_section _bfd_generic_link_split_section
10649
10650 --- a/bfd/vms.c
10651 +++ b/bfd/vms.c
10652 @@ -30,6 +30,8 @@
10653 #define vms_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) bfd_false)
10654 #define vms_make_empty_symbol _bfd_generic_make_empty_symbol
10655 #define vms_bfd_link_just_syms _bfd_generic_link_just_syms
10656 +#define vms_bfd_copy_link_hash_symbol_type \
10657 + _bfd_generic_copy_link_hash_symbol_type
10658 #define vms_bfd_is_group_section bfd_generic_is_group_section
10659 #define vms_bfd_discard_group bfd_generic_discard_group
10660 #define vms_section_already_linked _bfd_generic_section_already_linked
10661 --- a/bfd/xsym.c
10662 +++ b/bfd/xsym.c
10663 @@ -49,6 +49,8 @@
10664 #define bfd_sym_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
10665 #define bfd_sym_bfd_link_add_symbols _bfd_generic_link_add_symbols
10666 #define bfd_sym_bfd_link_just_syms _bfd_generic_link_just_syms
10667 +#define bfd_sym_bfd_copy_link_hash_symbol_type \
10668 + _bfd_generic_copy_link_hash_symbol_type
10669 #define bfd_sym_bfd_final_link _bfd_generic_final_link
10670 #define bfd_sym_bfd_link_split_section _bfd_generic_link_split_section
10671 #define bfd_sym_get_section_contents_in_window _bfd_generic_get_section_contents_in_window
10672 --- a/binutils/objcopy.c
10673 +++ b/binutils/objcopy.c
10674 @@ -2218,6 +2218,26 @@ setup_bfd_headers (bfd *ibfd, bfd *obfd)
10675 return;
10676 }
10677
10678 +/* Sign extend VMA if ABFD tells us that addresses are sign
10679 + extended. */
10680 +
10681 +static bfd_vma
10682 +maybe_sign_extend_vma (bfd *abfd, bfd_vma vma)
10683 +{
10684 + if (bfd_get_sign_extend_vma (abfd) == 1
10685 + && bfd_arch_bits_per_address (abfd) < 8 * sizeof (bfd_vma))
10686 + {
10687 + unsigned int bits = bfd_arch_bits_per_address (abfd);
10688 + bfd_vma sign_bit = ((bfd_vma) 1) << (bits - 1);
10689 + bfd_vma upper_bits = (~(bfd_vma) 0) << bits;
10690 + if ((vma & sign_bit) != 0)
10691 + vma |= upper_bits;
10692 + else
10693 + vma &= ~upper_bits;
10694 + }
10695 + return vma;
10696 +}
10697 +
10698 /* Create a section in OBFD with the same
10699 name and attributes as ISECTION in IBFD. */
10700
10701 @@ -2314,6 +2334,7 @@ setup_section (bfd *ibfd, sec_ptr isecti
10702 else
10703 vma += change_section_address;
10704
10705 + vma = maybe_sign_extend_vma (ibfd, vma);
10706 if (! bfd_set_section_vma (obfd, osection, vma))
10707 {
10708 err = _("failed to set vma");
10709 @@ -2333,6 +2354,7 @@ setup_section (bfd *ibfd, sec_ptr isecti
10710 else
10711 lma += change_section_address;
10712
10713 + lma = maybe_sign_extend_vma (ibfd, lma);
10714 osection->lma = lma;
10715
10716 /* FIXME: This is probably not enough. If we change the LMA we
10717 --- a/binutils/objdump.c
10718 +++ b/binutils/objdump.c
10719 @@ -1895,7 +1895,7 @@ disassemble_section (bfd *abfd, asection
10720 bfd_boolean insns;
10721
10722 addr = section->vma + addr_offset;
10723 - addr = (addr ^ sign_adjust) - sign_adjust;
10724 + addr = ((addr & ((sign_adjust << 1) - 1)) ^ sign_adjust) - sign_adjust;
10725
10726 if (sym != NULL && bfd_asymbol_value (sym) <= addr)
10727 {
10728 @@ -1958,7 +1958,8 @@ disassemble_section (bfd *abfd, asection
10729 else
10730 nextstop_offset = bfd_asymbol_value (nextsym) - section->vma;
10731
10732 - if (nextstop_offset > stop_offset)
10733 + if (nextstop_offset > stop_offset
10734 + || nextstop_offset <= addr_offset)
10735 nextstop_offset = stop_offset;
10736
10737 /* If a symbol is explicitly marked as being an object
10738 --- a/binutils/readelf.c
10739 +++ b/binutils/readelf.c
10740 @@ -2688,6 +2688,10 @@ get_arm_section_type_name (unsigned int
10741 return "ARM_PREEMPTMAP";
10742 case SHT_ARM_ATTRIBUTES:
10743 return "ARM_ATTRIBUTES";
10744 + case SHT_ARM_DEBUGOVERLAY:
10745 + return "ARM_DEBUGOVERLAY";
10746 + case SHT_ARM_OVERLAYSECTION:
10747 + return "ARM_OVERLAYSECTION";
10748 default:
10749 break;
10750 }
10751 --- a/binutils/testsuite/binutils-all/arm/thumb2-cond.s
10752 +++ b/binutils/testsuite/binutils-all/arm/thumb2-cond.s
10753 @@ -1,6 +1,8 @@
10754 -.thumb
10755 + .arch armv7
10756 + .syntax unified
10757 + .thumb
10758 foo:
10759 -.short 0xf000, 0xf800
10760 -.short 0xbf38
10761 -.short 0xf000, 0xbf04
10762 -bx lr
10763 + bl 1f
10764 +1: it cc
10765 + bcc.w .+0xe0c
10766 + bx lr
10767 --- a/binutils/testsuite/binutils-all/objdump.W
10768 +++ b/binutils/testsuite/binutils-all/objdump.W
10769 @@ -1,5 +1,5 @@
10770
10771 -tmpdir/dw2-compressed.o: file format .*
10772 +.*dw2-compressed.o: file format .*
10773
10774 Contents of the .debug_info section:
10775
10776 --- a/binutils/testsuite/binutils-all/objdump.s
10777 +++ b/binutils/testsuite/binutils-all/objdump.s
10778 @@ -1,5 +1,5 @@
10779
10780 -tmpdir/dw2-compressed.o: file format .*
10781 +.*dw2-compressed.o: file format .*
10782
10783 Contents of section .zdebug_abbrev:
10784 0000 5a4c4942 00000000 00000033 785e6314 ZLIB.......3x\^c.
10785 --- a/config/mh-mingw
10786 +++ b/config/mh-mingw
10787 @@ -1,6 +1,8 @@
10788 # Add -D__USE_MINGW_ACCESS to enable the built compiler to work on Windows
10789 # Vista (see PR33281 for details).
10790 -BOOT_CFLAGS += -D__USE_MINGW_ACCESS -Wno-pedantic-ms-format
10791 -CFLAGS += -D__USE_MINGW_ACCESS
10792 +# Because we wrap access in libiberty/cygpath.c, we do not want to use
10793 +# the MinGW wrappers for access.
10794 +BOOT_CFLAGS += -Wno-pedantic-ms-format
10795 +# CFLAGS += -D__USE_MINGW_ACCESS
10796 # Increase stack limit to same as Linux default.
10797 LDFLAGS += -Wl,--stack,8388608
10798 --- a/configure
10799 +++ b/configure
10800 @@ -2597,11 +2597,16 @@ case "${target}" in
10801 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
10802 ;;
10803 mips*-sde-elf*)
10804 - skipdirs="$skipdirs target-libiberty"
10805 - noconfigdirs="$noconfigdirs ${libgcj}"
10806 - if test x$with_newlib = xyes; then
10807 - noconfigdirs="$noconfigdirs gprof"
10808 - fi
10809 + noconfigdirs="${noconfigdirs} sid ${libgcj} target-rda"
10810 + if ! test x"${with_newlib}" = xyes ; then
10811 + # remove libgloss and libiberty too, when we're not building newlib
10812 + skipdirs="${skipdirs} target-libgloss target-libiberty"
10813 + # add sde-conv host tool
10814 + configdirs="${configdirs} convert"
10815 + fi
10816 + # add gprof back in - we do support it!
10817 + skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'`
10818 + noconfigdirs=`echo " ${noconfigdirs} " | sed -e 's/ gprof / /'`
10819 libgloss_dir=mips
10820 ;;
10821 mips*-*-irix5*)
10822 --- a/configure.ac
10823 +++ b/configure.ac
10824 @@ -833,11 +833,16 @@ case "${target}" in
10825 noconfigdirs="$noconfigdirs ld binutils gprof target-libgloss ${libgcj}"
10826 ;;
10827 mips*-sde-elf*)
10828 - skipdirs="$skipdirs target-libiberty"
10829 - noconfigdirs="$noconfigdirs ${libgcj}"
10830 - if test x$with_newlib = xyes; then
10831 - noconfigdirs="$noconfigdirs gprof"
10832 + noconfigdirs="${noconfigdirs} sid ${libgcj} target-rda"
10833 + if ! test x"${with_newlib}" = xyes ; then
10834 + # remove libgloss and libiberty too, when we're not building newlib
10835 + skipdirs="${skipdirs} target-libgloss target-libiberty"
10836 + # add sde-conv host tool
10837 + configdirs="${configdirs} convert"
10838 fi
10839 + # add gprof back in - we do support it!
10840 + skipdirs=`echo " ${skipdirs} " | sed -e 's/ gprof / /'`
10841 + noconfigdirs=`echo " ${noconfigdirs} " | sed -e 's/ gprof / /'`
10842 libgloss_dir=mips
10843 ;;
10844 mips*-*-irix5*)
10845 --- /dev/null
10846 +++ b/convert/ChangeLog
10847 @@ -0,0 +1,213 @@
10848 +2008-03-11 Thiemo Seufer <ths@mips.com>
10849 +
10850 + * bin.c, conv.texi, convert.c, elf.h, elfio.c, elfmips.h,
10851 + elfout.c, idtbin.c, lsifast.c, mipsflash.c, srec.c, stagbin.c:
10852 + Update license to GPL v3.
10853 +
10854 +2007-07-02 Maciej W. Rozycki <macro@mips.com>
10855 +
10856 + * Makefile.am (AUTOMAKE_OPTIONS): Use "cygnus" rather than
10857 + "foreign".
10858 + * Makefile.in: Regenerate.
10859 +
10860 +2004-10-08 Nigel Stephens <nigel@mips.com>
10861 +
10862 + * elfout.c (ElfEnd): Use ehdr.e_phnum to calculate offset of
10863 + section header, otherwise we are out by one.
10864 +
10865 +2004-10-04 Nigel Stephens <nigel@mips.com>
10866 +
10867 + * Makefile.am: Use "cygnus" automake options, so that info file
10868 + gets created in build directory, not source directory.
10869 +
10870 + * Makefile.in: Rebuilt.
10871 +
10872 +2004-09-09 Nigel Stephens <nigel@mips.com>
10873 +
10874 + * elfout.c (ElfEnd): Set paddr field in program header as well as vaddr.
10875 + Set number of program header entries to the actual number of
10876 + entries created (1 less than the number of sections. Use
10877 + ehdr.e_phnum and ehdr.e_shnum to select the number of program and
10878 + section headers to be written out.
10879 +
10880 +Tue Oct 21 12:13:43 2003 Nigel Stephens <nigel@mips.com>
10881 +
10882 + * conv.info: Gets built in source dir.
10883 +
10884 +Sat Oct 4 00:34:44 2003 Nigel Stephens <nigel@mips.com>
10885 +
10886 + * Makefile.am: Added conv.texi and html build rule.
10887 +
10888 + * conv.texi: New Texinfo doc file for conv only.
10889 +
10890 +Tue Aug 19 13:07:43 2003 Nigel Stephens <nigel@mips.com>
10891 +
10892 + Changed to GPL copyright headers.
10893 +
10894 +Tue Aug 5 22:18:41 2003 Nigel Stephens <nigel@mips.com>
10895 +
10896 + Added BSD-style copyright headers.
10897 +
10898 +Wed Jul 9 03:31:06 2003 Nigel Stephens <nigel@mips.com>
10899 +
10900 + * mipsflash.c: New MIPS flash download format. Needs some more
10901 + work before prime-time.
10902 +
10903 + * convert.c: Use const char * where necessary.
10904 + (formats): Add description of each format to table.
10905 + Add mips flash download format.
10906 + (usage): Output format descriptions.
10907 + (main): Output format descriptions if we get a bas format name.
10908 +
10909 + * Makefile.am (conv_SOURCES): Added mipsflash.c
10910 +
10911 +Thu Apr 24 15:09:32 2003 Nigel Stephens <nigel@mips.com>
10912 +
10913 + * elfout.c (ElfStart): Set ehdr.e_version to EV_CURRENT, not EV_NONE.
10914 +
10915 +Wed Dec 18 16:47:42 2002 Nigel Stephens <nigel@mips.com>
10916 +
10917 + * acinclude.m4 (CONV_BINARY_FOPEN): Match cygwin* not cygwin32*.
10918 +
10919 + * configure: Rebuilt.
10920 + * config.h.in: Rebuilt.
10921 + * aclocal.m4: Rebuilt.
10922 +
10923 +Mon Nov 18 11:04:04 2002 Nigel Stephens <nigel@mips.com>
10924 +
10925 + * configure.in (AC_REPLACE_FUNCS): Removed, used libiberty
10926 + versions of getopt and strtoul.
10927 +
10928 + * Makefile.am (EXTRA_conv_SOURCES): Line removed, we don't have
10929 + our own getopt.h now.
10930 + (LIBIBERTY): New variable.
10931 + (conv_LDADD): Set to LIBIBERTY, not LDADD.
10932 +
10933 + * Makefile.in, configure, config.h.in: Rebuilt.
10934 +
10935 + * getopt.h: Removed.
10936 + * getopt.c: Removed.
10937 + * strtoul.c: Removed.
10938 +
10939 +Tue Oct 15 12:57:11 2002 Nigel Stephens <nigel@mips.com>
10940 +
10941 + * elfout.c: New "relocated" ELF output format, mainly so that we
10942 + can give a PROM image to MIPSsim.
10943 +
10944 + * convert.c: Add endianness argument to start function entries in
10945 + table.
10946 + (formats): Add "relf" format.
10947 + (progname): Make it global.
10948 + (promflag): Similarly.
10949 + (prombase): Similarly.
10950 + (usage): Add -EB/-EL.
10951 + (xmalloc): New error checking interface to malloc.
10952 + (convertSymbols): Use xmalloc(), and free malloced data when
10953 + returning.
10954 + (main): Handle -EB/-EL argument, only relevant for raw binary
10955 + input files. In other cases set bigendian flag from the ELF input
10956 + file. Pass bigendian flag to format "start" function. Use
10957 + xmalloc/free.
10958 +
10959 + * configure.in (AC_CHECK_HEADERS): Add stdlib.h
10960 +
10961 + * config.h.in: Add HAVE_STDLIB_H
10962 +
10963 + * lsifast.c (LsiStart): Use xmalloc().
10964 + (LsiEnd): Use free().
10965 + * bin.c: Similarly.
10966 + * stagbin.c: Similarly.
10967 +
10968 + * sysdep.h: Fix up definitions of alloca(). Add definition of
10969 + xmalloc().
10970 +
10971 + * Makefile.am (conv_SOURCES): Add elfout.c
10972 + (install-exec-local): Don't add .exe extension on twice.
10973 +
10974 +Fri Jun 7 13:58:49 2002 Nigel Stephens <nigel@algor.co.uk>
10975 +
10976 + * Makefile.am (html): Do nothing target.
10977 +
10978 + * Makefile.in: Rebuilt.
10979 +
10980 +Mon Mar 18 19:13:08 2002 Nigel Stephens <nigel@algor.co.uk>
10981 +
10982 + * Makefile.am: Add manual install step to install program with
10983 + additional target alias name.
10984 +
10985 + * Makefile.in: Rebuilt.
10986 +
10987 +Tue Nov 7 00:35:37 2000 Chris Dearman <chris@algor.co.uk>
10988 +
10989 + * convert.c (main): Convert promlimit to physical address when
10990 + parsing -a base:limit option. Exit with error if promlimit!=0
10991 + && promlimit<=prombase.
10992 +
10993 +Tue Jul 18 15:19:09 2000 Nigel Stephens <nigel@algor.co.uk>
10994 +
10995 + * convert.c (main): Sort the program header into physical/load
10996 + address order - the linker sorts it into virtual address order.
10997 + (phcompar): New comparison function for qsort().
10998 +
10999 +Fri Nov 19 16:42:57 1999 Nigel Stephens <nigel@algor.co.uk>
11000 +
11001 + * All: Added copyright messages.
11002 +
11003 +Thu Nov 11 15:25:54 1999 Nigel Stephens <nigel@algor.co.uk>
11004 +
11005 + * convert.c (main): Allow byte selection when not in PROM mode.
11006 +
11007 +Mon Oct 25 14:21:47 1999 Nigel Stephens <nigel@algor.co.uk>
11008 +
11009 + * Makefile.am: Add no-dependencies to AUTOMAKE_OPTIONS
11010 +
11011 +Thu Sep 9 18:12:11 1999 Nigel Stephens <nigel@algor.co.uk>
11012 +
11013 + * convert.c (convertSegment): Change in read/write flag of segment
11014 + will cause it to be moved to next 16 byte boundary.
11015 +
11016 +Wed Jun 3 16:35:32 1998 Nigel Stephens <nigel@algor.co.uk>
11017 +
11018 + * configure.in (AC_CANONICAL_SYSTEM): No longer needed by
11019 + AM_CYGWIN32. Use AM_EXEEXT instead of AM_CYGWIN32.
11020 +
11021 +Tue May 12 15:42:10 1998 Nigel Stephens <nigel@algor.co.uk>
11022 +
11023 + * configure.in: Bump version number to 3.0.3
11024 +
11025 + * Makefile.am: Change automake options to --foreign.
11026 +
11027 +Fri Apr 17 14:26:29 1998 Nigel Stephens <nigel@algor.co.uk>
11028 +
11029 + * Makefile.am: Moved over to automake/autoconf.
11030 +
11031 +Mon Jan 26 15:40:18 1998 Nigel Stephens <nigel@algor.co.uk>
11032 +
11033 + * convert.c (convertSymbols): Flag MIPS16 symbols by making symbol
11034 + address odd.
11035 + (main): Do all PROM resident segments first, irrespective of what
11036 + type they are.
11037 +
11038 +Mon Jul 7 18:04:50 1997 Nigel Stephens <nigel@algor.co.uk>
11039 +
11040 + SDE-MIPS version 2.2.1 released.
11041 +
11042 +Tue May 20 18:07:32 1997 Nigel Stephens <nigel@algor.co.uk>
11043 +
11044 + SDE-MIPS version 2.2 released.
11045 +
11046 +Tue May 20 14:39:41 1997 Nigel Stephens <nigel@algor.co.uk>
11047 +
11048 + * convert.c: Realign segment when the PF_X flag changes.
11049 +
11050 +Wed Apr 30 17:59:56 1997 Nigel Stephens <nigel@algor.co.uk>
11051 +
11052 + SDE-MIPS version 2.2-beta released.
11053 +
11054 +Thu Apr 24 13:52:08 1997 Nigel Stephens <nigel@algor.co.uk>
11055 +
11056 + * elfio.c: Added functions to read and write .reginfo and .gptab
11057 + sections.
11058 +
11059 + * elfmips.h: Added prototypes for above, and defined new
11060 + architecture flags and SDE-MIPS special flags.
11061 --- /dev/null
11062 +++ b/convert/Makefile.am
11063 @@ -0,0 +1,62 @@
11064 +## Process this file with automake to generate Makefile.in
11065 +
11066 +AUTOMAKE_OPTIONS = cygnus
11067 +ACLOCAL_AMFLAGS = -I . -I .. -I ../config
11068 +
11069 +noinst_PROGRAMS = conv
11070 +
11071 +conv_SOURCES = convert.c elfio.c elfout.c mipsflash.c \
11072 + srec.c lsifast.c idtbin.c stagbin.c bin.c \
11073 + elf.h elfmips.h sysdep.h conv-version.h \
11074 + conv.1
11075 +
11076 +#EXTRA_conv_SOURCES = getopt.h # alloca.c getopt.c strtoul.c
11077 +
11078 +conv-version.h: $(srcdir)/version.h $(srcdir)/Makefile.in
11079 + @echo "creating $@"
11080 + conv_version_package="\"$(PKGVERSION)\"" ;\
11081 + report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
11082 + sed -e "s,@conv_version_package@,$$conv_version_package," \
11083 + -e "s,@report_bugs_to@,$$report_bugs_to," \
11084 + < $(srcdir)/version.h > $@
11085 +
11086 +convert.o: convert.c conv-version.h
11087 +
11088 +LIBIBERTY = ../libiberty/libiberty.a
11089 +
11090 +conv_LDADD = $(LIBIBERTY)
11091 +
11092 +man_MANS = conv.1
11093 +
11094 +info_TEXINFOS = conv.texi
11095 +
11096 +conv_TEXI = $(srcdir)/conv.texi
11097 +
11098 +# FIXME!
11099 +conv.html: $(conv_TEXI)
11100 +# @rm -f conv.html
11101 +# texi2html -monolithic -glossary -menu -I . -I $(srcdir) $(conv_TEXI)
11102 + touch $@
11103 +
11104 +conv.dvi: $(conv_TEXI)
11105 +
11106 +conv.info: $(conv_TEXI)
11107 +
11108 +.PHONY: install-exec-local install-html
11109 +
11110 +install-exec-local: $(noinst_PROGRAMS)
11111 + @$(NORMAL_INSTALL)
11112 + $(mkinstalldirs) $(DESTDIR)$(bindir)
11113 + @list='$(noinst_PROGRAMS)'; for p in $$list; do \
11114 + if test -f $$p; then \
11115 + t="$(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
11116 + echo " $(INSTALL_PROGRAM) $$p $$t"; \
11117 + $(INSTALL_PROGRAM) $$p $$t; \
11118 + else :; fi; \
11119 + done
11120 +
11121 +install-html:
11122 + echo FIXME > /dev/null
11123 +
11124 +install-pdf:
11125 + echo FIXME > /dev/null
11126 --- /dev/null
11127 +++ b/convert/Makefile.in
11128 @@ -0,0 +1,638 @@
11129 +# Makefile.in generated by automake 1.9.5 from Makefile.am.
11130 +# @configure_input@
11131 +
11132 +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
11133 +# 2003, 2004, 2005 Free Software Foundation, Inc.
11134 +# This Makefile.in is free software; the Free Software Foundation
11135 +# gives unlimited permission to copy and/or distribute it,
11136 +# with or without modifications, as long as this notice is preserved.
11137 +
11138 +# This program is distributed in the hope that it will be useful,
11139 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11140 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11141 +# PARTICULAR PURPOSE.
11142 +
11143 +@SET_MAKE@
11144 +
11145 +SOURCES = $(conv_SOURCES)
11146 +
11147 +srcdir = @srcdir@
11148 +top_srcdir = @top_srcdir@
11149 +VPATH = @srcdir@
11150 +pkgdatadir = $(datadir)/@PACKAGE@
11151 +pkglibdir = $(libdir)/@PACKAGE@
11152 +pkgincludedir = $(includedir)/@PACKAGE@
11153 +top_builddir = .
11154 +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
11155 +INSTALL = @INSTALL@
11156 +install_sh_DATA = $(install_sh) -c -m 644
11157 +install_sh_PROGRAM = $(install_sh) -c
11158 +install_sh_SCRIPT = $(install_sh) -c
11159 +INSTALL_HEADER = $(INSTALL_DATA)
11160 +transform = $(program_transform_name)
11161 +NORMAL_INSTALL = :
11162 +PRE_INSTALL = :
11163 +POST_INSTALL = :
11164 +NORMAL_UNINSTALL = :
11165 +PRE_UNINSTALL = :
11166 +POST_UNINSTALL = :
11167 +build_triplet = @build@
11168 +host_triplet = @host@
11169 +target_triplet = @target@
11170 +noinst_PROGRAMS = conv$(EXEEXT)
11171 +DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub \
11172 + ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
11173 + $(top_srcdir)/configure $(am__configure_deps) \
11174 + $(srcdir)/config.h.in $(srcdir)/../mkinstalldirs
11175 +subdir = .
11176 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
11177 +am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
11178 + $(top_srcdir)/../config/depstand.m4 \
11179 + $(top_srcdir)/../config/lead-dot.m4 $(top_srcdir)/acinclude.m4 \
11180 + $(top_srcdir)/configure.ac
11181 +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
11182 + $(ACLOCAL_M4)
11183 +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
11184 + configure.lineno configure.status.lineno
11185 +mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
11186 +CONFIG_HEADER = config.h
11187 +CONFIG_CLEAN_FILES =
11188 +PROGRAMS = $(noinst_PROGRAMS)
11189 +am_conv_OBJECTS = convert.$(OBJEXT) elfio.$(OBJEXT) elfout.$(OBJEXT) \
11190 + mipsflash.$(OBJEXT) srec.$(OBJEXT) lsifast.$(OBJEXT) \
11191 + idtbin.$(OBJEXT) stagbin.$(OBJEXT) bin.$(OBJEXT)
11192 +conv_OBJECTS = $(am_conv_OBJECTS)
11193 +am__DEPENDENCIES_1 = ../libiberty/libiberty.a
11194 +conv_DEPENDENCIES = $(am__DEPENDENCIES_1)
11195 +DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
11196 +depcomp =
11197 +am__depfiles_maybe =
11198 +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
11199 + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
11200 +CCLD = $(CC)
11201 +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
11202 +SOURCES = $(conv_SOURCES)
11203 +INFO_DEPS = $(srcdir)/conv.info
11204 +TEXINFO_TEX = $(top_srcdir)/../texinfo/texinfo.tex
11205 +am__TEXINFO_TEX_DIR = $(top_srcdir)/../texinfo
11206 +DVIS = conv.dvi
11207 +PDFS = conv.pdf
11208 +PSS = conv.ps
11209 +HTMLS = conv.html
11210 +TEXINFOS = conv.texi
11211 +TEXI2DVI = `if test -f $(top_srcdir)/../texinfo/util/texi2dvi; then \
11212 + echo $(top_srcdir)/../texinfo/util/texi2dvi; \
11213 + else \
11214 + echo texi2dvi; \
11215 + fi`
11216 +TEXI2PDF = $(TEXI2DVI) --pdf --batch
11217 +MAKEINFOHTML = $(MAKEINFO) --html
11218 +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
11219 +DVIPS = dvips
11220 +man1dir = $(mandir)/man1
11221 +am__installdirs = "$(DESTDIR)$(man1dir)"
11222 +NROFF = nroff
11223 +MANS = $(man_MANS)
11224 +ETAGS = etags
11225 +CTAGS = ctags
11226 +ACLOCAL = @ACLOCAL@
11227 +ALLOCA = @ALLOCA@
11228 +AMDEP_FALSE = @AMDEP_FALSE@
11229 +AMDEP_TRUE = @AMDEP_TRUE@
11230 +AMTAR = @AMTAR@
11231 +AUTOCONF = @AUTOCONF@
11232 +AUTOHEADER = @AUTOHEADER@
11233 +AUTOMAKE = @AUTOMAKE@
11234 +AWK = @AWK@
11235 +CC = @CC@
11236 +CCDEPMODE = @CCDEPMODE@
11237 +CFLAGS = @CFLAGS@
11238 +CPP = @CPP@
11239 +CPPFLAGS = @CPPFLAGS@
11240 +CYGPATH_W = @CYGPATH_W@
11241 +DEFS = @DEFS@
11242 +DEPDIR = @DEPDIR@
11243 +ECHO_C = @ECHO_C@
11244 +ECHO_N = @ECHO_N@
11245 +ECHO_T = @ECHO_T@
11246 +EGREP = @EGREP@
11247 +EXEEXT = @EXEEXT@
11248 +INSTALL_DATA = @INSTALL_DATA@
11249 +INSTALL_PROGRAM = @INSTALL_PROGRAM@
11250 +INSTALL_SCRIPT = @INSTALL_SCRIPT@
11251 +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
11252 +LDFLAGS = @LDFLAGS@
11253 +LIBOBJS = @LIBOBJS@
11254 +LIBS = @LIBS@
11255 +LTLIBOBJS = @LTLIBOBJS@
11256 +MAINT = @MAINT@
11257 +MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
11258 +MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
11259 +MAKEINFO = @MAKEINFO@
11260 +OBJEXT = @OBJEXT@
11261 +PACKAGE = @PACKAGE@
11262 +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
11263 +PACKAGE_NAME = @PACKAGE_NAME@
11264 +PACKAGE_STRING = @PACKAGE_STRING@
11265 +PACKAGE_TARNAME = @PACKAGE_TARNAME@
11266 +PACKAGE_VERSION = @PACKAGE_VERSION@
11267 +PATH_SEPARATOR = @PATH_SEPARATOR@
11268 +PKGVERSION = @PKGVERSION@
11269 +REPORT_BUGS_TEXI = @REPORT_BUGS_TEXI@
11270 +REPORT_BUGS_TO = @REPORT_BUGS_TO@
11271 +SET_MAKE = @SET_MAKE@
11272 +SHELL = @SHELL@
11273 +STRIP = @STRIP@
11274 +VERSION = @VERSION@
11275 +ac_ct_CC = @ac_ct_CC@
11276 +ac_ct_STRIP = @ac_ct_STRIP@
11277 +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
11278 +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
11279 +am__include = @am__include@
11280 +am__leading_dot = @am__leading_dot@
11281 +am__quote = @am__quote@
11282 +am__tar = @am__tar@
11283 +am__untar = @am__untar@
11284 +bindir = @bindir@
11285 +build = @build@
11286 +build_alias = @build_alias@
11287 +build_cpu = @build_cpu@
11288 +build_os = @build_os@
11289 +build_vendor = @build_vendor@
11290 +datadir = @datadir@
11291 +exec_prefix = @exec_prefix@
11292 +host = @host@
11293 +host_alias = @host_alias@
11294 +host_cpu = @host_cpu@
11295 +host_os = @host_os@
11296 +host_vendor = @host_vendor@
11297 +includedir = @includedir@
11298 +infodir = @infodir@
11299 +install_sh = @install_sh@
11300 +libdir = @libdir@
11301 +libexecdir = @libexecdir@
11302 +localstatedir = @localstatedir@
11303 +mandir = @mandir@
11304 +mkdir_p = @mkdir_p@
11305 +oldincludedir = @oldincludedir@
11306 +prefix = @prefix@
11307 +program_transform_name = @program_transform_name@
11308 +sbindir = @sbindir@
11309 +sharedstatedir = @sharedstatedir@
11310 +sysconfdir = @sysconfdir@
11311 +target = @target@
11312 +target_alias = @target_alias@
11313 +target_cpu = @target_cpu@
11314 +target_os = @target_os@
11315 +target_vendor = @target_vendor@
11316 +AUTOMAKE_OPTIONS = cygnus
11317 +ACLOCAL_AMFLAGS = -I . -I .. -I ../config
11318 +conv_SOURCES = convert.c elfio.c elfout.c mipsflash.c \
11319 + srec.c lsifast.c idtbin.c stagbin.c bin.c \
11320 + elf.h elfmips.h sysdep.h conv-version.h \
11321 + conv.1
11322 +
11323 +LIBIBERTY = ../libiberty/libiberty.a
11324 +conv_LDADD = $(LIBIBERTY)
11325 +man_MANS = conv.1
11326 +info_TEXINFOS = conv.texi
11327 +conv_TEXI = $(srcdir)/conv.texi
11328 +all: config.h
11329 + $(MAKE) $(AM_MAKEFLAGS) all-am
11330 +
11331 +.SUFFIXES:
11332 +.SUFFIXES: .c .dvi .html .info .o .obj .pdf .ps .texi
11333 +am--refresh:
11334 + @:
11335 +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
11336 + @for dep in $?; do \
11337 + case '$(am__configure_deps)' in \
11338 + *$$dep*) \
11339 + echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \
11340 + cd $(srcdir) && $(AUTOMAKE) --foreign \
11341 + && exit 0; \
11342 + exit 1;; \
11343 + esac; \
11344 + done; \
11345 + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
11346 + cd $(top_srcdir) && \
11347 + $(AUTOMAKE) --foreign Makefile
11348 +.PRECIOUS: Makefile
11349 +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
11350 + @case '$?' in \
11351 + *config.status*) \
11352 + echo ' $(SHELL) ./config.status'; \
11353 + $(SHELL) ./config.status;; \
11354 + *) \
11355 + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
11356 + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
11357 + esac;
11358 +
11359 +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
11360 + $(SHELL) ./config.status --recheck
11361 +
11362 +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
11363 + cd $(srcdir) && $(AUTOCONF)
11364 +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
11365 + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
11366 +
11367 +config.h: stamp-h1
11368 + @if test ! -f $@; then \
11369 + rm -f stamp-h1; \
11370 + $(MAKE) stamp-h1; \
11371 + else :; fi
11372 +
11373 +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
11374 + @rm -f stamp-h1
11375 + cd $(top_builddir) && $(SHELL) ./config.status config.h
11376 +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
11377 + cd $(top_srcdir) && $(AUTOHEADER)
11378 + rm -f stamp-h1
11379 + touch $@
11380 +
11381 +distclean-hdr:
11382 + -rm -f config.h stamp-h1
11383 +
11384 +clean-noinstPROGRAMS:
11385 + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
11386 +conv$(EXEEXT): $(conv_OBJECTS) $(conv_DEPENDENCIES)
11387 + @rm -f conv$(EXEEXT)
11388 + $(LINK) $(conv_LDFLAGS) $(conv_OBJECTS) $(conv_LDADD) $(LIBS)
11389 +
11390 +mostlyclean-compile:
11391 + -rm -f *.$(OBJEXT)
11392 +
11393 +distclean-compile:
11394 + -rm -f *.tab.c
11395 +
11396 +.c.o:
11397 + $(COMPILE) -c $<
11398 +
11399 +.c.obj:
11400 + $(COMPILE) -c `$(CYGPATH_W) '$<'`
11401 +
11402 +.texi.info:
11403 + restore=: && backupdir="$(am__leading_dot)am$$$$" && \
11404 + am__cwd=`pwd` && cd $(srcdir) && \
11405 + rm -rf $$backupdir && mkdir $$backupdir && \
11406 + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
11407 + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
11408 + done; \
11409 + cd "$$am__cwd"; \
11410 + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
11411 + -o $@ $<; \
11412 + then \
11413 + rc=0; \
11414 + cd $(srcdir); \
11415 + else \
11416 + rc=$$?; \
11417 + cd $(srcdir) && \
11418 + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
11419 + fi; \
11420 + rm -rf $$backupdir; exit $$rc
11421 +
11422 +.texi.dvi:
11423 + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
11424 + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
11425 + $(TEXI2DVI) $<
11426 +
11427 +.texi.pdf:
11428 + TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
11429 + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
11430 + $(TEXI2PDF) $<
11431 +
11432 +.texi.html:
11433 + rm -rf $(@:.html=.htp)
11434 + if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
11435 + -o $(@:.html=.htp) $<; \
11436 + then \
11437 + rm -rf $@; \
11438 + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
11439 + mv $(@:.html=) $@; else mv $(@:.html=.htp) $@; fi; \
11440 + else \
11441 + if test ! -d $(@:.html=.htp) && test -d $(@:.html=); then \
11442 + rm -rf $(@:.html=); else rm -Rf $(@:.html=.htp) $@; fi; \
11443 + exit 1; \
11444 + fi
11445 +$(srcdir)/conv.info: conv.texi
11446 +conv.pdf: conv.texi
11447 +.dvi.ps:
11448 + $(DVIPS) -o $@ $<
11449 +
11450 +uninstall-info-am:
11451 + @$(PRE_UNINSTALL)
11452 + @if (install-info --version && \
11453 + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
11454 + list='$(INFO_DEPS)'; \
11455 + for file in $$list; do \
11456 + relfile=`echo "$$file" | sed 's|^.*/||'`; \
11457 + echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
11458 + install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
11459 + done; \
11460 + else :; fi
11461 + @$(NORMAL_UNINSTALL)
11462 + @list='$(INFO_DEPS)'; \
11463 + for file in $$list; do \
11464 + relfile=`echo "$$file" | sed 's|^.*/||'`; \
11465 + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
11466 + (if cd "$(DESTDIR)$(infodir)"; then \
11467 + echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
11468 + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
11469 + else :; fi); \
11470 + done
11471 +
11472 +dist-info: $(INFO_DEPS)
11473 + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
11474 + list='$(INFO_DEPS)'; \
11475 + for base in $$list; do \
11476 + case $$base in \
11477 + $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
11478 + esac; \
11479 + if test -f $$base; then d=.; else d=$(srcdir); fi; \
11480 + for file in $$d/$$base*; do \
11481 + relfile=`expr "$$file" : "$$d/\(.*\)"`; \
11482 + test -f $(distdir)/$$relfile || \
11483 + cp -p $$file $(distdir)/$$relfile; \
11484 + done; \
11485 + done
11486 +
11487 +mostlyclean-aminfo:
11488 + -rm -rf conv.aux conv.cp conv.cps conv.fn conv.fns conv.ky conv.log conv.pg \
11489 + conv.pgs conv.tmp conv.toc conv.tp conv.tps conv.vr conv.vrs \
11490 + conv.dvi conv.pdf conv.ps conv.html
11491 +
11492 +maintainer-clean-aminfo:
11493 + @list='$(INFO_DEPS)'; for i in $$list; do \
11494 + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
11495 + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
11496 + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
11497 + done
11498 +
11499 +clean-info: mostlyclean-aminfo
11500 +install-man1: $(man1_MANS) $(man_MANS)
11501 + @$(NORMAL_INSTALL)
11502 + test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
11503 + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
11504 + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
11505 + for i in $$l2; do \
11506 + case "$$i" in \
11507 + *.1*) list="$$list $$i" ;; \
11508 + esac; \
11509 + done; \
11510 + for i in $$list; do \
11511 + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
11512 + else file=$$i; fi; \
11513 + ext=`echo $$i | sed -e 's/^.*\\.//'`; \
11514 + case "$$ext" in \
11515 + 1*) ;; \
11516 + *) ext='1' ;; \
11517 + esac; \
11518 + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
11519 + inst=`echo $$inst | sed -e 's/^.*\///'`; \
11520 + inst=`echo $$inst | sed '$(transform)'`.$$ext; \
11521 + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
11522 + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
11523 + done
11524 +uninstall-man1:
11525 + @$(NORMAL_UNINSTALL)
11526 + @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
11527 + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
11528 + for i in $$l2; do \
11529 + case "$$i" in \
11530 + *.1*) list="$$list $$i" ;; \
11531 + esac; \
11532 + done; \
11533 + for i in $$list; do \
11534 + ext=`echo $$i | sed -e 's/^.*\\.//'`; \
11535 + case "$$ext" in \
11536 + 1*) ;; \
11537 + *) ext='1' ;; \
11538 + esac; \
11539 + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
11540 + inst=`echo $$inst | sed -e 's/^.*\///'`; \
11541 + inst=`echo $$inst | sed '$(transform)'`.$$ext; \
11542 + echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
11543 + rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
11544 + done
11545 +
11546 +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
11547 + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
11548 + unique=`for i in $$list; do \
11549 + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
11550 + done | \
11551 + $(AWK) ' { files[$$0] = 1; } \
11552 + END { for (i in files) print i; }'`; \
11553 + mkid -fID $$unique
11554 +tags: TAGS
11555 +
11556 +TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
11557 + $(TAGS_FILES) $(LISP)
11558 + tags=; \
11559 + here=`pwd`; \
11560 + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
11561 + unique=`for i in $$list; do \
11562 + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
11563 + done | \
11564 + $(AWK) ' { files[$$0] = 1; } \
11565 + END { for (i in files) print i; }'`; \
11566 + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
11567 + test -n "$$unique" || unique=$$empty_fix; \
11568 + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
11569 + $$tags $$unique; \
11570 + fi
11571 +ctags: CTAGS
11572 +CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
11573 + $(TAGS_FILES) $(LISP)
11574 + tags=; \
11575 + here=`pwd`; \
11576 + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
11577 + unique=`for i in $$list; do \
11578 + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
11579 + done | \
11580 + $(AWK) ' { files[$$0] = 1; } \
11581 + END { for (i in files) print i; }'`; \
11582 + test -z "$(CTAGS_ARGS)$$tags$$unique" \
11583 + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
11584 + $$tags $$unique
11585 +
11586 +GTAGS:
11587 + here=`$(am__cd) $(top_builddir) && pwd` \
11588 + && cd $(top_srcdir) \
11589 + && gtags -i $(GTAGS_ARGS) $$here
11590 +
11591 +distclean-tags:
11592 + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
11593 +check-am:
11594 +check: check-am
11595 +all-am: Makefile $(PROGRAMS) $(MANS) config.h
11596 +installdirs:
11597 + for dir in "$(DESTDIR)$(man1dir)"; do \
11598 + test -z "$$dir" || $(mkdir_p) "$$dir"; \
11599 + done
11600 +install: install-am
11601 +install-exec: install-exec-am
11602 +install-data: install-data-am
11603 +uninstall: uninstall-am
11604 +
11605 +install-am: all-am
11606 + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
11607 +
11608 +installcheck: installcheck-am
11609 +install-strip:
11610 + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
11611 + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
11612 + `test -z '$(STRIP)' || \
11613 + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
11614 +mostlyclean-generic:
11615 +
11616 +clean-generic:
11617 +
11618 +distclean-generic:
11619 + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
11620 +
11621 +maintainer-clean-generic:
11622 + @echo "This command is intended for maintainers to use"
11623 + @echo "it deletes files that may require special tools to rebuild."
11624 +clean: clean-am
11625 +
11626 +clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am
11627 +
11628 +distclean: distclean-am
11629 + -rm -f $(am__CONFIG_DISTCLEAN_FILES)
11630 + -rm -f Makefile
11631 +distclean-am: clean-am distclean-compile distclean-generic \
11632 + distclean-hdr distclean-tags
11633 +
11634 +dvi: dvi-am
11635 +
11636 +dvi-am: $(DVIS)
11637 +
11638 +html: html-am
11639 +
11640 +html-am: $(HTMLS)
11641 +
11642 +info: info-am
11643 +
11644 +info-am: $(INFO_DEPS)
11645 +
11646 +install-data-am: install-man
11647 +
11648 +install-exec-am: install-exec-local
11649 +
11650 +install-info: install-info-am
11651 +
11652 +install-info-am: $(INFO_DEPS)
11653 + @$(NORMAL_INSTALL)
11654 + test -z "$(infodir)" || $(mkdir_p) "$(DESTDIR)$(infodir)"
11655 + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
11656 + list='$(INFO_DEPS)'; \
11657 + for file in $$list; do \
11658 + case $$file in \
11659 + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
11660 + esac; \
11661 + if test -f $$file; then d=.; else d=$(srcdir); fi; \
11662 + file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
11663 + for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
11664 + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
11665 + if test -f $$ifile; then \
11666 + relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
11667 + echo " $(INSTALL_DATA) '$$ifile' '$(DESTDIR)$(infodir)/$$relfile'"; \
11668 + $(INSTALL_DATA) "$$ifile" "$(DESTDIR)$(infodir)/$$relfile"; \
11669 + else : ; fi; \
11670 + done; \
11671 + done
11672 + @$(POST_INSTALL)
11673 + @if (install-info --version && \
11674 + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \
11675 + list='$(INFO_DEPS)'; \
11676 + for file in $$list; do \
11677 + relfile=`echo "$$file" | sed 's|^.*/||'`; \
11678 + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
11679 + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
11680 + done; \
11681 + else : ; fi
11682 +install-man: install-man1
11683 +
11684 +installcheck-am:
11685 +
11686 +maintainer-clean: maintainer-clean-am
11687 + -rm -f $(am__CONFIG_DISTCLEAN_FILES)
11688 + -rm -rf $(top_srcdir)/autom4te.cache
11689 + -rm -f Makefile
11690 +maintainer-clean-am: distclean-am maintainer-clean-aminfo \
11691 + maintainer-clean-generic
11692 +
11693 +mostlyclean: mostlyclean-am
11694 +
11695 +mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \
11696 + mostlyclean-generic
11697 +
11698 +pdf: pdf-am
11699 +
11700 +pdf-am: $(PDFS)
11701 +
11702 +ps: ps-am
11703 +
11704 +ps-am: $(PSS)
11705 +
11706 +uninstall-am: uninstall-man
11707 +
11708 +uninstall-man: uninstall-man1
11709 +
11710 +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
11711 + clean-generic clean-info clean-noinstPROGRAMS ctags dist-info \
11712 + distclean distclean-compile distclean-generic distclean-hdr \
11713 + distclean-tags dvi dvi-am html html-am info info-am install \
11714 + install-am install-data install-data-am install-exec \
11715 + install-exec-am install-exec-local install-info \
11716 + install-info-am install-man install-man1 install-strip \
11717 + installcheck installcheck-am installdirs maintainer-clean \
11718 + maintainer-clean-aminfo maintainer-clean-generic mostlyclean \
11719 + mostlyclean-aminfo mostlyclean-compile mostlyclean-generic pdf \
11720 + pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am \
11721 + uninstall-man uninstall-man1
11722 +
11723 +
11724 +#EXTRA_conv_SOURCES = getopt.h # alloca.c getopt.c strtoul.c
11725 +
11726 +conv-version.h: $(srcdir)/version.h $(srcdir)/Makefile.in
11727 + @echo "creating $@"
11728 + conv_version_package="\"$(PKGVERSION)\"" ;\
11729 + report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\
11730 + sed -e "s,@conv_version_package@,$$conv_version_package," \
11731 + -e "s,@report_bugs_to@,$$report_bugs_to," \
11732 + < $(srcdir)/version.h > $@
11733 +
11734 +convert.o: convert.c conv-version.h
11735 +
11736 +# FIXME!
11737 +conv.html: $(conv_TEXI)
11738 +# @rm -f conv.html
11739 +# texi2html -monolithic -glossary -menu -I . -I $(srcdir) $(conv_TEXI)
11740 + touch $@
11741 +
11742 +conv.dvi: $(conv_TEXI)
11743 +
11744 +conv.info: $(conv_TEXI)
11745 +
11746 +.PHONY: install-exec-local install-html
11747 +
11748 +install-exec-local: $(noinst_PROGRAMS)
11749 + @$(NORMAL_INSTALL)
11750 + $(mkinstalldirs) $(DESTDIR)$(bindir)
11751 + @list='$(noinst_PROGRAMS)'; for p in $$list; do \
11752 + if test -f $$p; then \
11753 + t="$(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
11754 + echo " $(INSTALL_PROGRAM) $$p $$t"; \
11755 + $(INSTALL_PROGRAM) $$p $$t; \
11756 + else :; fi; \
11757 + done
11758 +
11759 +install-html:
11760 + echo FIXME > /dev/null
11761 +
11762 +install-pdf:
11763 + echo FIXME > /dev/null
11764 +# Tell versions [3.59,3.63) of GNU make to not export all variables.
11765 +# Otherwise a system limit (for SysV at least) may be exceeded.
11766 +.NOEXPORT:
11767 --- /dev/null
11768 +++ b/convert/acinclude.m4
11769 @@ -0,0 +1,37 @@
11770 +dnl See whether we need to use fopen-bin.h rather than fopen-same.h.
11771 +AC_DEFUN([CONV_BINARY_FOPEN],
11772 +[AC_REQUIRE([AC_CANONICAL_HOST])
11773 +case "${host}" in
11774 +changequote(,)dnl
11775 +*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows)
11776 +changequote([,])dnl
11777 + AC_DEFINE([USE_BINARY_FOPEN], 1, [Use b modifier when opening binary files?]) ;;
11778 +esac])dnl
11779 +
11780 +dnl See whether we need a declaration for a function.
11781 +AC_DEFUN([CONV_NEED_DECLARATION],
11782 +[AC_MSG_CHECKING([whether $1 must be declared])
11783 +AC_CACHE_VAL(bfd_cv_decl_needed_$1,
11784 +[AC_TRY_COMPILE([
11785 +#include <stdio.h>
11786 +#ifdef HAVE_STRING_H
11787 +#include <string.h>
11788 +#else
11789 +#ifdef HAVE_STRINGS_H
11790 +#include <strings.h>
11791 +#endif
11792 +#endif
11793 +#ifdef HAVE_STDLIB_H
11794 +#include <stdlib.h>
11795 +#endif
11796 +#ifdef HAVE_UNISTD_H
11797 +#include <unistd.h>
11798 +#endif],
11799 +[char *(*pfn) = (char *(*)) $1],
11800 +bfd_cv_decl_needed_$1=no, bfd_cv_decl_needed_$1=yes)])
11801 +AC_MSG_RESULT($bfd_cv_decl_needed_$1)
11802 +if test $bfd_cv_decl_needed_$1 = yes; then
11803 + bfd_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
11804 + AC_DEFINE_UNQUOTED($bfd_tr_decl, 1, [Define if a declaration is needed.])
11805 +fi
11806 +])dnl
11807 --- /dev/null
11808 +++ b/convert/aclocal.m4
11809 @@ -0,0 +1,862 @@
11810 +# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
11811 +
11812 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
11813 +# 2005 Free Software Foundation, Inc.
11814 +# This file is free software; the Free Software Foundation
11815 +# gives unlimited permission to copy and/or distribute it,
11816 +# with or without modifications, as long as this notice is preserved.
11817 +
11818 +# This program is distributed in the hope that it will be useful,
11819 +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11820 +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11821 +# PARTICULAR PURPOSE.
11822 +
11823 +# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
11824 +#
11825 +# This file is free software; the Free Software Foundation
11826 +# gives unlimited permission to copy and/or distribute it,
11827 +# with or without modifications, as long as this notice is preserved.
11828 +
11829 +# AM_AUTOMAKE_VERSION(VERSION)
11830 +# ----------------------------
11831 +# Automake X.Y traces this macro to ensure aclocal.m4 has been
11832 +# generated from the m4 files accompanying Automake X.Y.
11833 +AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
11834 +
11835 +# AM_SET_CURRENT_AUTOMAKE_VERSION
11836 +# -------------------------------
11837 +# Call AM_AUTOMAKE_VERSION so it can be traced.
11838 +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
11839 +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
11840 + [AM_AUTOMAKE_VERSION([1.9.5])])
11841 +
11842 +# AM_AUX_DIR_EXPAND -*- Autoconf -*-
11843 +
11844 +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
11845 +#
11846 +# This file is free software; the Free Software Foundation
11847 +# gives unlimited permission to copy and/or distribute it,
11848 +# with or without modifications, as long as this notice is preserved.
11849 +
11850 +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
11851 +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
11852 +# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
11853 +#
11854 +# Of course, Automake must honor this variable whenever it calls a
11855 +# tool from the auxiliary directory. The problem is that $srcdir (and
11856 +# therefore $ac_aux_dir as well) can be either absolute or relative,
11857 +# depending on how configure is run. This is pretty annoying, since
11858 +# it makes $ac_aux_dir quite unusable in subdirectories: in the top
11859 +# source directory, any form will work fine, but in subdirectories a
11860 +# relative path needs to be adjusted first.
11861 +#
11862 +# $ac_aux_dir/missing
11863 +# fails when called from a subdirectory if $ac_aux_dir is relative
11864 +# $top_srcdir/$ac_aux_dir/missing
11865 +# fails if $ac_aux_dir is absolute,
11866 +# fails when called from a subdirectory in a VPATH build with
11867 +# a relative $ac_aux_dir
11868 +#
11869 +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
11870 +# are both prefixed by $srcdir. In an in-source build this is usually
11871 +# harmless because $srcdir is `.', but things will broke when you
11872 +# start a VPATH build or use an absolute $srcdir.
11873 +#
11874 +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
11875 +# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
11876 +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
11877 +# and then we would define $MISSING as
11878 +# MISSING="\${SHELL} $am_aux_dir/missing"
11879 +# This will work as long as MISSING is not called from configure, because
11880 +# unfortunately $(top_srcdir) has no meaning in configure.
11881 +# However there are other variables, like CC, which are often used in
11882 +# configure, and could therefore not use this "fixed" $ac_aux_dir.
11883 +#
11884 +# Another solution, used here, is to always expand $ac_aux_dir to an
11885 +# absolute PATH. The drawback is that using absolute paths prevent a
11886 +# configured tree to be moved without reconfiguration.
11887 +
11888 +AC_DEFUN([AM_AUX_DIR_EXPAND],
11889 +[dnl Rely on autoconf to set up CDPATH properly.
11890 +AC_PREREQ([2.50])dnl
11891 +# expand $ac_aux_dir to an absolute path
11892 +am_aux_dir=`cd $ac_aux_dir && pwd`
11893 +])
11894 +
11895 +# AM_CONDITIONAL -*- Autoconf -*-
11896 +
11897 +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
11898 +# Free Software Foundation, Inc.
11899 +#
11900 +# This file is free software; the Free Software Foundation
11901 +# gives unlimited permission to copy and/or distribute it,
11902 +# with or without modifications, as long as this notice is preserved.
11903 +
11904 +# serial 7
11905 +
11906 +# AM_CONDITIONAL(NAME, SHELL-CONDITION)
11907 +# -------------------------------------
11908 +# Define a conditional.
11909 +AC_DEFUN([AM_CONDITIONAL],
11910 +[AC_PREREQ(2.52)dnl
11911 + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
11912 + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
11913 +AC_SUBST([$1_TRUE])
11914 +AC_SUBST([$1_FALSE])
11915 +if $2; then
11916 + $1_TRUE=
11917 + $1_FALSE='#'
11918 +else
11919 + $1_TRUE='#'
11920 + $1_FALSE=
11921 +fi
11922 +AC_CONFIG_COMMANDS_PRE(
11923 +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
11924 + AC_MSG_ERROR([[conditional "$1" was never defined.
11925 +Usually this means the macro was only invoked conditionally.]])
11926 +fi])])
11927 +
11928 +
11929 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
11930 +# Free Software Foundation, Inc.
11931 +#
11932 +# This file is free software; the Free Software Foundation
11933 +# gives unlimited permission to copy and/or distribute it,
11934 +# with or without modifications, as long as this notice is preserved.
11935 +
11936 +# serial 8
11937 +
11938 +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
11939 +# written in clear, in which case automake, when reading aclocal.m4,
11940 +# will think it sees a *use*, and therefore will trigger all it's
11941 +# C support machinery. Also note that it means that autoscan, seeing
11942 +# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
11943 +
11944 +
11945 +# _AM_DEPENDENCIES(NAME)
11946 +# ----------------------
11947 +# See how the compiler implements dependency checking.
11948 +# NAME is "CC", "CXX", "GCJ", or "OBJC".
11949 +# We try a few techniques and use that to set a single cache variable.
11950 +#
11951 +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
11952 +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
11953 +# dependency, and given that the user is not expected to run this macro,
11954 +# just rely on AC_PROG_CC.
11955 +AC_DEFUN([_AM_DEPENDENCIES],
11956 +[AC_REQUIRE([AM_SET_DEPDIR])dnl
11957 +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
11958 +AC_REQUIRE([AM_MAKE_INCLUDE])dnl
11959 +AC_REQUIRE([AM_DEP_TRACK])dnl
11960 +
11961 +ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
11962 + [$1], CXX, [depcc="$CXX" am_compiler_list=],
11963 + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
11964 + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
11965 + [depcc="$$1" am_compiler_list=])
11966 +
11967 +AC_CACHE_CHECK([dependency style of $depcc],
11968 + [am_cv_$1_dependencies_compiler_type],
11969 +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
11970 + # We make a subdir and do the tests there. Otherwise we can end up
11971 + # making bogus files that we don't know about and never remove. For
11972 + # instance it was reported that on HP-UX the gcc test will end up
11973 + # making a dummy file named `D' -- because `-MD' means `put the output
11974 + # in D'.
11975 + mkdir conftest.dir
11976 + # Copy depcomp to subdir because otherwise we won't find it if we're
11977 + # using a relative directory.
11978 + cp "$am_depcomp" conftest.dir
11979 + cd conftest.dir
11980 + # We will build objects and dependencies in a subdirectory because
11981 + # it helps to detect inapplicable dependency modes. For instance
11982 + # both Tru64's cc and ICC support -MD to output dependencies as a
11983 + # side effect of compilation, but ICC will put the dependencies in
11984 + # the current directory while Tru64 will put them in the object
11985 + # directory.
11986 + mkdir sub
11987 +
11988 + am_cv_$1_dependencies_compiler_type=none
11989 + if test "$am_compiler_list" = ""; then
11990 + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
11991 + fi
11992 + for depmode in $am_compiler_list; do
11993 + # Setup a source with many dependencies, because some compilers
11994 + # like to wrap large dependency lists on column 80 (with \), and
11995 + # we should not choose a depcomp mode which is confused by this.
11996 + #
11997 + # We need to recreate these files for each test, as the compiler may
11998 + # overwrite some of them when testing with obscure command lines.
11999 + # This happens at least with the AIX C compiler.
12000 + : > sub/conftest.c
12001 + for i in 1 2 3 4 5 6; do
12002 + echo '#include "conftst'$i'.h"' >> sub/conftest.c
12003 + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
12004 + # Solaris 8's {/usr,}/bin/sh.
12005 + touch sub/conftst$i.h
12006 + done
12007 + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
12008 +
12009 + case $depmode in
12010 + nosideeffect)
12011 + # after this tag, mechanisms are not by side-effect, so they'll
12012 + # only be used when explicitly requested
12013 + if test "x$enable_dependency_tracking" = xyes; then
12014 + continue
12015 + else
12016 + break
12017 + fi
12018 + ;;
12019 + none) break ;;
12020 + esac
12021 + # We check with `-c' and `-o' for the sake of the "dashmstdout"
12022 + # mode. It turns out that the SunPro C++ compiler does not properly
12023 + # handle `-M -o', and we need to detect this.
12024 + if depmode=$depmode \
12025 + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
12026 + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
12027 + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
12028 + >/dev/null 2>conftest.err &&
12029 + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
12030 + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
12031 + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
12032 + # icc doesn't choke on unknown options, it will just issue warnings
12033 + # or remarks (even with -Werror). So we grep stderr for any message
12034 + # that says an option was ignored or not supported.
12035 + # When given -MP, icc 7.0 and 7.1 complain thusly:
12036 + # icc: Command line warning: ignoring option '-M'; no argument required
12037 + # The diagnosis changed in icc 8.0:
12038 + # icc: Command line remark: option '-MP' not supported
12039 + if (grep 'ignoring option' conftest.err ||
12040 + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
12041 + am_cv_$1_dependencies_compiler_type=$depmode
12042 + break
12043 + fi
12044 + fi
12045 + done
12046 +
12047 + cd ..
12048 + rm -rf conftest.dir
12049 +else
12050 + am_cv_$1_dependencies_compiler_type=none
12051 +fi
12052 +])
12053 +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
12054 +AM_CONDITIONAL([am__fastdep$1], [
12055 + test "x$enable_dependency_tracking" != xno \
12056 + && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
12057 +])
12058 +
12059 +
12060 +# AM_SET_DEPDIR
12061 +# -------------
12062 +# Choose a directory name for dependency files.
12063 +# This macro is AC_REQUIREd in _AM_DEPENDENCIES
12064 +AC_DEFUN([AM_SET_DEPDIR],
12065 +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
12066 +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
12067 +])
12068 +
12069 +
12070 +# AM_DEP_TRACK
12071 +# ------------
12072 +AC_DEFUN([AM_DEP_TRACK],
12073 +[AC_ARG_ENABLE(dependency-tracking,
12074 +[ --disable-dependency-tracking speeds up one-time build
12075 + --enable-dependency-tracking do not reject slow dependency extractors])
12076 +if test "x$enable_dependency_tracking" != xno; then
12077 + am_depcomp="$ac_aux_dir/depcomp"
12078 + AMDEPBACKSLASH='\'
12079 +fi
12080 +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
12081 +AC_SUBST([AMDEPBACKSLASH])
12082 +])
12083 +
12084 +# Generate code to set up dependency tracking. -*- Autoconf -*-
12085 +
12086 +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
12087 +# Free Software Foundation, Inc.
12088 +#
12089 +# This file is free software; the Free Software Foundation
12090 +# gives unlimited permission to copy and/or distribute it,
12091 +# with or without modifications, as long as this notice is preserved.
12092 +
12093 +#serial 3
12094 +
12095 +# _AM_OUTPUT_DEPENDENCY_COMMANDS
12096 +# ------------------------------
12097 +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
12098 +[for mf in $CONFIG_FILES; do
12099 + # Strip MF so we end up with the name of the file.
12100 + mf=`echo "$mf" | sed -e 's/:.*$//'`
12101 + # Check whether this is an Automake generated Makefile or not.
12102 + # We used to match only the files named `Makefile.in', but
12103 + # some people rename them; so instead we look at the file content.
12104 + # Grep'ing the first line is not enough: some people post-process
12105 + # each Makefile.in and add a new line on top of each file to say so.
12106 + # So let's grep whole file.
12107 + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
12108 + dirpart=`AS_DIRNAME("$mf")`
12109 + else
12110 + continue
12111 + fi
12112 + # Extract the definition of DEPDIR, am__include, and am__quote
12113 + # from the Makefile without running `make'.
12114 + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
12115 + test -z "$DEPDIR" && continue
12116 + am__include=`sed -n 's/^am__include = //p' < "$mf"`
12117 + test -z "am__include" && continue
12118 + am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
12119 + # When using ansi2knr, U may be empty or an underscore; expand it
12120 + U=`sed -n 's/^U = //p' < "$mf"`
12121 + # Find all dependency output files, they are included files with
12122 + # $(DEPDIR) in their names. We invoke sed twice because it is the
12123 + # simplest approach to changing $(DEPDIR) to its actual value in the
12124 + # expansion.
12125 + for file in `sed -n "
12126 + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
12127 + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
12128 + # Make sure the directory exists.
12129 + test -f "$dirpart/$file" && continue
12130 + fdir=`AS_DIRNAME(["$file"])`
12131 + AS_MKDIR_P([$dirpart/$fdir])
12132 + # echo "creating $dirpart/$file"
12133 + echo '# dummy' > "$dirpart/$file"
12134 + done
12135 +done
12136 +])# _AM_OUTPUT_DEPENDENCY_COMMANDS
12137 +
12138 +
12139 +# AM_OUTPUT_DEPENDENCY_COMMANDS
12140 +# -----------------------------
12141 +# This macro should only be invoked once -- use via AC_REQUIRE.
12142 +#
12143 +# This code is only required when automatic dependency tracking
12144 +# is enabled. FIXME. This creates each `.P' file that we will
12145 +# need in order to bootstrap the dependency handling code.
12146 +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
12147 +[AC_CONFIG_COMMANDS([depfiles],
12148 + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
12149 + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
12150 +])
12151 +
12152 +# Do all the work for Automake. -*- Autoconf -*-
12153 +
12154 +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
12155 +# Free Software Foundation, Inc.
12156 +#
12157 +# This file is free software; the Free Software Foundation
12158 +# gives unlimited permission to copy and/or distribute it,
12159 +# with or without modifications, as long as this notice is preserved.
12160 +
12161 +# serial 12
12162 +
12163 +# This macro actually does too much. Some checks are only needed if
12164 +# your package does certain things. But this isn't really a big deal.
12165 +
12166 +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
12167 +# AM_INIT_AUTOMAKE([OPTIONS])
12168 +# -----------------------------------------------
12169 +# The call with PACKAGE and VERSION arguments is the old style
12170 +# call (pre autoconf-2.50), which is being phased out. PACKAGE
12171 +# and VERSION should now be passed to AC_INIT and removed from
12172 +# the call to AM_INIT_AUTOMAKE.
12173 +# We support both call styles for the transition. After
12174 +# the next Automake release, Autoconf can make the AC_INIT
12175 +# arguments mandatory, and then we can depend on a new Autoconf
12176 +# release and drop the old call support.
12177 +AC_DEFUN([AM_INIT_AUTOMAKE],
12178 +[AC_PREREQ([2.58])dnl
12179 +dnl Autoconf wants to disallow AM_ names. We explicitly allow
12180 +dnl the ones we care about.
12181 +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
12182 +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
12183 +AC_REQUIRE([AC_PROG_INSTALL])dnl
12184 +# test to see if srcdir already configured
12185 +if test "`cd $srcdir && pwd`" != "`pwd`" &&
12186 + test -f $srcdir/config.status; then
12187 + AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
12188 +fi
12189 +
12190 +# test whether we have cygpath
12191 +if test -z "$CYGPATH_W"; then
12192 + if (cygpath --version) >/dev/null 2>/dev/null; then
12193 + CYGPATH_W='cygpath -w'
12194 + else
12195 + CYGPATH_W=echo
12196 + fi
12197 +fi
12198 +AC_SUBST([CYGPATH_W])
12199 +
12200 +# Define the identity of the package.
12201 +dnl Distinguish between old-style and new-style calls.
12202 +m4_ifval([$2],
12203 +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
12204 + AC_SUBST([PACKAGE], [$1])dnl
12205 + AC_SUBST([VERSION], [$2])],
12206 +[_AM_SET_OPTIONS([$1])dnl
12207 + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
12208 + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
12209 +
12210 +_AM_IF_OPTION([no-define],,
12211 +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
12212 + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
12213 +
12214 +# Some tools Automake needs.
12215 +AC_REQUIRE([AM_SANITY_CHECK])dnl
12216 +AC_REQUIRE([AC_ARG_PROGRAM])dnl
12217 +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
12218 +AM_MISSING_PROG(AUTOCONF, autoconf)
12219 +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
12220 +AM_MISSING_PROG(AUTOHEADER, autoheader)
12221 +AM_MISSING_PROG(MAKEINFO, makeinfo)
12222 +AM_PROG_INSTALL_SH
12223 +AM_PROG_INSTALL_STRIP
12224 +AC_REQUIRE([AM_PROG_MKDIR_P])dnl
12225 +# We need awk for the "check" target. The system "awk" is bad on
12226 +# some platforms.
12227 +AC_REQUIRE([AC_PROG_AWK])dnl
12228 +AC_REQUIRE([AC_PROG_MAKE_SET])dnl
12229 +AC_REQUIRE([AM_SET_LEADING_DOT])dnl
12230 +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
12231 + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
12232 + [_AM_PROG_TAR([v7])])])
12233 +_AM_IF_OPTION([no-dependencies],,
12234 +[AC_PROVIDE_IFELSE([AC_PROG_CC],
12235 + [_AM_DEPENDENCIES(CC)],
12236 + [define([AC_PROG_CC],
12237 + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
12238 +AC_PROVIDE_IFELSE([AC_PROG_CXX],
12239 + [_AM_DEPENDENCIES(CXX)],
12240 + [define([AC_PROG_CXX],
12241 + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
12242 +])
12243 +])
12244 +
12245 +
12246 +# When config.status generates a header, we must update the stamp-h file.
12247 +# This file resides in the same directory as the config header
12248 +# that is generated. The stamp files are numbered to have different names.
12249 +
12250 +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
12251 +# loop where config.status creates the headers, so we can generate
12252 +# our stamp files there.
12253 +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
12254 +[# Compute $1's index in $config_headers.
12255 +_am_stamp_count=1
12256 +for _am_header in $config_headers :; do
12257 + case $_am_header in
12258 + $1 | $1:* )
12259 + break ;;
12260 + * )
12261 + _am_stamp_count=`expr $_am_stamp_count + 1` ;;
12262 + esac
12263 +done
12264 +echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
12265 +
12266 +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
12267 +#
12268 +# This file is free software; the Free Software Foundation
12269 +# gives unlimited permission to copy and/or distribute it,
12270 +# with or without modifications, as long as this notice is preserved.
12271 +
12272 +# AM_PROG_INSTALL_SH
12273 +# ------------------
12274 +# Define $install_sh.
12275 +AC_DEFUN([AM_PROG_INSTALL_SH],
12276 +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
12277 +install_sh=${install_sh-"$am_aux_dir/install-sh"}
12278 +AC_SUBST(install_sh)])
12279 +
12280 +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
12281 +# From Jim Meyering
12282 +
12283 +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
12284 +# Free Software Foundation, Inc.
12285 +#
12286 +# This file is free software; the Free Software Foundation
12287 +# gives unlimited permission to copy and/or distribute it,
12288 +# with or without modifications, as long as this notice is preserved.
12289 +
12290 +# serial 4
12291 +
12292 +AC_DEFUN([AM_MAINTAINER_MODE],
12293 +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
12294 + dnl maintainer-mode is disabled by default
12295 + AC_ARG_ENABLE(maintainer-mode,
12296 +[ --enable-maintainer-mode enable make rules and dependencies not useful
12297 + (and sometimes confusing) to the casual installer],
12298 + USE_MAINTAINER_MODE=$enableval,
12299 + USE_MAINTAINER_MODE=no)
12300 + AC_MSG_RESULT([$USE_MAINTAINER_MODE])
12301 + AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
12302 + MAINT=$MAINTAINER_MODE_TRUE
12303 + AC_SUBST(MAINT)dnl
12304 +]
12305 +)
12306 +
12307 +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
12308 +
12309 +# Check to see how 'make' treats includes. -*- Autoconf -*-
12310 +
12311 +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
12312 +#
12313 +# This file is free software; the Free Software Foundation
12314 +# gives unlimited permission to copy and/or distribute it,
12315 +# with or without modifications, as long as this notice is preserved.
12316 +
12317 +# serial 3
12318 +
12319 +# AM_MAKE_INCLUDE()
12320 +# -----------------
12321 +# Check to see how make treats includes.
12322 +AC_DEFUN([AM_MAKE_INCLUDE],
12323 +[am_make=${MAKE-make}
12324 +cat > confinc << 'END'
12325 +am__doit:
12326 + @echo done
12327 +.PHONY: am__doit
12328 +END
12329 +# If we don't find an include directive, just comment out the code.
12330 +AC_MSG_CHECKING([for style of include used by $am_make])
12331 +am__include="#"
12332 +am__quote=
12333 +_am_result=none
12334 +# First try GNU make style include.
12335 +echo "include confinc" > confmf
12336 +# We grep out `Entering directory' and `Leaving directory'
12337 +# messages which can occur if `w' ends up in MAKEFLAGS.
12338 +# In particular we don't look at `^make:' because GNU make might
12339 +# be invoked under some other name (usually "gmake"), in which
12340 +# case it prints its new name instead of `make'.
12341 +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
12342 + am__include=include
12343 + am__quote=
12344 + _am_result=GNU
12345 +fi
12346 +# Now try BSD make style include.
12347 +if test "$am__include" = "#"; then
12348 + echo '.include "confinc"' > confmf
12349 + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
12350 + am__include=.include
12351 + am__quote="\""
12352 + _am_result=BSD
12353 + fi
12354 +fi
12355 +AC_SUBST([am__include])
12356 +AC_SUBST([am__quote])
12357 +AC_MSG_RESULT([$_am_result])
12358 +rm -f confinc confmf
12359 +])
12360 +
12361 +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
12362 +
12363 +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
12364 +# Free Software Foundation, Inc.
12365 +#
12366 +# This file is free software; the Free Software Foundation
12367 +# gives unlimited permission to copy and/or distribute it,
12368 +# with or without modifications, as long as this notice is preserved.
12369 +
12370 +# serial 4
12371 +
12372 +# AM_MISSING_PROG(NAME, PROGRAM)
12373 +# ------------------------------
12374 +AC_DEFUN([AM_MISSING_PROG],
12375 +[AC_REQUIRE([AM_MISSING_HAS_RUN])
12376 +$1=${$1-"${am_missing_run}$2"}
12377 +AC_SUBST($1)])
12378 +
12379 +
12380 +# AM_MISSING_HAS_RUN
12381 +# ------------------
12382 +# Define MISSING if not defined so far and test if it supports --run.
12383 +# If it does, set am_missing_run to use it, otherwise, to nothing.
12384 +AC_DEFUN([AM_MISSING_HAS_RUN],
12385 +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
12386 +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
12387 +# Use eval to expand $SHELL
12388 +if eval "$MISSING --run true"; then
12389 + am_missing_run="$MISSING --run "
12390 +else
12391 + am_missing_run=
12392 + AC_MSG_WARN([`missing' script is too old or missing])
12393 +fi
12394 +])
12395 +
12396 +# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
12397 +#
12398 +# This file is free software; the Free Software Foundation
12399 +# gives unlimited permission to copy and/or distribute it,
12400 +# with or without modifications, as long as this notice is preserved.
12401 +
12402 +# AM_PROG_MKDIR_P
12403 +# ---------------
12404 +# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
12405 +#
12406 +# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
12407 +# created by `make install' are always world readable, even if the
12408 +# installer happens to have an overly restrictive umask (e.g. 077).
12409 +# This was a mistake. There are at least two reasons why we must not
12410 +# use `-m 0755':
12411 +# - it causes special bits like SGID to be ignored,
12412 +# - it may be too restrictive (some setups expect 775 directories).
12413 +#
12414 +# Do not use -m 0755 and let people choose whatever they expect by
12415 +# setting umask.
12416 +#
12417 +# We cannot accept any implementation of `mkdir' that recognizes `-p'.
12418 +# Some implementations (such as Solaris 8's) are not thread-safe: if a
12419 +# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
12420 +# concurrently, both version can detect that a/ is missing, but only
12421 +# one can create it and the other will error out. Consequently we
12422 +# restrict ourselves to GNU make (using the --version option ensures
12423 +# this.)
12424 +AC_DEFUN([AM_PROG_MKDIR_P],
12425 +[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
12426 + # We used to keeping the `.' as first argument, in order to
12427 + # allow $(mkdir_p) to be used without argument. As in
12428 + # $(mkdir_p) $(somedir)
12429 + # where $(somedir) is conditionally defined. However this is wrong
12430 + # for two reasons:
12431 + # 1. if the package is installed by a user who cannot write `.'
12432 + # make install will fail,
12433 + # 2. the above comment should most certainly read
12434 + # $(mkdir_p) $(DESTDIR)$(somedir)
12435 + # so it does not work when $(somedir) is undefined and
12436 + # $(DESTDIR) is not.
12437 + # To support the latter case, we have to write
12438 + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
12439 + # so the `.' trick is pointless.
12440 + mkdir_p='mkdir -p --'
12441 +else
12442 + # On NextStep and OpenStep, the `mkdir' command does not
12443 + # recognize any option. It will interpret all options as
12444 + # directories to create, and then abort because `.' already
12445 + # exists.
12446 + for d in ./-p ./--version;
12447 + do
12448 + test -d $d && rmdir $d
12449 + done
12450 + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
12451 + if test -f "$ac_aux_dir/mkinstalldirs"; then
12452 + mkdir_p='$(mkinstalldirs)'
12453 + else
12454 + mkdir_p='$(install_sh) -d'
12455 + fi
12456 +fi
12457 +AC_SUBST([mkdir_p])])
12458 +
12459 +# Helper functions for option handling. -*- Autoconf -*-
12460 +
12461 +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
12462 +#
12463 +# This file is free software; the Free Software Foundation
12464 +# gives unlimited permission to copy and/or distribute it,
12465 +# with or without modifications, as long as this notice is preserved.
12466 +
12467 +# serial 3
12468 +
12469 +# _AM_MANGLE_OPTION(NAME)
12470 +# -----------------------
12471 +AC_DEFUN([_AM_MANGLE_OPTION],
12472 +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
12473 +
12474 +# _AM_SET_OPTION(NAME)
12475 +# ------------------------------
12476 +# Set option NAME. Presently that only means defining a flag for this option.
12477 +AC_DEFUN([_AM_SET_OPTION],
12478 +[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
12479 +
12480 +# _AM_SET_OPTIONS(OPTIONS)
12481 +# ----------------------------------
12482 +# OPTIONS is a space-separated list of Automake options.
12483 +AC_DEFUN([_AM_SET_OPTIONS],
12484 +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
12485 +
12486 +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
12487 +# -------------------------------------------
12488 +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
12489 +AC_DEFUN([_AM_IF_OPTION],
12490 +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
12491 +
12492 +# Check to make sure that the build environment is sane. -*- Autoconf -*-
12493 +
12494 +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
12495 +# Free Software Foundation, Inc.
12496 +#
12497 +# This file is free software; the Free Software Foundation
12498 +# gives unlimited permission to copy and/or distribute it,
12499 +# with or without modifications, as long as this notice is preserved.
12500 +
12501 +# serial 4
12502 +
12503 +# AM_SANITY_CHECK
12504 +# ---------------
12505 +AC_DEFUN([AM_SANITY_CHECK],
12506 +[AC_MSG_CHECKING([whether build environment is sane])
12507 +# Just in case
12508 +sleep 1
12509 +echo timestamp > conftest.file
12510 +# Do `set' in a subshell so we don't clobber the current shell's
12511 +# arguments. Must try -L first in case configure is actually a
12512 +# symlink; some systems play weird games with the mod time of symlinks
12513 +# (eg FreeBSD returns the mod time of the symlink's containing
12514 +# directory).
12515 +if (
12516 + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
12517 + if test "$[*]" = "X"; then
12518 + # -L didn't work.
12519 + set X `ls -t $srcdir/configure conftest.file`
12520 + fi
12521 + rm -f conftest.file
12522 + if test "$[*]" != "X $srcdir/configure conftest.file" \
12523 + && test "$[*]" != "X conftest.file $srcdir/configure"; then
12524 +
12525 + # If neither matched, then we have a broken ls. This can happen
12526 + # if, for instance, CONFIG_SHELL is bash and it inherits a
12527 + # broken ls alias from the environment. This has actually
12528 + # happened. Such a system could not be considered "sane".
12529 + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
12530 +alias in your environment])
12531 + fi
12532 +
12533 + test "$[2]" = conftest.file
12534 + )
12535 +then
12536 + # Ok.
12537 + :
12538 +else
12539 + AC_MSG_ERROR([newly created file is older than distributed files!
12540 +Check your system clock])
12541 +fi
12542 +AC_MSG_RESULT(yes)])
12543 +
12544 +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
12545 +#
12546 +# This file is free software; the Free Software Foundation
12547 +# gives unlimited permission to copy and/or distribute it,
12548 +# with or without modifications, as long as this notice is preserved.
12549 +
12550 +# AM_PROG_INSTALL_STRIP
12551 +# ---------------------
12552 +# One issue with vendor `install' (even GNU) is that you can't
12553 +# specify the program used to strip binaries. This is especially
12554 +# annoying in cross-compiling environments, where the build's strip
12555 +# is unlikely to handle the host's binaries.
12556 +# Fortunately install-sh will honor a STRIPPROG variable, so we
12557 +# always use install-sh in `make install-strip', and initialize
12558 +# STRIPPROG with the value of the STRIP variable (set by the user).
12559 +AC_DEFUN([AM_PROG_INSTALL_STRIP],
12560 +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
12561 +# Installed binaries are usually stripped using `strip' when the user
12562 +# run `make install-strip'. However `strip' might not be the right
12563 +# tool to use in cross-compilation environments, therefore Automake
12564 +# will honor the `STRIP' environment variable to overrule this program.
12565 +dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
12566 +if test "$cross_compiling" != no; then
12567 + AC_CHECK_TOOL([STRIP], [strip], :)
12568 +fi
12569 +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
12570 +AC_SUBST([INSTALL_STRIP_PROGRAM])])
12571 +
12572 +# Check how to create a tarball. -*- Autoconf -*-
12573 +
12574 +# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
12575 +#
12576 +# This file is free software; the Free Software Foundation
12577 +# gives unlimited permission to copy and/or distribute it,
12578 +# with or without modifications, as long as this notice is preserved.
12579 +
12580 +# serial 2
12581 +
12582 +# _AM_PROG_TAR(FORMAT)
12583 +# --------------------
12584 +# Check how to create a tarball in format FORMAT.
12585 +# FORMAT should be one of `v7', `ustar', or `pax'.
12586 +#
12587 +# Substitute a variable $(am__tar) that is a command
12588 +# writing to stdout a FORMAT-tarball containing the directory
12589 +# $tardir.
12590 +# tardir=directory && $(am__tar) > result.tar
12591 +#
12592 +# Substitute a variable $(am__untar) that extract such
12593 +# a tarball read from stdin.
12594 +# $(am__untar) < result.tar
12595 +AC_DEFUN([_AM_PROG_TAR],
12596 +[# Always define AMTAR for backward compatibility.
12597 +AM_MISSING_PROG([AMTAR], [tar])
12598 +m4_if([$1], [v7],
12599 + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
12600 + [m4_case([$1], [ustar],, [pax],,
12601 + [m4_fatal([Unknown tar format])])
12602 +AC_MSG_CHECKING([how to create a $1 tar archive])
12603 +# Loop over all known methods to create a tar archive until one works.
12604 +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
12605 +_am_tools=${am_cv_prog_tar_$1-$_am_tools}
12606 +# Do not fold the above two line into one, because Tru64 sh and
12607 +# Solaris sh will not grok spaces in the rhs of `-'.
12608 +for _am_tool in $_am_tools
12609 +do
12610 + case $_am_tool in
12611 + gnutar)
12612 + for _am_tar in tar gnutar gtar;
12613 + do
12614 + AM_RUN_LOG([$_am_tar --version]) && break
12615 + done
12616 + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
12617 + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
12618 + am__untar="$_am_tar -xf -"
12619 + ;;
12620 + plaintar)
12621 + # Must skip GNU tar: if it does not support --format= it doesn't create
12622 + # ustar tarball either.
12623 + (tar --version) >/dev/null 2>&1 && continue
12624 + am__tar='tar chf - "$$tardir"'
12625 + am__tar_='tar chf - "$tardir"'
12626 + am__untar='tar xf -'
12627 + ;;
12628 + pax)
12629 + am__tar='pax -L -x $1 -w "$$tardir"'
12630 + am__tar_='pax -L -x $1 -w "$tardir"'
12631 + am__untar='pax -r'
12632 + ;;
12633 + cpio)
12634 + am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
12635 + am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
12636 + am__untar='cpio -i -H $1 -d'
12637 + ;;
12638 + none)
12639 + am__tar=false
12640 + am__tar_=false
12641 + am__untar=false
12642 + ;;
12643 + esac
12644 +
12645 + # If the value was cached, stop now. We just wanted to have am__tar
12646 + # and am__untar set.
12647 + test -n "${am_cv_prog_tar_$1}" && break
12648 +
12649 + # tar/untar a dummy directory, and stop if the command works
12650 + rm -rf conftest.dir
12651 + mkdir conftest.dir
12652 + echo GrepMe > conftest.dir/file
12653 + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
12654 + rm -rf conftest.dir
12655 + if test -s conftest.tar; then
12656 + AM_RUN_LOG([$am__untar <conftest.tar])
12657 + grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
12658 + fi
12659 +done
12660 +rm -rf conftest.dir
12661 +
12662 +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
12663 +AC_MSG_RESULT([$am_cv_prog_tar_$1])])
12664 +AC_SUBST([am__tar])
12665 +AC_SUBST([am__untar])
12666 +]) # _AM_PROG_TAR
12667 +
12668 +m4_include([../config/acx.m4])
12669 +m4_include([../config/depstand.m4])
12670 +m4_include([../config/lead-dot.m4])
12671 +m4_include([acinclude.m4])
12672 --- /dev/null
12673 +++ b/convert/alloca.c
12674 @@ -0,0 +1,479 @@
12675 +/* alloca.c -- allocate automatically reclaimed memory
12676 + (Mostly) portable public-domain implementation -- D A Gwyn
12677 +
12678 + This implementation of the PWB library alloca function,
12679 + which is used to allocate space off the run-time stack so
12680 + that it is automatically reclaimed upon procedure exit,
12681 + was inspired by discussions with J. Q. Johnson of Cornell.
12682 + J.Otto Tennant <jot@cray.com> contributed the Cray support.
12683 +
12684 + There are some preprocessor constants that can
12685 + be defined when compiling for your specific system, for
12686 + improved efficiency; however, the defaults should be okay.
12687 +
12688 + The general concept of this implementation is to keep
12689 + track of all alloca-allocated blocks, and reclaim any
12690 + that are found to be deeper in the stack than the current
12691 + invocation. This heuristic does not reclaim storage as
12692 + soon as it becomes invalid, but it will do so eventually.
12693 +
12694 + As a special case, alloca(0) reclaims storage without
12695 + allocating any. It is a good idea to use alloca(0) in
12696 + your main control loop, etc. to force garbage collection. */
12697 +
12698 +#ifdef HAVE_CONFIG_H
12699 +#include "config.h"
12700 +#endif
12701 +
12702 +/* If compiling with GCC, this file's not needed. */
12703 +#ifndef alloca
12704 +
12705 +#ifdef emacs
12706 +#ifdef static
12707 +/* actually, only want this if static is defined as ""
12708 + -- this is for usg, in which emacs must undefine static
12709 + in order to make unexec workable
12710 + */
12711 +#ifndef STACK_DIRECTION
12712 +you
12713 +lose
12714 +-- must know STACK_DIRECTION at compile-time
12715 +#endif /* STACK_DIRECTION undefined */
12716 +#endif /* static */
12717 +#endif /* emacs */
12718 +
12719 +/* If your stack is a linked list of frames, you have to
12720 + provide an "address metric" ADDRESS_FUNCTION macro. */
12721 +
12722 +#if defined (CRAY) && defined (CRAY_STACKSEG_END)
12723 +long i00afunc ();
12724 +#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
12725 +#else
12726 +#define ADDRESS_FUNCTION(arg) &(arg)
12727 +#endif
12728 +
12729 +#if __STDC__
12730 +#include <stddef.h>
12731 +typedef void *pointer;
12732 +#else
12733 +typedef char *pointer;
12734 +typedef unsigned size_t;
12735 +#endif
12736 +
12737 +#ifndef NULL
12738 +#define NULL 0
12739 +#endif
12740 +
12741 +/* Different portions of Emacs need to call different versions of
12742 + malloc. The Emacs executable needs alloca to call xmalloc, because
12743 + ordinary malloc isn't protected from input signals. On the other
12744 + hand, the utilities in lib-src need alloca to call malloc; some of
12745 + them are very simple, and don't have an xmalloc routine.
12746 +
12747 + Non-Emacs programs expect this to call use xmalloc.
12748 +
12749 + Callers below should use malloc. */
12750 +
12751 +#ifndef emacs
12752 +#define malloc xmalloc
12753 +extern pointer xmalloc ();
12754 +#endif
12755 +
12756 +/* Define STACK_DIRECTION if you know the direction of stack
12757 + growth for your system; otherwise it will be automatically
12758 + deduced at run-time.
12759 +
12760 + STACK_DIRECTION > 0 => grows toward higher addresses
12761 + STACK_DIRECTION < 0 => grows toward lower addresses
12762 + STACK_DIRECTION = 0 => direction of growth unknown */
12763 +
12764 +#ifndef STACK_DIRECTION
12765 +#define STACK_DIRECTION 0 /* Direction unknown. */
12766 +#endif
12767 +
12768 +#if STACK_DIRECTION != 0
12769 +
12770 +#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
12771 +
12772 +#else /* STACK_DIRECTION == 0; need run-time code. */
12773 +
12774 +static int stack_dir; /* 1 or -1 once known. */
12775 +#define STACK_DIR stack_dir
12776 +
12777 +static void
12778 +find_stack_direction ()
12779 +{
12780 + static char *addr = NULL; /* Address of first `dummy', once known. */
12781 + auto char dummy; /* To get stack address. */
12782 +
12783 + if (addr == NULL)
12784 + { /* Initial entry. */
12785 + addr = ADDRESS_FUNCTION (dummy);
12786 +
12787 + find_stack_direction (); /* Recurse once. */
12788 + }
12789 + else
12790 + {
12791 + /* Second entry. */
12792 + if (ADDRESS_FUNCTION (dummy) > addr)
12793 + stack_dir = 1; /* Stack grew upward. */
12794 + else
12795 + stack_dir = -1; /* Stack grew downward. */
12796 + }
12797 +}
12798 +
12799 +#endif /* STACK_DIRECTION == 0 */
12800 +
12801 +/* An "alloca header" is used to:
12802 + (a) chain together all alloca'ed blocks;
12803 + (b) keep track of stack depth.
12804 +
12805 + It is very important that sizeof(header) agree with malloc
12806 + alignment chunk size. The following default should work okay. */
12807 +
12808 +#ifndef ALIGN_SIZE
12809 +#define ALIGN_SIZE sizeof(double)
12810 +#endif
12811 +
12812 +typedef union hdr
12813 +{
12814 + char align[ALIGN_SIZE]; /* To force sizeof(header). */
12815 + struct
12816 + {
12817 + union hdr *next; /* For chaining headers. */
12818 + char *deep; /* For stack depth measure. */
12819 + } h;
12820 +} header;
12821 +
12822 +static header *last_alloca_header = NULL; /* -> last alloca header. */
12823 +
12824 +/* Return a pointer to at least SIZE bytes of storage,
12825 + which will be automatically reclaimed upon exit from
12826 + the procedure that called alloca. Originally, this space
12827 + was supposed to be taken from the current stack frame of the
12828 + caller, but that method cannot be made to work for some
12829 + implementations of C, for example under Gould's UTX/32. */
12830 +
12831 +pointer
12832 +alloca (size)
12833 + size_t size;
12834 +{
12835 + auto char probe; /* Probes stack depth: */
12836 + register char *depth = ADDRESS_FUNCTION (probe);
12837 +
12838 +#if STACK_DIRECTION == 0
12839 + if (STACK_DIR == 0) /* Unknown growth direction. */
12840 + find_stack_direction ();
12841 +#endif
12842 +
12843 + /* Reclaim garbage, defined as all alloca'd storage that
12844 + was allocated from deeper in the stack than currently. */
12845 +
12846 + {
12847 + register header *hp; /* Traverses linked list. */
12848 +
12849 + for (hp = last_alloca_header; hp != NULL;)
12850 + if ((STACK_DIR > 0 && hp->h.deep > depth)
12851 + || (STACK_DIR < 0 && hp->h.deep < depth))
12852 + {
12853 + register header *np = hp->h.next;
12854 +
12855 + free ((pointer) hp); /* Collect garbage. */
12856 +
12857 + hp = np; /* -> next header. */
12858 + }
12859 + else
12860 + break; /* Rest are not deeper. */
12861 +
12862 + last_alloca_header = hp; /* -> last valid storage. */
12863 + }
12864 +
12865 + if (size == 0)
12866 + return NULL; /* No allocation required. */
12867 +
12868 + /* Allocate combined header + user data storage. */
12869 +
12870 + {
12871 + register pointer new = malloc (sizeof (header) + size);
12872 + /* Address of header. */
12873 +
12874 + ((header *) new)->h.next = last_alloca_header;
12875 + ((header *) new)->h.deep = depth;
12876 +
12877 + last_alloca_header = (header *) new;
12878 +
12879 + /* User storage begins just after header. */
12880 +
12881 + return (pointer) ((char *) new + sizeof (header));
12882 + }
12883 +}
12884 +
12885 +#if defined (CRAY) && defined (CRAY_STACKSEG_END)
12886 +
12887 +#ifdef DEBUG_I00AFUNC
12888 +#include <stdio.h>
12889 +#endif
12890 +
12891 +#ifndef CRAY_STACK
12892 +#define CRAY_STACK
12893 +#ifndef CRAY2
12894 +/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
12895 +struct stack_control_header
12896 + {
12897 + long shgrow:32; /* Number of times stack has grown. */
12898 + long shaseg:32; /* Size of increments to stack. */
12899 + long shhwm:32; /* High water mark of stack. */
12900 + long shsize:32; /* Current size of stack (all segments). */
12901 + };
12902 +
12903 +/* The stack segment linkage control information occurs at
12904 + the high-address end of a stack segment. (The stack
12905 + grows from low addresses to high addresses.) The initial
12906 + part of the stack segment linkage control information is
12907 + 0200 (octal) words. This provides for register storage
12908 + for the routine which overflows the stack. */
12909 +
12910 +struct stack_segment_linkage
12911 + {
12912 + long ss[0200]; /* 0200 overflow words. */
12913 + long sssize:32; /* Number of words in this segment. */
12914 + long ssbase:32; /* Offset to stack base. */
12915 + long:32;
12916 + long sspseg:32; /* Offset to linkage control of previous
12917 + segment of stack. */
12918 + long:32;
12919 + long sstcpt:32; /* Pointer to task common address block. */
12920 + long sscsnm; /* Private control structure number for
12921 + microtasking. */
12922 + long ssusr1; /* Reserved for user. */
12923 + long ssusr2; /* Reserved for user. */
12924 + long sstpid; /* Process ID for pid based multi-tasking. */
12925 + long ssgvup; /* Pointer to multitasking thread giveup. */
12926 + long sscray[7]; /* Reserved for Cray Research. */
12927 + long ssa0;
12928 + long ssa1;
12929 + long ssa2;
12930 + long ssa3;
12931 + long ssa4;
12932 + long ssa5;
12933 + long ssa6;
12934 + long ssa7;
12935 + long sss0;
12936 + long sss1;
12937 + long sss2;
12938 + long sss3;
12939 + long sss4;
12940 + long sss5;
12941 + long sss6;
12942 + long sss7;
12943 + };
12944 +
12945 +#else /* CRAY2 */
12946 +/* The following structure defines the vector of words
12947 + returned by the STKSTAT library routine. */
12948 +struct stk_stat
12949 + {
12950 + long now; /* Current total stack size. */
12951 + long maxc; /* Amount of contiguous space which would
12952 + be required to satisfy the maximum
12953 + stack demand to date. */
12954 + long high_water; /* Stack high-water mark. */
12955 + long overflows; /* Number of stack overflow ($STKOFEN) calls. */
12956 + long hits; /* Number of internal buffer hits. */
12957 + long extends; /* Number of block extensions. */
12958 + long stko_mallocs; /* Block allocations by $STKOFEN. */
12959 + long underflows; /* Number of stack underflow calls ($STKRETN). */
12960 + long stko_free; /* Number of deallocations by $STKRETN. */
12961 + long stkm_free; /* Number of deallocations by $STKMRET. */
12962 + long segments; /* Current number of stack segments. */
12963 + long maxs; /* Maximum number of stack segments so far. */
12964 + long pad_size; /* Stack pad size. */
12965 + long current_address; /* Current stack segment address. */
12966 + long current_size; /* Current stack segment size. This
12967 + number is actually corrupted by STKSTAT to
12968 + include the fifteen word trailer area. */
12969 + long initial_address; /* Address of initial segment. */
12970 + long initial_size; /* Size of initial segment. */
12971 + };
12972 +
12973 +/* The following structure describes the data structure which trails
12974 + any stack segment. I think that the description in 'asdef' is
12975 + out of date. I only describe the parts that I am sure about. */
12976 +
12977 +struct stk_trailer
12978 + {
12979 + long this_address; /* Address of this block. */
12980 + long this_size; /* Size of this block (does not include
12981 + this trailer). */
12982 + long unknown2;
12983 + long unknown3;
12984 + long link; /* Address of trailer block of previous
12985 + segment. */
12986 + long unknown5;
12987 + long unknown6;
12988 + long unknown7;
12989 + long unknown8;
12990 + long unknown9;
12991 + long unknown10;
12992 + long unknown11;
12993 + long unknown12;
12994 + long unknown13;
12995 + long unknown14;
12996 + };
12997 +
12998 +#endif /* CRAY2 */
12999 +#endif /* not CRAY_STACK */
13000 +
13001 +#ifdef CRAY2
13002 +/* Determine a "stack measure" for an arbitrary ADDRESS.
13003 + I doubt that "lint" will like this much. */
13004 +
13005 +static long
13006 +i00afunc (long *address)
13007 +{
13008 + struct stk_stat status;
13009 + struct stk_trailer *trailer;
13010 + long *block, size;
13011 + long result = 0;
13012 +
13013 + /* We want to iterate through all of the segments. The first
13014 + step is to get the stack status structure. We could do this
13015 + more quickly and more directly, perhaps, by referencing the
13016 + $LM00 common block, but I know that this works. */
13017 +
13018 + STKSTAT (&status);
13019 +
13020 + /* Set up the iteration. */
13021 +
13022 + trailer = (struct stk_trailer *) (status.current_address
13023 + + status.current_size
13024 + - 15);
13025 +
13026 + /* There must be at least one stack segment. Therefore it is
13027 + a fatal error if "trailer" is null. */
13028 +
13029 + if (trailer == 0)
13030 + abort ();
13031 +
13032 + /* Discard segments that do not contain our argument address. */
13033 +
13034 + while (trailer != 0)
13035 + {
13036 + block = (long *) trailer->this_address;
13037 + size = trailer->this_size;
13038 + if (block == 0 || size == 0)
13039 + abort ();
13040 + trailer = (struct stk_trailer *) trailer->link;
13041 + if ((block <= address) && (address < (block + size)))
13042 + break;
13043 + }
13044 +
13045 + /* Set the result to the offset in this segment and add the sizes
13046 + of all predecessor segments. */
13047 +
13048 + result = address - block;
13049 +
13050 + if (trailer == 0)
13051 + {
13052 + return result;
13053 + }
13054 +
13055 + do
13056 + {
13057 + if (trailer->this_size <= 0)
13058 + abort ();
13059 + result += trailer->this_size;
13060 + trailer = (struct stk_trailer *) trailer->link;
13061 + }
13062 + while (trailer != 0);
13063 +
13064 + /* We are done. Note that if you present a bogus address (one
13065 + not in any segment), you will get a different number back, formed
13066 + from subtracting the address of the first block. This is probably
13067 + not what you want. */
13068 +
13069 + return (result);
13070 +}
13071 +
13072 +#else /* not CRAY2 */
13073 +/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
13074 + Determine the number of the cell within the stack,
13075 + given the address of the cell. The purpose of this
13076 + routine is to linearize, in some sense, stack addresses
13077 + for alloca. */
13078 +
13079 +static long
13080 +i00afunc (long address)
13081 +{
13082 + long stkl = 0;
13083 +
13084 + long size, pseg, this_segment, stack;
13085 + long result = 0;
13086 +
13087 + struct stack_segment_linkage *ssptr;
13088 +
13089 + /* Register B67 contains the address of the end of the
13090 + current stack segment. If you (as a subprogram) store
13091 + your registers on the stack and find that you are past
13092 + the contents of B67, you have overflowed the segment.
13093 +
13094 + B67 also points to the stack segment linkage control
13095 + area, which is what we are really interested in. */
13096 +
13097 + stkl = CRAY_STACKSEG_END ();
13098 + ssptr = (struct stack_segment_linkage *) stkl;
13099 +
13100 + /* If one subtracts 'size' from the end of the segment,
13101 + one has the address of the first word of the segment.
13102 +
13103 + If this is not the first segment, 'pseg' will be
13104 + nonzero. */
13105 +
13106 + pseg = ssptr->sspseg;
13107 + size = ssptr->sssize;
13108 +
13109 + this_segment = stkl - size;
13110 +
13111 + /* It is possible that calling this routine itself caused
13112 + a stack overflow. Discard stack segments which do not
13113 + contain the target address. */
13114 +
13115 + while (!(this_segment <= address && address <= stkl))
13116 + {
13117 +#ifdef DEBUG_I00AFUNC
13118 + fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
13119 +#endif
13120 + if (pseg == 0)
13121 + break;
13122 + stkl = stkl - pseg;
13123 + ssptr = (struct stack_segment_linkage *) stkl;
13124 + size = ssptr->sssize;
13125 + pseg = ssptr->sspseg;
13126 + this_segment = stkl - size;
13127 + }
13128 +
13129 + result = address - this_segment;
13130 +
13131 + /* If you subtract pseg from the current end of the stack,
13132 + you get the address of the previous stack segment's end.
13133 + This seems a little convoluted to me, but I'll bet you save
13134 + a cycle somewhere. */
13135 +
13136 + while (pseg != 0)
13137 + {
13138 +#ifdef DEBUG_I00AFUNC
13139 + fprintf (stderr, "%011o %011o\n", pseg, size);
13140 +#endif
13141 + stkl = stkl - pseg;
13142 + ssptr = (struct stack_segment_linkage *) stkl;
13143 + size = ssptr->sssize;
13144 + pseg = ssptr->sspseg;
13145 + result += size;
13146 + }
13147 + return (result);
13148 +}
13149 +
13150 +#endif /* not CRAY2 */
13151 +#endif /* CRAY */
13152 +
13153 +#endif /* no alloca */
13154 --- /dev/null
13155 +++ b/convert/bin.c
13156 @@ -0,0 +1,68 @@
13157 +/* bin.c -- Raw Binary Output
13158 +
13159 + Copyright (c) 1993-2003, 2008 Free Software Foundation, Inc.
13160 + Contributed by MIPS Technologies, Inc.
13161 +
13162 + This program is free software; you can redistribute it and/or modify
13163 + it under the terms of the GNU General Public License as published by
13164 + the Free Software Foundation; either version 3, or (at your option)
13165 + any later version.
13166 +
13167 + This program is distributed in the hope that it will be useful,
13168 + but WITHOUT ANY WARRANTY; without even the implied warranty of
13169 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13170 + GNU General Public License for more details.
13171 +
13172 + You should have received a copy of the GNU General Public License
13173 + along with this program; If not, write to the Free Software
13174 + Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
13175 + 02110-1301, USA. */
13176 +
13177 +#include "sysdep.h"
13178 +
13179 +#define BUFSIZE 8192 /* max bytes per block */
13180 +
13181 +static FILE *binfp;
13182 +static unsigned long binfirst = ~0;
13183 +static unsigned long binaddr = ~0;
13184 +static int binlen;
13185 +static unsigned char *binbuf;
13186 +
13187 +static void
13188 +binFlush ()
13189 +{
13190 + if (binlen > 0) {
13191 + fseek (binfp, binaddr - binfirst, 0);
13192 + fwrite (binbuf, 1, binlen, binfp);
13193 + binlen = 0;
13194 + }
13195 +}
13196 +
13197 +void
13198 +BinStart (FILE *fp, unsigned long ep)
13199 +{
13200 + binbuf = xmalloc (BUFSIZE);
13201 + binfp = fp;
13202 +}
13203 +
13204 +
13205 +void
13206 +BinOutput (unsigned long addr, unsigned char byte)
13207 +{
13208 + if (addr != binaddr + binlen || binlen == BUFSIZE) {
13209 + binFlush ();
13210 + binaddr = addr;
13211 + if (binfirst == ~0)
13212 + binfirst = addr;
13213 + }
13214 + binbuf[binlen++] = byte;
13215 +}
13216 +
13217 +
13218 +void
13219 +BinEnd (unsigned long ep)
13220 +{
13221 + binFlush ();
13222 + free (binbuf);
13223 +}
13224 +
13225 --- /dev/null
13226 +++ b/convert/config.h.in
13227 @@ -0,0 +1,105 @@
13228 +/* config.h.in. Generated from configure.ac by autoheader. */
13229 +
13230 +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
13231 + systems. This function is required for `alloca.c' support on those systems.
13232 + */
13233 +#undef CRAY_STACKSEG_END
13234 +
13235 +/* Define to 1 if using `alloca.c'. */
13236 +#undef C_ALLOCA
13237 +
13238 +/* Define to 1 if you have `alloca', as a function or macro. */
13239 +#undef HAVE_ALLOCA
13240 +
13241 +/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
13242 + */
13243 +#undef HAVE_ALLOCA_H
13244 +
13245 +/* Define to 1 if you have the <fcntl.h> header file. */
13246 +#undef HAVE_FCNTL_H
13247 +
13248 +/* Define to 1 if you have the <inttypes.h> header file. */
13249 +#undef HAVE_INTTYPES_H
13250 +
13251 +/* Define to 1 if you have the <limits.h> header file. */
13252 +#undef HAVE_LIMITS_H
13253 +
13254 +/* Define to 1 if you have the `memcpy' function. */
13255 +#undef HAVE_MEMCPY
13256 +
13257 +/* Define to 1 if you have the <memory.h> header file. */
13258 +#undef HAVE_MEMORY_H
13259 +
13260 +/* Define to 1 if you have the <stddef.h> header file. */
13261 +#undef HAVE_STDDEF_H
13262 +
13263 +/* Define to 1 if you have the <stdint.h> header file. */
13264 +#undef HAVE_STDINT_H
13265 +
13266 +/* Define to 1 if you have the <stdlib.h> header file. */
13267 +#undef HAVE_STDLIB_H
13268 +
13269 +/* Define to 1 if you have the `strchr' function. */
13270 +#undef HAVE_STRCHR
13271 +
13272 +/* Define to 1 if you have the <strings.h> header file. */
13273 +#undef HAVE_STRINGS_H
13274 +
13275 +/* Define to 1 if you have the <string.h> header file. */
13276 +#undef HAVE_STRING_H
13277 +
13278 +/* Define to 1 if you have the `strtok' function. */
13279 +#undef HAVE_STRTOK
13280 +
13281 +/* Define to 1 if you have the <sys/file.h> header file. */
13282 +#undef HAVE_SYS_FILE_H
13283 +
13284 +/* Define to 1 if you have the <sys/stat.h> header file. */
13285 +#undef HAVE_SYS_STAT_H
13286 +
13287 +/* Define to 1 if you have the <sys/types.h> header file. */
13288 +#undef HAVE_SYS_TYPES_H
13289 +
13290 +/* Define to 1 if you have the <unistd.h> header file. */
13291 +#undef HAVE_UNISTD_H
13292 +
13293 +/* Name of package */
13294 +#undef PACKAGE
13295 +
13296 +/* Define to the address where bug reports for this package should be sent. */
13297 +#undef PACKAGE_BUGREPORT
13298 +
13299 +/* Define to the full name of this package. */
13300 +#undef PACKAGE_NAME
13301 +
13302 +/* Define to the full name and version of this package. */
13303 +#undef PACKAGE_STRING
13304 +
13305 +/* Define to the one symbol short name of this package. */
13306 +#undef PACKAGE_TARNAME
13307 +
13308 +/* Define to the version of this package. */
13309 +#undef PACKAGE_VERSION
13310 +
13311 +/* If using the C implementation of alloca, define if you know the
13312 + direction of stack growth for your system; otherwise it will be
13313 + automatically deduced at runtime.
13314 + STACK_DIRECTION > 0 => grows toward higher addresses
13315 + STACK_DIRECTION < 0 => grows toward lower addresses
13316 + STACK_DIRECTION = 0 => direction of growth unknown */
13317 +#undef STACK_DIRECTION
13318 +
13319 +/* Define to 1 if you have the ANSI C header files. */
13320 +#undef STDC_HEADERS
13321 +
13322 +/* Use b modifier when opening binary files? */
13323 +#undef USE_BINARY_FOPEN
13324 +
13325 +/* Version number of package */
13326 +#undef VERSION
13327 +
13328 +/* Define to empty if `const' does not conform to ANSI C. */
13329 +#undef const
13330 +
13331 +/* Define to `unsigned int' if <sys/types.h> does not define. */
13332 +#undef size_t
13333 --- /dev/null
13334 +++ b/convert/configure
13335 @@ -0,0 +1,6916 @@
13336 +#! /bin/sh
13337 +# Guess values for system-dependent variables and create Makefiles.
13338 +# Generated by GNU Autoconf 2.61 for convert 3.0.4.
13339 +#
13340 +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
13341 +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
13342 +# This configure script is free software; the Free Software Foundation
13343 +# gives unlimited permission to copy, distribute and modify it.
13344 +## --------------------- ##
13345 +## M4sh Initialization. ##
13346 +## --------------------- ##
13347 +
13348 +# Be more Bourne compatible
13349 +DUALCASE=1; export DUALCASE # for MKS sh
13350 +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
13351 + emulate sh
13352 + NULLCMD=:
13353 + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
13354 + # is contrary to our usage. Disable this feature.
13355 + alias -g '${1+"$@"}'='"$@"'
13356 + setopt NO_GLOB_SUBST
13357 +else
13358 + case `(set -o) 2>/dev/null` in
13359 + *posix*) set -o posix ;;
13360 +esac
13361 +
13362 +fi
13363 +
13364 +
13365 +
13366 +
13367 +# PATH needs CR
13368 +# Avoid depending upon Character Ranges.
13369 +as_cr_letters='abcdefghijklmnopqrstuvwxyz'
13370 +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13371 +as_cr_Letters=$as_cr_letters$as_cr_LETTERS
13372 +as_cr_digits='0123456789'
13373 +as_cr_alnum=$as_cr_Letters$as_cr_digits
13374 +
13375 +# The user is always right.
13376 +if test "${PATH_SEPARATOR+set}" != set; then
13377 + echo "#! /bin/sh" >conf$$.sh
13378 + echo "exit 0" >>conf$$.sh
13379 + chmod +x conf$$.sh
13380 + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
13381 + PATH_SEPARATOR=';'
13382 + else
13383 + PATH_SEPARATOR=:
13384 + fi
13385 + rm -f conf$$.sh
13386 +fi
13387 +
13388 +# Support unset when possible.
13389 +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
13390 + as_unset=unset
13391 +else
13392 + as_unset=false
13393 +fi
13394 +
13395 +
13396 +# IFS
13397 +# We need space, tab and new line, in precisely that order. Quoting is
13398 +# there to prevent editors from complaining about space-tab.
13399 +# (If _AS_PATH_WALK were called with IFS unset, it would disable word
13400 +# splitting by setting IFS to empty value.)
13401 +as_nl='
13402 +'
13403 +IFS=" "" $as_nl"
13404 +
13405 +# Find who we are. Look in the path if we contain no directory separator.
13406 +case $0 in
13407 + *[\\/]* ) as_myself=$0 ;;
13408 + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13409 +for as_dir in $PATH
13410 +do
13411 + IFS=$as_save_IFS
13412 + test -z "$as_dir" && as_dir=.
13413 + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
13414 +done
13415 +IFS=$as_save_IFS
13416 +
13417 + ;;
13418 +esac
13419 +# We did not find ourselves, most probably we were run as `sh COMMAND'
13420 +# in which case we are not to be found in the path.
13421 +if test "x$as_myself" = x; then
13422 + as_myself=$0
13423 +fi
13424 +if test ! -f "$as_myself"; then
13425 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
13426 + { (exit 1); exit 1; }
13427 +fi
13428 +
13429 +# Work around bugs in pre-3.0 UWIN ksh.
13430 +for as_var in ENV MAIL MAILPATH
13431 +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
13432 +done
13433 +PS1='$ '
13434 +PS2='> '
13435 +PS4='+ '
13436 +
13437 +# NLS nuisances.
13438 +for as_var in \
13439 + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
13440 + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
13441 + LC_TELEPHONE LC_TIME
13442 +do
13443 + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
13444 + eval $as_var=C; export $as_var
13445 + else
13446 + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
13447 + fi
13448 +done
13449 +
13450 +# Required to use basename.
13451 +if expr a : '\(a\)' >/dev/null 2>&1 &&
13452 + test "X`expr 00001 : '.*\(...\)'`" = X001; then
13453 + as_expr=expr
13454 +else
13455 + as_expr=false
13456 +fi
13457 +
13458 +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
13459 + as_basename=basename
13460 +else
13461 + as_basename=false
13462 +fi
13463 +
13464 +
13465 +# Name of the executable.
13466 +as_me=`$as_basename -- "$0" ||
13467 +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
13468 + X"$0" : 'X\(//\)$' \| \
13469 + X"$0" : 'X\(/\)' \| . 2>/dev/null ||
13470 +echo X/"$0" |
13471 + sed '/^.*\/\([^/][^/]*\)\/*$/{
13472 + s//\1/
13473 + q
13474 + }
13475 + /^X\/\(\/\/\)$/{
13476 + s//\1/
13477 + q
13478 + }
13479 + /^X\/\(\/\).*/{
13480 + s//\1/
13481 + q
13482 + }
13483 + s/.*/./; q'`
13484 +
13485 +# CDPATH.
13486 +$as_unset CDPATH
13487 +
13488 +
13489 +if test "x$CONFIG_SHELL" = x; then
13490 + if (eval ":") 2>/dev/null; then
13491 + as_have_required=yes
13492 +else
13493 + as_have_required=no
13494 +fi
13495 +
13496 + if test $as_have_required = yes && (eval ":
13497 +(as_func_return () {
13498 + (exit \$1)
13499 +}
13500 +as_func_success () {
13501 + as_func_return 0
13502 +}
13503 +as_func_failure () {
13504 + as_func_return 1
13505 +}
13506 +as_func_ret_success () {
13507 + return 0
13508 +}
13509 +as_func_ret_failure () {
13510 + return 1
13511 +}
13512 +
13513 +exitcode=0
13514 +if as_func_success; then
13515 + :
13516 +else
13517 + exitcode=1
13518 + echo as_func_success failed.
13519 +fi
13520 +
13521 +if as_func_failure; then
13522 + exitcode=1
13523 + echo as_func_failure succeeded.
13524 +fi
13525 +
13526 +if as_func_ret_success; then
13527 + :
13528 +else
13529 + exitcode=1
13530 + echo as_func_ret_success failed.
13531 +fi
13532 +
13533 +if as_func_ret_failure; then
13534 + exitcode=1
13535 + echo as_func_ret_failure succeeded.
13536 +fi
13537 +
13538 +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
13539 + :
13540 +else
13541 + exitcode=1
13542 + echo positional parameters were not saved.
13543 +fi
13544 +
13545 +test \$exitcode = 0) || { (exit 1); exit 1; }
13546 +
13547 +(
13548 + as_lineno_1=\$LINENO
13549 + as_lineno_2=\$LINENO
13550 + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
13551 + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
13552 +") 2> /dev/null; then
13553 + :
13554 +else
13555 + as_candidate_shells=
13556 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
13557 +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
13558 +do
13559 + IFS=$as_save_IFS
13560 + test -z "$as_dir" && as_dir=.
13561 + case $as_dir in
13562 + /*)
13563 + for as_base in sh bash ksh sh5; do
13564 + as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
13565 + done;;
13566 + esac
13567 +done
13568 +IFS=$as_save_IFS
13569 +
13570 +
13571 + for as_shell in $as_candidate_shells $SHELL; do
13572 + # Try only shells that exist, to save several forks.
13573 + if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
13574 + { ("$as_shell") 2> /dev/null <<\_ASEOF
13575 +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
13576 + emulate sh
13577 + NULLCMD=:
13578 + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
13579 + # is contrary to our usage. Disable this feature.
13580 + alias -g '${1+"$@"}'='"$@"'
13581 + setopt NO_GLOB_SUBST
13582 +else
13583 + case `(set -o) 2>/dev/null` in
13584 + *posix*) set -o posix ;;
13585 +esac
13586 +
13587 +fi
13588 +
13589 +
13590 +:
13591 +_ASEOF
13592 +}; then
13593 + CONFIG_SHELL=$as_shell
13594 + as_have_required=yes
13595 + if { "$as_shell" 2> /dev/null <<\_ASEOF
13596 +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
13597 + emulate sh
13598 + NULLCMD=:
13599 + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
13600 + # is contrary to our usage. Disable this feature.
13601 + alias -g '${1+"$@"}'='"$@"'
13602 + setopt NO_GLOB_SUBST
13603 +else
13604 + case `(set -o) 2>/dev/null` in
13605 + *posix*) set -o posix ;;
13606 +esac
13607 +
13608 +fi
13609 +
13610 +
13611 +:
13612 +(as_func_return () {
13613 + (exit $1)
13614 +}
13615 +as_func_success () {
13616 + as_func_return 0
13617 +}
13618 +as_func_failure () {
13619 + as_func_return 1
13620 +}
13621 +as_func_ret_success () {
13622 + return 0
13623 +}
13624 +as_func_ret_failure () {
13625 + return 1
13626 +}
13627 +
13628 +exitcode=0
13629 +if as_func_success; then
13630 + :
13631 +else
13632 + exitcode=1
13633 + echo as_func_success failed.
13634 +fi
13635 +
13636 +if as_func_failure; then
13637 + exitcode=1
13638 + echo as_func_failure succeeded.
13639 +fi
13640 +
13641 +if as_func_ret_success; then
13642 + :
13643 +else
13644 + exitcode=1
13645 + echo as_func_ret_success failed.
13646 +fi
13647 +
13648 +if as_func_ret_failure; then
13649 + exitcode=1
13650 + echo as_func_ret_failure succeeded.
13651 +fi
13652 +
13653 +if ( set x; as_func_ret_success y && test x = "$1" ); then
13654 + :
13655 +else
13656 + exitcode=1
13657 + echo positional parameters were not saved.
13658 +fi
13659 +
13660 +test $exitcode = 0) || { (exit 1); exit 1; }
13661 +
13662 +(
13663 + as_lineno_1=$LINENO
13664 + as_lineno_2=$LINENO
13665 + test "x$as_lineno_1" != "x$as_lineno_2" &&
13666 + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
13667 +
13668 +_ASEOF
13669 +}; then
13670 + break
13671 +fi
13672 +
13673 +fi
13674 +
13675 + done
13676 +
13677 + if test "x$CONFIG_SHELL" != x; then
13678 + for as_var in BASH_ENV ENV
13679 + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
13680 + done
13681 + export CONFIG_SHELL
13682 + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
13683 +fi
13684 +
13685 +
13686 + if test $as_have_required = no; then
13687 + echo This script requires a shell more modern than all the
13688 + echo shells that I found on your system. Please install a
13689 + echo modern shell, or manually run the script under such a
13690 + echo shell if you do have one.
13691 + { (exit 1); exit 1; }
13692 +fi
13693 +
13694 +
13695 +fi
13696 +
13697 +fi
13698 +
13699 +
13700 +
13701 +(eval "as_func_return () {
13702 + (exit \$1)
13703 +}
13704 +as_func_success () {
13705 + as_func_return 0
13706 +}
13707 +as_func_failure () {
13708 + as_func_return 1
13709 +}
13710 +as_func_ret_success () {
13711 + return 0
13712 +}
13713 +as_func_ret_failure () {
13714 + return 1
13715 +}
13716 +
13717 +exitcode=0
13718 +if as_func_success; then
13719 + :
13720 +else
13721 + exitcode=1
13722 + echo as_func_success failed.
13723 +fi
13724 +
13725 +if as_func_failure; then
13726 + exitcode=1
13727 + echo as_func_failure succeeded.
13728 +fi
13729 +
13730 +if as_func_ret_success; then
13731 + :
13732 +else
13733 + exitcode=1
13734 + echo as_func_ret_success failed.
13735 +fi
13736 +
13737 +if as_func_ret_failure; then
13738 + exitcode=1
13739 + echo as_func_ret_failure succeeded.
13740 +fi
13741 +
13742 +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
13743 + :
13744 +else
13745 + exitcode=1
13746 + echo positional parameters were not saved.
13747 +fi
13748 +
13749 +test \$exitcode = 0") || {
13750 + echo No shell found that supports shell functions.
13751 + echo Please tell autoconf@gnu.org about your system,
13752 + echo including any error possibly output before this
13753 + echo message
13754 +}
13755 +
13756 +
13757 +
13758 + as_lineno_1=$LINENO
13759 + as_lineno_2=$LINENO
13760 + test "x$as_lineno_1" != "x$as_lineno_2" &&
13761 + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
13762 +
13763 + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
13764 + # uniformly replaced by the line number. The first 'sed' inserts a
13765 + # line-number line after each line using $LINENO; the second 'sed'
13766 + # does the real work. The second script uses 'N' to pair each
13767 + # line-number line with the line containing $LINENO, and appends
13768 + # trailing '-' during substitution so that $LINENO is not a special
13769 + # case at line end.
13770 + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
13771 + # scripts with optimization help from Paolo Bonzini. Blame Lee
13772 + # E. McMahon (1931-1989) for sed's syntax. :-)
13773 + sed -n '
13774 + p
13775 + /[$]LINENO/=
13776 + ' <$as_myself |
13777 + sed '
13778 + s/[$]LINENO.*/&-/
13779 + t lineno
13780 + b
13781 + :lineno
13782 + N
13783 + :loop
13784 + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
13785 + t loop
13786 + s/-\n.*//
13787 + ' >$as_me.lineno &&
13788 + chmod +x "$as_me.lineno" ||
13789 + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
13790 + { (exit 1); exit 1; }; }
13791 +
13792 + # Don't try to exec as it changes $[0], causing all sort of problems
13793 + # (the dirname of $[0] is not the place where we might find the
13794 + # original and so on. Autoconf is especially sensitive to this).
13795 + . "./$as_me.lineno"
13796 + # Exit status is that of the last command.
13797 + exit
13798 +}
13799 +
13800 +
13801 +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
13802 + as_dirname=dirname
13803 +else
13804 + as_dirname=false
13805 +fi
13806 +
13807 +ECHO_C= ECHO_N= ECHO_T=
13808 +case `echo -n x` in
13809 +-n*)
13810 + case `echo 'x\c'` in
13811 + *c*) ECHO_T=' ';; # ECHO_T is single tab character.
13812 + *) ECHO_C='\c';;
13813 + esac;;
13814 +*)
13815 + ECHO_N='-n';;
13816 +esac
13817 +
13818 +if expr a : '\(a\)' >/dev/null 2>&1 &&
13819 + test "X`expr 00001 : '.*\(...\)'`" = X001; then
13820 + as_expr=expr
13821 +else
13822 + as_expr=false
13823 +fi
13824 +
13825 +rm -f conf$$ conf$$.exe conf$$.file
13826 +if test -d conf$$.dir; then
13827 + rm -f conf$$.dir/conf$$.file
13828 +else
13829 + rm -f conf$$.dir
13830 + mkdir conf$$.dir
13831 +fi
13832 +echo >conf$$.file
13833 +if ln -s conf$$.file conf$$ 2>/dev/null; then
13834 + as_ln_s='ln -s'
13835 + # ... but there are two gotchas:
13836 + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
13837 + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
13838 + # In both cases, we have to default to `cp -p'.
13839 + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
13840 + as_ln_s='cp -p'
13841 +elif ln conf$$.file conf$$ 2>/dev/null; then
13842 + as_ln_s=ln
13843 +else
13844 + as_ln_s='cp -p'
13845 +fi
13846 +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
13847 +rmdir conf$$.dir 2>/dev/null
13848 +
13849 +if mkdir -p . 2>/dev/null; then
13850 + as_mkdir_p=:
13851 +else
13852 + test -d ./-p && rmdir ./-p
13853 + as_mkdir_p=false
13854 +fi
13855 +
13856 +if test -x / >/dev/null 2>&1; then
13857 + as_test_x='test -x'
13858 +else
13859 + if ls -dL / >/dev/null 2>&1; then
13860 + as_ls_L_option=L
13861 + else
13862 + as_ls_L_option=
13863 + fi
13864 + as_test_x='
13865 + eval sh -c '\''
13866 + if test -d "$1"; then
13867 + test -d "$1/.";
13868 + else
13869 + case $1 in
13870 + -*)set "./$1";;
13871 + esac;
13872 + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
13873 + ???[sx]*):;;*)false;;esac;fi
13874 + '\'' sh
13875 + '
13876 +fi
13877 +as_executable_p=$as_test_x
13878 +
13879 +# Sed expression to map a string onto a valid CPP name.
13880 +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
13881 +
13882 +# Sed expression to map a string onto a valid variable name.
13883 +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
13884 +
13885 +
13886 +
13887 +exec 7<&0 </dev/null 6>&1
13888 +
13889 +# Name of the host.
13890 +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
13891 +# so uname gets run too.
13892 +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
13893 +
13894 +#
13895 +# Initializations.
13896 +#
13897 +ac_default_prefix=/usr/local
13898 +ac_clean_files=
13899 +ac_config_libobj_dir=.
13900 +LIBOBJS=
13901 +cross_compiling=no
13902 +subdirs=
13903 +MFLAGS=
13904 +MAKEFLAGS=
13905 +SHELL=${CONFIG_SHELL-/bin/sh}
13906 +
13907 +# Identity of this package.
13908 +PACKAGE_NAME='convert'
13909 +PACKAGE_TARNAME='convert'
13910 +PACKAGE_VERSION='3.0.4'
13911 +PACKAGE_STRING='convert 3.0.4'
13912 +PACKAGE_BUGREPORT=''
13913 +
13914 +ac_unique_file="convert.c"
13915 +# Factoring default headers for most tests.
13916 +ac_includes_default="\
13917 +#include <stdio.h>
13918 +#ifdef HAVE_SYS_TYPES_H
13919 +# include <sys/types.h>
13920 +#endif
13921 +#ifdef HAVE_SYS_STAT_H
13922 +# include <sys/stat.h>
13923 +#endif
13924 +#ifdef STDC_HEADERS
13925 +# include <stdlib.h>
13926 +# include <stddef.h>
13927 +#else
13928 +# ifdef HAVE_STDLIB_H
13929 +# include <stdlib.h>
13930 +# endif
13931 +#endif
13932 +#ifdef HAVE_STRING_H
13933 +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
13934 +# include <memory.h>
13935 +# endif
13936 +# include <string.h>
13937 +#endif
13938 +#ifdef HAVE_STRINGS_H
13939 +# include <strings.h>
13940 +#endif
13941 +#ifdef HAVE_INTTYPES_H
13942 +# include <inttypes.h>
13943 +#endif
13944 +#ifdef HAVE_STDINT_H
13945 +# include <stdint.h>
13946 +#endif
13947 +#ifdef HAVE_UNISTD_H
13948 +# include <unistd.h>
13949 +#endif"
13950 +
13951 +ac_subst_vars='SHELL
13952 +PATH_SEPARATOR
13953 +PACKAGE_NAME
13954 +PACKAGE_TARNAME
13955 +PACKAGE_VERSION
13956 +PACKAGE_STRING
13957 +PACKAGE_BUGREPORT
13958 +exec_prefix
13959 +prefix
13960 +program_transform_name
13961 +bindir
13962 +sbindir
13963 +libexecdir
13964 +datarootdir
13965 +datadir
13966 +sysconfdir
13967 +sharedstatedir
13968 +localstatedir
13969 +includedir
13970 +oldincludedir
13971 +docdir
13972 +infodir
13973 +htmldir
13974 +dvidir
13975 +pdfdir
13976 +psdir
13977 +libdir
13978 +localedir
13979 +mandir
13980 +DEFS
13981 +ECHO_C
13982 +ECHO_N
13983 +ECHO_T
13984 +LIBS
13985 +build_alias
13986 +host_alias
13987 +target_alias
13988 +build
13989 +build_cpu
13990 +build_vendor
13991 +build_os
13992 +host
13993 +host_cpu
13994 +host_vendor
13995 +host_os
13996 +target
13997 +target_cpu
13998 +target_vendor
13999 +target_os
14000 +INSTALL_PROGRAM
14001 +INSTALL_SCRIPT
14002 +INSTALL_DATA
14003 +CYGPATH_W
14004 +PACKAGE
14005 +VERSION
14006 +ACLOCAL
14007 +AUTOCONF
14008 +AUTOMAKE
14009 +AUTOHEADER
14010 +MAKEINFO
14011 +install_sh
14012 +STRIP
14013 +INSTALL_STRIP_PROGRAM
14014 +mkdir_p
14015 +AWK
14016 +SET_MAKE
14017 +am__leading_dot
14018 +AMTAR
14019 +am__tar
14020 +am__untar
14021 +CC
14022 +CFLAGS
14023 +LDFLAGS
14024 +CPPFLAGS
14025 +ac_ct_CC
14026 +EXEEXT
14027 +OBJEXT
14028 +DEPDIR
14029 +am__include
14030 +am__quote
14031 +AMDEP_TRUE
14032 +AMDEP_FALSE
14033 +AMDEPBACKSLASH
14034 +CCDEPMODE
14035 +am__fastdepCC_TRUE
14036 +am__fastdepCC_FALSE
14037 +CPP
14038 +GREP
14039 +EGREP
14040 +ALLOCA
14041 +PKGVERSION
14042 +REPORT_BUGS_TO
14043 +REPORT_BUGS_TEXI
14044 +MAINTAINER_MODE_TRUE
14045 +MAINTAINER_MODE_FALSE
14046 +MAINT
14047 +LIBOBJS
14048 +LTLIBOBJS'
14049 +ac_subst_files=''
14050 + ac_precious_vars='build_alias
14051 +host_alias
14052 +target_alias
14053 +CC
14054 +CFLAGS
14055 +LDFLAGS
14056 +LIBS
14057 +CPPFLAGS
14058 +CPP'
14059 +
14060 +
14061 +# Initialize some variables set by options.
14062 +ac_init_help=
14063 +ac_init_version=false
14064 +# The variables have the same names as the options, with
14065 +# dashes changed to underlines.
14066 +cache_file=/dev/null
14067 +exec_prefix=NONE
14068 +no_create=
14069 +no_recursion=
14070 +prefix=NONE
14071 +program_prefix=NONE
14072 +program_suffix=NONE
14073 +program_transform_name=s,x,x,
14074 +silent=
14075 +site=
14076 +srcdir=
14077 +verbose=
14078 +x_includes=NONE
14079 +x_libraries=NONE
14080 +
14081 +# Installation directory options.
14082 +# These are left unexpanded so users can "make install exec_prefix=/foo"
14083 +# and all the variables that are supposed to be based on exec_prefix
14084 +# by default will actually change.
14085 +# Use braces instead of parens because sh, perl, etc. also accept them.
14086 +# (The list follows the same order as the GNU Coding Standards.)
14087 +bindir='${exec_prefix}/bin'
14088 +sbindir='${exec_prefix}/sbin'
14089 +libexecdir='${exec_prefix}/libexec'
14090 +datarootdir='${prefix}/share'
14091 +datadir='${datarootdir}'
14092 +sysconfdir='${prefix}/etc'
14093 +sharedstatedir='${prefix}/com'
14094 +localstatedir='${prefix}/var'
14095 +includedir='${prefix}/include'
14096 +oldincludedir='/usr/include'
14097 +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
14098 +infodir='${datarootdir}/info'
14099 +htmldir='${docdir}'
14100 +dvidir='${docdir}'
14101 +pdfdir='${docdir}'
14102 +psdir='${docdir}'
14103 +libdir='${exec_prefix}/lib'
14104 +localedir='${datarootdir}/locale'
14105 +mandir='${datarootdir}/man'
14106 +
14107 +ac_prev=
14108 +ac_dashdash=
14109 +for ac_option
14110 +do
14111 + # If the previous option needs an argument, assign it.
14112 + if test -n "$ac_prev"; then
14113 + eval $ac_prev=\$ac_option
14114 + ac_prev=
14115 + continue
14116 + fi
14117 +
14118 + case $ac_option in
14119 + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
14120 + *) ac_optarg=yes ;;
14121 + esac
14122 +
14123 + # Accept the important Cygnus configure options, so we can diagnose typos.
14124 +
14125 + case $ac_dashdash$ac_option in
14126 + --)
14127 + ac_dashdash=yes ;;
14128 +
14129 + -bindir | --bindir | --bindi | --bind | --bin | --bi)
14130 + ac_prev=bindir ;;
14131 + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
14132 + bindir=$ac_optarg ;;
14133 +
14134 + -build | --build | --buil | --bui | --bu)
14135 + ac_prev=build_alias ;;
14136 + -build=* | --build=* | --buil=* | --bui=* | --bu=*)
14137 + build_alias=$ac_optarg ;;
14138 +
14139 + -cache-file | --cache-file | --cache-fil | --cache-fi \
14140 + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
14141 + ac_prev=cache_file ;;
14142 + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
14143 + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
14144 + cache_file=$ac_optarg ;;
14145 +
14146 + --config-cache | -C)
14147 + cache_file=config.cache ;;
14148 +
14149 + -datadir | --datadir | --datadi | --datad)
14150 + ac_prev=datadir ;;
14151 + -datadir=* | --datadir=* | --datadi=* | --datad=*)
14152 + datadir=$ac_optarg ;;
14153 +
14154 + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
14155 + | --dataroo | --dataro | --datar)
14156 + ac_prev=datarootdir ;;
14157 + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
14158 + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
14159 + datarootdir=$ac_optarg ;;
14160 +
14161 + -disable-* | --disable-*)
14162 + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
14163 + # Reject names that are not valid shell variable names.
14164 + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
14165 + { echo "$as_me: error: invalid feature name: $ac_feature" >&2
14166 + { (exit 1); exit 1; }; }
14167 + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
14168 + eval enable_$ac_feature=no ;;
14169 +
14170 + -docdir | --docdir | --docdi | --doc | --do)
14171 + ac_prev=docdir ;;
14172 + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
14173 + docdir=$ac_optarg ;;
14174 +
14175 + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
14176 + ac_prev=dvidir ;;
14177 + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
14178 + dvidir=$ac_optarg ;;
14179 +
14180 + -enable-* | --enable-*)
14181 + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
14182 + # Reject names that are not valid shell variable names.
14183 + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
14184 + { echo "$as_me: error: invalid feature name: $ac_feature" >&2
14185 + { (exit 1); exit 1; }; }
14186 + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
14187 + eval enable_$ac_feature=\$ac_optarg ;;
14188 +
14189 + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
14190 + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
14191 + | --exec | --exe | --ex)
14192 + ac_prev=exec_prefix ;;
14193 + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
14194 + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
14195 + | --exec=* | --exe=* | --ex=*)
14196 + exec_prefix=$ac_optarg ;;
14197 +
14198 + -gas | --gas | --ga | --g)
14199 + # Obsolete; use --with-gas.
14200 + with_gas=yes ;;
14201 +
14202 + -help | --help | --hel | --he | -h)
14203 + ac_init_help=long ;;
14204 + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
14205 + ac_init_help=recursive ;;
14206 + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
14207 + ac_init_help=short ;;
14208 +
14209 + -host | --host | --hos | --ho)
14210 + ac_prev=host_alias ;;
14211 + -host=* | --host=* | --hos=* | --ho=*)
14212 + host_alias=$ac_optarg ;;
14213 +
14214 + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
14215 + ac_prev=htmldir ;;
14216 + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
14217 + | --ht=*)
14218 + htmldir=$ac_optarg ;;
14219 +
14220 + -includedir | --includedir | --includedi | --included | --include \
14221 + | --includ | --inclu | --incl | --inc)
14222 + ac_prev=includedir ;;
14223 + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
14224 + | --includ=* | --inclu=* | --incl=* | --inc=*)
14225 + includedir=$ac_optarg ;;
14226 +
14227 + -infodir | --infodir | --infodi | --infod | --info | --inf)
14228 + ac_prev=infodir ;;
14229 + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
14230 + infodir=$ac_optarg ;;
14231 +
14232 + -libdir | --libdir | --libdi | --libd)
14233 + ac_prev=libdir ;;
14234 + -libdir=* | --libdir=* | --libdi=* | --libd=*)
14235 + libdir=$ac_optarg ;;
14236 +
14237 + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
14238 + | --libexe | --libex | --libe)
14239 + ac_prev=libexecdir ;;
14240 + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
14241 + | --libexe=* | --libex=* | --libe=*)
14242 + libexecdir=$ac_optarg ;;
14243 +
14244 + -localedir | --localedir | --localedi | --localed | --locale)
14245 + ac_prev=localedir ;;
14246 + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
14247 + localedir=$ac_optarg ;;
14248 +
14249 + -localstatedir | --localstatedir | --localstatedi | --localstated \
14250 + | --localstate | --localstat | --localsta | --localst | --locals)
14251 + ac_prev=localstatedir ;;
14252 + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
14253 + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
14254 + localstatedir=$ac_optarg ;;
14255 +
14256 + -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
14257 + ac_prev=mandir ;;
14258 + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
14259 + mandir=$ac_optarg ;;
14260 +
14261 + -nfp | --nfp | --nf)
14262 + # Obsolete; use --without-fp.
14263 + with_fp=no ;;
14264 +
14265 + -no-create | --no-create | --no-creat | --no-crea | --no-cre \
14266 + | --no-cr | --no-c | -n)
14267 + no_create=yes ;;
14268 +
14269 + -no-recursion | --no-recursion | --no-recursio | --no-recursi \
14270 + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
14271 + no_recursion=yes ;;
14272 +
14273 + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
14274 + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
14275 + | --oldin | --oldi | --old | --ol | --o)
14276 + ac_prev=oldincludedir ;;
14277 + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
14278 + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
14279 + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
14280 + oldincludedir=$ac_optarg ;;
14281 +
14282 + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
14283 + ac_prev=prefix ;;
14284 + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
14285 + prefix=$ac_optarg ;;
14286 +
14287 + -program-prefix | --program-prefix | --program-prefi | --program-pref \
14288 + | --program-pre | --program-pr | --program-p)
14289 + ac_prev=program_prefix ;;
14290 + -program-prefix=* | --program-prefix=* | --program-prefi=* \
14291 + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
14292 + program_prefix=$ac_optarg ;;
14293 +
14294 + -program-suffix | --program-suffix | --program-suffi | --program-suff \
14295 + | --program-suf | --program-su | --program-s)
14296 + ac_prev=program_suffix ;;
14297 + -program-suffix=* | --program-suffix=* | --program-suffi=* \
14298 + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
14299 + program_suffix=$ac_optarg ;;
14300 +
14301 + -program-transform-name | --program-transform-name \
14302 + | --program-transform-nam | --program-transform-na \
14303 + | --program-transform-n | --program-transform- \
14304 + | --program-transform | --program-transfor \
14305 + | --program-transfo | --program-transf \
14306 + | --program-trans | --program-tran \
14307 + | --progr-tra | --program-tr | --program-t)
14308 + ac_prev=program_transform_name ;;
14309 + -program-transform-name=* | --program-transform-name=* \
14310 + | --program-transform-nam=* | --program-transform-na=* \
14311 + | --program-transform-n=* | --program-transform-=* \
14312 + | --program-transform=* | --program-transfor=* \
14313 + | --program-transfo=* | --program-transf=* \
14314 + | --program-trans=* | --program-tran=* \
14315 + | --progr-tra=* | --program-tr=* | --program-t=*)
14316 + program_transform_name=$ac_optarg ;;
14317 +
14318 + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
14319 + ac_prev=pdfdir ;;
14320 + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
14321 + pdfdir=$ac_optarg ;;
14322 +
14323 + -psdir | --psdir | --psdi | --psd | --ps)
14324 + ac_prev=psdir ;;
14325 + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
14326 + psdir=$ac_optarg ;;
14327 +
14328 + -q | -quiet | --quiet | --quie | --qui | --qu | --q \
14329 + | -silent | --silent | --silen | --sile | --sil)
14330 + silent=yes ;;
14331 +
14332 + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
14333 + ac_prev=sbindir ;;
14334 + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
14335 + | --sbi=* | --sb=*)
14336 + sbindir=$ac_optarg ;;
14337 +
14338 + -sharedstatedir | --sharedstatedir | --sharedstatedi \
14339 + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
14340 + | --sharedst | --shareds | --shared | --share | --shar \
14341 + | --sha | --sh)
14342 + ac_prev=sharedstatedir ;;
14343 + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
14344 + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
14345 + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
14346 + | --sha=* | --sh=*)
14347 + sharedstatedir=$ac_optarg ;;
14348 +
14349 + -site | --site | --sit)
14350 + ac_prev=site ;;
14351 + -site=* | --site=* | --sit=*)
14352 + site=$ac_optarg ;;
14353 +
14354 + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
14355 + ac_prev=srcdir ;;
14356 + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
14357 + srcdir=$ac_optarg ;;
14358 +
14359 + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
14360 + | --syscon | --sysco | --sysc | --sys | --sy)
14361 + ac_prev=sysconfdir ;;
14362 + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
14363 + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
14364 + sysconfdir=$ac_optarg ;;
14365 +
14366 + -target | --target | --targe | --targ | --tar | --ta | --t)
14367 + ac_prev=target_alias ;;
14368 + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
14369 + target_alias=$ac_optarg ;;
14370 +
14371 + -v | -verbose | --verbose | --verbos | --verbo | --verb)
14372 + verbose=yes ;;
14373 +
14374 + -version | --version | --versio | --versi | --vers | -V)
14375 + ac_init_version=: ;;
14376 +
14377 + -with-* | --with-*)
14378 + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
14379 + # Reject names that are not valid shell variable names.
14380 + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
14381 + { echo "$as_me: error: invalid package name: $ac_package" >&2
14382 + { (exit 1); exit 1; }; }
14383 + ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
14384 + eval with_$ac_package=\$ac_optarg ;;
14385 +
14386 + -without-* | --without-*)
14387 + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
14388 + # Reject names that are not valid shell variable names.
14389 + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
14390 + { echo "$as_me: error: invalid package name: $ac_package" >&2
14391 + { (exit 1); exit 1; }; }
14392 + ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
14393 + eval with_$ac_package=no ;;
14394 +
14395 + --x)
14396 + # Obsolete; use --with-x.
14397 + with_x=yes ;;
14398 +
14399 + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
14400 + | --x-incl | --x-inc | --x-in | --x-i)
14401 + ac_prev=x_includes ;;
14402 + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
14403 + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
14404 + x_includes=$ac_optarg ;;
14405 +
14406 + -x-libraries | --x-libraries | --x-librarie | --x-librari \
14407 + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
14408 + ac_prev=x_libraries ;;
14409 + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
14410 + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
14411 + x_libraries=$ac_optarg ;;
14412 +
14413 + -*) { echo "$as_me: error: unrecognized option: $ac_option
14414 +Try \`$0 --help' for more information." >&2
14415 + { (exit 1); exit 1; }; }
14416 + ;;
14417 +
14418 + *=*)
14419 + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
14420 + # Reject names that are not valid shell variable names.
14421 + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
14422 + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
14423 + { (exit 1); exit 1; }; }
14424 + eval $ac_envvar=\$ac_optarg
14425 + export $ac_envvar ;;
14426 +
14427 + *)
14428 + # FIXME: should be removed in autoconf 3.0.
14429 + echo "$as_me: WARNING: you should use --build, --host, --target" >&2
14430 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
14431 + echo "$as_me: WARNING: invalid host type: $ac_option" >&2
14432 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
14433 + ;;
14434 +
14435 + esac
14436 +done
14437 +
14438 +if test -n "$ac_prev"; then
14439 + ac_option=--`echo $ac_prev | sed 's/_/-/g'`
14440 + { echo "$as_me: error: missing argument to $ac_option" >&2
14441 + { (exit 1); exit 1; }; }
14442 +fi
14443 +
14444 +# Be sure to have absolute directory names.
14445 +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
14446 + datadir sysconfdir sharedstatedir localstatedir includedir \
14447 + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
14448 + libdir localedir mandir
14449 +do
14450 + eval ac_val=\$$ac_var
14451 + case $ac_val in
14452 + [\\/$]* | ?:[\\/]* ) continue;;
14453 + NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
14454 + esac
14455 + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
14456 + { (exit 1); exit 1; }; }
14457 +done
14458 +
14459 +# There might be people who depend on the old broken behavior: `$host'
14460 +# used to hold the argument of --host etc.
14461 +# FIXME: To remove some day.
14462 +build=$build_alias
14463 +host=$host_alias
14464 +target=$target_alias
14465 +
14466 +# FIXME: To remove some day.
14467 +if test "x$host_alias" != x; then
14468 + if test "x$build_alias" = x; then
14469 + cross_compiling=maybe
14470 + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
14471 + If a cross compiler is detected then cross compile mode will be used." >&2
14472 + elif test "x$build_alias" != "x$host_alias"; then
14473 + cross_compiling=yes
14474 + fi
14475 +fi
14476 +
14477 +ac_tool_prefix=
14478 +test -n "$host_alias" && ac_tool_prefix=$host_alias-
14479 +
14480 +test "$silent" = yes && exec 6>/dev/null
14481 +
14482 +
14483 +ac_pwd=`pwd` && test -n "$ac_pwd" &&
14484 +ac_ls_di=`ls -di .` &&
14485 +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
14486 + { echo "$as_me: error: Working directory cannot be determined" >&2
14487 + { (exit 1); exit 1; }; }
14488 +test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
14489 + { echo "$as_me: error: pwd does not report name of working directory" >&2
14490 + { (exit 1); exit 1; }; }
14491 +
14492 +
14493 +# Find the source files, if location was not specified.
14494 +if test -z "$srcdir"; then
14495 + ac_srcdir_defaulted=yes
14496 + # Try the directory containing this script, then the parent directory.
14497 + ac_confdir=`$as_dirname -- "$0" ||
14498 +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
14499 + X"$0" : 'X\(//\)[^/]' \| \
14500 + X"$0" : 'X\(//\)$' \| \
14501 + X"$0" : 'X\(/\)' \| . 2>/dev/null ||
14502 +echo X"$0" |
14503 + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
14504 + s//\1/
14505 + q
14506 + }
14507 + /^X\(\/\/\)[^/].*/{
14508 + s//\1/
14509 + q
14510 + }
14511 + /^X\(\/\/\)$/{
14512 + s//\1/
14513 + q
14514 + }
14515 + /^X\(\/\).*/{
14516 + s//\1/
14517 + q
14518 + }
14519 + s/.*/./; q'`
14520 + srcdir=$ac_confdir
14521 + if test ! -r "$srcdir/$ac_unique_file"; then
14522 + srcdir=..
14523 + fi
14524 +else
14525 + ac_srcdir_defaulted=no
14526 +fi
14527 +if test ! -r "$srcdir/$ac_unique_file"; then
14528 + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
14529 + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
14530 + { (exit 1); exit 1; }; }
14531 +fi
14532 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
14533 +ac_abs_confdir=`(
14534 + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
14535 + { (exit 1); exit 1; }; }
14536 + pwd)`
14537 +# When building in place, set srcdir=.
14538 +if test "$ac_abs_confdir" = "$ac_pwd"; then
14539 + srcdir=.
14540 +fi
14541 +# Remove unnecessary trailing slashes from srcdir.
14542 +# Double slashes in file names in object file debugging info
14543 +# mess up M-x gdb in Emacs.
14544 +case $srcdir in
14545 +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
14546 +esac
14547 +for ac_var in $ac_precious_vars; do
14548 + eval ac_env_${ac_var}_set=\${${ac_var}+set}
14549 + eval ac_env_${ac_var}_value=\$${ac_var}
14550 + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
14551 + eval ac_cv_env_${ac_var}_value=\$${ac_var}
14552 +done
14553 +
14554 +#
14555 +# Report the --help message.
14556 +#
14557 +if test "$ac_init_help" = "long"; then
14558 + # Omit some internal or obsolete options to make the list less imposing.
14559 + # This message is too long to be a string in the A/UX 3.1 sh.
14560 + cat <<_ACEOF
14561 +\`configure' configures convert 3.0.4 to adapt to many kinds of systems.
14562 +
14563 +Usage: $0 [OPTION]... [VAR=VALUE]...
14564 +
14565 +To assign environment variables (e.g., CC, CFLAGS...), specify them as
14566 +VAR=VALUE. See below for descriptions of some of the useful variables.
14567 +
14568 +Defaults for the options are specified in brackets.
14569 +
14570 +Configuration:
14571 + -h, --help display this help and exit
14572 + --help=short display options specific to this package
14573 + --help=recursive display the short help of all the included packages
14574 + -V, --version display version information and exit
14575 + -q, --quiet, --silent do not print \`checking...' messages
14576 + --cache-file=FILE cache test results in FILE [disabled]
14577 + -C, --config-cache alias for \`--cache-file=config.cache'
14578 + -n, --no-create do not create output files
14579 + --srcdir=DIR find the sources in DIR [configure dir or \`..']
14580 +
14581 +Installation directories:
14582 + --prefix=PREFIX install architecture-independent files in PREFIX
14583 + [$ac_default_prefix]
14584 + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
14585 + [PREFIX]
14586 +
14587 +By default, \`make install' will install all the files in
14588 +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
14589 +an installation prefix other than \`$ac_default_prefix' using \`--prefix',
14590 +for instance \`--prefix=\$HOME'.
14591 +
14592 +For better control, use the options below.
14593 +
14594 +Fine tuning of the installation directories:
14595 + --bindir=DIR user executables [EPREFIX/bin]
14596 + --sbindir=DIR system admin executables [EPREFIX/sbin]
14597 + --libexecdir=DIR program executables [EPREFIX/libexec]
14598 + --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
14599 + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
14600 + --localstatedir=DIR modifiable single-machine data [PREFIX/var]
14601 + --libdir=DIR object code libraries [EPREFIX/lib]
14602 + --includedir=DIR C header files [PREFIX/include]
14603 + --oldincludedir=DIR C header files for non-gcc [/usr/include]
14604 + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
14605 + --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
14606 + --infodir=DIR info documentation [DATAROOTDIR/info]
14607 + --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
14608 + --mandir=DIR man documentation [DATAROOTDIR/man]
14609 + --docdir=DIR documentation root [DATAROOTDIR/doc/convert]
14610 + --htmldir=DIR html documentation [DOCDIR]
14611 + --dvidir=DIR dvi documentation [DOCDIR]
14612 + --pdfdir=DIR pdf documentation [DOCDIR]
14613 + --psdir=DIR ps documentation [DOCDIR]
14614 +_ACEOF
14615 +
14616 + cat <<\_ACEOF
14617 +
14618 +Program names:
14619 + --program-prefix=PREFIX prepend PREFIX to installed program names
14620 + --program-suffix=SUFFIX append SUFFIX to installed program names
14621 + --program-transform-name=PROGRAM run sed PROGRAM on installed program names
14622 +
14623 +System types:
14624 + --build=BUILD configure for building on BUILD [guessed]
14625 + --host=HOST cross-compile to build programs to run on HOST [BUILD]
14626 + --target=TARGET configure for building compilers for TARGET [HOST]
14627 +_ACEOF
14628 +fi
14629 +
14630 +if test -n "$ac_init_help"; then
14631 + case $ac_init_help in
14632 + short | recursive ) echo "Configuration of convert 3.0.4:";;
14633 + esac
14634 + cat <<\_ACEOF
14635 +
14636 +Optional Features:
14637 + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
14638 + --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
14639 + --disable-dependency-tracking speeds up one-time build
14640 + --enable-dependency-tracking do not reject slow dependency extractors
14641 + --enable-maintainer-mode enable make rules and dependencies not useful
14642 + (and sometimes confusing) to the casual installer
14643 +
14644 +Optional Packages:
14645 + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
14646 + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
14647 + --with-pkgversion=PKG Use PKG in the version string in place of "MIPS
14648 + Convert"
14649 + --with-bugurl=URL Direct users to URL to report a bug
14650 +
14651 +Some influential environment variables:
14652 + CC C compiler command
14653 + CFLAGS C compiler flags
14654 + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
14655 + nonstandard directory <lib dir>
14656 + LIBS libraries to pass to the linker, e.g. -l<library>
14657 + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
14658 + you have headers in a nonstandard directory <include dir>
14659 + CPP C preprocessor
14660 +
14661 +Use these variables to override the choices made by `configure' or to help
14662 +it to find libraries and programs with nonstandard names/locations.
14663 +
14664 +_ACEOF
14665 +ac_status=$?
14666 +fi
14667 +
14668 +if test "$ac_init_help" = "recursive"; then
14669 + # If there are subdirs, report their specific --help.
14670 + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
14671 + test -d "$ac_dir" || continue
14672 + ac_builddir=.
14673 +
14674 +case "$ac_dir" in
14675 +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
14676 +*)
14677 + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
14678 + # A ".." for each directory in $ac_dir_suffix.
14679 + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
14680 + case $ac_top_builddir_sub in
14681 + "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
14682 + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
14683 + esac ;;
14684 +esac
14685 +ac_abs_top_builddir=$ac_pwd
14686 +ac_abs_builddir=$ac_pwd$ac_dir_suffix
14687 +# for backward compatibility:
14688 +ac_top_builddir=$ac_top_build_prefix
14689 +
14690 +case $srcdir in
14691 + .) # We are building in place.
14692 + ac_srcdir=.
14693 + ac_top_srcdir=$ac_top_builddir_sub
14694 + ac_abs_top_srcdir=$ac_pwd ;;
14695 + [\\/]* | ?:[\\/]* ) # Absolute name.
14696 + ac_srcdir=$srcdir$ac_dir_suffix;
14697 + ac_top_srcdir=$srcdir
14698 + ac_abs_top_srcdir=$srcdir ;;
14699 + *) # Relative name.
14700 + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
14701 + ac_top_srcdir=$ac_top_build_prefix$srcdir
14702 + ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
14703 +esac
14704 +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
14705 +
14706 + cd "$ac_dir" || { ac_status=$?; continue; }
14707 + # Check for guested configure.
14708 + if test -f "$ac_srcdir/configure.gnu"; then
14709 + echo &&
14710 + $SHELL "$ac_srcdir/configure.gnu" --help=recursive
14711 + elif test -f "$ac_srcdir/configure"; then
14712 + echo &&
14713 + $SHELL "$ac_srcdir/configure" --help=recursive
14714 + else
14715 + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
14716 + fi || ac_status=$?
14717 + cd "$ac_pwd" || { ac_status=$?; break; }
14718 + done
14719 +fi
14720 +
14721 +test -n "$ac_init_help" && exit $ac_status
14722 +if $ac_init_version; then
14723 + cat <<\_ACEOF
14724 +convert configure 3.0.4
14725 +generated by GNU Autoconf 2.61
14726 +
14727 +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
14728 +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
14729 +This configure script is free software; the Free Software Foundation
14730 +gives unlimited permission to copy, distribute and modify it.
14731 +_ACEOF
14732 + exit
14733 +fi
14734 +cat >config.log <<_ACEOF
14735 +This file contains any messages produced by compilers while
14736 +running configure, to aid debugging if configure makes a mistake.
14737 +
14738 +It was created by convert $as_me 3.0.4, which was
14739 +generated by GNU Autoconf 2.61. Invocation command line was
14740 +
14741 + $ $0 $@
14742 +
14743 +_ACEOF
14744 +exec 5>>config.log
14745 +{
14746 +cat <<_ASUNAME
14747 +## --------- ##
14748 +## Platform. ##
14749 +## --------- ##
14750 +
14751 +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
14752 +uname -m = `(uname -m) 2>/dev/null || echo unknown`
14753 +uname -r = `(uname -r) 2>/dev/null || echo unknown`
14754 +uname -s = `(uname -s) 2>/dev/null || echo unknown`
14755 +uname -v = `(uname -v) 2>/dev/null || echo unknown`
14756 +
14757 +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
14758 +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
14759 +
14760 +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
14761 +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
14762 +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
14763 +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
14764 +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
14765 +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
14766 +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
14767 +
14768 +_ASUNAME
14769 +
14770 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
14771 +for as_dir in $PATH
14772 +do
14773 + IFS=$as_save_IFS
14774 + test -z "$as_dir" && as_dir=.
14775 + echo "PATH: $as_dir"
14776 +done
14777 +IFS=$as_save_IFS
14778 +
14779 +} >&5
14780 +
14781 +cat >&5 <<_ACEOF
14782 +
14783 +
14784 +## ----------- ##
14785 +## Core tests. ##
14786 +## ----------- ##
14787 +
14788 +_ACEOF
14789 +
14790 +
14791 +# Keep a trace of the command line.
14792 +# Strip out --no-create and --no-recursion so they do not pile up.
14793 +# Strip out --silent because we don't want to record it for future runs.
14794 +# Also quote any args containing shell meta-characters.
14795 +# Make two passes to allow for proper duplicate-argument suppression.
14796 +ac_configure_args=
14797 +ac_configure_args0=
14798 +ac_configure_args1=
14799 +ac_must_keep_next=false
14800 +for ac_pass in 1 2
14801 +do
14802 + for ac_arg
14803 + do
14804 + case $ac_arg in
14805 + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
14806 + -q | -quiet | --quiet | --quie | --qui | --qu | --q \
14807 + | -silent | --silent | --silen | --sile | --sil)
14808 + continue ;;
14809 + *\'*)
14810 + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
14811 + esac
14812 + case $ac_pass in
14813 + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
14814 + 2)
14815 + ac_configure_args1="$ac_configure_args1 '$ac_arg'"
14816 + if test $ac_must_keep_next = true; then
14817 + ac_must_keep_next=false # Got value, back to normal.
14818 + else
14819 + case $ac_arg in
14820 + *=* | --config-cache | -C | -disable-* | --disable-* \
14821 + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
14822 + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
14823 + | -with-* | --with-* | -without-* | --without-* | --x)
14824 + case "$ac_configure_args0 " in
14825 + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
14826 + esac
14827 + ;;
14828 + -* ) ac_must_keep_next=true ;;
14829 + esac
14830 + fi
14831 + ac_configure_args="$ac_configure_args '$ac_arg'"
14832 + ;;
14833 + esac
14834 + done
14835 +done
14836 +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
14837 +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
14838 +
14839 +# When interrupted or exit'd, cleanup temporary files, and complete
14840 +# config.log. We remove comments because anyway the quotes in there
14841 +# would cause problems or look ugly.
14842 +# WARNING: Use '\'' to represent an apostrophe within the trap.
14843 +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
14844 +trap 'exit_status=$?
14845 + # Save into config.log some information that might help in debugging.
14846 + {
14847 + echo
14848 +
14849 + cat <<\_ASBOX
14850 +## ---------------- ##
14851 +## Cache variables. ##
14852 +## ---------------- ##
14853 +_ASBOX
14854 + echo
14855 + # The following way of writing the cache mishandles newlines in values,
14856 +(
14857 + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
14858 + eval ac_val=\$$ac_var
14859 + case $ac_val in #(
14860 + *${as_nl}*)
14861 + case $ac_var in #(
14862 + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
14863 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
14864 + esac
14865 + case $ac_var in #(
14866 + _ | IFS | as_nl) ;; #(
14867 + *) $as_unset $ac_var ;;
14868 + esac ;;
14869 + esac
14870 + done
14871 + (set) 2>&1 |
14872 + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
14873 + *${as_nl}ac_space=\ *)
14874 + sed -n \
14875 + "s/'\''/'\''\\\\'\'''\''/g;
14876 + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
14877 + ;; #(
14878 + *)
14879 + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
14880 + ;;
14881 + esac |
14882 + sort
14883 +)
14884 + echo
14885 +
14886 + cat <<\_ASBOX
14887 +## ----------------- ##
14888 +## Output variables. ##
14889 +## ----------------- ##
14890 +_ASBOX
14891 + echo
14892 + for ac_var in $ac_subst_vars
14893 + do
14894 + eval ac_val=\$$ac_var
14895 + case $ac_val in
14896 + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
14897 + esac
14898 + echo "$ac_var='\''$ac_val'\''"
14899 + done | sort
14900 + echo
14901 +
14902 + if test -n "$ac_subst_files"; then
14903 + cat <<\_ASBOX
14904 +## ------------------- ##
14905 +## File substitutions. ##
14906 +## ------------------- ##
14907 +_ASBOX
14908 + echo
14909 + for ac_var in $ac_subst_files
14910 + do
14911 + eval ac_val=\$$ac_var
14912 + case $ac_val in
14913 + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
14914 + esac
14915 + echo "$ac_var='\''$ac_val'\''"
14916 + done | sort
14917 + echo
14918 + fi
14919 +
14920 + if test -s confdefs.h; then
14921 + cat <<\_ASBOX
14922 +## ----------- ##
14923 +## confdefs.h. ##
14924 +## ----------- ##
14925 +_ASBOX
14926 + echo
14927 + cat confdefs.h
14928 + echo
14929 + fi
14930 + test "$ac_signal" != 0 &&
14931 + echo "$as_me: caught signal $ac_signal"
14932 + echo "$as_me: exit $exit_status"
14933 + } >&5
14934 + rm -f core *.core core.conftest.* &&
14935 + rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
14936 + exit $exit_status
14937 +' 0
14938 +for ac_signal in 1 2 13 15; do
14939 + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
14940 +done
14941 +ac_signal=0
14942 +
14943 +# confdefs.h avoids OS command line length limits that DEFS can exceed.
14944 +rm -f -r conftest* confdefs.h
14945 +
14946 +# Predefined preprocessor variables.
14947 +
14948 +cat >>confdefs.h <<_ACEOF
14949 +#define PACKAGE_NAME "$PACKAGE_NAME"
14950 +_ACEOF
14951 +
14952 +
14953 +cat >>confdefs.h <<_ACEOF
14954 +#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
14955 +_ACEOF
14956 +
14957 +
14958 +cat >>confdefs.h <<_ACEOF
14959 +#define PACKAGE_VERSION "$PACKAGE_VERSION"
14960 +_ACEOF
14961 +
14962 +
14963 +cat >>confdefs.h <<_ACEOF
14964 +#define PACKAGE_STRING "$PACKAGE_STRING"
14965 +_ACEOF
14966 +
14967 +
14968 +cat >>confdefs.h <<_ACEOF
14969 +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
14970 +_ACEOF
14971 +
14972 +
14973 +# Let the site file select an alternate cache file if it wants to.
14974 +# Prefer explicitly selected file to automatically selected ones.
14975 +if test -n "$CONFIG_SITE"; then
14976 + set x "$CONFIG_SITE"
14977 +elif test "x$prefix" != xNONE; then
14978 + set x "$prefix/share/config.site" "$prefix/etc/config.site"
14979 +else
14980 + set x "$ac_default_prefix/share/config.site" \
14981 + "$ac_default_prefix/etc/config.site"
14982 +fi
14983 +shift
14984 +for ac_site_file
14985 +do
14986 + if test -r "$ac_site_file"; then
14987 + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
14988 +echo "$as_me: loading site script $ac_site_file" >&6;}
14989 + sed 's/^/| /' "$ac_site_file" >&5
14990 + . "$ac_site_file"
14991 + fi
14992 +done
14993 +
14994 +if test -r "$cache_file"; then
14995 + # Some versions of bash will fail to source /dev/null (special
14996 + # files actually), so we avoid doing that.
14997 + if test -f "$cache_file"; then
14998 + { echo "$as_me:$LINENO: loading cache $cache_file" >&5
14999 +echo "$as_me: loading cache $cache_file" >&6;}
15000 + case $cache_file in
15001 + [\\/]* | ?:[\\/]* ) . "$cache_file";;
15002 + *) . "./$cache_file";;
15003 + esac
15004 + fi
15005 +else
15006 + { echo "$as_me:$LINENO: creating cache $cache_file" >&5
15007 +echo "$as_me: creating cache $cache_file" >&6;}
15008 + >$cache_file
15009 +fi
15010 +
15011 +# Check that the precious variables saved in the cache have kept the same
15012 +# value.
15013 +ac_cache_corrupted=false
15014 +for ac_var in $ac_precious_vars; do
15015 + eval ac_old_set=\$ac_cv_env_${ac_var}_set
15016 + eval ac_new_set=\$ac_env_${ac_var}_set
15017 + eval ac_old_val=\$ac_cv_env_${ac_var}_value
15018 + eval ac_new_val=\$ac_env_${ac_var}_value
15019 + case $ac_old_set,$ac_new_set in
15020 + set,)
15021 + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
15022 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
15023 + ac_cache_corrupted=: ;;
15024 + ,set)
15025 + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
15026 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
15027 + ac_cache_corrupted=: ;;
15028 + ,);;
15029 + *)
15030 + if test "x$ac_old_val" != "x$ac_new_val"; then
15031 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
15032 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
15033 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
15034 +echo "$as_me: former value: $ac_old_val" >&2;}
15035 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
15036 +echo "$as_me: current value: $ac_new_val" >&2;}
15037 + ac_cache_corrupted=:
15038 + fi;;
15039 + esac
15040 + # Pass precious variables to config.status.
15041 + if test "$ac_new_set" = set; then
15042 + case $ac_new_val in
15043 + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
15044 + *) ac_arg=$ac_var=$ac_new_val ;;
15045 + esac
15046 + case " $ac_configure_args " in
15047 + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
15048 + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
15049 + esac
15050 + fi
15051 +done
15052 +if $ac_cache_corrupted; then
15053 + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
15054 +echo "$as_me: error: changes in the environment can compromise the build" >&2;}
15055 + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
15056 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
15057 + { (exit 1); exit 1; }; }
15058 +fi
15059 +
15060 +
15061 +
15062 +
15063 +
15064 +
15065 +
15066 +
15067 +
15068 +
15069 +
15070 +
15071 +
15072 +
15073 +
15074 +
15075 +
15076 +
15077 +
15078 +
15079 +
15080 +
15081 +
15082 +
15083 +
15084 +ac_ext=c
15085 +ac_cpp='$CPP $CPPFLAGS'
15086 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15087 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15088 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
15089 +
15090 +
15091 +ac_aux_dir=
15092 +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
15093 + if test -f "$ac_dir/install-sh"; then
15094 + ac_aux_dir=$ac_dir
15095 + ac_install_sh="$ac_aux_dir/install-sh -c"
15096 + break
15097 + elif test -f "$ac_dir/install.sh"; then
15098 + ac_aux_dir=$ac_dir
15099 + ac_install_sh="$ac_aux_dir/install.sh -c"
15100 + break
15101 + elif test -f "$ac_dir/shtool"; then
15102 + ac_aux_dir=$ac_dir
15103 + ac_install_sh="$ac_aux_dir/shtool install -c"
15104 + break
15105 + fi
15106 +done
15107 +if test -z "$ac_aux_dir"; then
15108 + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
15109 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
15110 + { (exit 1); exit 1; }; }
15111 +fi
15112 +
15113 +# These three variables are undocumented and unsupported,
15114 +# and are intended to be withdrawn in a future Autoconf release.
15115 +# They can cause serious problems if a builder's source tree is in a directory
15116 +# whose full name contains unusual characters.
15117 +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
15118 +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
15119 +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
15120 +
15121 +
15122 +# Make sure we can run config.sub.
15123 +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
15124 + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
15125 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
15126 + { (exit 1); exit 1; }; }
15127 +
15128 +{ echo "$as_me:$LINENO: checking build system type" >&5
15129 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; }
15130 +if test "${ac_cv_build+set}" = set; then
15131 + echo $ECHO_N "(cached) $ECHO_C" >&6
15132 +else
15133 + ac_build_alias=$build_alias
15134 +test "x$ac_build_alias" = x &&
15135 + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
15136 +test "x$ac_build_alias" = x &&
15137 + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
15138 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
15139 + { (exit 1); exit 1; }; }
15140 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
15141 + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
15142 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
15143 + { (exit 1); exit 1; }; }
15144 +
15145 +fi
15146 +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
15147 +echo "${ECHO_T}$ac_cv_build" >&6; }
15148 +case $ac_cv_build in
15149 +*-*-*) ;;
15150 +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
15151 +echo "$as_me: error: invalid value of canonical build" >&2;}
15152 + { (exit 1); exit 1; }; };;
15153 +esac
15154 +build=$ac_cv_build
15155 +ac_save_IFS=$IFS; IFS='-'
15156 +set x $ac_cv_build
15157 +shift
15158 +build_cpu=$1
15159 +build_vendor=$2
15160 +shift; shift
15161 +# Remember, the first character of IFS is used to create $*,
15162 +# except with old shells:
15163 +build_os=$*
15164 +IFS=$ac_save_IFS
15165 +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
15166 +
15167 +
15168 +{ echo "$as_me:$LINENO: checking host system type" >&5
15169 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; }
15170 +if test "${ac_cv_host+set}" = set; then
15171 + echo $ECHO_N "(cached) $ECHO_C" >&6
15172 +else
15173 + if test "x$host_alias" = x; then
15174 + ac_cv_host=$ac_cv_build
15175 +else
15176 + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
15177 + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
15178 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
15179 + { (exit 1); exit 1; }; }
15180 +fi
15181 +
15182 +fi
15183 +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
15184 +echo "${ECHO_T}$ac_cv_host" >&6; }
15185 +case $ac_cv_host in
15186 +*-*-*) ;;
15187 +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
15188 +echo "$as_me: error: invalid value of canonical host" >&2;}
15189 + { (exit 1); exit 1; }; };;
15190 +esac
15191 +host=$ac_cv_host
15192 +ac_save_IFS=$IFS; IFS='-'
15193 +set x $ac_cv_host
15194 +shift
15195 +host_cpu=$1
15196 +host_vendor=$2
15197 +shift; shift
15198 +# Remember, the first character of IFS is used to create $*,
15199 +# except with old shells:
15200 +host_os=$*
15201 +IFS=$ac_save_IFS
15202 +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
15203 +
15204 +
15205 +{ echo "$as_me:$LINENO: checking target system type" >&5
15206 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; }
15207 +if test "${ac_cv_target+set}" = set; then
15208 + echo $ECHO_N "(cached) $ECHO_C" >&6
15209 +else
15210 + if test "x$target_alias" = x; then
15211 + ac_cv_target=$ac_cv_host
15212 +else
15213 + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
15214 + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
15215 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
15216 + { (exit 1); exit 1; }; }
15217 +fi
15218 +
15219 +fi
15220 +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
15221 +echo "${ECHO_T}$ac_cv_target" >&6; }
15222 +case $ac_cv_target in
15223 +*-*-*) ;;
15224 +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
15225 +echo "$as_me: error: invalid value of canonical target" >&2;}
15226 + { (exit 1); exit 1; }; };;
15227 +esac
15228 +target=$ac_cv_target
15229 +ac_save_IFS=$IFS; IFS='-'
15230 +set x $ac_cv_target
15231 +shift
15232 +target_cpu=$1
15233 +target_vendor=$2
15234 +shift; shift
15235 +# Remember, the first character of IFS is used to create $*,
15236 +# except with old shells:
15237 +target_os=$*
15238 +IFS=$ac_save_IFS
15239 +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
15240 +
15241 +
15242 +# The aliases save the names the user supplied, while $host etc.
15243 +# will get canonicalized.
15244 +test -n "$target_alias" &&
15245 + test "$program_prefix$program_suffix$program_transform_name" = \
15246 + NONENONEs,x,x, &&
15247 + program_prefix=${target_alias}-
15248 +am__api_version="1.9"
15249 +# Find a good install program. We prefer a C program (faster),
15250 +# so one script is as good as another. But avoid the broken or
15251 +# incompatible versions:
15252 +# SysV /etc/install, /usr/sbin/install
15253 +# SunOS /usr/etc/install
15254 +# IRIX /sbin/install
15255 +# AIX /bin/install
15256 +# AmigaOS /C/install, which installs bootblocks on floppy discs
15257 +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
15258 +# AFS /usr/afsws/bin/install, which mishandles nonexistent args
15259 +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
15260 +# OS/2's system install, which has a completely different semantic
15261 +# ./install, which can be erroneously created by make from ./install.sh.
15262 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
15263 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
15264 +if test -z "$INSTALL"; then
15265 +if test "${ac_cv_path_install+set}" = set; then
15266 + echo $ECHO_N "(cached) $ECHO_C" >&6
15267 +else
15268 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15269 +for as_dir in $PATH
15270 +do
15271 + IFS=$as_save_IFS
15272 + test -z "$as_dir" && as_dir=.
15273 + # Account for people who put trailing slashes in PATH elements.
15274 +case $as_dir/ in
15275 + ./ | .// | /cC/* | \
15276 + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
15277 + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
15278 + /usr/ucb/* ) ;;
15279 + *)
15280 + # OSF1 and SCO ODT 3.0 have their own names for install.
15281 + # Don't use installbsd from OSF since it installs stuff as root
15282 + # by default.
15283 + for ac_prog in ginstall scoinst install; do
15284 + for ac_exec_ext in '' $ac_executable_extensions; do
15285 + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
15286 + if test $ac_prog = install &&
15287 + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
15288 + # AIX install. It has an incompatible calling convention.
15289 + :
15290 + elif test $ac_prog = install &&
15291 + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
15292 + # program-specific install script used by HP pwplus--don't use.
15293 + :
15294 + else
15295 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
15296 + break 3
15297 + fi
15298 + fi
15299 + done
15300 + done
15301 + ;;
15302 +esac
15303 +done
15304 +IFS=$as_save_IFS
15305 +
15306 +
15307 +fi
15308 + if test "${ac_cv_path_install+set}" = set; then
15309 + INSTALL=$ac_cv_path_install
15310 + else
15311 + # As a last resort, use the slow shell script. Don't cache a
15312 + # value for INSTALL within a source directory, because that will
15313 + # break other packages using the cache if that directory is
15314 + # removed, or if the value is a relative name.
15315 + INSTALL=$ac_install_sh
15316 + fi
15317 +fi
15318 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5
15319 +echo "${ECHO_T}$INSTALL" >&6; }
15320 +
15321 +# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
15322 +# It thinks the first close brace ends the variable substitution.
15323 +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
15324 +
15325 +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
15326 +
15327 +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
15328 +
15329 +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
15330 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
15331 +# Just in case
15332 +sleep 1
15333 +echo timestamp > conftest.file
15334 +# Do `set' in a subshell so we don't clobber the current shell's
15335 +# arguments. Must try -L first in case configure is actually a
15336 +# symlink; some systems play weird games with the mod time of symlinks
15337 +# (eg FreeBSD returns the mod time of the symlink's containing
15338 +# directory).
15339 +if (
15340 + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
15341 + if test "$*" = "X"; then
15342 + # -L didn't work.
15343 + set X `ls -t $srcdir/configure conftest.file`
15344 + fi
15345 + rm -f conftest.file
15346 + if test "$*" != "X $srcdir/configure conftest.file" \
15347 + && test "$*" != "X conftest.file $srcdir/configure"; then
15348 +
15349 + # If neither matched, then we have a broken ls. This can happen
15350 + # if, for instance, CONFIG_SHELL is bash and it inherits a
15351 + # broken ls alias from the environment. This has actually
15352 + # happened. Such a system could not be considered "sane".
15353 + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
15354 +alias in your environment" >&5
15355 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
15356 +alias in your environment" >&2;}
15357 + { (exit 1); exit 1; }; }
15358 + fi
15359 +
15360 + test "$2" = conftest.file
15361 + )
15362 +then
15363 + # Ok.
15364 + :
15365 +else
15366 + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
15367 +Check your system clock" >&5
15368 +echo "$as_me: error: newly created file is older than distributed files!
15369 +Check your system clock" >&2;}
15370 + { (exit 1); exit 1; }; }
15371 +fi
15372 +{ echo "$as_me:$LINENO: result: yes" >&5
15373 +echo "${ECHO_T}yes" >&6; }
15374 +test "$program_prefix" != NONE &&
15375 + program_transform_name="s&^&$program_prefix&;$program_transform_name"
15376 +# Use a double $ so make ignores it.
15377 +test "$program_suffix" != NONE &&
15378 + program_transform_name="s&\$&$program_suffix&;$program_transform_name"
15379 +# Double any \ or $. echo might interpret backslashes.
15380 +# By default was `s,x,x', remove it if useless.
15381 +cat <<\_ACEOF >conftest.sed
15382 +s/[\\$]/&&/g;s/;s,x,x,$//
15383 +_ACEOF
15384 +program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
15385 +rm -f conftest.sed
15386 +
15387 +# expand $ac_aux_dir to an absolute path
15388 +am_aux_dir=`cd $ac_aux_dir && pwd`
15389 +
15390 +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
15391 +# Use eval to expand $SHELL
15392 +if eval "$MISSING --run true"; then
15393 + am_missing_run="$MISSING --run "
15394 +else
15395 + am_missing_run=
15396 + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
15397 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
15398 +fi
15399 +
15400 +if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
15401 + # We used to keeping the `.' as first argument, in order to
15402 + # allow $(mkdir_p) to be used without argument. As in
15403 + # $(mkdir_p) $(somedir)
15404 + # where $(somedir) is conditionally defined. However this is wrong
15405 + # for two reasons:
15406 + # 1. if the package is installed by a user who cannot write `.'
15407 + # make install will fail,
15408 + # 2. the above comment should most certainly read
15409 + # $(mkdir_p) $(DESTDIR)$(somedir)
15410 + # so it does not work when $(somedir) is undefined and
15411 + # $(DESTDIR) is not.
15412 + # To support the latter case, we have to write
15413 + # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
15414 + # so the `.' trick is pointless.
15415 + mkdir_p='mkdir -p --'
15416 +else
15417 + # On NextStep and OpenStep, the `mkdir' command does not
15418 + # recognize any option. It will interpret all options as
15419 + # directories to create, and then abort because `.' already
15420 + # exists.
15421 + for d in ./-p ./--version;
15422 + do
15423 + test -d $d && rmdir $d
15424 + done
15425 + # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
15426 + if test -f "$ac_aux_dir/mkinstalldirs"; then
15427 + mkdir_p='$(mkinstalldirs)'
15428 + else
15429 + mkdir_p='$(install_sh) -d'
15430 + fi
15431 +fi
15432 +
15433 +for ac_prog in gawk mawk nawk awk
15434 +do
15435 + # Extract the first word of "$ac_prog", so it can be a program name with args.
15436 +set dummy $ac_prog; ac_word=$2
15437 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5
15438 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
15439 +if test "${ac_cv_prog_AWK+set}" = set; then
15440 + echo $ECHO_N "(cached) $ECHO_C" >&6
15441 +else
15442 + if test -n "$AWK"; then
15443 + ac_cv_prog_AWK="$AWK" # Let the user override the test.
15444 +else
15445 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15446 +for as_dir in $PATH
15447 +do
15448 + IFS=$as_save_IFS
15449 + test -z "$as_dir" && as_dir=.
15450 + for ac_exec_ext in '' $ac_executable_extensions; do
15451 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
15452 + ac_cv_prog_AWK="$ac_prog"
15453 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
15454 + break 2
15455 + fi
15456 +done
15457 +done
15458 +IFS=$as_save_IFS
15459 +
15460 +fi
15461 +fi
15462 +AWK=$ac_cv_prog_AWK
15463 +if test -n "$AWK"; then
15464 + { echo "$as_me:$LINENO: result: $AWK" >&5
15465 +echo "${ECHO_T}$AWK" >&6; }
15466 +else
15467 + { echo "$as_me:$LINENO: result: no" >&5
15468 +echo "${ECHO_T}no" >&6; }
15469 +fi
15470 +
15471 +
15472 + test -n "$AWK" && break
15473 +done
15474 +
15475 +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
15476 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
15477 +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
15478 +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
15479 + echo $ECHO_N "(cached) $ECHO_C" >&6
15480 +else
15481 + cat >conftest.make <<\_ACEOF
15482 +SHELL = /bin/sh
15483 +all:
15484 + @echo '@@@%%%=$(MAKE)=@@@%%%'
15485 +_ACEOF
15486 +# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
15487 +case `${MAKE-make} -f conftest.make 2>/dev/null` in
15488 + *@@@%%%=?*=@@@%%%*)
15489 + eval ac_cv_prog_make_${ac_make}_set=yes;;
15490 + *)
15491 + eval ac_cv_prog_make_${ac_make}_set=no;;
15492 +esac
15493 +rm -f conftest.make
15494 +fi
15495 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
15496 + { echo "$as_me:$LINENO: result: yes" >&5
15497 +echo "${ECHO_T}yes" >&6; }
15498 + SET_MAKE=
15499 +else
15500 + { echo "$as_me:$LINENO: result: no" >&5
15501 +echo "${ECHO_T}no" >&6; }
15502 + SET_MAKE="MAKE=${MAKE-make}"
15503 +fi
15504 +
15505 +rm -rf .tst 2>/dev/null
15506 +mkdir .tst 2>/dev/null
15507 +if test -d .tst; then
15508 + am__leading_dot=.
15509 +else
15510 + am__leading_dot=_
15511 +fi
15512 +rmdir .tst 2>/dev/null
15513 +
15514 +# test to see if srcdir already configured
15515 +if test "`cd $srcdir && pwd`" != "`pwd`" &&
15516 + test -f $srcdir/config.status; then
15517 + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
15518 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
15519 + { (exit 1); exit 1; }; }
15520 +fi
15521 +
15522 +# test whether we have cygpath
15523 +if test -z "$CYGPATH_W"; then
15524 + if (cygpath --version) >/dev/null 2>/dev/null; then
15525 + CYGPATH_W='cygpath -w'
15526 + else
15527 + CYGPATH_W=echo
15528 + fi
15529 +fi
15530 +
15531 +
15532 +# Define the identity of the package.
15533 + PACKAGE='convert'
15534 + VERSION='3.0.4'
15535 +
15536 +
15537 +cat >>confdefs.h <<_ACEOF
15538 +#define PACKAGE "$PACKAGE"
15539 +_ACEOF
15540 +
15541 +
15542 +cat >>confdefs.h <<_ACEOF
15543 +#define VERSION "$VERSION"
15544 +_ACEOF
15545 +
15546 +# Some tools Automake needs.
15547 +
15548 +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
15549 +
15550 +
15551 +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
15552 +
15553 +
15554 +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
15555 +
15556 +
15557 +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
15558 +
15559 +
15560 +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
15561 +
15562 +install_sh=${install_sh-"$am_aux_dir/install-sh"}
15563 +
15564 +# Installed binaries are usually stripped using `strip' when the user
15565 +# run `make install-strip'. However `strip' might not be the right
15566 +# tool to use in cross-compilation environments, therefore Automake
15567 +# will honor the `STRIP' environment variable to overrule this program.
15568 +if test "$cross_compiling" != no; then
15569 + if test -n "$ac_tool_prefix"; then
15570 + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
15571 +set dummy ${ac_tool_prefix}strip; ac_word=$2
15572 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5
15573 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
15574 +if test "${ac_cv_prog_STRIP+set}" = set; then
15575 + echo $ECHO_N "(cached) $ECHO_C" >&6
15576 +else
15577 + if test -n "$STRIP"; then
15578 + ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
15579 +else
15580 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15581 +for as_dir in $PATH
15582 +do
15583 + IFS=$as_save_IFS
15584 + test -z "$as_dir" && as_dir=.
15585 + for ac_exec_ext in '' $ac_executable_extensions; do
15586 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
15587 + ac_cv_prog_STRIP="${ac_tool_prefix}strip"
15588 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
15589 + break 2
15590 + fi
15591 +done
15592 +done
15593 +IFS=$as_save_IFS
15594 +
15595 +fi
15596 +fi
15597 +STRIP=$ac_cv_prog_STRIP
15598 +if test -n "$STRIP"; then
15599 + { echo "$as_me:$LINENO: result: $STRIP" >&5
15600 +echo "${ECHO_T}$STRIP" >&6; }
15601 +else
15602 + { echo "$as_me:$LINENO: result: no" >&5
15603 +echo "${ECHO_T}no" >&6; }
15604 +fi
15605 +
15606 +
15607 +fi
15608 +if test -z "$ac_cv_prog_STRIP"; then
15609 + ac_ct_STRIP=$STRIP
15610 + # Extract the first word of "strip", so it can be a program name with args.
15611 +set dummy strip; ac_word=$2
15612 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5
15613 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
15614 +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
15615 + echo $ECHO_N "(cached) $ECHO_C" >&6
15616 +else
15617 + if test -n "$ac_ct_STRIP"; then
15618 + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
15619 +else
15620 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15621 +for as_dir in $PATH
15622 +do
15623 + IFS=$as_save_IFS
15624 + test -z "$as_dir" && as_dir=.
15625 + for ac_exec_ext in '' $ac_executable_extensions; do
15626 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
15627 + ac_cv_prog_ac_ct_STRIP="strip"
15628 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
15629 + break 2
15630 + fi
15631 +done
15632 +done
15633 +IFS=$as_save_IFS
15634 +
15635 +fi
15636 +fi
15637 +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
15638 +if test -n "$ac_ct_STRIP"; then
15639 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
15640 +echo "${ECHO_T}$ac_ct_STRIP" >&6; }
15641 +else
15642 + { echo "$as_me:$LINENO: result: no" >&5
15643 +echo "${ECHO_T}no" >&6; }
15644 +fi
15645 +
15646 + if test "x$ac_ct_STRIP" = x; then
15647 + STRIP=":"
15648 + else
15649 + case $cross_compiling:$ac_tool_warned in
15650 +yes:)
15651 +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
15652 +whose name does not start with the host triplet. If you think this
15653 +configuration is useful to you, please write to autoconf@gnu.org." >&5
15654 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
15655 +whose name does not start with the host triplet. If you think this
15656 +configuration is useful to you, please write to autoconf@gnu.org." >&2;}
15657 +ac_tool_warned=yes ;;
15658 +esac
15659 + STRIP=$ac_ct_STRIP
15660 + fi
15661 +else
15662 + STRIP="$ac_cv_prog_STRIP"
15663 +fi
15664 +
15665 +fi
15666 +INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
15667 +
15668 +# We need awk for the "check" target. The system "awk" is bad on
15669 +# some platforms.
15670 +# Always define AMTAR for backward compatibility.
15671 +
15672 +AMTAR=${AMTAR-"${am_missing_run}tar"}
15673 +
15674 +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
15675 +
15676 +
15677 +
15678 +
15679 +
15680 +
15681 +
15682 +
15683 +ac_ext=c
15684 +ac_cpp='$CPP $CPPFLAGS'
15685 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
15686 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
15687 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
15688 +if test -n "$ac_tool_prefix"; then
15689 + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
15690 +set dummy ${ac_tool_prefix}gcc; ac_word=$2
15691 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5
15692 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
15693 +if test "${ac_cv_prog_CC+set}" = set; then
15694 + echo $ECHO_N "(cached) $ECHO_C" >&6
15695 +else
15696 + if test -n "$CC"; then
15697 + ac_cv_prog_CC="$CC" # Let the user override the test.
15698 +else
15699 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15700 +for as_dir in $PATH
15701 +do
15702 + IFS=$as_save_IFS
15703 + test -z "$as_dir" && as_dir=.
15704 + for ac_exec_ext in '' $ac_executable_extensions; do
15705 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
15706 + ac_cv_prog_CC="${ac_tool_prefix}gcc"
15707 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
15708 + break 2
15709 + fi
15710 +done
15711 +done
15712 +IFS=$as_save_IFS
15713 +
15714 +fi
15715 +fi
15716 +CC=$ac_cv_prog_CC
15717 +if test -n "$CC"; then
15718 + { echo "$as_me:$LINENO: result: $CC" >&5
15719 +echo "${ECHO_T}$CC" >&6; }
15720 +else
15721 + { echo "$as_me:$LINENO: result: no" >&5
15722 +echo "${ECHO_T}no" >&6; }
15723 +fi
15724 +
15725 +
15726 +fi
15727 +if test -z "$ac_cv_prog_CC"; then
15728 + ac_ct_CC=$CC
15729 + # Extract the first word of "gcc", so it can be a program name with args.
15730 +set dummy gcc; ac_word=$2
15731 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5
15732 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
15733 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
15734 + echo $ECHO_N "(cached) $ECHO_C" >&6
15735 +else
15736 + if test -n "$ac_ct_CC"; then
15737 + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
15738 +else
15739 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15740 +for as_dir in $PATH
15741 +do
15742 + IFS=$as_save_IFS
15743 + test -z "$as_dir" && as_dir=.
15744 + for ac_exec_ext in '' $ac_executable_extensions; do
15745 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
15746 + ac_cv_prog_ac_ct_CC="gcc"
15747 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
15748 + break 2
15749 + fi
15750 +done
15751 +done
15752 +IFS=$as_save_IFS
15753 +
15754 +fi
15755 +fi
15756 +ac_ct_CC=$ac_cv_prog_ac_ct_CC
15757 +if test -n "$ac_ct_CC"; then
15758 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
15759 +echo "${ECHO_T}$ac_ct_CC" >&6; }
15760 +else
15761 + { echo "$as_me:$LINENO: result: no" >&5
15762 +echo "${ECHO_T}no" >&6; }
15763 +fi
15764 +
15765 + if test "x$ac_ct_CC" = x; then
15766 + CC=""
15767 + else
15768 + case $cross_compiling:$ac_tool_warned in
15769 +yes:)
15770 +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
15771 +whose name does not start with the host triplet. If you think this
15772 +configuration is useful to you, please write to autoconf@gnu.org." >&5
15773 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
15774 +whose name does not start with the host triplet. If you think this
15775 +configuration is useful to you, please write to autoconf@gnu.org." >&2;}
15776 +ac_tool_warned=yes ;;
15777 +esac
15778 + CC=$ac_ct_CC
15779 + fi
15780 +else
15781 + CC="$ac_cv_prog_CC"
15782 +fi
15783 +
15784 +if test -z "$CC"; then
15785 + if test -n "$ac_tool_prefix"; then
15786 + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
15787 +set dummy ${ac_tool_prefix}cc; ac_word=$2
15788 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5
15789 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
15790 +if test "${ac_cv_prog_CC+set}" = set; then
15791 + echo $ECHO_N "(cached) $ECHO_C" >&6
15792 +else
15793 + if test -n "$CC"; then
15794 + ac_cv_prog_CC="$CC" # Let the user override the test.
15795 +else
15796 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15797 +for as_dir in $PATH
15798 +do
15799 + IFS=$as_save_IFS
15800 + test -z "$as_dir" && as_dir=.
15801 + for ac_exec_ext in '' $ac_executable_extensions; do
15802 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
15803 + ac_cv_prog_CC="${ac_tool_prefix}cc"
15804 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
15805 + break 2
15806 + fi
15807 +done
15808 +done
15809 +IFS=$as_save_IFS
15810 +
15811 +fi
15812 +fi
15813 +CC=$ac_cv_prog_CC
15814 +if test -n "$CC"; then
15815 + { echo "$as_me:$LINENO: result: $CC" >&5
15816 +echo "${ECHO_T}$CC" >&6; }
15817 +else
15818 + { echo "$as_me:$LINENO: result: no" >&5
15819 +echo "${ECHO_T}no" >&6; }
15820 +fi
15821 +
15822 +
15823 + fi
15824 +fi
15825 +if test -z "$CC"; then
15826 + # Extract the first word of "cc", so it can be a program name with args.
15827 +set dummy cc; ac_word=$2
15828 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5
15829 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
15830 +if test "${ac_cv_prog_CC+set}" = set; then
15831 + echo $ECHO_N "(cached) $ECHO_C" >&6
15832 +else
15833 + if test -n "$CC"; then
15834 + ac_cv_prog_CC="$CC" # Let the user override the test.
15835 +else
15836 + ac_prog_rejected=no
15837 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15838 +for as_dir in $PATH
15839 +do
15840 + IFS=$as_save_IFS
15841 + test -z "$as_dir" && as_dir=.
15842 + for ac_exec_ext in '' $ac_executable_extensions; do
15843 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
15844 + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
15845 + ac_prog_rejected=yes
15846 + continue
15847 + fi
15848 + ac_cv_prog_CC="cc"
15849 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
15850 + break 2
15851 + fi
15852 +done
15853 +done
15854 +IFS=$as_save_IFS
15855 +
15856 +if test $ac_prog_rejected = yes; then
15857 + # We found a bogon in the path, so make sure we never use it.
15858 + set dummy $ac_cv_prog_CC
15859 + shift
15860 + if test $# != 0; then
15861 + # We chose a different compiler from the bogus one.
15862 + # However, it has the same basename, so the bogon will be chosen
15863 + # first if we set CC to just the basename; use the full file name.
15864 + shift
15865 + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
15866 + fi
15867 +fi
15868 +fi
15869 +fi
15870 +CC=$ac_cv_prog_CC
15871 +if test -n "$CC"; then
15872 + { echo "$as_me:$LINENO: result: $CC" >&5
15873 +echo "${ECHO_T}$CC" >&6; }
15874 +else
15875 + { echo "$as_me:$LINENO: result: no" >&5
15876 +echo "${ECHO_T}no" >&6; }
15877 +fi
15878 +
15879 +
15880 +fi
15881 +if test -z "$CC"; then
15882 + if test -n "$ac_tool_prefix"; then
15883 + for ac_prog in cl.exe
15884 + do
15885 + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15886 +set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15887 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5
15888 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
15889 +if test "${ac_cv_prog_CC+set}" = set; then
15890 + echo $ECHO_N "(cached) $ECHO_C" >&6
15891 +else
15892 + if test -n "$CC"; then
15893 + ac_cv_prog_CC="$CC" # Let the user override the test.
15894 +else
15895 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15896 +for as_dir in $PATH
15897 +do
15898 + IFS=$as_save_IFS
15899 + test -z "$as_dir" && as_dir=.
15900 + for ac_exec_ext in '' $ac_executable_extensions; do
15901 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
15902 + ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
15903 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
15904 + break 2
15905 + fi
15906 +done
15907 +done
15908 +IFS=$as_save_IFS
15909 +
15910 +fi
15911 +fi
15912 +CC=$ac_cv_prog_CC
15913 +if test -n "$CC"; then
15914 + { echo "$as_me:$LINENO: result: $CC" >&5
15915 +echo "${ECHO_T}$CC" >&6; }
15916 +else
15917 + { echo "$as_me:$LINENO: result: no" >&5
15918 +echo "${ECHO_T}no" >&6; }
15919 +fi
15920 +
15921 +
15922 + test -n "$CC" && break
15923 + done
15924 +fi
15925 +if test -z "$CC"; then
15926 + ac_ct_CC=$CC
15927 + for ac_prog in cl.exe
15928 +do
15929 + # Extract the first word of "$ac_prog", so it can be a program name with args.
15930 +set dummy $ac_prog; ac_word=$2
15931 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5
15932 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
15933 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
15934 + echo $ECHO_N "(cached) $ECHO_C" >&6
15935 +else
15936 + if test -n "$ac_ct_CC"; then
15937 + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
15938 +else
15939 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
15940 +for as_dir in $PATH
15941 +do
15942 + IFS=$as_save_IFS
15943 + test -z "$as_dir" && as_dir=.
15944 + for ac_exec_ext in '' $ac_executable_extensions; do
15945 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
15946 + ac_cv_prog_ac_ct_CC="$ac_prog"
15947 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
15948 + break 2
15949 + fi
15950 +done
15951 +done
15952 +IFS=$as_save_IFS
15953 +
15954 +fi
15955 +fi
15956 +ac_ct_CC=$ac_cv_prog_ac_ct_CC
15957 +if test -n "$ac_ct_CC"; then
15958 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
15959 +echo "${ECHO_T}$ac_ct_CC" >&6; }
15960 +else
15961 + { echo "$as_me:$LINENO: result: no" >&5
15962 +echo "${ECHO_T}no" >&6; }
15963 +fi
15964 +
15965 +
15966 + test -n "$ac_ct_CC" && break
15967 +done
15968 +
15969 + if test "x$ac_ct_CC" = x; then
15970 + CC=""
15971 + else
15972 + case $cross_compiling:$ac_tool_warned in
15973 +yes:)
15974 +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
15975 +whose name does not start with the host triplet. If you think this
15976 +configuration is useful to you, please write to autoconf@gnu.org." >&5
15977 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
15978 +whose name does not start with the host triplet. If you think this
15979 +configuration is useful to you, please write to autoconf@gnu.org." >&2;}
15980 +ac_tool_warned=yes ;;
15981 +esac
15982 + CC=$ac_ct_CC
15983 + fi
15984 +fi
15985 +
15986 +fi
15987 +
15988 +
15989 +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
15990 +See \`config.log' for more details." >&5
15991 +echo "$as_me: error: no acceptable C compiler found in \$PATH
15992 +See \`config.log' for more details." >&2;}
15993 + { (exit 1); exit 1; }; }
15994 +
15995 +# Provide some information about the compiler.
15996 +echo "$as_me:$LINENO: checking for C compiler version" >&5
15997 +ac_compiler=`set X $ac_compile; echo $2`
15998 +{ (ac_try="$ac_compiler --version >&5"
15999 +case "(($ac_try" in
16000 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16001 + *) ac_try_echo=$ac_try;;
16002 +esac
16003 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16004 + (eval "$ac_compiler --version >&5") 2>&5
16005 + ac_status=$?
16006 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16007 + (exit $ac_status); }
16008 +{ (ac_try="$ac_compiler -v >&5"
16009 +case "(($ac_try" in
16010 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16011 + *) ac_try_echo=$ac_try;;
16012 +esac
16013 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16014 + (eval "$ac_compiler -v >&5") 2>&5
16015 + ac_status=$?
16016 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16017 + (exit $ac_status); }
16018 +{ (ac_try="$ac_compiler -V >&5"
16019 +case "(($ac_try" in
16020 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16021 + *) ac_try_echo=$ac_try;;
16022 +esac
16023 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16024 + (eval "$ac_compiler -V >&5") 2>&5
16025 + ac_status=$?
16026 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16027 + (exit $ac_status); }
16028 +
16029 +cat >conftest.$ac_ext <<_ACEOF
16030 +/* confdefs.h. */
16031 +_ACEOF
16032 +cat confdefs.h >>conftest.$ac_ext
16033 +cat >>conftest.$ac_ext <<_ACEOF
16034 +/* end confdefs.h. */
16035 +
16036 +int
16037 +main ()
16038 +{
16039 +
16040 + ;
16041 + return 0;
16042 +}
16043 +_ACEOF
16044 +ac_clean_files_save=$ac_clean_files
16045 +ac_clean_files="$ac_clean_files a.out a.exe b.out"
16046 +# Try to create an executable without -o first, disregard a.out.
16047 +# It will help us diagnose broken compilers, and finding out an intuition
16048 +# of exeext.
16049 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
16050 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
16051 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
16052 +#
16053 +# List of possible output files, starting from the most likely.
16054 +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
16055 +# only as a last resort. b.out is created by i960 compilers.
16056 +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
16057 +#
16058 +# The IRIX 6 linker writes into existing files which may not be
16059 +# executable, retaining their permissions. Remove them first so a
16060 +# subsequent execution test works.
16061 +ac_rmfiles=
16062 +for ac_file in $ac_files
16063 +do
16064 + case $ac_file in
16065 + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
16066 + * ) ac_rmfiles="$ac_rmfiles $ac_file";;
16067 + esac
16068 +done
16069 +rm -f $ac_rmfiles
16070 +
16071 +if { (ac_try="$ac_link_default"
16072 +case "(($ac_try" in
16073 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16074 + *) ac_try_echo=$ac_try;;
16075 +esac
16076 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16077 + (eval "$ac_link_default") 2>&5
16078 + ac_status=$?
16079 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16080 + (exit $ac_status); }; then
16081 + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
16082 +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
16083 +# in a Makefile. We should not override ac_cv_exeext if it was cached,
16084 +# so that the user can short-circuit this test for compilers unknown to
16085 +# Autoconf.
16086 +for ac_file in $ac_files ''
16087 +do
16088 + test -f "$ac_file" || continue
16089 + case $ac_file in
16090 + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
16091 + ;;
16092 + [ab].out )
16093 + # We found the default executable, but exeext='' is most
16094 + # certainly right.
16095 + break;;
16096 + *.* )
16097 + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
16098 + then :; else
16099 + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
16100 + fi
16101 + # We set ac_cv_exeext here because the later test for it is not
16102 + # safe: cross compilers may not add the suffix if given an `-o'
16103 + # argument, so we may need to know it at that point already.
16104 + # Even if this section looks crufty: it has the advantage of
16105 + # actually working.
16106 + break;;
16107 + * )
16108 + break;;
16109 + esac
16110 +done
16111 +test "$ac_cv_exeext" = no && ac_cv_exeext=
16112 +
16113 +else
16114 + ac_file=''
16115 +fi
16116 +
16117 +{ echo "$as_me:$LINENO: result: $ac_file" >&5
16118 +echo "${ECHO_T}$ac_file" >&6; }
16119 +if test -z "$ac_file"; then
16120 + echo "$as_me: failed program was:" >&5
16121 +sed 's/^/| /' conftest.$ac_ext >&5
16122 +
16123 +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
16124 +See \`config.log' for more details." >&5
16125 +echo "$as_me: error: C compiler cannot create executables
16126 +See \`config.log' for more details." >&2;}
16127 + { (exit 77); exit 77; }; }
16128 +fi
16129 +
16130 +ac_exeext=$ac_cv_exeext
16131 +
16132 +# Check that the compiler produces executables we can run. If not, either
16133 +# the compiler is broken, or we cross compile.
16134 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
16135 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
16136 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
16137 +# If not cross compiling, check that we can run a simple program.
16138 +if test "$cross_compiling" != yes; then
16139 + if { ac_try='./$ac_file'
16140 + { (case "(($ac_try" in
16141 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16142 + *) ac_try_echo=$ac_try;;
16143 +esac
16144 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16145 + (eval "$ac_try") 2>&5
16146 + ac_status=$?
16147 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16148 + (exit $ac_status); }; }; then
16149 + cross_compiling=no
16150 + else
16151 + if test "$cross_compiling" = maybe; then
16152 + cross_compiling=yes
16153 + else
16154 + { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
16155 +If you meant to cross compile, use \`--host'.
16156 +See \`config.log' for more details." >&5
16157 +echo "$as_me: error: cannot run C compiled programs.
16158 +If you meant to cross compile, use \`--host'.
16159 +See \`config.log' for more details." >&2;}
16160 + { (exit 1); exit 1; }; }
16161 + fi
16162 + fi
16163 +fi
16164 +{ echo "$as_me:$LINENO: result: yes" >&5
16165 +echo "${ECHO_T}yes" >&6; }
16166 +
16167 +rm -f a.out a.exe conftest$ac_cv_exeext b.out
16168 +ac_clean_files=$ac_clean_files_save
16169 +# Check that the compiler produces executables we can run. If not, either
16170 +# the compiler is broken, or we cross compile.
16171 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
16172 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
16173 +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
16174 +echo "${ECHO_T}$cross_compiling" >&6; }
16175 +
16176 +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
16177 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
16178 +if { (ac_try="$ac_link"
16179 +case "(($ac_try" in
16180 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16181 + *) ac_try_echo=$ac_try;;
16182 +esac
16183 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16184 + (eval "$ac_link") 2>&5
16185 + ac_status=$?
16186 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16187 + (exit $ac_status); }; then
16188 + # If both `conftest.exe' and `conftest' are `present' (well, observable)
16189 +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
16190 +# work properly (i.e., refer to `conftest.exe'), while it won't with
16191 +# `rm'.
16192 +for ac_file in conftest.exe conftest conftest.*; do
16193 + test -f "$ac_file" || continue
16194 + case $ac_file in
16195 + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
16196 + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
16197 + break;;
16198 + * ) break;;
16199 + esac
16200 +done
16201 +else
16202 + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
16203 +See \`config.log' for more details." >&5
16204 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
16205 +See \`config.log' for more details." >&2;}
16206 + { (exit 1); exit 1; }; }
16207 +fi
16208 +
16209 +rm -f conftest$ac_cv_exeext
16210 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
16211 +echo "${ECHO_T}$ac_cv_exeext" >&6; }
16212 +
16213 +rm -f conftest.$ac_ext
16214 +EXEEXT=$ac_cv_exeext
16215 +ac_exeext=$EXEEXT
16216 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
16217 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
16218 +if test "${ac_cv_objext+set}" = set; then
16219 + echo $ECHO_N "(cached) $ECHO_C" >&6
16220 +else
16221 + cat >conftest.$ac_ext <<_ACEOF
16222 +/* confdefs.h. */
16223 +_ACEOF
16224 +cat confdefs.h >>conftest.$ac_ext
16225 +cat >>conftest.$ac_ext <<_ACEOF
16226 +/* end confdefs.h. */
16227 +
16228 +int
16229 +main ()
16230 +{
16231 +
16232 + ;
16233 + return 0;
16234 +}
16235 +_ACEOF
16236 +rm -f conftest.o conftest.obj
16237 +if { (ac_try="$ac_compile"
16238 +case "(($ac_try" in
16239 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16240 + *) ac_try_echo=$ac_try;;
16241 +esac
16242 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16243 + (eval "$ac_compile") 2>&5
16244 + ac_status=$?
16245 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16246 + (exit $ac_status); }; then
16247 + for ac_file in conftest.o conftest.obj conftest.*; do
16248 + test -f "$ac_file" || continue;
16249 + case $ac_file in
16250 + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
16251 + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
16252 + break;;
16253 + esac
16254 +done
16255 +else
16256 + echo "$as_me: failed program was:" >&5
16257 +sed 's/^/| /' conftest.$ac_ext >&5
16258 +
16259 +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
16260 +See \`config.log' for more details." >&5
16261 +echo "$as_me: error: cannot compute suffix of object files: cannot compile
16262 +See \`config.log' for more details." >&2;}
16263 + { (exit 1); exit 1; }; }
16264 +fi
16265 +
16266 +rm -f conftest.$ac_cv_objext conftest.$ac_ext
16267 +fi
16268 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
16269 +echo "${ECHO_T}$ac_cv_objext" >&6; }
16270 +OBJEXT=$ac_cv_objext
16271 +ac_objext=$OBJEXT
16272 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
16273 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
16274 +if test "${ac_cv_c_compiler_gnu+set}" = set; then
16275 + echo $ECHO_N "(cached) $ECHO_C" >&6
16276 +else
16277 + cat >conftest.$ac_ext <<_ACEOF
16278 +/* confdefs.h. */
16279 +_ACEOF
16280 +cat confdefs.h >>conftest.$ac_ext
16281 +cat >>conftest.$ac_ext <<_ACEOF
16282 +/* end confdefs.h. */
16283 +
16284 +int
16285 +main ()
16286 +{
16287 +#ifndef __GNUC__
16288 + choke me
16289 +#endif
16290 +
16291 + ;
16292 + return 0;
16293 +}
16294 +_ACEOF
16295 +rm -f conftest.$ac_objext
16296 +if { (ac_try="$ac_compile"
16297 +case "(($ac_try" in
16298 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16299 + *) ac_try_echo=$ac_try;;
16300 +esac
16301 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16302 + (eval "$ac_compile") 2>conftest.er1
16303 + ac_status=$?
16304 + grep -v '^ *+' conftest.er1 >conftest.err
16305 + rm -f conftest.er1
16306 + cat conftest.err >&5
16307 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16308 + (exit $ac_status); } && {
16309 + test -z "$ac_c_werror_flag" ||
16310 + test ! -s conftest.err
16311 + } && test -s conftest.$ac_objext; then
16312 + ac_compiler_gnu=yes
16313 +else
16314 + echo "$as_me: failed program was:" >&5
16315 +sed 's/^/| /' conftest.$ac_ext >&5
16316 +
16317 + ac_compiler_gnu=no
16318 +fi
16319 +
16320 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16321 +ac_cv_c_compiler_gnu=$ac_compiler_gnu
16322 +
16323 +fi
16324 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
16325 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
16326 +GCC=`test $ac_compiler_gnu = yes && echo yes`
16327 +ac_test_CFLAGS=${CFLAGS+set}
16328 +ac_save_CFLAGS=$CFLAGS
16329 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
16330 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
16331 +if test "${ac_cv_prog_cc_g+set}" = set; then
16332 + echo $ECHO_N "(cached) $ECHO_C" >&6
16333 +else
16334 + ac_save_c_werror_flag=$ac_c_werror_flag
16335 + ac_c_werror_flag=yes
16336 + ac_cv_prog_cc_g=no
16337 + CFLAGS="-g"
16338 + cat >conftest.$ac_ext <<_ACEOF
16339 +/* confdefs.h. */
16340 +_ACEOF
16341 +cat confdefs.h >>conftest.$ac_ext
16342 +cat >>conftest.$ac_ext <<_ACEOF
16343 +/* end confdefs.h. */
16344 +
16345 +int
16346 +main ()
16347 +{
16348 +
16349 + ;
16350 + return 0;
16351 +}
16352 +_ACEOF
16353 +rm -f conftest.$ac_objext
16354 +if { (ac_try="$ac_compile"
16355 +case "(($ac_try" in
16356 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16357 + *) ac_try_echo=$ac_try;;
16358 +esac
16359 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16360 + (eval "$ac_compile") 2>conftest.er1
16361 + ac_status=$?
16362 + grep -v '^ *+' conftest.er1 >conftest.err
16363 + rm -f conftest.er1
16364 + cat conftest.err >&5
16365 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16366 + (exit $ac_status); } && {
16367 + test -z "$ac_c_werror_flag" ||
16368 + test ! -s conftest.err
16369 + } && test -s conftest.$ac_objext; then
16370 + ac_cv_prog_cc_g=yes
16371 +else
16372 + echo "$as_me: failed program was:" >&5
16373 +sed 's/^/| /' conftest.$ac_ext >&5
16374 +
16375 + CFLAGS=""
16376 + cat >conftest.$ac_ext <<_ACEOF
16377 +/* confdefs.h. */
16378 +_ACEOF
16379 +cat confdefs.h >>conftest.$ac_ext
16380 +cat >>conftest.$ac_ext <<_ACEOF
16381 +/* end confdefs.h. */
16382 +
16383 +int
16384 +main ()
16385 +{
16386 +
16387 + ;
16388 + return 0;
16389 +}
16390 +_ACEOF
16391 +rm -f conftest.$ac_objext
16392 +if { (ac_try="$ac_compile"
16393 +case "(($ac_try" in
16394 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16395 + *) ac_try_echo=$ac_try;;
16396 +esac
16397 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16398 + (eval "$ac_compile") 2>conftest.er1
16399 + ac_status=$?
16400 + grep -v '^ *+' conftest.er1 >conftest.err
16401 + rm -f conftest.er1
16402 + cat conftest.err >&5
16403 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16404 + (exit $ac_status); } && {
16405 + test -z "$ac_c_werror_flag" ||
16406 + test ! -s conftest.err
16407 + } && test -s conftest.$ac_objext; then
16408 + :
16409 +else
16410 + echo "$as_me: failed program was:" >&5
16411 +sed 's/^/| /' conftest.$ac_ext >&5
16412 +
16413 + ac_c_werror_flag=$ac_save_c_werror_flag
16414 + CFLAGS="-g"
16415 + cat >conftest.$ac_ext <<_ACEOF
16416 +/* confdefs.h. */
16417 +_ACEOF
16418 +cat confdefs.h >>conftest.$ac_ext
16419 +cat >>conftest.$ac_ext <<_ACEOF
16420 +/* end confdefs.h. */
16421 +
16422 +int
16423 +main ()
16424 +{
16425 +
16426 + ;
16427 + return 0;
16428 +}
16429 +_ACEOF
16430 +rm -f conftest.$ac_objext
16431 +if { (ac_try="$ac_compile"
16432 +case "(($ac_try" in
16433 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16434 + *) ac_try_echo=$ac_try;;
16435 +esac
16436 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16437 + (eval "$ac_compile") 2>conftest.er1
16438 + ac_status=$?
16439 + grep -v '^ *+' conftest.er1 >conftest.err
16440 + rm -f conftest.er1
16441 + cat conftest.err >&5
16442 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16443 + (exit $ac_status); } && {
16444 + test -z "$ac_c_werror_flag" ||
16445 + test ! -s conftest.err
16446 + } && test -s conftest.$ac_objext; then
16447 + ac_cv_prog_cc_g=yes
16448 +else
16449 + echo "$as_me: failed program was:" >&5
16450 +sed 's/^/| /' conftest.$ac_ext >&5
16451 +
16452 +
16453 +fi
16454 +
16455 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16456 +fi
16457 +
16458 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16459 +fi
16460 +
16461 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
16462 + ac_c_werror_flag=$ac_save_c_werror_flag
16463 +fi
16464 +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
16465 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
16466 +if test "$ac_test_CFLAGS" = set; then
16467 + CFLAGS=$ac_save_CFLAGS
16468 +elif test $ac_cv_prog_cc_g = yes; then
16469 + if test "$GCC" = yes; then
16470 + CFLAGS="-g -O2"
16471 + else
16472 + CFLAGS="-g"
16473 + fi
16474 +else
16475 + if test "$GCC" = yes; then
16476 + CFLAGS="-O2"
16477 + else
16478 + CFLAGS=
16479 + fi
16480 +fi
16481 +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
16482 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
16483 +if test "${ac_cv_prog_cc_c89+set}" = set; then
16484 + echo $ECHO_N "(cached) $ECHO_C" >&6
16485 +else
16486 + ac_cv_prog_cc_c89=no
16487 +ac_save_CC=$CC
16488 +cat >conftest.$ac_ext <<_ACEOF
16489 +/* confdefs.h. */
16490 +_ACEOF
16491 +cat confdefs.h >>conftest.$ac_ext
16492 +cat >>conftest.$ac_ext <<_ACEOF
16493 +/* end confdefs.h. */
16494 +#include <stdarg.h>
16495 +#include <stdio.h>
16496 +#include <sys/types.h>
16497 +#include <sys/stat.h>
16498 +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
16499 +struct buf { int x; };
16500 +FILE * (*rcsopen) (struct buf *, struct stat *, int);
16501 +static char *e (p, i)
16502 + char **p;
16503 + int i;
16504 +{
16505 + return p[i];
16506 +}
16507 +static char *f (char * (*g) (char **, int), char **p, ...)
16508 +{
16509 + char *s;
16510 + va_list v;
16511 + va_start (v,p);
16512 + s = g (p, va_arg (v,int));
16513 + va_end (v);
16514 + return s;
16515 +}
16516 +
16517 +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
16518 + function prototypes and stuff, but not '\xHH' hex character constants.
16519 + These don't provoke an error unfortunately, instead are silently treated
16520 + as 'x'. The following induces an error, until -std is added to get
16521 + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
16522 + array size at least. It's necessary to write '\x00'==0 to get something
16523 + that's true only with -std. */
16524 +int osf4_cc_array ['\x00' == 0 ? 1 : -1];
16525 +
16526 +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
16527 + inside strings and character constants. */
16528 +#define FOO(x) 'x'
16529 +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
16530 +
16531 +int test (int i, double x);
16532 +struct s1 {int (*f) (int a);};
16533 +struct s2 {int (*f) (double a);};
16534 +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
16535 +int argc;
16536 +char **argv;
16537 +int
16538 +main ()
16539 +{
16540 +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
16541 + ;
16542 + return 0;
16543 +}
16544 +_ACEOF
16545 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
16546 + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
16547 +do
16548 + CC="$ac_save_CC $ac_arg"
16549 + rm -f conftest.$ac_objext
16550 +if { (ac_try="$ac_compile"
16551 +case "(($ac_try" in
16552 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16553 + *) ac_try_echo=$ac_try;;
16554 +esac
16555 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16556 + (eval "$ac_compile") 2>conftest.er1
16557 + ac_status=$?
16558 + grep -v '^ *+' conftest.er1 >conftest.err
16559 + rm -f conftest.er1
16560 + cat conftest.err >&5
16561 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16562 + (exit $ac_status); } && {
16563 + test -z "$ac_c_werror_flag" ||
16564 + test ! -s conftest.err
16565 + } && test -s conftest.$ac_objext; then
16566 + ac_cv_prog_cc_c89=$ac_arg
16567 +else
16568 + echo "$as_me: failed program was:" >&5
16569 +sed 's/^/| /' conftest.$ac_ext >&5
16570 +
16571 +
16572 +fi
16573 +
16574 +rm -f core conftest.err conftest.$ac_objext
16575 + test "x$ac_cv_prog_cc_c89" != "xno" && break
16576 +done
16577 +rm -f conftest.$ac_ext
16578 +CC=$ac_save_CC
16579 +
16580 +fi
16581 +# AC_CACHE_VAL
16582 +case "x$ac_cv_prog_cc_c89" in
16583 + x)
16584 + { echo "$as_me:$LINENO: result: none needed" >&5
16585 +echo "${ECHO_T}none needed" >&6; } ;;
16586 + xno)
16587 + { echo "$as_me:$LINENO: result: unsupported" >&5
16588 +echo "${ECHO_T}unsupported" >&6; } ;;
16589 + *)
16590 + CC="$CC $ac_cv_prog_cc_c89"
16591 + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
16592 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
16593 +esac
16594 +
16595 +
16596 +ac_ext=c
16597 +ac_cpp='$CPP $CPPFLAGS'
16598 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
16599 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
16600 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
16601 +DEPDIR="${am__leading_dot}deps"
16602 +
16603 +ac_config_commands="$ac_config_commands depfiles"
16604 +
16605 +
16606 +am_make=${MAKE-make}
16607 +cat > confinc << 'END'
16608 +am__doit:
16609 + @echo done
16610 +.PHONY: am__doit
16611 +END
16612 +# If we don't find an include directive, just comment out the code.
16613 +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
16614 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
16615 +am__include="#"
16616 +am__quote=
16617 +_am_result=none
16618 +# First try GNU make style include.
16619 +echo "include confinc" > confmf
16620 +# We grep out `Entering directory' and `Leaving directory'
16621 +# messages which can occur if `w' ends up in MAKEFLAGS.
16622 +# In particular we don't look at `^make:' because GNU make might
16623 +# be invoked under some other name (usually "gmake"), in which
16624 +# case it prints its new name instead of `make'.
16625 +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
16626 + am__include=include
16627 + am__quote=
16628 + _am_result=GNU
16629 +fi
16630 +# Now try BSD make style include.
16631 +if test "$am__include" = "#"; then
16632 + echo '.include "confinc"' > confmf
16633 + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
16634 + am__include=.include
16635 + am__quote="\""
16636 + _am_result=BSD
16637 + fi
16638 +fi
16639 +
16640 +
16641 +{ echo "$as_me:$LINENO: result: $_am_result" >&5
16642 +echo "${ECHO_T}$_am_result" >&6; }
16643 +rm -f confinc confmf
16644 +
16645 +# Check whether --enable-dependency-tracking was given.
16646 +if test "${enable_dependency_tracking+set}" = set; then
16647 + enableval=$enable_dependency_tracking;
16648 +fi
16649 +
16650 +if test "x$enable_dependency_tracking" != xno; then
16651 + am_depcomp="$ac_aux_dir/depcomp"
16652 + AMDEPBACKSLASH='\'
16653 +fi
16654 +
16655 +
16656 +if test "x$enable_dependency_tracking" != xno; then
16657 + AMDEP_TRUE=
16658 + AMDEP_FALSE='#'
16659 +else
16660 + AMDEP_TRUE='#'
16661 + AMDEP_FALSE=
16662 +fi
16663 +
16664 +
16665 +
16666 +
16667 +depcc="$CC" am_compiler_list=
16668 +
16669 +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
16670 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
16671 +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
16672 + echo $ECHO_N "(cached) $ECHO_C" >&6
16673 +else
16674 + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
16675 + # We make a subdir and do the tests there. Otherwise we can end up
16676 + # making bogus files that we don't know about and never remove. For
16677 + # instance it was reported that on HP-UX the gcc test will end up
16678 + # making a dummy file named `D' -- because `-MD' means `put the output
16679 + # in D'.
16680 + mkdir conftest.dir
16681 + # Copy depcomp to subdir because otherwise we won't find it if we're
16682 + # using a relative directory.
16683 + cp "$am_depcomp" conftest.dir
16684 + cd conftest.dir
16685 + # We will build objects and dependencies in a subdirectory because
16686 + # it helps to detect inapplicable dependency modes. For instance
16687 + # both Tru64's cc and ICC support -MD to output dependencies as a
16688 + # side effect of compilation, but ICC will put the dependencies in
16689 + # the current directory while Tru64 will put them in the object
16690 + # directory.
16691 + mkdir sub
16692 +
16693 + am_cv_CC_dependencies_compiler_type=none
16694 + if test "$am_compiler_list" = ""; then
16695 + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
16696 + fi
16697 + for depmode in $am_compiler_list; do
16698 + # Setup a source with many dependencies, because some compilers
16699 + # like to wrap large dependency lists on column 80 (with \), and
16700 + # we should not choose a depcomp mode which is confused by this.
16701 + #
16702 + # We need to recreate these files for each test, as the compiler may
16703 + # overwrite some of them when testing with obscure command lines.
16704 + # This happens at least with the AIX C compiler.
16705 + : > sub/conftest.c
16706 + for i in 1 2 3 4 5 6; do
16707 + echo '#include "conftst'$i'.h"' >> sub/conftest.c
16708 + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
16709 + # Solaris 8's {/usr,}/bin/sh.
16710 + touch sub/conftst$i.h
16711 + done
16712 + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
16713 +
16714 + case $depmode in
16715 + nosideeffect)
16716 + # after this tag, mechanisms are not by side-effect, so they'll
16717 + # only be used when explicitly requested
16718 + if test "x$enable_dependency_tracking" = xyes; then
16719 + continue
16720 + else
16721 + break
16722 + fi
16723 + ;;
16724 + none) break ;;
16725 + esac
16726 + # We check with `-c' and `-o' for the sake of the "dashmstdout"
16727 + # mode. It turns out that the SunPro C++ compiler does not properly
16728 + # handle `-M -o', and we need to detect this.
16729 + if depmode=$depmode \
16730 + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
16731 + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
16732 + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
16733 + >/dev/null 2>conftest.err &&
16734 + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
16735 + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
16736 + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
16737 + # icc doesn't choke on unknown options, it will just issue warnings
16738 + # or remarks (even with -Werror). So we grep stderr for any message
16739 + # that says an option was ignored or not supported.
16740 + # When given -MP, icc 7.0 and 7.1 complain thusly:
16741 + # icc: Command line warning: ignoring option '-M'; no argument required
16742 + # The diagnosis changed in icc 8.0:
16743 + # icc: Command line remark: option '-MP' not supported
16744 + if (grep 'ignoring option' conftest.err ||
16745 + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
16746 + am_cv_CC_dependencies_compiler_type=$depmode
16747 + break
16748 + fi
16749 + fi
16750 + done
16751 +
16752 + cd ..
16753 + rm -rf conftest.dir
16754 +else
16755 + am_cv_CC_dependencies_compiler_type=none
16756 +fi
16757 +
16758 +fi
16759 +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
16760 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
16761 +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
16762 +
16763 +
16764 +
16765 +if
16766 + test "x$enable_dependency_tracking" != xno \
16767 + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
16768 + am__fastdepCC_TRUE=
16769 + am__fastdepCC_FALSE='#'
16770 +else
16771 + am__fastdepCC_TRUE='#'
16772 + am__fastdepCC_FALSE=
16773 +fi
16774 +
16775 +
16776 +# Find a good install program. We prefer a C program (faster),
16777 +# so one script is as good as another. But avoid the broken or
16778 +# incompatible versions:
16779 +# SysV /etc/install, /usr/sbin/install
16780 +# SunOS /usr/etc/install
16781 +# IRIX /sbin/install
16782 +# AIX /bin/install
16783 +# AmigaOS /C/install, which installs bootblocks on floppy discs
16784 +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
16785 +# AFS /usr/afsws/bin/install, which mishandles nonexistent args
16786 +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
16787 +# OS/2's system install, which has a completely different semantic
16788 +# ./install, which can be erroneously created by make from ./install.sh.
16789 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
16790 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
16791 +if test -z "$INSTALL"; then
16792 +if test "${ac_cv_path_install+set}" = set; then
16793 + echo $ECHO_N "(cached) $ECHO_C" >&6
16794 +else
16795 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
16796 +for as_dir in $PATH
16797 +do
16798 + IFS=$as_save_IFS
16799 + test -z "$as_dir" && as_dir=.
16800 + # Account for people who put trailing slashes in PATH elements.
16801 +case $as_dir/ in
16802 + ./ | .// | /cC/* | \
16803 + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
16804 + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
16805 + /usr/ucb/* ) ;;
16806 + *)
16807 + # OSF1 and SCO ODT 3.0 have their own names for install.
16808 + # Don't use installbsd from OSF since it installs stuff as root
16809 + # by default.
16810 + for ac_prog in ginstall scoinst install; do
16811 + for ac_exec_ext in '' $ac_executable_extensions; do
16812 + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
16813 + if test $ac_prog = install &&
16814 + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
16815 + # AIX install. It has an incompatible calling convention.
16816 + :
16817 + elif test $ac_prog = install &&
16818 + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
16819 + # program-specific install script used by HP pwplus--don't use.
16820 + :
16821 + else
16822 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
16823 + break 3
16824 + fi
16825 + fi
16826 + done
16827 + done
16828 + ;;
16829 +esac
16830 +done
16831 +IFS=$as_save_IFS
16832 +
16833 +
16834 +fi
16835 + if test "${ac_cv_path_install+set}" = set; then
16836 + INSTALL=$ac_cv_path_install
16837 + else
16838 + # As a last resort, use the slow shell script. Don't cache a
16839 + # value for INSTALL within a source directory, because that will
16840 + # break other packages using the cache if that directory is
16841 + # removed, or if the value is a relative name.
16842 + INSTALL=$ac_install_sh
16843 + fi
16844 +fi
16845 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5
16846 +echo "${ECHO_T}$INSTALL" >&6; }
16847 +
16848 +# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
16849 +# It thinks the first close brace ends the variable substitution.
16850 +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
16851 +
16852 +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
16853 +
16854 +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
16855 +
16856 +
16857 +
16858 +{ echo "$as_me:$LINENO: checking for library containing strerror" >&5
16859 +echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; }
16860 +if test "${ac_cv_search_strerror+set}" = set; then
16861 + echo $ECHO_N "(cached) $ECHO_C" >&6
16862 +else
16863 + ac_func_search_save_LIBS=$LIBS
16864 +cat >conftest.$ac_ext <<_ACEOF
16865 +/* confdefs.h. */
16866 +_ACEOF
16867 +cat confdefs.h >>conftest.$ac_ext
16868 +cat >>conftest.$ac_ext <<_ACEOF
16869 +/* end confdefs.h. */
16870 +
16871 +/* Override any GCC internal prototype to avoid an error.
16872 + Use char because int might match the return type of a GCC
16873 + builtin and then its argument prototype would still apply. */
16874 +#ifdef __cplusplus
16875 +extern "C"
16876 +#endif
16877 +char strerror ();
16878 +int
16879 +main ()
16880 +{
16881 +return strerror ();
16882 + ;
16883 + return 0;
16884 +}
16885 +_ACEOF
16886 +for ac_lib in '' cposix; do
16887 + if test -z "$ac_lib"; then
16888 + ac_res="none required"
16889 + else
16890 + ac_res=-l$ac_lib
16891 + LIBS="-l$ac_lib $ac_func_search_save_LIBS"
16892 + fi
16893 + rm -f conftest.$ac_objext conftest$ac_exeext
16894 +if { (ac_try="$ac_link"
16895 +case "(($ac_try" in
16896 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16897 + *) ac_try_echo=$ac_try;;
16898 +esac
16899 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16900 + (eval "$ac_link") 2>conftest.er1
16901 + ac_status=$?
16902 + grep -v '^ *+' conftest.er1 >conftest.err
16903 + rm -f conftest.er1
16904 + cat conftest.err >&5
16905 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16906 + (exit $ac_status); } && {
16907 + test -z "$ac_c_werror_flag" ||
16908 + test ! -s conftest.err
16909 + } && test -s conftest$ac_exeext &&
16910 + $as_test_x conftest$ac_exeext; then
16911 + ac_cv_search_strerror=$ac_res
16912 +else
16913 + echo "$as_me: failed program was:" >&5
16914 +sed 's/^/| /' conftest.$ac_ext >&5
16915 +
16916 +
16917 +fi
16918 +
16919 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
16920 + conftest$ac_exeext
16921 + if test "${ac_cv_search_strerror+set}" = set; then
16922 + break
16923 +fi
16924 +done
16925 +if test "${ac_cv_search_strerror+set}" = set; then
16926 + :
16927 +else
16928 + ac_cv_search_strerror=no
16929 +fi
16930 +rm conftest.$ac_ext
16931 +LIBS=$ac_func_search_save_LIBS
16932 +fi
16933 +{ echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
16934 +echo "${ECHO_T}$ac_cv_search_strerror" >&6; }
16935 +ac_res=$ac_cv_search_strerror
16936 +if test "$ac_res" != no; then
16937 + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
16938 +
16939 +fi
16940 +
16941 +
16942 +ac_ext=c
16943 +ac_cpp='$CPP $CPPFLAGS'
16944 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
16945 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
16946 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
16947 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
16948 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
16949 +# On Suns, sometimes $CPP names a directory.
16950 +if test -n "$CPP" && test -d "$CPP"; then
16951 + CPP=
16952 +fi
16953 +if test -z "$CPP"; then
16954 + if test "${ac_cv_prog_CPP+set}" = set; then
16955 + echo $ECHO_N "(cached) $ECHO_C" >&6
16956 +else
16957 + # Double quotes because CPP needs to be expanded
16958 + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
16959 + do
16960 + ac_preproc_ok=false
16961 +for ac_c_preproc_warn_flag in '' yes
16962 +do
16963 + # Use a header file that comes with gcc, so configuring glibc
16964 + # with a fresh cross-compiler works.
16965 + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
16966 + # <limits.h> exists even on freestanding compilers.
16967 + # On the NeXT, cc -E runs the code through the compiler's parser,
16968 + # not just through cpp. "Syntax error" is here to catch this case.
16969 + cat >conftest.$ac_ext <<_ACEOF
16970 +/* confdefs.h. */
16971 +_ACEOF
16972 +cat confdefs.h >>conftest.$ac_ext
16973 +cat >>conftest.$ac_ext <<_ACEOF
16974 +/* end confdefs.h. */
16975 +#ifdef __STDC__
16976 +# include <limits.h>
16977 +#else
16978 +# include <assert.h>
16979 +#endif
16980 + Syntax error
16981 +_ACEOF
16982 +if { (ac_try="$ac_cpp conftest.$ac_ext"
16983 +case "(($ac_try" in
16984 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
16985 + *) ac_try_echo=$ac_try;;
16986 +esac
16987 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
16988 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
16989 + ac_status=$?
16990 + grep -v '^ *+' conftest.er1 >conftest.err
16991 + rm -f conftest.er1
16992 + cat conftest.err >&5
16993 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
16994 + (exit $ac_status); } >/dev/null && {
16995 + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
16996 + test ! -s conftest.err
16997 + }; then
16998 + :
16999 +else
17000 + echo "$as_me: failed program was:" >&5
17001 +sed 's/^/| /' conftest.$ac_ext >&5
17002 +
17003 + # Broken: fails on valid input.
17004 +continue
17005 +fi
17006 +
17007 +rm -f conftest.err conftest.$ac_ext
17008 +
17009 + # OK, works on sane cases. Now check whether nonexistent headers
17010 + # can be detected and how.
17011 + cat >conftest.$ac_ext <<_ACEOF
17012 +/* confdefs.h. */
17013 +_ACEOF
17014 +cat confdefs.h >>conftest.$ac_ext
17015 +cat >>conftest.$ac_ext <<_ACEOF
17016 +/* end confdefs.h. */
17017 +#include <ac_nonexistent.h>
17018 +_ACEOF
17019 +if { (ac_try="$ac_cpp conftest.$ac_ext"
17020 +case "(($ac_try" in
17021 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17022 + *) ac_try_echo=$ac_try;;
17023 +esac
17024 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17025 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
17026 + ac_status=$?
17027 + grep -v '^ *+' conftest.er1 >conftest.err
17028 + rm -f conftest.er1
17029 + cat conftest.err >&5
17030 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
17031 + (exit $ac_status); } >/dev/null && {
17032 + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
17033 + test ! -s conftest.err
17034 + }; then
17035 + # Broken: success on invalid input.
17036 +continue
17037 +else
17038 + echo "$as_me: failed program was:" >&5
17039 +sed 's/^/| /' conftest.$ac_ext >&5
17040 +
17041 + # Passes both tests.
17042 +ac_preproc_ok=:
17043 +break
17044 +fi
17045 +
17046 +rm -f conftest.err conftest.$ac_ext
17047 +
17048 +done
17049 +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
17050 +rm -f conftest.err conftest.$ac_ext
17051 +if $ac_preproc_ok; then
17052 + break
17053 +fi
17054 +
17055 + done
17056 + ac_cv_prog_CPP=$CPP
17057 +
17058 +fi
17059 + CPP=$ac_cv_prog_CPP
17060 +else
17061 + ac_cv_prog_CPP=$CPP
17062 +fi
17063 +{ echo "$as_me:$LINENO: result: $CPP" >&5
17064 +echo "${ECHO_T}$CPP" >&6; }
17065 +ac_preproc_ok=false
17066 +for ac_c_preproc_warn_flag in '' yes
17067 +do
17068 + # Use a header file that comes with gcc, so configuring glibc
17069 + # with a fresh cross-compiler works.
17070 + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
17071 + # <limits.h> exists even on freestanding compilers.
17072 + # On the NeXT, cc -E runs the code through the compiler's parser,
17073 + # not just through cpp. "Syntax error" is here to catch this case.
17074 + cat >conftest.$ac_ext <<_ACEOF
17075 +/* confdefs.h. */
17076 +_ACEOF
17077 +cat confdefs.h >>conftest.$ac_ext
17078 +cat >>conftest.$ac_ext <<_ACEOF
17079 +/* end confdefs.h. */
17080 +#ifdef __STDC__
17081 +# include <limits.h>
17082 +#else
17083 +# include <assert.h>
17084 +#endif
17085 + Syntax error
17086 +_ACEOF
17087 +if { (ac_try="$ac_cpp conftest.$ac_ext"
17088 +case "(($ac_try" in
17089 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17090 + *) ac_try_echo=$ac_try;;
17091 +esac
17092 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17093 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
17094 + ac_status=$?
17095 + grep -v '^ *+' conftest.er1 >conftest.err
17096 + rm -f conftest.er1
17097 + cat conftest.err >&5
17098 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
17099 + (exit $ac_status); } >/dev/null && {
17100 + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
17101 + test ! -s conftest.err
17102 + }; then
17103 + :
17104 +else
17105 + echo "$as_me: failed program was:" >&5
17106 +sed 's/^/| /' conftest.$ac_ext >&5
17107 +
17108 + # Broken: fails on valid input.
17109 +continue
17110 +fi
17111 +
17112 +rm -f conftest.err conftest.$ac_ext
17113 +
17114 + # OK, works on sane cases. Now check whether nonexistent headers
17115 + # can be detected and how.
17116 + cat >conftest.$ac_ext <<_ACEOF
17117 +/* confdefs.h. */
17118 +_ACEOF
17119 +cat confdefs.h >>conftest.$ac_ext
17120 +cat >>conftest.$ac_ext <<_ACEOF
17121 +/* end confdefs.h. */
17122 +#include <ac_nonexistent.h>
17123 +_ACEOF
17124 +if { (ac_try="$ac_cpp conftest.$ac_ext"
17125 +case "(($ac_try" in
17126 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17127 + *) ac_try_echo=$ac_try;;
17128 +esac
17129 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17130 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
17131 + ac_status=$?
17132 + grep -v '^ *+' conftest.er1 >conftest.err
17133 + rm -f conftest.er1
17134 + cat conftest.err >&5
17135 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
17136 + (exit $ac_status); } >/dev/null && {
17137 + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
17138 + test ! -s conftest.err
17139 + }; then
17140 + # Broken: success on invalid input.
17141 +continue
17142 +else
17143 + echo "$as_me: failed program was:" >&5
17144 +sed 's/^/| /' conftest.$ac_ext >&5
17145 +
17146 + # Passes both tests.
17147 +ac_preproc_ok=:
17148 +break
17149 +fi
17150 +
17151 +rm -f conftest.err conftest.$ac_ext
17152 +
17153 +done
17154 +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
17155 +rm -f conftest.err conftest.$ac_ext
17156 +if $ac_preproc_ok; then
17157 + :
17158 +else
17159 + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
17160 +See \`config.log' for more details." >&5
17161 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
17162 +See \`config.log' for more details." >&2;}
17163 + { (exit 1); exit 1; }; }
17164 +fi
17165 +
17166 +ac_ext=c
17167 +ac_cpp='$CPP $CPPFLAGS'
17168 +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
17169 +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
17170 +ac_compiler_gnu=$ac_cv_c_compiler_gnu
17171 +
17172 +
17173 +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
17174 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
17175 +if test "${ac_cv_path_GREP+set}" = set; then
17176 + echo $ECHO_N "(cached) $ECHO_C" >&6
17177 +else
17178 + # Extract the first word of "grep ggrep" to use in msg output
17179 +if test -z "$GREP"; then
17180 +set dummy grep ggrep; ac_prog_name=$2
17181 +if test "${ac_cv_path_GREP+set}" = set; then
17182 + echo $ECHO_N "(cached) $ECHO_C" >&6
17183 +else
17184 + ac_path_GREP_found=false
17185 +# Loop through the user's path and test for each of PROGNAME-LIST
17186 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
17187 +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
17188 +do
17189 + IFS=$as_save_IFS
17190 + test -z "$as_dir" && as_dir=.
17191 + for ac_prog in grep ggrep; do
17192 + for ac_exec_ext in '' $ac_executable_extensions; do
17193 + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
17194 + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
17195 + # Check for GNU ac_path_GREP and select it if it is found.
17196 + # Check for GNU $ac_path_GREP
17197 +case `"$ac_path_GREP" --version 2>&1` in
17198 +*GNU*)
17199 + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
17200 +*)
17201 + ac_count=0
17202 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
17203 + while :
17204 + do
17205 + cat "conftest.in" "conftest.in" >"conftest.tmp"
17206 + mv "conftest.tmp" "conftest.in"
17207 + cp "conftest.in" "conftest.nl"
17208 + echo 'GREP' >> "conftest.nl"
17209 + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
17210 + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
17211 + ac_count=`expr $ac_count + 1`
17212 + if test $ac_count -gt ${ac_path_GREP_max-0}; then
17213 + # Best one so far, save it but keep looking for a better one
17214 + ac_cv_path_GREP="$ac_path_GREP"
17215 + ac_path_GREP_max=$ac_count
17216 + fi
17217 + # 10*(2^10) chars as input seems more than enough
17218 + test $ac_count -gt 10 && break
17219 + done
17220 + rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
17221 +esac
17222 +
17223 +
17224 + $ac_path_GREP_found && break 3
17225 + done
17226 +done
17227 +
17228 +done
17229 +IFS=$as_save_IFS
17230 +
17231 +
17232 +fi
17233 +
17234 +GREP="$ac_cv_path_GREP"
17235 +if test -z "$GREP"; then
17236 + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
17237 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
17238 + { (exit 1); exit 1; }; }
17239 +fi
17240 +
17241 +else
17242 + ac_cv_path_GREP=$GREP
17243 +fi
17244 +
17245 +
17246 +fi
17247 +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
17248 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
17249 + GREP="$ac_cv_path_GREP"
17250 +
17251 +
17252 +{ echo "$as_me:$LINENO: checking for egrep" >&5
17253 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
17254 +if test "${ac_cv_path_EGREP+set}" = set; then
17255 + echo $ECHO_N "(cached) $ECHO_C" >&6
17256 +else
17257 + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
17258 + then ac_cv_path_EGREP="$GREP -E"
17259 + else
17260 + # Extract the first word of "egrep" to use in msg output
17261 +if test -z "$EGREP"; then
17262 +set dummy egrep; ac_prog_name=$2
17263 +if test "${ac_cv_path_EGREP+set}" = set; then
17264 + echo $ECHO_N "(cached) $ECHO_C" >&6
17265 +else
17266 + ac_path_EGREP_found=false
17267 +# Loop through the user's path and test for each of PROGNAME-LIST
17268 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
17269 +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
17270 +do
17271 + IFS=$as_save_IFS
17272 + test -z "$as_dir" && as_dir=.
17273 + for ac_prog in egrep; do
17274 + for ac_exec_ext in '' $ac_executable_extensions; do
17275 + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
17276 + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
17277 + # Check for GNU ac_path_EGREP and select it if it is found.
17278 + # Check for GNU $ac_path_EGREP
17279 +case `"$ac_path_EGREP" --version 2>&1` in
17280 +*GNU*)
17281 + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
17282 +*)
17283 + ac_count=0
17284 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
17285 + while :
17286 + do
17287 + cat "conftest.in" "conftest.in" >"conftest.tmp"
17288 + mv "conftest.tmp" "conftest.in"
17289 + cp "conftest.in" "conftest.nl"
17290 + echo 'EGREP' >> "conftest.nl"
17291 + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
17292 + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
17293 + ac_count=`expr $ac_count + 1`
17294 + if test $ac_count -gt ${ac_path_EGREP_max-0}; then
17295 + # Best one so far, save it but keep looking for a better one
17296 + ac_cv_path_EGREP="$ac_path_EGREP"
17297 + ac_path_EGREP_max=$ac_count
17298 + fi
17299 + # 10*(2^10) chars as input seems more than enough
17300 + test $ac_count -gt 10 && break
17301 + done
17302 + rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
17303 +esac
17304 +
17305 +
17306 + $ac_path_EGREP_found && break 3
17307 + done
17308 +done
17309 +
17310 +done
17311 +IFS=$as_save_IFS
17312 +
17313 +
17314 +fi
17315 +
17316 +EGREP="$ac_cv_path_EGREP"
17317 +if test -z "$EGREP"; then
17318 + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
17319 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
17320 + { (exit 1); exit 1; }; }
17321 +fi
17322 +
17323 +else
17324 + ac_cv_path_EGREP=$EGREP
17325 +fi
17326 +
17327 +
17328 + fi
17329 +fi
17330 +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
17331 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
17332 + EGREP="$ac_cv_path_EGREP"
17333 +
17334 +
17335 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
17336 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
17337 +if test "${ac_cv_header_stdc+set}" = set; then
17338 + echo $ECHO_N "(cached) $ECHO_C" >&6
17339 +else
17340 + cat >conftest.$ac_ext <<_ACEOF
17341 +/* confdefs.h. */
17342 +_ACEOF
17343 +cat confdefs.h >>conftest.$ac_ext
17344 +cat >>conftest.$ac_ext <<_ACEOF
17345 +/* end confdefs.h. */
17346 +#include <stdlib.h>
17347 +#include <stdarg.h>
17348 +#include <string.h>
17349 +#include <float.h>
17350 +
17351 +int
17352 +main ()
17353 +{
17354 +
17355 + ;
17356 + return 0;
17357 +}
17358 +_ACEOF
17359 +rm -f conftest.$ac_objext
17360 +if { (ac_try="$ac_compile"
17361 +case "(($ac_try" in
17362 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17363 + *) ac_try_echo=$ac_try;;
17364 +esac
17365 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17366 + (eval "$ac_compile") 2>conftest.er1
17367 + ac_status=$?
17368 + grep -v '^ *+' conftest.er1 >conftest.err
17369 + rm -f conftest.er1
17370 + cat conftest.err >&5
17371 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
17372 + (exit $ac_status); } && {
17373 + test -z "$ac_c_werror_flag" ||
17374 + test ! -s conftest.err
17375 + } && test -s conftest.$ac_objext; then
17376 + ac_cv_header_stdc=yes
17377 +else
17378 + echo "$as_me: failed program was:" >&5
17379 +sed 's/^/| /' conftest.$ac_ext >&5
17380 +
17381 + ac_cv_header_stdc=no
17382 +fi
17383 +
17384 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17385 +
17386 +if test $ac_cv_header_stdc = yes; then
17387 + # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17388 + cat >conftest.$ac_ext <<_ACEOF
17389 +/* confdefs.h. */
17390 +_ACEOF
17391 +cat confdefs.h >>conftest.$ac_ext
17392 +cat >>conftest.$ac_ext <<_ACEOF
17393 +/* end confdefs.h. */
17394 +#include <string.h>
17395 +
17396 +_ACEOF
17397 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17398 + $EGREP "memchr" >/dev/null 2>&1; then
17399 + :
17400 +else
17401 + ac_cv_header_stdc=no
17402 +fi
17403 +rm -f conftest*
17404 +
17405 +fi
17406 +
17407 +if test $ac_cv_header_stdc = yes; then
17408 + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17409 + cat >conftest.$ac_ext <<_ACEOF
17410 +/* confdefs.h. */
17411 +_ACEOF
17412 +cat confdefs.h >>conftest.$ac_ext
17413 +cat >>conftest.$ac_ext <<_ACEOF
17414 +/* end confdefs.h. */
17415 +#include <stdlib.h>
17416 +
17417 +_ACEOF
17418 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17419 + $EGREP "free" >/dev/null 2>&1; then
17420 + :
17421 +else
17422 + ac_cv_header_stdc=no
17423 +fi
17424 +rm -f conftest*
17425 +
17426 +fi
17427 +
17428 +if test $ac_cv_header_stdc = yes; then
17429 + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17430 + if test "$cross_compiling" = yes; then
17431 + :
17432 +else
17433 + cat >conftest.$ac_ext <<_ACEOF
17434 +/* confdefs.h. */
17435 +_ACEOF
17436 +cat confdefs.h >>conftest.$ac_ext
17437 +cat >>conftest.$ac_ext <<_ACEOF
17438 +/* end confdefs.h. */
17439 +#include <ctype.h>
17440 +#include <stdlib.h>
17441 +#if ((' ' & 0x0FF) == 0x020)
17442 +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17443 +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17444 +#else
17445 +# define ISLOWER(c) \
17446 + (('a' <= (c) && (c) <= 'i') \
17447 + || ('j' <= (c) && (c) <= 'r') \
17448 + || ('s' <= (c) && (c) <= 'z'))
17449 +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17450 +#endif
17451 +
17452 +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17453 +int
17454 +main ()
17455 +{
17456 + int i;
17457 + for (i = 0; i < 256; i++)
17458 + if (XOR (islower (i), ISLOWER (i))
17459 + || toupper (i) != TOUPPER (i))
17460 + return 2;
17461 + return 0;
17462 +}
17463 +_ACEOF
17464 +rm -f conftest$ac_exeext
17465 +if { (ac_try="$ac_link"
17466 +case "(($ac_try" in
17467 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17468 + *) ac_try_echo=$ac_try;;
17469 +esac
17470 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17471 + (eval "$ac_link") 2>&5
17472 + ac_status=$?
17473 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
17474 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17475 + { (case "(($ac_try" in
17476 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17477 + *) ac_try_echo=$ac_try;;
17478 +esac
17479 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17480 + (eval "$ac_try") 2>&5
17481 + ac_status=$?
17482 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
17483 + (exit $ac_status); }; }; then
17484 + :
17485 +else
17486 + echo "$as_me: program exited with status $ac_status" >&5
17487 +echo "$as_me: failed program was:" >&5
17488 +sed 's/^/| /' conftest.$ac_ext >&5
17489 +
17490 +( exit $ac_status )
17491 +ac_cv_header_stdc=no
17492 +fi
17493 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17494 +fi
17495 +
17496 +
17497 +fi
17498 +fi
17499 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
17500 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
17501 +if test $ac_cv_header_stdc = yes; then
17502 +
17503 +cat >>confdefs.h <<\_ACEOF
17504 +#define STDC_HEADERS 1
17505 +_ACEOF
17506 +
17507 +fi
17508 +
17509 +ac_config_headers="$ac_config_headers config.h"
17510 +
17511 +# On IRIX 5.3, sys/types and inttypes.h are conflicting.
17512 +
17513 +
17514 +
17515 +
17516 +
17517 +
17518 +
17519 +
17520 +
17521 +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
17522 + inttypes.h stdint.h unistd.h
17523 +do
17524 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17525 +{ echo "$as_me:$LINENO: checking for $ac_header" >&5
17526 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
17527 +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17528 + echo $ECHO_N "(cached) $ECHO_C" >&6
17529 +else
17530 + cat >conftest.$ac_ext <<_ACEOF
17531 +/* confdefs.h. */
17532 +_ACEOF
17533 +cat confdefs.h >>conftest.$ac_ext
17534 +cat >>conftest.$ac_ext <<_ACEOF
17535 +/* end confdefs.h. */
17536 +$ac_includes_default
17537 +
17538 +#include <$ac_header>
17539 +_ACEOF
17540 +rm -f conftest.$ac_objext
17541 +if { (ac_try="$ac_compile"
17542 +case "(($ac_try" in
17543 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17544 + *) ac_try_echo=$ac_try;;
17545 +esac
17546 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17547 + (eval "$ac_compile") 2>conftest.er1
17548 + ac_status=$?
17549 + grep -v '^ *+' conftest.er1 >conftest.err
17550 + rm -f conftest.er1
17551 + cat conftest.err >&5
17552 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
17553 + (exit $ac_status); } && {
17554 + test -z "$ac_c_werror_flag" ||
17555 + test ! -s conftest.err
17556 + } && test -s conftest.$ac_objext; then
17557 + eval "$as_ac_Header=yes"
17558 +else
17559 + echo "$as_me: failed program was:" >&5
17560 +sed 's/^/| /' conftest.$ac_ext >&5
17561 +
17562 + eval "$as_ac_Header=no"
17563 +fi
17564 +
17565 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17566 +fi
17567 +ac_res=`eval echo '${'$as_ac_Header'}'`
17568 + { echo "$as_me:$LINENO: result: $ac_res" >&5
17569 +echo "${ECHO_T}$ac_res" >&6; }
17570 +if test `eval echo '${'$as_ac_Header'}'` = yes; then
17571 + cat >>confdefs.h <<_ACEOF
17572 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17573 +_ACEOF
17574 +
17575 +fi
17576 +
17577 +done
17578 +
17579 +
17580 +
17581 +
17582 +
17583 +
17584 +
17585 +for ac_header in stddef.h stdlib.h strings.h unistd.h limits.h
17586 +do
17587 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17588 +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17589 + { echo "$as_me:$LINENO: checking for $ac_header" >&5
17590 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
17591 +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17592 + echo $ECHO_N "(cached) $ECHO_C" >&6
17593 +fi
17594 +ac_res=`eval echo '${'$as_ac_Header'}'`
17595 + { echo "$as_me:$LINENO: result: $ac_res" >&5
17596 +echo "${ECHO_T}$ac_res" >&6; }
17597 +else
17598 + # Is the header compilable?
17599 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
17600 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
17601 +cat >conftest.$ac_ext <<_ACEOF
17602 +/* confdefs.h. */
17603 +_ACEOF
17604 +cat confdefs.h >>conftest.$ac_ext
17605 +cat >>conftest.$ac_ext <<_ACEOF
17606 +/* end confdefs.h. */
17607 +$ac_includes_default
17608 +#include <$ac_header>
17609 +_ACEOF
17610 +rm -f conftest.$ac_objext
17611 +if { (ac_try="$ac_compile"
17612 +case "(($ac_try" in
17613 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17614 + *) ac_try_echo=$ac_try;;
17615 +esac
17616 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17617 + (eval "$ac_compile") 2>conftest.er1
17618 + ac_status=$?
17619 + grep -v '^ *+' conftest.er1 >conftest.err
17620 + rm -f conftest.er1
17621 + cat conftest.err >&5
17622 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
17623 + (exit $ac_status); } && {
17624 + test -z "$ac_c_werror_flag" ||
17625 + test ! -s conftest.err
17626 + } && test -s conftest.$ac_objext; then
17627 + ac_header_compiler=yes
17628 +else
17629 + echo "$as_me: failed program was:" >&5
17630 +sed 's/^/| /' conftest.$ac_ext >&5
17631 +
17632 + ac_header_compiler=no
17633 +fi
17634 +
17635 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17636 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
17637 +echo "${ECHO_T}$ac_header_compiler" >&6; }
17638 +
17639 +# Is the header present?
17640 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
17641 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
17642 +cat >conftest.$ac_ext <<_ACEOF
17643 +/* confdefs.h. */
17644 +_ACEOF
17645 +cat confdefs.h >>conftest.$ac_ext
17646 +cat >>conftest.$ac_ext <<_ACEOF
17647 +/* end confdefs.h. */
17648 +#include <$ac_header>
17649 +_ACEOF
17650 +if { (ac_try="$ac_cpp conftest.$ac_ext"
17651 +case "(($ac_try" in
17652 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17653 + *) ac_try_echo=$ac_try;;
17654 +esac
17655 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17656 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
17657 + ac_status=$?
17658 + grep -v '^ *+' conftest.er1 >conftest.err
17659 + rm -f conftest.er1
17660 + cat conftest.err >&5
17661 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
17662 + (exit $ac_status); } >/dev/null && {
17663 + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
17664 + test ! -s conftest.err
17665 + }; then
17666 + ac_header_preproc=yes
17667 +else
17668 + echo "$as_me: failed program was:" >&5
17669 +sed 's/^/| /' conftest.$ac_ext >&5
17670 +
17671 + ac_header_preproc=no
17672 +fi
17673 +
17674 +rm -f conftest.err conftest.$ac_ext
17675 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
17676 +echo "${ECHO_T}$ac_header_preproc" >&6; }
17677 +
17678 +# So? What about this header?
17679 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
17680 + yes:no: )
17681 + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
17682 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
17683 + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
17684 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
17685 + ac_header_preproc=yes
17686 + ;;
17687 + no:yes:* )
17688 + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
17689 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
17690 + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
17691 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
17692 + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
17693 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
17694 + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
17695 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
17696 + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
17697 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
17698 + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
17699 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
17700 +
17701 + ;;
17702 +esac
17703 +{ echo "$as_me:$LINENO: checking for $ac_header" >&5
17704 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
17705 +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17706 + echo $ECHO_N "(cached) $ECHO_C" >&6
17707 +else
17708 + eval "$as_ac_Header=\$ac_header_preproc"
17709 +fi
17710 +ac_res=`eval echo '${'$as_ac_Header'}'`
17711 + { echo "$as_me:$LINENO: result: $ac_res" >&5
17712 +echo "${ECHO_T}$ac_res" >&6; }
17713 +
17714 +fi
17715 +if test `eval echo '${'$as_ac_Header'}'` = yes; then
17716 + cat >>confdefs.h <<_ACEOF
17717 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17718 +_ACEOF
17719 +
17720 +fi
17721 +
17722 +done
17723 +
17724 +
17725 +
17726 +for ac_header in fcntl.h sys/file.h
17727 +do
17728 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17729 +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17730 + { echo "$as_me:$LINENO: checking for $ac_header" >&5
17731 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
17732 +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17733 + echo $ECHO_N "(cached) $ECHO_C" >&6
17734 +fi
17735 +ac_res=`eval echo '${'$as_ac_Header'}'`
17736 + { echo "$as_me:$LINENO: result: $ac_res" >&5
17737 +echo "${ECHO_T}$ac_res" >&6; }
17738 +else
17739 + # Is the header compilable?
17740 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
17741 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
17742 +cat >conftest.$ac_ext <<_ACEOF
17743 +/* confdefs.h. */
17744 +_ACEOF
17745 +cat confdefs.h >>conftest.$ac_ext
17746 +cat >>conftest.$ac_ext <<_ACEOF
17747 +/* end confdefs.h. */
17748 +$ac_includes_default
17749 +#include <$ac_header>
17750 +_ACEOF
17751 +rm -f conftest.$ac_objext
17752 +if { (ac_try="$ac_compile"
17753 +case "(($ac_try" in
17754 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17755 + *) ac_try_echo=$ac_try;;
17756 +esac
17757 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17758 + (eval "$ac_compile") 2>conftest.er1
17759 + ac_status=$?
17760 + grep -v '^ *+' conftest.er1 >conftest.err
17761 + rm -f conftest.er1
17762 + cat conftest.err >&5
17763 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
17764 + (exit $ac_status); } && {
17765 + test -z "$ac_c_werror_flag" ||
17766 + test ! -s conftest.err
17767 + } && test -s conftest.$ac_objext; then
17768 + ac_header_compiler=yes
17769 +else
17770 + echo "$as_me: failed program was:" >&5
17771 +sed 's/^/| /' conftest.$ac_ext >&5
17772 +
17773 + ac_header_compiler=no
17774 +fi
17775 +
17776 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17777 +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
17778 +echo "${ECHO_T}$ac_header_compiler" >&6; }
17779 +
17780 +# Is the header present?
17781 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
17782 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
17783 +cat >conftest.$ac_ext <<_ACEOF
17784 +/* confdefs.h. */
17785 +_ACEOF
17786 +cat confdefs.h >>conftest.$ac_ext
17787 +cat >>conftest.$ac_ext <<_ACEOF
17788 +/* end confdefs.h. */
17789 +#include <$ac_header>
17790 +_ACEOF
17791 +if { (ac_try="$ac_cpp conftest.$ac_ext"
17792 +case "(($ac_try" in
17793 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17794 + *) ac_try_echo=$ac_try;;
17795 +esac
17796 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17797 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
17798 + ac_status=$?
17799 + grep -v '^ *+' conftest.er1 >conftest.err
17800 + rm -f conftest.er1
17801 + cat conftest.err >&5
17802 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
17803 + (exit $ac_status); } >/dev/null && {
17804 + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
17805 + test ! -s conftest.err
17806 + }; then
17807 + ac_header_preproc=yes
17808 +else
17809 + echo "$as_me: failed program was:" >&5
17810 +sed 's/^/| /' conftest.$ac_ext >&5
17811 +
17812 + ac_header_preproc=no
17813 +fi
17814 +
17815 +rm -f conftest.err conftest.$ac_ext
17816 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
17817 +echo "${ECHO_T}$ac_header_preproc" >&6; }
17818 +
17819 +# So? What about this header?
17820 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
17821 + yes:no: )
17822 + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
17823 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
17824 + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
17825 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
17826 + ac_header_preproc=yes
17827 + ;;
17828 + no:yes:* )
17829 + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
17830 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
17831 + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
17832 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
17833 + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
17834 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
17835 + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
17836 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
17837 + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
17838 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
17839 + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
17840 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
17841 +
17842 + ;;
17843 +esac
17844 +{ echo "$as_me:$LINENO: checking for $ac_header" >&5
17845 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
17846 +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
17847 + echo $ECHO_N "(cached) $ECHO_C" >&6
17848 +else
17849 + eval "$as_ac_Header=\$ac_header_preproc"
17850 +fi
17851 +ac_res=`eval echo '${'$as_ac_Header'}'`
17852 + { echo "$as_me:$LINENO: result: $ac_res" >&5
17853 +echo "${ECHO_T}$ac_res" >&6; }
17854 +
17855 +fi
17856 +if test `eval echo '${'$as_ac_Header'}'` = yes; then
17857 + cat >>confdefs.h <<_ACEOF
17858 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17859 +_ACEOF
17860 +
17861 +fi
17862 +
17863 +done
17864 +
17865 +
17866 +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
17867 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
17868 +if test "${ac_cv_c_const+set}" = set; then
17869 + echo $ECHO_N "(cached) $ECHO_C" >&6
17870 +else
17871 + cat >conftest.$ac_ext <<_ACEOF
17872 +/* confdefs.h. */
17873 +_ACEOF
17874 +cat confdefs.h >>conftest.$ac_ext
17875 +cat >>conftest.$ac_ext <<_ACEOF
17876 +/* end confdefs.h. */
17877 +
17878 +int
17879 +main ()
17880 +{
17881 +/* FIXME: Include the comments suggested by Paul. */
17882 +#ifndef __cplusplus
17883 + /* Ultrix mips cc rejects this. */
17884 + typedef int charset[2];
17885 + const charset cs;
17886 + /* SunOS 4.1.1 cc rejects this. */
17887 + char const *const *pcpcc;
17888 + char **ppc;
17889 + /* NEC SVR4.0.2 mips cc rejects this. */
17890 + struct point {int x, y;};
17891 + static struct point const zero = {0,0};
17892 + /* AIX XL C 1.02.0.0 rejects this.
17893 + It does not let you subtract one const X* pointer from another in
17894 + an arm of an if-expression whose if-part is not a constant
17895 + expression */
17896 + const char *g = "string";
17897 + pcpcc = &g + (g ? g-g : 0);
17898 + /* HPUX 7.0 cc rejects these. */
17899 + ++pcpcc;
17900 + ppc = (char**) pcpcc;
17901 + pcpcc = (char const *const *) ppc;
17902 + { /* SCO 3.2v4 cc rejects this. */
17903 + char *t;
17904 + char const *s = 0 ? (char *) 0 : (char const *) 0;
17905 +
17906 + *t++ = 0;
17907 + if (s) return 0;
17908 + }
17909 + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
17910 + int x[] = {25, 17};
17911 + const int *foo = &x[0];
17912 + ++foo;
17913 + }
17914 + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
17915 + typedef const int *iptr;
17916 + iptr p = 0;
17917 + ++p;
17918 + }
17919 + { /* AIX XL C 1.02.0.0 rejects this saying
17920 + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
17921 + struct s { int j; const int *ap[3]; };
17922 + struct s *b; b->j = 5;
17923 + }
17924 + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
17925 + const int foo = 10;
17926 + if (!foo) return 0;
17927 + }
17928 + return !cs[0] && !zero.x;
17929 +#endif
17930 +
17931 + ;
17932 + return 0;
17933 +}
17934 +_ACEOF
17935 +rm -f conftest.$ac_objext
17936 +if { (ac_try="$ac_compile"
17937 +case "(($ac_try" in
17938 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
17939 + *) ac_try_echo=$ac_try;;
17940 +esac
17941 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
17942 + (eval "$ac_compile") 2>conftest.er1
17943 + ac_status=$?
17944 + grep -v '^ *+' conftest.er1 >conftest.err
17945 + rm -f conftest.er1
17946 + cat conftest.err >&5
17947 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
17948 + (exit $ac_status); } && {
17949 + test -z "$ac_c_werror_flag" ||
17950 + test ! -s conftest.err
17951 + } && test -s conftest.$ac_objext; then
17952 + ac_cv_c_const=yes
17953 +else
17954 + echo "$as_me: failed program was:" >&5
17955 +sed 's/^/| /' conftest.$ac_ext >&5
17956 +
17957 + ac_cv_c_const=no
17958 +fi
17959 +
17960 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
17961 +fi
17962 +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
17963 +echo "${ECHO_T}$ac_cv_c_const" >&6; }
17964 +if test $ac_cv_c_const = no; then
17965 +
17966 +cat >>confdefs.h <<\_ACEOF
17967 +#define const
17968 +_ACEOF
17969 +
17970 +fi
17971 +
17972 +{ echo "$as_me:$LINENO: checking for size_t" >&5
17973 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
17974 +if test "${ac_cv_type_size_t+set}" = set; then
17975 + echo $ECHO_N "(cached) $ECHO_C" >&6
17976 +else
17977 + cat >conftest.$ac_ext <<_ACEOF
17978 +/* confdefs.h. */
17979 +_ACEOF
17980 +cat confdefs.h >>conftest.$ac_ext
17981 +cat >>conftest.$ac_ext <<_ACEOF
17982 +/* end confdefs.h. */
17983 +$ac_includes_default
17984 +typedef size_t ac__type_new_;
17985 +int
17986 +main ()
17987 +{
17988 +if ((ac__type_new_ *) 0)
17989 + return 0;
17990 +if (sizeof (ac__type_new_))
17991 + return 0;
17992 + ;
17993 + return 0;
17994 +}
17995 +_ACEOF
17996 +rm -f conftest.$ac_objext
17997 +if { (ac_try="$ac_compile"
17998 +case "(($ac_try" in
17999 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18000 + *) ac_try_echo=$ac_try;;
18001 +esac
18002 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
18003 + (eval "$ac_compile") 2>conftest.er1
18004 + ac_status=$?
18005 + grep -v '^ *+' conftest.er1 >conftest.err
18006 + rm -f conftest.er1
18007 + cat conftest.err >&5
18008 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
18009 + (exit $ac_status); } && {
18010 + test -z "$ac_c_werror_flag" ||
18011 + test ! -s conftest.err
18012 + } && test -s conftest.$ac_objext; then
18013 + ac_cv_type_size_t=yes
18014 +else
18015 + echo "$as_me: failed program was:" >&5
18016 +sed 's/^/| /' conftest.$ac_ext >&5
18017 +
18018 + ac_cv_type_size_t=no
18019 +fi
18020 +
18021 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18022 +fi
18023 +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
18024 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
18025 +if test $ac_cv_type_size_t = yes; then
18026 + :
18027 +else
18028 +
18029 +cat >>confdefs.h <<_ACEOF
18030 +#define size_t unsigned int
18031 +_ACEOF
18032 +
18033 +fi
18034 +
18035 +
18036 +
18037 +
18038 +
18039 +for ac_func in strchr strtok memcpy
18040 +do
18041 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18042 +{ echo "$as_me:$LINENO: checking for $ac_func" >&5
18043 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
18044 +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
18045 + echo $ECHO_N "(cached) $ECHO_C" >&6
18046 +else
18047 + cat >conftest.$ac_ext <<_ACEOF
18048 +/* confdefs.h. */
18049 +_ACEOF
18050 +cat confdefs.h >>conftest.$ac_ext
18051 +cat >>conftest.$ac_ext <<_ACEOF
18052 +/* end confdefs.h. */
18053 +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
18054 + For example, HP-UX 11i <limits.h> declares gettimeofday. */
18055 +#define $ac_func innocuous_$ac_func
18056 +
18057 +/* System header to define __stub macros and hopefully few prototypes,
18058 + which can conflict with char $ac_func (); below.
18059 + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
18060 + <limits.h> exists even on freestanding compilers. */
18061 +
18062 +#ifdef __STDC__
18063 +# include <limits.h>
18064 +#else
18065 +# include <assert.h>
18066 +#endif
18067 +
18068 +#undef $ac_func
18069 +
18070 +/* Override any GCC internal prototype to avoid an error.
18071 + Use char because int might match the return type of a GCC
18072 + builtin and then its argument prototype would still apply. */
18073 +#ifdef __cplusplus
18074 +extern "C"
18075 +#endif
18076 +char $ac_func ();
18077 +/* The GNU C library defines this for functions which it implements
18078 + to always fail with ENOSYS. Some functions are actually named
18079 + something starting with __ and the normal name is an alias. */
18080 +#if defined __stub_$ac_func || defined __stub___$ac_func
18081 +choke me
18082 +#endif
18083 +
18084 +int
18085 +main ()
18086 +{
18087 +return $ac_func ();
18088 + ;
18089 + return 0;
18090 +}
18091 +_ACEOF
18092 +rm -f conftest.$ac_objext conftest$ac_exeext
18093 +if { (ac_try="$ac_link"
18094 +case "(($ac_try" in
18095 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18096 + *) ac_try_echo=$ac_try;;
18097 +esac
18098 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
18099 + (eval "$ac_link") 2>conftest.er1
18100 + ac_status=$?
18101 + grep -v '^ *+' conftest.er1 >conftest.err
18102 + rm -f conftest.er1
18103 + cat conftest.err >&5
18104 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
18105 + (exit $ac_status); } && {
18106 + test -z "$ac_c_werror_flag" ||
18107 + test ! -s conftest.err
18108 + } && test -s conftest$ac_exeext &&
18109 + $as_test_x conftest$ac_exeext; then
18110 + eval "$as_ac_var=yes"
18111 +else
18112 + echo "$as_me: failed program was:" >&5
18113 +sed 's/^/| /' conftest.$ac_ext >&5
18114 +
18115 + eval "$as_ac_var=no"
18116 +fi
18117 +
18118 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
18119 + conftest$ac_exeext conftest.$ac_ext
18120 +fi
18121 +ac_res=`eval echo '${'$as_ac_var'}'`
18122 + { echo "$as_me:$LINENO: result: $ac_res" >&5
18123 +echo "${ECHO_T}$ac_res" >&6; }
18124 +if test `eval echo '${'$as_ac_var'}'` = yes; then
18125 + cat >>confdefs.h <<_ACEOF
18126 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
18127 +_ACEOF
18128 +
18129 +fi
18130 +done
18131 +
18132 +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
18133 +# for constant arguments. Useless!
18134 +{ echo "$as_me:$LINENO: checking for working alloca.h" >&5
18135 +echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; }
18136 +if test "${ac_cv_working_alloca_h+set}" = set; then
18137 + echo $ECHO_N "(cached) $ECHO_C" >&6
18138 +else
18139 + cat >conftest.$ac_ext <<_ACEOF
18140 +/* confdefs.h. */
18141 +_ACEOF
18142 +cat confdefs.h >>conftest.$ac_ext
18143 +cat >>conftest.$ac_ext <<_ACEOF
18144 +/* end confdefs.h. */
18145 +#include <alloca.h>
18146 +int
18147 +main ()
18148 +{
18149 +char *p = (char *) alloca (2 * sizeof (int));
18150 + if (p) return 0;
18151 + ;
18152 + return 0;
18153 +}
18154 +_ACEOF
18155 +rm -f conftest.$ac_objext conftest$ac_exeext
18156 +if { (ac_try="$ac_link"
18157 +case "(($ac_try" in
18158 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18159 + *) ac_try_echo=$ac_try;;
18160 +esac
18161 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
18162 + (eval "$ac_link") 2>conftest.er1
18163 + ac_status=$?
18164 + grep -v '^ *+' conftest.er1 >conftest.err
18165 + rm -f conftest.er1
18166 + cat conftest.err >&5
18167 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
18168 + (exit $ac_status); } && {
18169 + test -z "$ac_c_werror_flag" ||
18170 + test ! -s conftest.err
18171 + } && test -s conftest$ac_exeext &&
18172 + $as_test_x conftest$ac_exeext; then
18173 + ac_cv_working_alloca_h=yes
18174 +else
18175 + echo "$as_me: failed program was:" >&5
18176 +sed 's/^/| /' conftest.$ac_ext >&5
18177 +
18178 + ac_cv_working_alloca_h=no
18179 +fi
18180 +
18181 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
18182 + conftest$ac_exeext conftest.$ac_ext
18183 +fi
18184 +{ echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
18185 +echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; }
18186 +if test $ac_cv_working_alloca_h = yes; then
18187 +
18188 +cat >>confdefs.h <<\_ACEOF
18189 +#define HAVE_ALLOCA_H 1
18190 +_ACEOF
18191 +
18192 +fi
18193 +
18194 +{ echo "$as_me:$LINENO: checking for alloca" >&5
18195 +echo $ECHO_N "checking for alloca... $ECHO_C" >&6; }
18196 +if test "${ac_cv_func_alloca_works+set}" = set; then
18197 + echo $ECHO_N "(cached) $ECHO_C" >&6
18198 +else
18199 + cat >conftest.$ac_ext <<_ACEOF
18200 +/* confdefs.h. */
18201 +_ACEOF
18202 +cat confdefs.h >>conftest.$ac_ext
18203 +cat >>conftest.$ac_ext <<_ACEOF
18204 +/* end confdefs.h. */
18205 +#ifdef __GNUC__
18206 +# define alloca __builtin_alloca
18207 +#else
18208 +# ifdef _MSC_VER
18209 +# include <malloc.h>
18210 +# define alloca _alloca
18211 +# else
18212 +# ifdef HAVE_ALLOCA_H
18213 +# include <alloca.h>
18214 +# else
18215 +# ifdef _AIX
18216 + #pragma alloca
18217 +# else
18218 +# ifndef alloca /* predefined by HP cc +Olibcalls */
18219 +char *alloca ();
18220 +# endif
18221 +# endif
18222 +# endif
18223 +# endif
18224 +#endif
18225 +
18226 +int
18227 +main ()
18228 +{
18229 +char *p = (char *) alloca (1);
18230 + if (p) return 0;
18231 + ;
18232 + return 0;
18233 +}
18234 +_ACEOF
18235 +rm -f conftest.$ac_objext conftest$ac_exeext
18236 +if { (ac_try="$ac_link"
18237 +case "(($ac_try" in
18238 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18239 + *) ac_try_echo=$ac_try;;
18240 +esac
18241 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
18242 + (eval "$ac_link") 2>conftest.er1
18243 + ac_status=$?
18244 + grep -v '^ *+' conftest.er1 >conftest.err
18245 + rm -f conftest.er1
18246 + cat conftest.err >&5
18247 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
18248 + (exit $ac_status); } && {
18249 + test -z "$ac_c_werror_flag" ||
18250 + test ! -s conftest.err
18251 + } && test -s conftest$ac_exeext &&
18252 + $as_test_x conftest$ac_exeext; then
18253 + ac_cv_func_alloca_works=yes
18254 +else
18255 + echo "$as_me: failed program was:" >&5
18256 +sed 's/^/| /' conftest.$ac_ext >&5
18257 +
18258 + ac_cv_func_alloca_works=no
18259 +fi
18260 +
18261 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
18262 + conftest$ac_exeext conftest.$ac_ext
18263 +fi
18264 +{ echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
18265 +echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; }
18266 +
18267 +if test $ac_cv_func_alloca_works = yes; then
18268 +
18269 +cat >>confdefs.h <<\_ACEOF
18270 +#define HAVE_ALLOCA 1
18271 +_ACEOF
18272 +
18273 +else
18274 + # The SVR3 libPW and SVR4 libucb both contain incompatible functions
18275 +# that cause trouble. Some versions do not even contain alloca or
18276 +# contain a buggy version. If you still want to use their alloca,
18277 +# use ar to extract alloca.o from them instead of compiling alloca.c.
18278 +
18279 +ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
18280 +
18281 +cat >>confdefs.h <<\_ACEOF
18282 +#define C_ALLOCA 1
18283 +_ACEOF
18284 +
18285 +
18286 +{ echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
18287 +echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; }
18288 +if test "${ac_cv_os_cray+set}" = set; then
18289 + echo $ECHO_N "(cached) $ECHO_C" >&6
18290 +else
18291 + cat >conftest.$ac_ext <<_ACEOF
18292 +/* confdefs.h. */
18293 +_ACEOF
18294 +cat confdefs.h >>conftest.$ac_ext
18295 +cat >>conftest.$ac_ext <<_ACEOF
18296 +/* end confdefs.h. */
18297 +#if defined CRAY && ! defined CRAY2
18298 +webecray
18299 +#else
18300 +wenotbecray
18301 +#endif
18302 +
18303 +_ACEOF
18304 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
18305 + $EGREP "webecray" >/dev/null 2>&1; then
18306 + ac_cv_os_cray=yes
18307 +else
18308 + ac_cv_os_cray=no
18309 +fi
18310 +rm -f conftest*
18311 +
18312 +fi
18313 +{ echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
18314 +echo "${ECHO_T}$ac_cv_os_cray" >&6; }
18315 +if test $ac_cv_os_cray = yes; then
18316 + for ac_func in _getb67 GETB67 getb67; do
18317 + as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
18318 +{ echo "$as_me:$LINENO: checking for $ac_func" >&5
18319 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
18320 +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
18321 + echo $ECHO_N "(cached) $ECHO_C" >&6
18322 +else
18323 + cat >conftest.$ac_ext <<_ACEOF
18324 +/* confdefs.h. */
18325 +_ACEOF
18326 +cat confdefs.h >>conftest.$ac_ext
18327 +cat >>conftest.$ac_ext <<_ACEOF
18328 +/* end confdefs.h. */
18329 +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
18330 + For example, HP-UX 11i <limits.h> declares gettimeofday. */
18331 +#define $ac_func innocuous_$ac_func
18332 +
18333 +/* System header to define __stub macros and hopefully few prototypes,
18334 + which can conflict with char $ac_func (); below.
18335 + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
18336 + <limits.h> exists even on freestanding compilers. */
18337 +
18338 +#ifdef __STDC__
18339 +# include <limits.h>
18340 +#else
18341 +# include <assert.h>
18342 +#endif
18343 +
18344 +#undef $ac_func
18345 +
18346 +/* Override any GCC internal prototype to avoid an error.
18347 + Use char because int might match the return type of a GCC
18348 + builtin and then its argument prototype would still apply. */
18349 +#ifdef __cplusplus
18350 +extern "C"
18351 +#endif
18352 +char $ac_func ();
18353 +/* The GNU C library defines this for functions which it implements
18354 + to always fail with ENOSYS. Some functions are actually named
18355 + something starting with __ and the normal name is an alias. */
18356 +#if defined __stub_$ac_func || defined __stub___$ac_func
18357 +choke me
18358 +#endif
18359 +
18360 +int
18361 +main ()
18362 +{
18363 +return $ac_func ();
18364 + ;
18365 + return 0;
18366 +}
18367 +_ACEOF
18368 +rm -f conftest.$ac_objext conftest$ac_exeext
18369 +if { (ac_try="$ac_link"
18370 +case "(($ac_try" in
18371 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18372 + *) ac_try_echo=$ac_try;;
18373 +esac
18374 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
18375 + (eval "$ac_link") 2>conftest.er1
18376 + ac_status=$?
18377 + grep -v '^ *+' conftest.er1 >conftest.err
18378 + rm -f conftest.er1
18379 + cat conftest.err >&5
18380 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
18381 + (exit $ac_status); } && {
18382 + test -z "$ac_c_werror_flag" ||
18383 + test ! -s conftest.err
18384 + } && test -s conftest$ac_exeext &&
18385 + $as_test_x conftest$ac_exeext; then
18386 + eval "$as_ac_var=yes"
18387 +else
18388 + echo "$as_me: failed program was:" >&5
18389 +sed 's/^/| /' conftest.$ac_ext >&5
18390 +
18391 + eval "$as_ac_var=no"
18392 +fi
18393 +
18394 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
18395 + conftest$ac_exeext conftest.$ac_ext
18396 +fi
18397 +ac_res=`eval echo '${'$as_ac_var'}'`
18398 + { echo "$as_me:$LINENO: result: $ac_res" >&5
18399 +echo "${ECHO_T}$ac_res" >&6; }
18400 +if test `eval echo '${'$as_ac_var'}'` = yes; then
18401 +
18402 +cat >>confdefs.h <<_ACEOF
18403 +#define CRAY_STACKSEG_END $ac_func
18404 +_ACEOF
18405 +
18406 + break
18407 +fi
18408 +
18409 + done
18410 +fi
18411 +
18412 +{ echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
18413 +echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; }
18414 +if test "${ac_cv_c_stack_direction+set}" = set; then
18415 + echo $ECHO_N "(cached) $ECHO_C" >&6
18416 +else
18417 + if test "$cross_compiling" = yes; then
18418 + ac_cv_c_stack_direction=0
18419 +else
18420 + cat >conftest.$ac_ext <<_ACEOF
18421 +/* confdefs.h. */
18422 +_ACEOF
18423 +cat confdefs.h >>conftest.$ac_ext
18424 +cat >>conftest.$ac_ext <<_ACEOF
18425 +/* end confdefs.h. */
18426 +$ac_includes_default
18427 +int
18428 +find_stack_direction ()
18429 +{
18430 + static char *addr = 0;
18431 + auto char dummy;
18432 + if (addr == 0)
18433 + {
18434 + addr = &dummy;
18435 + return find_stack_direction ();
18436 + }
18437 + else
18438 + return (&dummy > addr) ? 1 : -1;
18439 +}
18440 +
18441 +int
18442 +main ()
18443 +{
18444 + return find_stack_direction () < 0;
18445 +}
18446 +_ACEOF
18447 +rm -f conftest$ac_exeext
18448 +if { (ac_try="$ac_link"
18449 +case "(($ac_try" in
18450 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18451 + *) ac_try_echo=$ac_try;;
18452 +esac
18453 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
18454 + (eval "$ac_link") 2>&5
18455 + ac_status=$?
18456 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
18457 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18458 + { (case "(($ac_try" in
18459 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18460 + *) ac_try_echo=$ac_try;;
18461 +esac
18462 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
18463 + (eval "$ac_try") 2>&5
18464 + ac_status=$?
18465 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
18466 + (exit $ac_status); }; }; then
18467 + ac_cv_c_stack_direction=1
18468 +else
18469 + echo "$as_me: program exited with status $ac_status" >&5
18470 +echo "$as_me: failed program was:" >&5
18471 +sed 's/^/| /' conftest.$ac_ext >&5
18472 +
18473 +( exit $ac_status )
18474 +ac_cv_c_stack_direction=-1
18475 +fi
18476 +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18477 +fi
18478 +
18479 +
18480 +fi
18481 +{ echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
18482 +echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; }
18483 +
18484 +cat >>confdefs.h <<_ACEOF
18485 +#define STACK_DIRECTION $ac_cv_c_stack_direction
18486 +_ACEOF
18487 +
18488 +
18489 +fi
18490 +
18491 +
18492 +
18493 +case "${host}" in
18494 +*-*-msdos* | *-*-go32* | *-*-mingw32* | *-*-cygwin* | *-*-windows)
18495 +
18496 +cat >>confdefs.h <<\_ACEOF
18497 +#define USE_BINARY_FOPEN 1
18498 +_ACEOF
18499 + ;;
18500 +esac
18501 +
18502 +{ echo "$as_me:$LINENO: checking whether malloc must be declared" >&5
18503 +echo $ECHO_N "checking whether malloc must be declared... $ECHO_C" >&6; }
18504 +if test "${bfd_cv_decl_needed_malloc+set}" = set; then
18505 + echo $ECHO_N "(cached) $ECHO_C" >&6
18506 +else
18507 + cat >conftest.$ac_ext <<_ACEOF
18508 +/* confdefs.h. */
18509 +_ACEOF
18510 +cat confdefs.h >>conftest.$ac_ext
18511 +cat >>conftest.$ac_ext <<_ACEOF
18512 +/* end confdefs.h. */
18513 +
18514 +#include <stdio.h>
18515 +#ifdef HAVE_STRING_H
18516 +#include <string.h>
18517 +#else
18518 +#ifdef HAVE_STRINGS_H
18519 +#include <strings.h>
18520 +#endif
18521 +#endif
18522 +#ifdef HAVE_STDLIB_H
18523 +#include <stdlib.h>
18524 +#endif
18525 +#ifdef HAVE_UNISTD_H
18526 +#include <unistd.h>
18527 +#endif
18528 +int
18529 +main ()
18530 +{
18531 +char *(*pfn) = (char *(*)) malloc
18532 + ;
18533 + return 0;
18534 +}
18535 +_ACEOF
18536 +rm -f conftest.$ac_objext
18537 +if { (ac_try="$ac_compile"
18538 +case "(($ac_try" in
18539 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18540 + *) ac_try_echo=$ac_try;;
18541 +esac
18542 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
18543 + (eval "$ac_compile") 2>conftest.er1
18544 + ac_status=$?
18545 + grep -v '^ *+' conftest.er1 >conftest.err
18546 + rm -f conftest.er1
18547 + cat conftest.err >&5
18548 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
18549 + (exit $ac_status); } && {
18550 + test -z "$ac_c_werror_flag" ||
18551 + test ! -s conftest.err
18552 + } && test -s conftest.$ac_objext; then
18553 + bfd_cv_decl_needed_malloc=no
18554 +else
18555 + echo "$as_me: failed program was:" >&5
18556 +sed 's/^/| /' conftest.$ac_ext >&5
18557 +
18558 + bfd_cv_decl_needed_malloc=yes
18559 +fi
18560 +
18561 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18562 +fi
18563 +
18564 +{ echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_malloc" >&5
18565 +echo "${ECHO_T}$bfd_cv_decl_needed_malloc" >&6; }
18566 +if test $bfd_cv_decl_needed_malloc = yes; then
18567 + bfd_tr_decl=NEED_DECLARATION_`echo malloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
18568 +
18569 +cat >>confdefs.h <<_ACEOF
18570 +#define $bfd_tr_decl 1
18571 +_ACEOF
18572 +
18573 +fi
18574 +
18575 +{ echo "$as_me:$LINENO: checking whether realloc must be declared" >&5
18576 +echo $ECHO_N "checking whether realloc must be declared... $ECHO_C" >&6; }
18577 +if test "${bfd_cv_decl_needed_realloc+set}" = set; then
18578 + echo $ECHO_N "(cached) $ECHO_C" >&6
18579 +else
18580 + cat >conftest.$ac_ext <<_ACEOF
18581 +/* confdefs.h. */
18582 +_ACEOF
18583 +cat confdefs.h >>conftest.$ac_ext
18584 +cat >>conftest.$ac_ext <<_ACEOF
18585 +/* end confdefs.h. */
18586 +
18587 +#include <stdio.h>
18588 +#ifdef HAVE_STRING_H
18589 +#include <string.h>
18590 +#else
18591 +#ifdef HAVE_STRINGS_H
18592 +#include <strings.h>
18593 +#endif
18594 +#endif
18595 +#ifdef HAVE_STDLIB_H
18596 +#include <stdlib.h>
18597 +#endif
18598 +#ifdef HAVE_UNISTD_H
18599 +#include <unistd.h>
18600 +#endif
18601 +int
18602 +main ()
18603 +{
18604 +char *(*pfn) = (char *(*)) realloc
18605 + ;
18606 + return 0;
18607 +}
18608 +_ACEOF
18609 +rm -f conftest.$ac_objext
18610 +if { (ac_try="$ac_compile"
18611 +case "(($ac_try" in
18612 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18613 + *) ac_try_echo=$ac_try;;
18614 +esac
18615 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
18616 + (eval "$ac_compile") 2>conftest.er1
18617 + ac_status=$?
18618 + grep -v '^ *+' conftest.er1 >conftest.err
18619 + rm -f conftest.er1
18620 + cat conftest.err >&5
18621 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
18622 + (exit $ac_status); } && {
18623 + test -z "$ac_c_werror_flag" ||
18624 + test ! -s conftest.err
18625 + } && test -s conftest.$ac_objext; then
18626 + bfd_cv_decl_needed_realloc=no
18627 +else
18628 + echo "$as_me: failed program was:" >&5
18629 +sed 's/^/| /' conftest.$ac_ext >&5
18630 +
18631 + bfd_cv_decl_needed_realloc=yes
18632 +fi
18633 +
18634 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18635 +fi
18636 +
18637 +{ echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_realloc" >&5
18638 +echo "${ECHO_T}$bfd_cv_decl_needed_realloc" >&6; }
18639 +if test $bfd_cv_decl_needed_realloc = yes; then
18640 + bfd_tr_decl=NEED_DECLARATION_`echo realloc | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
18641 +
18642 +cat >>confdefs.h <<_ACEOF
18643 +#define $bfd_tr_decl 1
18644 +_ACEOF
18645 +
18646 +fi
18647 +
18648 +{ echo "$as_me:$LINENO: checking whether free must be declared" >&5
18649 +echo $ECHO_N "checking whether free must be declared... $ECHO_C" >&6; }
18650 +if test "${bfd_cv_decl_needed_free+set}" = set; then
18651 + echo $ECHO_N "(cached) $ECHO_C" >&6
18652 +else
18653 + cat >conftest.$ac_ext <<_ACEOF
18654 +/* confdefs.h. */
18655 +_ACEOF
18656 +cat confdefs.h >>conftest.$ac_ext
18657 +cat >>conftest.$ac_ext <<_ACEOF
18658 +/* end confdefs.h. */
18659 +
18660 +#include <stdio.h>
18661 +#ifdef HAVE_STRING_H
18662 +#include <string.h>
18663 +#else
18664 +#ifdef HAVE_STRINGS_H
18665 +#include <strings.h>
18666 +#endif
18667 +#endif
18668 +#ifdef HAVE_STDLIB_H
18669 +#include <stdlib.h>
18670 +#endif
18671 +#ifdef HAVE_UNISTD_H
18672 +#include <unistd.h>
18673 +#endif
18674 +int
18675 +main ()
18676 +{
18677 +char *(*pfn) = (char *(*)) free
18678 + ;
18679 + return 0;
18680 +}
18681 +_ACEOF
18682 +rm -f conftest.$ac_objext
18683 +if { (ac_try="$ac_compile"
18684 +case "(($ac_try" in
18685 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18686 + *) ac_try_echo=$ac_try;;
18687 +esac
18688 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
18689 + (eval "$ac_compile") 2>conftest.er1
18690 + ac_status=$?
18691 + grep -v '^ *+' conftest.er1 >conftest.err
18692 + rm -f conftest.er1
18693 + cat conftest.err >&5
18694 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
18695 + (exit $ac_status); } && {
18696 + test -z "$ac_c_werror_flag" ||
18697 + test ! -s conftest.err
18698 + } && test -s conftest.$ac_objext; then
18699 + bfd_cv_decl_needed_free=no
18700 +else
18701 + echo "$as_me: failed program was:" >&5
18702 +sed 's/^/| /' conftest.$ac_ext >&5
18703 +
18704 + bfd_cv_decl_needed_free=yes
18705 +fi
18706 +
18707 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18708 +fi
18709 +
18710 +{ echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_free" >&5
18711 +echo "${ECHO_T}$bfd_cv_decl_needed_free" >&6; }
18712 +if test $bfd_cv_decl_needed_free = yes; then
18713 + bfd_tr_decl=NEED_DECLARATION_`echo free | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
18714 +
18715 +cat >>confdefs.h <<_ACEOF
18716 +#define $bfd_tr_decl 1
18717 +_ACEOF
18718 +
18719 +fi
18720 +
18721 +{ echo "$as_me:$LINENO: checking whether strtok must be declared" >&5
18722 +echo $ECHO_N "checking whether strtok must be declared... $ECHO_C" >&6; }
18723 +if test "${bfd_cv_decl_needed_strtok+set}" = set; then
18724 + echo $ECHO_N "(cached) $ECHO_C" >&6
18725 +else
18726 + cat >conftest.$ac_ext <<_ACEOF
18727 +/* confdefs.h. */
18728 +_ACEOF
18729 +cat confdefs.h >>conftest.$ac_ext
18730 +cat >>conftest.$ac_ext <<_ACEOF
18731 +/* end confdefs.h. */
18732 +
18733 +#include <stdio.h>
18734 +#ifdef HAVE_STRING_H
18735 +#include <string.h>
18736 +#else
18737 +#ifdef HAVE_STRINGS_H
18738 +#include <strings.h>
18739 +#endif
18740 +#endif
18741 +#ifdef HAVE_STDLIB_H
18742 +#include <stdlib.h>
18743 +#endif
18744 +#ifdef HAVE_UNISTD_H
18745 +#include <unistd.h>
18746 +#endif
18747 +int
18748 +main ()
18749 +{
18750 +char *(*pfn) = (char *(*)) strtok
18751 + ;
18752 + return 0;
18753 +}
18754 +_ACEOF
18755 +rm -f conftest.$ac_objext
18756 +if { (ac_try="$ac_compile"
18757 +case "(($ac_try" in
18758 + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
18759 + *) ac_try_echo=$ac_try;;
18760 +esac
18761 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
18762 + (eval "$ac_compile") 2>conftest.er1
18763 + ac_status=$?
18764 + grep -v '^ *+' conftest.er1 >conftest.err
18765 + rm -f conftest.er1
18766 + cat conftest.err >&5
18767 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
18768 + (exit $ac_status); } && {
18769 + test -z "$ac_c_werror_flag" ||
18770 + test ! -s conftest.err
18771 + } && test -s conftest.$ac_objext; then
18772 + bfd_cv_decl_needed_strtok=no
18773 +else
18774 + echo "$as_me: failed program was:" >&5
18775 +sed 's/^/| /' conftest.$ac_ext >&5
18776 +
18777 + bfd_cv_decl_needed_strtok=yes
18778 +fi
18779 +
18780 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
18781 +fi
18782 +
18783 +{ echo "$as_me:$LINENO: result: $bfd_cv_decl_needed_strtok" >&5
18784 +echo "${ECHO_T}$bfd_cv_decl_needed_strtok" >&6; }
18785 +if test $bfd_cv_decl_needed_strtok = yes; then
18786 + bfd_tr_decl=NEED_DECLARATION_`echo strtok | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
18787 +
18788 +cat >>confdefs.h <<_ACEOF
18789 +#define $bfd_tr_decl 1
18790 +_ACEOF
18791 +
18792 +fi
18793 +
18794 +
18795 +
18796 +
18797 +# Check whether --with-pkgversion was given.
18798 +if test "${with_pkgversion+set}" = set; then
18799 + withval=$with_pkgversion; case "$withval" in
18800 + yes) { { echo "$as_me:$LINENO: error: package version not specified" >&5
18801 +echo "$as_me: error: package version not specified" >&2;}
18802 + { (exit 1); exit 1; }; } ;;
18803 + no) PKGVERSION= ;;
18804 + *) PKGVERSION="($withval) " ;;
18805 + esac
18806 +else
18807 + PKGVERSION="(MIPS Convert) "
18808 +
18809 +fi
18810 +
18811 +
18812 +
18813 +
18814 +
18815 +# Check whether --with-bugurl was given.
18816 +if test "${with_bugurl+set}" = set; then
18817 + withval=$with_bugurl; case "$withval" in
18818 + yes) { { echo "$as_me:$LINENO: error: bug URL not specified" >&5
18819 +echo "$as_me: error: bug URL not specified" >&2;}
18820 + { (exit 1); exit 1; }; } ;;
18821 + no) BUGURL=
18822 + ;;
18823 + *) BUGURL="$withval"
18824 + ;;
18825 + esac
18826 +else
18827 + BUGURL="http://support.codesourcery.com/"
18828 +
18829 +fi
18830 +
18831 + case ${BUGURL} in
18832 + "")
18833 + REPORT_BUGS_TO=
18834 + REPORT_BUGS_TEXI=
18835 + ;;
18836 + *)
18837 + REPORT_BUGS_TO="<$BUGURL>"
18838 + REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`}
18839 + ;;
18840 + esac;
18841 +
18842 +
18843 +
18844 +
18845 +{ echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
18846 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; }
18847 + # Check whether --enable-maintainer-mode was given.
18848 +if test "${enable_maintainer_mode+set}" = set; then
18849 + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
18850 +else
18851 + USE_MAINTAINER_MODE=no
18852 +fi
18853 +
18854 + { echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
18855 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6; }
18856 +
18857 +
18858 +if test $USE_MAINTAINER_MODE = yes; then
18859 + MAINTAINER_MODE_TRUE=
18860 + MAINTAINER_MODE_FALSE='#'
18861 +else
18862 + MAINTAINER_MODE_TRUE='#'
18863 + MAINTAINER_MODE_FALSE=
18864 +fi
18865 +
18866 + MAINT=$MAINTAINER_MODE_TRUE
18867 +
18868 +
18869 +
18870 +ac_config_files="$ac_config_files Makefile"
18871 +
18872 +cat >confcache <<\_ACEOF
18873 +# This file is a shell script that caches the results of configure
18874 +# tests run on this system so they can be shared between configure
18875 +# scripts and configure runs, see configure's option --config-cache.
18876 +# It is not useful on other systems. If it contains results you don't
18877 +# want to keep, you may remove or edit it.
18878 +#
18879 +# config.status only pays attention to the cache file if you give it
18880 +# the --recheck option to rerun configure.
18881 +#
18882 +# `ac_cv_env_foo' variables (set or unset) will be overridden when
18883 +# loading this file, other *unset* `ac_cv_foo' will be assigned the
18884 +# following values.
18885 +
18886 +_ACEOF
18887 +
18888 +# The following way of writing the cache mishandles newlines in values,
18889 +# but we know of no workaround that is simple, portable, and efficient.
18890 +# So, we kill variables containing newlines.
18891 +# Ultrix sh set writes to stderr and can't be redirected directly,
18892 +# and sets the high bit in the cache file unless we assign to the vars.
18893 +(
18894 + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
18895 + eval ac_val=\$$ac_var
18896 + case $ac_val in #(
18897 + *${as_nl}*)
18898 + case $ac_var in #(
18899 + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
18900 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
18901 + esac
18902 + case $ac_var in #(
18903 + _ | IFS | as_nl) ;; #(
18904 + *) $as_unset $ac_var ;;
18905 + esac ;;
18906 + esac
18907 + done
18908 +
18909 + (set) 2>&1 |
18910 + case $as_nl`(ac_space=' '; set) 2>&1` in #(
18911 + *${as_nl}ac_space=\ *)
18912 + # `set' does not quote correctly, so add quotes (double-quote
18913 + # substitution turns \\\\ into \\, and sed turns \\ into \).
18914 + sed -n \
18915 + "s/'/'\\\\''/g;
18916 + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
18917 + ;; #(
18918 + *)
18919 + # `set' quotes correctly as required by POSIX, so do not add quotes.
18920 + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
18921 + ;;
18922 + esac |
18923 + sort
18924 +) |
18925 + sed '
18926 + /^ac_cv_env_/b end
18927 + t clear
18928 + :clear
18929 + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
18930 + t end
18931 + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
18932 + :end' >>confcache
18933 +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
18934 + if test -w "$cache_file"; then
18935 + test "x$cache_file" != "x/dev/null" &&
18936 + { echo "$as_me:$LINENO: updating cache $cache_file" >&5
18937 +echo "$as_me: updating cache $cache_file" >&6;}
18938 + cat confcache >$cache_file
18939 + else
18940 + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
18941 +echo "$as_me: not updating unwritable cache $cache_file" >&6;}
18942 + fi
18943 +fi
18944 +rm -f confcache
18945 +
18946 +test "x$prefix" = xNONE && prefix=$ac_default_prefix
18947 +# Let make expand exec_prefix.
18948 +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
18949 +
18950 +DEFS=-DHAVE_CONFIG_H
18951 +
18952 +ac_libobjs=
18953 +ac_ltlibobjs=
18954 +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
18955 + # 1. Remove the extension, and $U if already installed.
18956 + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
18957 + ac_i=`echo "$ac_i" | sed "$ac_script"`
18958 + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
18959 + # will be set to the directory where LIBOBJS objects are built.
18960 + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
18961 + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
18962 +done
18963 +LIBOBJS=$ac_libobjs
18964 +
18965 +LTLIBOBJS=$ac_ltlibobjs
18966 +
18967 +
18968 +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
18969 + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
18970 +Usually this means the macro was only invoked conditionally." >&5
18971 +echo "$as_me: error: conditional \"AMDEP\" was never defined.
18972 +Usually this means the macro was only invoked conditionally." >&2;}
18973 + { (exit 1); exit 1; }; }
18974 +fi
18975 +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
18976 + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
18977 +Usually this means the macro was only invoked conditionally." >&5
18978 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
18979 +Usually this means the macro was only invoked conditionally." >&2;}
18980 + { (exit 1); exit 1; }; }
18981 +fi
18982 +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
18983 + { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
18984 +Usually this means the macro was only invoked conditionally." >&5
18985 +echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
18986 +Usually this means the macro was only invoked conditionally." >&2;}
18987 + { (exit 1); exit 1; }; }
18988 +fi
18989 +
18990 +: ${CONFIG_STATUS=./config.status}
18991 +ac_clean_files_save=$ac_clean_files
18992 +ac_clean_files="$ac_clean_files $CONFIG_STATUS"
18993 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
18994 +echo "$as_me: creating $CONFIG_STATUS" >&6;}
18995 +cat >$CONFIG_STATUS <<_ACEOF
18996 +#! $SHELL
18997 +# Generated by $as_me.
18998 +# Run this file to recreate the current configuration.
18999 +# Compiler output produced by configure, useful for debugging
19000 +# configure, is in config.log if it exists.
19001 +
19002 +debug=false
19003 +ac_cs_recheck=false
19004 +ac_cs_silent=false
19005 +SHELL=\${CONFIG_SHELL-$SHELL}
19006 +_ACEOF
19007 +
19008 +cat >>$CONFIG_STATUS <<\_ACEOF
19009 +## --------------------- ##
19010 +## M4sh Initialization. ##
19011 +## --------------------- ##
19012 +
19013 +# Be more Bourne compatible
19014 +DUALCASE=1; export DUALCASE # for MKS sh
19015 +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
19016 + emulate sh
19017 + NULLCMD=:
19018 + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
19019 + # is contrary to our usage. Disable this feature.
19020 + alias -g '${1+"$@"}'='"$@"'
19021 + setopt NO_GLOB_SUBST
19022 +else
19023 + case `(set -o) 2>/dev/null` in
19024 + *posix*) set -o posix ;;
19025 +esac
19026 +
19027 +fi
19028 +
19029 +
19030 +
19031 +
19032 +# PATH needs CR
19033 +# Avoid depending upon Character Ranges.
19034 +as_cr_letters='abcdefghijklmnopqrstuvwxyz'
19035 +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
19036 +as_cr_Letters=$as_cr_letters$as_cr_LETTERS
19037 +as_cr_digits='0123456789'
19038 +as_cr_alnum=$as_cr_Letters$as_cr_digits
19039 +
19040 +# The user is always right.
19041 +if test "${PATH_SEPARATOR+set}" != set; then
19042 + echo "#! /bin/sh" >conf$$.sh
19043 + echo "exit 0" >>conf$$.sh
19044 + chmod +x conf$$.sh
19045 + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
19046 + PATH_SEPARATOR=';'
19047 + else
19048 + PATH_SEPARATOR=:
19049 + fi
19050 + rm -f conf$$.sh
19051 +fi
19052 +
19053 +# Support unset when possible.
19054 +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
19055 + as_unset=unset
19056 +else
19057 + as_unset=false
19058 +fi
19059 +
19060 +
19061 +# IFS
19062 +# We need space, tab and new line, in precisely that order. Quoting is
19063 +# there to prevent editors from complaining about space-tab.
19064 +# (If _AS_PATH_WALK were called with IFS unset, it would disable word
19065 +# splitting by setting IFS to empty value.)
19066 +as_nl='
19067 +'
19068 +IFS=" "" $as_nl"
19069 +
19070 +# Find who we are. Look in the path if we contain no directory separator.
19071 +case $0 in
19072 + *[\\/]* ) as_myself=$0 ;;
19073 + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
19074 +for as_dir in $PATH
19075 +do
19076 + IFS=$as_save_IFS
19077 + test -z "$as_dir" && as_dir=.
19078 + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
19079 +done
19080 +IFS=$as_save_IFS
19081 +
19082 + ;;
19083 +esac
19084 +# We did not find ourselves, most probably we were run as `sh COMMAND'
19085 +# in which case we are not to be found in the path.
19086 +if test "x$as_myself" = x; then
19087 + as_myself=$0
19088 +fi
19089 +if test ! -f "$as_myself"; then
19090 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
19091 + { (exit 1); exit 1; }
19092 +fi
19093 +
19094 +# Work around bugs in pre-3.0 UWIN ksh.
19095 +for as_var in ENV MAIL MAILPATH
19096 +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
19097 +done
19098 +PS1='$ '
19099 +PS2='> '
19100 +PS4='+ '
19101 +
19102 +# NLS nuisances.
19103 +for as_var in \
19104 + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
19105 + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
19106 + LC_TELEPHONE LC_TIME
19107 +do
19108 + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
19109 + eval $as_var=C; export $as_var
19110 + else
19111 + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
19112 + fi
19113 +done
19114 +
19115 +# Required to use basename.
19116 +if expr a : '\(a\)' >/dev/null 2>&1 &&
19117 + test "X`expr 00001 : '.*\(...\)'`" = X001; then
19118 + as_expr=expr
19119 +else
19120 + as_expr=false
19121 +fi
19122 +
19123 +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
19124 + as_basename=basename
19125 +else
19126 + as_basename=false
19127 +fi
19128 +
19129 +
19130 +# Name of the executable.
19131 +as_me=`$as_basename -- "$0" ||
19132 +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
19133 + X"$0" : 'X\(//\)$' \| \
19134 + X"$0" : 'X\(/\)' \| . 2>/dev/null ||
19135 +echo X/"$0" |
19136 + sed '/^.*\/\([^/][^/]*\)\/*$/{
19137 + s//\1/
19138 + q
19139 + }
19140 + /^X\/\(\/\/\)$/{
19141 + s//\1/
19142 + q
19143 + }
19144 + /^X\/\(\/\).*/{
19145 + s//\1/
19146 + q
19147 + }
19148 + s/.*/./; q'`
19149 +
19150 +# CDPATH.
19151 +$as_unset CDPATH
19152 +
19153 +
19154 +
19155 + as_lineno_1=$LINENO
19156 + as_lineno_2=$LINENO
19157 + test "x$as_lineno_1" != "x$as_lineno_2" &&
19158 + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
19159 +
19160 + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
19161 + # uniformly replaced by the line number. The first 'sed' inserts a
19162 + # line-number line after each line using $LINENO; the second 'sed'
19163 + # does the real work. The second script uses 'N' to pair each
19164 + # line-number line with the line containing $LINENO, and appends
19165 + # trailing '-' during substitution so that $LINENO is not a special
19166 + # case at line end.
19167 + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
19168 + # scripts with optimization help from Paolo Bonzini. Blame Lee
19169 + # E. McMahon (1931-1989) for sed's syntax. :-)
19170 + sed -n '
19171 + p
19172 + /[$]LINENO/=
19173 + ' <$as_myself |
19174 + sed '
19175 + s/[$]LINENO.*/&-/
19176 + t lineno
19177 + b
19178 + :lineno
19179 + N
19180 + :loop
19181 + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
19182 + t loop
19183 + s/-\n.*//
19184 + ' >$as_me.lineno &&
19185 + chmod +x "$as_me.lineno" ||
19186 + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
19187 + { (exit 1); exit 1; }; }
19188 +
19189 + # Don't try to exec as it changes $[0], causing all sort of problems
19190 + # (the dirname of $[0] is not the place where we might find the
19191 + # original and so on. Autoconf is especially sensitive to this).
19192 + . "./$as_me.lineno"
19193 + # Exit status is that of the last command.
19194 + exit
19195 +}
19196 +
19197 +
19198 +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
19199 + as_dirname=dirname
19200 +else
19201 + as_dirname=false
19202 +fi
19203 +
19204 +ECHO_C= ECHO_N= ECHO_T=
19205 +case `echo -n x` in
19206 +-n*)
19207 + case `echo 'x\c'` in
19208 + *c*) ECHO_T=' ';; # ECHO_T is single tab character.
19209 + *) ECHO_C='\c';;
19210 + esac;;
19211 +*)
19212 + ECHO_N='-n';;
19213 +esac
19214 +
19215 +if expr a : '\(a\)' >/dev/null 2>&1 &&
19216 + test "X`expr 00001 : '.*\(...\)'`" = X001; then
19217 + as_expr=expr
19218 +else
19219 + as_expr=false
19220 +fi
19221 +
19222 +rm -f conf$$ conf$$.exe conf$$.file
19223 +if test -d conf$$.dir; then
19224 + rm -f conf$$.dir/conf$$.file
19225 +else
19226 + rm -f conf$$.dir
19227 + mkdir conf$$.dir
19228 +fi
19229 +echo >conf$$.file
19230 +if ln -s conf$$.file conf$$ 2>/dev/null; then
19231 + as_ln_s='ln -s'
19232 + # ... but there are two gotchas:
19233 + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
19234 + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
19235 + # In both cases, we have to default to `cp -p'.
19236 + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
19237 + as_ln_s='cp -p'
19238 +elif ln conf$$.file conf$$ 2>/dev/null; then
19239 + as_ln_s=ln
19240 +else
19241 + as_ln_s='cp -p'
19242 +fi
19243 +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
19244 +rmdir conf$$.dir 2>/dev/null
19245 +
19246 +if mkdir -p . 2>/dev/null; then
19247 + as_mkdir_p=:
19248 +else
19249 + test -d ./-p && rmdir ./-p
19250 + as_mkdir_p=false
19251 +fi
19252 +
19253 +if test -x / >/dev/null 2>&1; then
19254 + as_test_x='test -x'
19255 +else
19256 + if ls -dL / >/dev/null 2>&1; then
19257 + as_ls_L_option=L
19258 + else
19259 + as_ls_L_option=
19260 + fi
19261 + as_test_x='
19262 + eval sh -c '\''
19263 + if test -d "$1"; then
19264 + test -d "$1/.";
19265 + else
19266 + case $1 in
19267 + -*)set "./$1";;
19268 + esac;
19269 + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
19270 + ???[sx]*):;;*)false;;esac;fi
19271 + '\'' sh
19272 + '
19273 +fi
19274 +as_executable_p=$as_test_x
19275 +
19276 +# Sed expression to map a string onto a valid CPP name.
19277 +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
19278 +
19279 +# Sed expression to map a string onto a valid variable name.
19280 +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
19281 +
19282 +
19283 +exec 6>&1
19284 +
19285 +# Save the log message, to keep $[0] and so on meaningful, and to
19286 +# report actual input values of CONFIG_FILES etc. instead of their
19287 +# values after options handling.
19288 +ac_log="
19289 +This file was extended by convert $as_me 3.0.4, which was
19290 +generated by GNU Autoconf 2.61. Invocation command line was
19291 +
19292 + CONFIG_FILES = $CONFIG_FILES
19293 + CONFIG_HEADERS = $CONFIG_HEADERS
19294 + CONFIG_LINKS = $CONFIG_LINKS
19295 + CONFIG_COMMANDS = $CONFIG_COMMANDS
19296 + $ $0 $@
19297 +
19298 +on `(hostname || uname -n) 2>/dev/null | sed 1q`
19299 +"
19300 +
19301 +_ACEOF
19302 +
19303 +cat >>$CONFIG_STATUS <<_ACEOF
19304 +# Files that config.status was made for.
19305 +config_files="$ac_config_files"
19306 +config_headers="$ac_config_headers"
19307 +config_commands="$ac_config_commands"
19308 +
19309 +_ACEOF
19310 +
19311 +cat >>$CONFIG_STATUS <<\_ACEOF
19312 +ac_cs_usage="\
19313 +\`$as_me' instantiates files from templates according to the
19314 +current configuration.
19315 +
19316 +Usage: $0 [OPTIONS] [FILE]...
19317 +
19318 + -h, --help print this help, then exit
19319 + -V, --version print version number and configuration settings, then exit
19320 + -q, --quiet do not print progress messages
19321 + -d, --debug don't remove temporary files
19322 + --recheck update $as_me by reconfiguring in the same conditions
19323 + --file=FILE[:TEMPLATE]
19324 + instantiate the configuration file FILE
19325 + --header=FILE[:TEMPLATE]
19326 + instantiate the configuration header FILE
19327 +
19328 +Configuration files:
19329 +$config_files
19330 +
19331 +Configuration headers:
19332 +$config_headers
19333 +
19334 +Configuration commands:
19335 +$config_commands
19336 +
19337 +Report bugs to <bug-autoconf@gnu.org>."
19338 +
19339 +_ACEOF
19340 +cat >>$CONFIG_STATUS <<_ACEOF
19341 +ac_cs_version="\\
19342 +convert config.status 3.0.4
19343 +configured by $0, generated by GNU Autoconf 2.61,
19344 + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
19345 +
19346 +Copyright (C) 2006 Free Software Foundation, Inc.
19347 +This config.status script is free software; the Free Software Foundation
19348 +gives unlimited permission to copy, distribute and modify it."
19349 +
19350 +ac_pwd='$ac_pwd'
19351 +srcdir='$srcdir'
19352 +INSTALL='$INSTALL'
19353 +_ACEOF
19354 +
19355 +cat >>$CONFIG_STATUS <<\_ACEOF
19356 +# If no file are specified by the user, then we need to provide default
19357 +# value. By we need to know if files were specified by the user.
19358 +ac_need_defaults=:
19359 +while test $# != 0
19360 +do
19361 + case $1 in
19362 + --*=*)
19363 + ac_option=`expr "X$1" : 'X\([^=]*\)='`
19364 + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
19365 + ac_shift=:
19366 + ;;
19367 + *)
19368 + ac_option=$1
19369 + ac_optarg=$2
19370 + ac_shift=shift
19371 + ;;
19372 + esac
19373 +
19374 + case $ac_option in
19375 + # Handling of the options.
19376 + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
19377 + ac_cs_recheck=: ;;
19378 + --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
19379 + echo "$ac_cs_version"; exit ;;
19380 + --debug | --debu | --deb | --de | --d | -d )
19381 + debug=: ;;
19382 + --file | --fil | --fi | --f )
19383 + $ac_shift
19384 + CONFIG_FILES="$CONFIG_FILES $ac_optarg"
19385 + ac_need_defaults=false;;
19386 + --header | --heade | --head | --hea )
19387 + $ac_shift
19388 + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
19389 + ac_need_defaults=false;;
19390 + --he | --h)
19391 + # Conflict between --help and --header
19392 + { echo "$as_me: error: ambiguous option: $1
19393 +Try \`$0 --help' for more information." >&2
19394 + { (exit 1); exit 1; }; };;
19395 + --help | --hel | -h )
19396 + echo "$ac_cs_usage"; exit ;;
19397 + -q | -quiet | --quiet | --quie | --qui | --qu | --q \
19398 + | -silent | --silent | --silen | --sile | --sil | --si | --s)
19399 + ac_cs_silent=: ;;
19400 +
19401 + # This is an error.
19402 + -*) { echo "$as_me: error: unrecognized option: $1
19403 +Try \`$0 --help' for more information." >&2
19404 + { (exit 1); exit 1; }; } ;;
19405 +
19406 + *) ac_config_targets="$ac_config_targets $1"
19407 + ac_need_defaults=false ;;
19408 +
19409 + esac
19410 + shift
19411 +done
19412 +
19413 +ac_configure_extra_args=
19414 +
19415 +if $ac_cs_silent; then
19416 + exec 6>/dev/null
19417 + ac_configure_extra_args="$ac_configure_extra_args --silent"
19418 +fi
19419 +
19420 +_ACEOF
19421 +cat >>$CONFIG_STATUS <<_ACEOF
19422 +if \$ac_cs_recheck; then
19423 + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
19424 + CONFIG_SHELL=$SHELL
19425 + export CONFIG_SHELL
19426 + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
19427 +fi
19428 +
19429 +_ACEOF
19430 +cat >>$CONFIG_STATUS <<\_ACEOF
19431 +exec 5>>config.log
19432 +{
19433 + echo
19434 + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
19435 +## Running $as_me. ##
19436 +_ASBOX
19437 + echo "$ac_log"
19438 +} >&5
19439 +
19440 +_ACEOF
19441 +cat >>$CONFIG_STATUS <<_ACEOF
19442 +#
19443 +# INIT-COMMANDS
19444 +#
19445 +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
19446 +
19447 +_ACEOF
19448 +
19449 +cat >>$CONFIG_STATUS <<\_ACEOF
19450 +
19451 +# Handling of arguments.
19452 +for ac_config_target in $ac_config_targets
19453 +do
19454 + case $ac_config_target in
19455 + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
19456 + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
19457 + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
19458 +
19459 + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
19460 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
19461 + { (exit 1); exit 1; }; };;
19462 + esac
19463 +done
19464 +
19465 +
19466 +# If the user did not use the arguments to specify the items to instantiate,
19467 +# then the envvar interface is used. Set only those that are not.
19468 +# We use the long form for the default assignment because of an extremely
19469 +# bizarre bug on SunOS 4.1.3.
19470 +if $ac_need_defaults; then
19471 + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
19472 + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
19473 + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
19474 +fi
19475 +
19476 +# Have a temporary directory for convenience. Make it in the build tree
19477 +# simply because there is no reason against having it here, and in addition,
19478 +# creating and moving files from /tmp can sometimes cause problems.
19479 +# Hook for its removal unless debugging.
19480 +# Note that there is a small window in which the directory will not be cleaned:
19481 +# after its creation but before its name has been assigned to `$tmp'.
19482 +$debug ||
19483 +{
19484 + tmp=
19485 + trap 'exit_status=$?
19486 + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
19487 +' 0
19488 + trap '{ (exit 1); exit 1; }' 1 2 13 15
19489 +}
19490 +# Create a (secure) tmp directory for tmp files.
19491 +
19492 +{
19493 + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
19494 + test -n "$tmp" && test -d "$tmp"
19495 +} ||
19496 +{
19497 + tmp=./conf$$-$RANDOM
19498 + (umask 077 && mkdir "$tmp")
19499 +} ||
19500 +{
19501 + echo "$me: cannot create a temporary directory in ." >&2
19502 + { (exit 1); exit 1; }
19503 +}
19504 +
19505 +#
19506 +# Set up the sed scripts for CONFIG_FILES section.
19507 +#
19508 +
19509 +# No need to generate the scripts if there are no CONFIG_FILES.
19510 +# This happens for instance when ./config.status config.h
19511 +if test -n "$CONFIG_FILES"; then
19512 +
19513 +_ACEOF
19514 +
19515 +
19516 +
19517 +ac_delim='%!_!# '
19518 +for ac_last_try in false false false false false :; do
19519 + cat >conf$$subs.sed <<_ACEOF
19520 +SHELL!$SHELL$ac_delim
19521 +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
19522 +PACKAGE_NAME!$PACKAGE_NAME$ac_delim
19523 +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
19524 +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
19525 +PACKAGE_STRING!$PACKAGE_STRING$ac_delim
19526 +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
19527 +exec_prefix!$exec_prefix$ac_delim
19528 +prefix!$prefix$ac_delim
19529 +program_transform_name!$program_transform_name$ac_delim
19530 +bindir!$bindir$ac_delim
19531 +sbindir!$sbindir$ac_delim
19532 +libexecdir!$libexecdir$ac_delim
19533 +datarootdir!$datarootdir$ac_delim
19534 +datadir!$datadir$ac_delim
19535 +sysconfdir!$sysconfdir$ac_delim
19536 +sharedstatedir!$sharedstatedir$ac_delim
19537 +localstatedir!$localstatedir$ac_delim
19538 +includedir!$includedir$ac_delim
19539 +oldincludedir!$oldincludedir$ac_delim
19540 +docdir!$docdir$ac_delim
19541 +infodir!$infodir$ac_delim
19542 +htmldir!$htmldir$ac_delim
19543 +dvidir!$dvidir$ac_delim
19544 +pdfdir!$pdfdir$ac_delim
19545 +psdir!$psdir$ac_delim
19546 +libdir!$libdir$ac_delim
19547 +localedir!$localedir$ac_delim
19548 +mandir!$mandir$ac_delim
19549 +DEFS!$DEFS$ac_delim
19550 +ECHO_C!$ECHO_C$ac_delim
19551 +ECHO_N!$ECHO_N$ac_delim
19552 +ECHO_T!$ECHO_T$ac_delim
19553 +LIBS!$LIBS$ac_delim
19554 +build_alias!$build_alias$ac_delim
19555 +host_alias!$host_alias$ac_delim
19556 +target_alias!$target_alias$ac_delim
19557 +build!$build$ac_delim
19558 +build_cpu!$build_cpu$ac_delim
19559 +build_vendor!$build_vendor$ac_delim
19560 +build_os!$build_os$ac_delim
19561 +host!$host$ac_delim
19562 +host_cpu!$host_cpu$ac_delim
19563 +host_vendor!$host_vendor$ac_delim
19564 +host_os!$host_os$ac_delim
19565 +target!$target$ac_delim
19566 +target_cpu!$target_cpu$ac_delim
19567 +target_vendor!$target_vendor$ac_delim
19568 +target_os!$target_os$ac_delim
19569 +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
19570 +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
19571 +INSTALL_DATA!$INSTALL_DATA$ac_delim
19572 +CYGPATH_W!$CYGPATH_W$ac_delim
19573 +PACKAGE!$PACKAGE$ac_delim
19574 +VERSION!$VERSION$ac_delim
19575 +ACLOCAL!$ACLOCAL$ac_delim
19576 +AUTOCONF!$AUTOCONF$ac_delim
19577 +AUTOMAKE!$AUTOMAKE$ac_delim
19578 +AUTOHEADER!$AUTOHEADER$ac_delim
19579 +MAKEINFO!$MAKEINFO$ac_delim
19580 +install_sh!$install_sh$ac_delim
19581 +STRIP!$STRIP$ac_delim
19582 +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
19583 +mkdir_p!$mkdir_p$ac_delim
19584 +AWK!$AWK$ac_delim
19585 +SET_MAKE!$SET_MAKE$ac_delim
19586 +am__leading_dot!$am__leading_dot$ac_delim
19587 +AMTAR!$AMTAR$ac_delim
19588 +am__tar!$am__tar$ac_delim
19589 +am__untar!$am__untar$ac_delim
19590 +CC!$CC$ac_delim
19591 +CFLAGS!$CFLAGS$ac_delim
19592 +LDFLAGS!$LDFLAGS$ac_delim
19593 +CPPFLAGS!$CPPFLAGS$ac_delim
19594 +ac_ct_CC!$ac_ct_CC$ac_delim
19595 +EXEEXT!$EXEEXT$ac_delim
19596 +OBJEXT!$OBJEXT$ac_delim
19597 +DEPDIR!$DEPDIR$ac_delim
19598 +am__include!$am__include$ac_delim
19599 +am__quote!$am__quote$ac_delim
19600 +AMDEP_TRUE!$AMDEP_TRUE$ac_delim
19601 +AMDEP_FALSE!$AMDEP_FALSE$ac_delim
19602 +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
19603 +CCDEPMODE!$CCDEPMODE$ac_delim
19604 +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
19605 +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
19606 +CPP!$CPP$ac_delim
19607 +GREP!$GREP$ac_delim
19608 +EGREP!$EGREP$ac_delim
19609 +ALLOCA!$ALLOCA$ac_delim
19610 +PKGVERSION!$PKGVERSION$ac_delim
19611 +REPORT_BUGS_TO!$REPORT_BUGS_TO$ac_delim
19612 +REPORT_BUGS_TEXI!$REPORT_BUGS_TEXI$ac_delim
19613 +MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
19614 +MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
19615 +MAINT!$MAINT$ac_delim
19616 +LIBOBJS!$LIBOBJS$ac_delim
19617 +_ACEOF
19618 +
19619 + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
19620 + break
19621 + elif $ac_last_try; then
19622 + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
19623 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
19624 + { (exit 1); exit 1; }; }
19625 + else
19626 + ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
19627 + fi
19628 +done
19629 +
19630 +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
19631 +if test -n "$ac_eof"; then
19632 + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
19633 + ac_eof=`expr $ac_eof + 1`
19634 +fi
19635 +
19636 +cat >>$CONFIG_STATUS <<_ACEOF
19637 +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
19638 +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19639 +_ACEOF
19640 +sed '
19641 +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
19642 +s/^/s,@/; s/!/@,|#_!!_#|/
19643 +:n
19644 +t n
19645 +s/'"$ac_delim"'$/,g/; t
19646 +s/$/\\/; p
19647 +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
19648 +' >>$CONFIG_STATUS <conf$$subs.sed
19649 +rm -f conf$$subs.sed
19650 +cat >>$CONFIG_STATUS <<_ACEOF
19651 +CEOF$ac_eof
19652 +_ACEOF
19653 +
19654 +
19655 +ac_delim='%!_!# '
19656 +for ac_last_try in false false false false false :; do
19657 + cat >conf$$subs.sed <<_ACEOF
19658 +LTLIBOBJS!$LTLIBOBJS$ac_delim
19659 +_ACEOF
19660 +
19661 + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 1; then
19662 + break
19663 + elif $ac_last_try; then
19664 + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
19665 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
19666 + { (exit 1); exit 1; }; }
19667 + else
19668 + ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
19669 + fi
19670 +done
19671 +
19672 +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
19673 +if test -n "$ac_eof"; then
19674 + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
19675 + ac_eof=`expr $ac_eof + 1`
19676 +fi
19677 +
19678 +cat >>$CONFIG_STATUS <<_ACEOF
19679 +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
19680 +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
19681 +_ACEOF
19682 +sed '
19683 +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
19684 +s/^/s,@/; s/!/@,|#_!!_#|/
19685 +:n
19686 +t n
19687 +s/'"$ac_delim"'$/,g/; t
19688 +s/$/\\/; p
19689 +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
19690 +' >>$CONFIG_STATUS <conf$$subs.sed
19691 +rm -f conf$$subs.sed
19692 +cat >>$CONFIG_STATUS <<_ACEOF
19693 +:end
19694 +s/|#_!!_#|//g
19695 +CEOF$ac_eof
19696 +_ACEOF
19697 +
19698 +
19699 +# VPATH may cause trouble with some makes, so we remove $(srcdir),
19700 +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
19701 +# trailing colons and then remove the whole line if VPATH becomes empty
19702 +# (actually we leave an empty line to preserve line numbers).
19703 +if test "x$srcdir" = x.; then
19704 + ac_vpsub='/^[ ]*VPATH[ ]*=/{
19705 +s/:*\$(srcdir):*/:/
19706 +s/:*\${srcdir}:*/:/
19707 +s/:*@srcdir@:*/:/
19708 +s/^\([^=]*=[ ]*\):*/\1/
19709 +s/:*$//
19710 +s/^[^=]*=[ ]*$//
19711 +}'
19712 +fi
19713 +
19714 +cat >>$CONFIG_STATUS <<\_ACEOF
19715 +fi # test -n "$CONFIG_FILES"
19716 +
19717 +
19718 +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS
19719 +do
19720 + case $ac_tag in
19721 + :[FHLC]) ac_mode=$ac_tag; continue;;
19722 + esac
19723 + case $ac_mode$ac_tag in
19724 + :[FHL]*:*);;
19725 + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
19726 +echo "$as_me: error: Invalid tag $ac_tag." >&2;}
19727 + { (exit 1); exit 1; }; };;
19728 + :[FH]-) ac_tag=-:-;;
19729 + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
19730 + esac
19731 + ac_save_IFS=$IFS
19732 + IFS=:
19733 + set x $ac_tag
19734 + IFS=$ac_save_IFS
19735 + shift
19736 + ac_file=$1
19737 + shift
19738 +
19739 + case $ac_mode in
19740 + :L) ac_source=$1;;
19741 + :[FH])
19742 + ac_file_inputs=
19743 + for ac_f
19744 + do
19745 + case $ac_f in
19746 + -) ac_f="$tmp/stdin";;
19747 + *) # Look for the file first in the build tree, then in the source tree
19748 + # (if the path is not absolute). The absolute path cannot be DOS-style,
19749 + # because $ac_f cannot contain `:'.
19750 + test -f "$ac_f" ||
19751 + case $ac_f in
19752 + [\\/$]*) false;;
19753 + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
19754 + esac ||
19755 + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
19756 +echo "$as_me: error: cannot find input file: $ac_f" >&2;}
19757 + { (exit 1); exit 1; }; };;
19758 + esac
19759 + ac_file_inputs="$ac_file_inputs $ac_f"
19760 + done
19761 +
19762 + # Let's still pretend it is `configure' which instantiates (i.e., don't
19763 + # use $as_me), people would be surprised to read:
19764 + # /* config.h. Generated by config.status. */
19765 + configure_input="Generated from "`IFS=:
19766 + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
19767 + if test x"$ac_file" != x-; then
19768 + configure_input="$ac_file. $configure_input"
19769 + { echo "$as_me:$LINENO: creating $ac_file" >&5
19770 +echo "$as_me: creating $ac_file" >&6;}
19771 + fi
19772 +
19773 + case $ac_tag in
19774 + *:-:* | *:-) cat >"$tmp/stdin";;
19775 + esac
19776 + ;;
19777 + esac
19778 +
19779 + ac_dir=`$as_dirname -- "$ac_file" ||
19780 +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19781 + X"$ac_file" : 'X\(//\)[^/]' \| \
19782 + X"$ac_file" : 'X\(//\)$' \| \
19783 + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
19784 +echo X"$ac_file" |
19785 + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
19786 + s//\1/
19787 + q
19788 + }
19789 + /^X\(\/\/\)[^/].*/{
19790 + s//\1/
19791 + q
19792 + }
19793 + /^X\(\/\/\)$/{
19794 + s//\1/
19795 + q
19796 + }
19797 + /^X\(\/\).*/{
19798 + s//\1/
19799 + q
19800 + }
19801 + s/.*/./; q'`
19802 + { as_dir="$ac_dir"
19803 + case $as_dir in #(
19804 + -*) as_dir=./$as_dir;;
19805 + esac
19806 + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
19807 + as_dirs=
19808 + while :; do
19809 + case $as_dir in #(
19810 + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
19811 + *) as_qdir=$as_dir;;
19812 + esac
19813 + as_dirs="'$as_qdir' $as_dirs"
19814 + as_dir=`$as_dirname -- "$as_dir" ||
19815 +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
19816 + X"$as_dir" : 'X\(//\)[^/]' \| \
19817 + X"$as_dir" : 'X\(//\)$' \| \
19818 + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
19819 +echo X"$as_dir" |
19820 + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
19821 + s//\1/
19822 + q
19823 + }
19824 + /^X\(\/\/\)[^/].*/{
19825 + s//\1/
19826 + q
19827 + }
19828 + /^X\(\/\/\)$/{
19829 + s//\1/
19830 + q
19831 + }
19832 + /^X\(\/\).*/{
19833 + s//\1/
19834 + q
19835 + }
19836 + s/.*/./; q'`
19837 + test -d "$as_dir" && break
19838 + done
19839 + test -z "$as_dirs" || eval "mkdir $as_dirs"
19840 + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
19841 +echo "$as_me: error: cannot create directory $as_dir" >&2;}
19842 + { (exit 1); exit 1; }; }; }
19843 + ac_builddir=.
19844 +
19845 +case "$ac_dir" in
19846 +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
19847 +*)
19848 + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
19849 + # A ".." for each directory in $ac_dir_suffix.
19850 + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
19851 + case $ac_top_builddir_sub in
19852 + "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
19853 + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
19854 + esac ;;
19855 +esac
19856 +ac_abs_top_builddir=$ac_pwd
19857 +ac_abs_builddir=$ac_pwd$ac_dir_suffix
19858 +# for backward compatibility:
19859 +ac_top_builddir=$ac_top_build_prefix
19860 +
19861 +case $srcdir in
19862 + .) # We are building in place.
19863 + ac_srcdir=.
19864 + ac_top_srcdir=$ac_top_builddir_sub
19865 + ac_abs_top_srcdir=$ac_pwd ;;
19866 + [\\/]* | ?:[\\/]* ) # Absolute name.
19867 + ac_srcdir=$srcdir$ac_dir_suffix;
19868 + ac_top_srcdir=$srcdir
19869 + ac_abs_top_srcdir=$srcdir ;;
19870 + *) # Relative name.
19871 + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
19872 + ac_top_srcdir=$ac_top_build_prefix$srcdir
19873 + ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
19874 +esac
19875 +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
19876 +
19877 +
19878 + case $ac_mode in
19879 + :F)
19880 + #
19881 + # CONFIG_FILE
19882 + #
19883 +
19884 + case $INSTALL in
19885 + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
19886 + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
19887 + esac
19888 +_ACEOF
19889 +
19890 +cat >>$CONFIG_STATUS <<\_ACEOF
19891 +# If the template does not know about datarootdir, expand it.
19892 +# FIXME: This hack should be removed a few years after 2.60.
19893 +ac_datarootdir_hack=; ac_datarootdir_seen=
19894 +
19895 +case `sed -n '/datarootdir/ {
19896 + p
19897 + q
19898 +}
19899 +/@datadir@/p
19900 +/@docdir@/p
19901 +/@infodir@/p
19902 +/@localedir@/p
19903 +/@mandir@/p
19904 +' $ac_file_inputs` in
19905 +*datarootdir*) ac_datarootdir_seen=yes;;
19906 +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
19907 + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
19908 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
19909 +_ACEOF
19910 +cat >>$CONFIG_STATUS <<_ACEOF
19911 + ac_datarootdir_hack='
19912 + s&@datadir@&$datadir&g
19913 + s&@docdir@&$docdir&g
19914 + s&@infodir@&$infodir&g
19915 + s&@localedir@&$localedir&g
19916 + s&@mandir@&$mandir&g
19917 + s&\\\${datarootdir}&$datarootdir&g' ;;
19918 +esac
19919 +_ACEOF
19920 +
19921 +# Neutralize VPATH when `$srcdir' = `.'.
19922 +# Shell code in configure.ac might set extrasub.
19923 +# FIXME: do we really want to maintain this feature?
19924 +cat >>$CONFIG_STATUS <<_ACEOF
19925 + sed "$ac_vpsub
19926 +$extrasub
19927 +_ACEOF
19928 +cat >>$CONFIG_STATUS <<\_ACEOF
19929 +:t
19930 +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
19931 +s&@configure_input@&$configure_input&;t t
19932 +s&@top_builddir@&$ac_top_builddir_sub&;t t
19933 +s&@srcdir@&$ac_srcdir&;t t
19934 +s&@abs_srcdir@&$ac_abs_srcdir&;t t
19935 +s&@top_srcdir@&$ac_top_srcdir&;t t
19936 +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
19937 +s&@builddir@&$ac_builddir&;t t
19938 +s&@abs_builddir@&$ac_abs_builddir&;t t
19939 +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
19940 +s&@INSTALL@&$ac_INSTALL&;t t
19941 +$ac_datarootdir_hack
19942 +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
19943 +
19944 +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
19945 + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
19946 + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
19947 + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
19948 +which seems to be undefined. Please make sure it is defined." >&5
19949 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
19950 +which seems to be undefined. Please make sure it is defined." >&2;}
19951 +
19952 + rm -f "$tmp/stdin"
19953 + case $ac_file in
19954 + -) cat "$tmp/out"; rm -f "$tmp/out";;
19955 + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
19956 + esac
19957 + ;;
19958 + :H)
19959 + #
19960 + # CONFIG_HEADER
19961 + #
19962 +_ACEOF
19963 +
19964 +# Transform confdefs.h into a sed script `conftest.defines', that
19965 +# substitutes the proper values into config.h.in to produce config.h.
19966 +rm -f conftest.defines conftest.tail
19967 +# First, append a space to every undef/define line, to ease matching.
19968 +echo 's/$/ /' >conftest.defines
19969 +# Then, protect against being on the right side of a sed subst, or in
19970 +# an unquoted here document, in config.status. If some macros were
19971 +# called several times there might be several #defines for the same
19972 +# symbol, which is useless. But do not sort them, since the last
19973 +# AC_DEFINE must be honored.
19974 +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
19975 +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
19976 +# NAME is the cpp macro being defined, VALUE is the value it is being given.
19977 +# PARAMS is the parameter list in the macro definition--in most cases, it's
19978 +# just an empty string.
19979 +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
19980 +ac_dB='\\)[ (].*,\\1define\\2'
19981 +ac_dC=' '
19982 +ac_dD=' ,'
19983 +
19984 +uniq confdefs.h |
19985 + sed -n '
19986 + t rset
19987 + :rset
19988 + s/^[ ]*#[ ]*define[ ][ ]*//
19989 + t ok
19990 + d
19991 + :ok
19992 + s/[\\&,]/\\&/g
19993 + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
19994 + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
19995 + ' >>conftest.defines
19996 +
19997 +# Remove the space that was appended to ease matching.
19998 +# Then replace #undef with comments. This is necessary, for
19999 +# example, in the case of _POSIX_SOURCE, which is predefined and required
20000 +# on some systems where configure will not decide to define it.
20001 +# (The regexp can be short, since the line contains either #define or #undef.)
20002 +echo 's/ $//
20003 +s,^[ #]*u.*,/* & */,' >>conftest.defines
20004 +
20005 +# Break up conftest.defines:
20006 +ac_max_sed_lines=50
20007 +
20008 +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
20009 +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
20010 +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
20011 +# et cetera.
20012 +ac_in='$ac_file_inputs'
20013 +ac_out='"$tmp/out1"'
20014 +ac_nxt='"$tmp/out2"'
20015 +
20016 +while :
20017 +do
20018 + # Write a here document:
20019 + cat >>$CONFIG_STATUS <<_ACEOF
20020 + # First, check the format of the line:
20021 + cat >"\$tmp/defines.sed" <<\\CEOF
20022 +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
20023 +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
20024 +b
20025 +:def
20026 +_ACEOF
20027 + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
20028 + echo 'CEOF
20029 + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
20030 + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
20031 + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
20032 + grep . conftest.tail >/dev/null || break
20033 + rm -f conftest.defines
20034 + mv conftest.tail conftest.defines
20035 +done
20036 +rm -f conftest.defines conftest.tail
20037 +
20038 +echo "ac_result=$ac_in" >>$CONFIG_STATUS
20039 +cat >>$CONFIG_STATUS <<\_ACEOF
20040 + if test x"$ac_file" != x-; then
20041 + echo "/* $configure_input */" >"$tmp/config.h"
20042 + cat "$ac_result" >>"$tmp/config.h"
20043 + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
20044 + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
20045 +echo "$as_me: $ac_file is unchanged" >&6;}
20046 + else
20047 + rm -f $ac_file
20048 + mv "$tmp/config.h" $ac_file
20049 + fi
20050 + else
20051 + echo "/* $configure_input */"
20052 + cat "$ac_result"
20053 + fi
20054 + rm -f "$tmp/out12"
20055 +# Compute $ac_file's index in $config_headers.
20056 +_am_stamp_count=1
20057 +for _am_header in $config_headers :; do
20058 + case $_am_header in
20059 + $ac_file | $ac_file:* )
20060 + break ;;
20061 + * )
20062 + _am_stamp_count=`expr $_am_stamp_count + 1` ;;
20063 + esac
20064 +done
20065 +echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
20066 +$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20067 + X$ac_file : 'X\(//\)[^/]' \| \
20068 + X$ac_file : 'X\(//\)$' \| \
20069 + X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
20070 +echo X$ac_file |
20071 + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
20072 + s//\1/
20073 + q
20074 + }
20075 + /^X\(\/\/\)[^/].*/{
20076 + s//\1/
20077 + q
20078 + }
20079 + /^X\(\/\/\)$/{
20080 + s//\1/
20081 + q
20082 + }
20083 + /^X\(\/\).*/{
20084 + s//\1/
20085 + q
20086 + }
20087 + s/.*/./; q'`/stamp-h$_am_stamp_count
20088 + ;;
20089 +
20090 + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
20091 +echo "$as_me: executing $ac_file commands" >&6;}
20092 + ;;
20093 + esac
20094 +
20095 +
20096 + case $ac_file$ac_mode in
20097 + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
20098 + # Strip MF so we end up with the name of the file.
20099 + mf=`echo "$mf" | sed -e 's/:.*$//'`
20100 + # Check whether this is an Automake generated Makefile or not.
20101 + # We used to match only the files named `Makefile.in', but
20102 + # some people rename them; so instead we look at the file content.
20103 + # Grep'ing the first line is not enough: some people post-process
20104 + # each Makefile.in and add a new line on top of each file to say so.
20105 + # So let's grep whole file.
20106 + if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
20107 + dirpart=`$as_dirname -- "$mf" ||
20108 +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20109 + X"$mf" : 'X\(//\)[^/]' \| \
20110 + X"$mf" : 'X\(//\)$' \| \
20111 + X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
20112 +echo X"$mf" |
20113 + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
20114 + s//\1/
20115 + q
20116 + }
20117 + /^X\(\/\/\)[^/].*/{
20118 + s//\1/
20119 + q
20120 + }
20121 + /^X\(\/\/\)$/{
20122 + s//\1/
20123 + q
20124 + }
20125 + /^X\(\/\).*/{
20126 + s//\1/
20127 + q
20128 + }
20129 + s/.*/./; q'`
20130 + else
20131 + continue
20132 + fi
20133 + # Extract the definition of DEPDIR, am__include, and am__quote
20134 + # from the Makefile without running `make'.
20135 + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
20136 + test -z "$DEPDIR" && continue
20137 + am__include=`sed -n 's/^am__include = //p' < "$mf"`
20138 + test -z "am__include" && continue
20139 + am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
20140 + # When using ansi2knr, U may be empty or an underscore; expand it
20141 + U=`sed -n 's/^U = //p' < "$mf"`
20142 + # Find all dependency output files, they are included files with
20143 + # $(DEPDIR) in their names. We invoke sed twice because it is the
20144 + # simplest approach to changing $(DEPDIR) to its actual value in the
20145 + # expansion.
20146 + for file in `sed -n "
20147 + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
20148 + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
20149 + # Make sure the directory exists.
20150 + test -f "$dirpart/$file" && continue
20151 + fdir=`$as_dirname -- "$file" ||
20152 +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20153 + X"$file" : 'X\(//\)[^/]' \| \
20154 + X"$file" : 'X\(//\)$' \| \
20155 + X"$file" : 'X\(/\)' \| . 2>/dev/null ||
20156 +echo X"$file" |
20157 + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
20158 + s//\1/
20159 + q
20160 + }
20161 + /^X\(\/\/\)[^/].*/{
20162 + s//\1/
20163 + q
20164 + }
20165 + /^X\(\/\/\)$/{
20166 + s//\1/
20167 + q
20168 + }
20169 + /^X\(\/\).*/{
20170 + s//\1/
20171 + q
20172 + }
20173 + s/.*/./; q'`
20174 + { as_dir=$dirpart/$fdir
20175 + case $as_dir in #(
20176 + -*) as_dir=./$as_dir;;
20177 + esac
20178 + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
20179 + as_dirs=
20180 + while :; do
20181 + case $as_dir in #(
20182 + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
20183 + *) as_qdir=$as_dir;;
20184 + esac
20185 + as_dirs="'$as_qdir' $as_dirs"
20186 + as_dir=`$as_dirname -- "$as_dir" ||
20187 +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20188 + X"$as_dir" : 'X\(//\)[^/]' \| \
20189 + X"$as_dir" : 'X\(//\)$' \| \
20190 + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
20191 +echo X"$as_dir" |
20192 + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
20193 + s//\1/
20194 + q
20195 + }
20196 + /^X\(\/\/\)[^/].*/{
20197 + s//\1/
20198 + q
20199 + }
20200 + /^X\(\/\/\)$/{
20201 + s//\1/
20202 + q
20203 + }
20204 + /^X\(\/\).*/{
20205 + s//\1/
20206 + q
20207 + }
20208 + s/.*/./; q'`
20209 + test -d "$as_dir" && break
20210 + done
20211 + test -z "$as_dirs" || eval "mkdir $as_dirs"
20212 + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
20213 +echo "$as_me: error: cannot create directory $as_dir" >&2;}
20214 + { (exit 1); exit 1; }; }; }
20215 + # echo "creating $dirpart/$file"
20216 + echo '# dummy' > "$dirpart/$file"
20217 + done
20218 +done
20219 + ;;
20220 +
20221 + esac
20222 +done # for ac_tag
20223 +
20224 +
20225 +{ (exit 0); exit 0; }
20226 +_ACEOF
20227 +chmod +x $CONFIG_STATUS
20228 +ac_clean_files=$ac_clean_files_save
20229 +
20230 +
20231 +# configure is writing to config.log, and then calls config.status.
20232 +# config.status does its own redirection, appending to config.log.
20233 +# Unfortunately, on DOS this fails, as config.log is still kept open
20234 +# by configure, so config.status won't be able to write to it; its
20235 +# output is simply discarded. So we exec the FD to /dev/null,
20236 +# effectively closing config.log, so it can be properly (re)opened and
20237 +# appended to by config.status. When coming back to configure, we
20238 +# need to make the FD available again.
20239 +if test "$no_create" != yes; then
20240 + ac_cs_success=:
20241 + ac_config_status_args=
20242 + test "$silent" = yes &&
20243 + ac_config_status_args="$ac_config_status_args --quiet"
20244 + exec 5>/dev/null
20245 + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
20246 + exec 5>>config.log
20247 + # Use ||, not &&, to avoid exiting from the if with $? = 1, which
20248 + # would make configure fail if this is the last instruction.
20249 + $ac_cs_success || { (exit 1); exit 1; }
20250 +fi
20251 +
20252 --- /dev/null
20253 +++ b/convert/configure.ac
20254 @@ -0,0 +1,38 @@
20255 +dnl Process this file with autoconf to produce a configure script.
20256 +
20257 +AC_INIT(convert, 3.0.4)
20258 +AC_CANONICAL_TARGET
20259 +AM_INIT_AUTOMAKE
20260 +AC_PREREQ(2.59)
20261 +AC_CONFIG_SRCDIR(convert.c)
20262 +
20263 +AC_PROG_CC
20264 +AC_PROG_INSTALL
20265 +
20266 +AC_ISC_POSIX
20267 +
20268 +AC_HEADER_STDC
20269 +AC_CONFIG_HEADERS([config.h])
20270 +AC_CHECK_HEADERS(stddef.h stdlib.h strings.h unistd.h limits.h)
20271 +AC_CHECK_HEADERS(fcntl.h sys/file.h)
20272 +
20273 +AC_C_CONST
20274 +AC_TYPE_SIZE_T
20275 +
20276 +AC_CHECK_FUNCS(strchr strtok memcpy)
20277 +AC_FUNC_ALLOCA
20278 +
20279 +CONV_BINARY_FOPEN
20280 +
20281 +CONV_NEED_DECLARATION(malloc)
20282 +CONV_NEED_DECLARATION(realloc)
20283 +CONV_NEED_DECLARATION(free)
20284 +CONV_NEED_DECLARATION(strtok)
20285 +
20286 +ACX_PKGVERSION([MIPS Convert])
20287 +ACX_BUGURL([http://support.codesourcery.com/])
20288 +
20289 +AM_MAINTAINER_MODE
20290 +
20291 +AC_CONFIG_FILES([Makefile])
20292 +AC_OUTPUT
20293 --- /dev/null
20294 +++ b/convert/conv.1
20295 @@ -0,0 +1,178 @@
20296 +.TH conv 1 "29 Jul 2003" "MIPS SDE" "Programmer's Manual"
20297 +.de BP
20298 +.sp
20299 +.ti -.2i
20300 +\(**
20301 +..
20302 +.SH NAME
20303 +conv \- ELF object file converter
20304 +.SH SYNOPSIS
20305 +.B conv
20306 +.RB [ \-lvypr ]
20307 +.RB [ "\-a \fIaddr" [ /\fIsize ]]
20308 +.RB [ "\-a \fIaddr" [ :\fIlimit ]]
20309 +.RB [ "\-R \fIoffs" ]
20310 +.RB [ "\-f \fIfmt" ]
20311 +.RB [ "\-i \fIoffs" ]
20312 +.RB [ "\-w \fIwidth" ]
20313 +.RB [ "\-b \fIbyte,..." ]
20314 +.br
20315 +.RB [ "\-s \fIsize" ]
20316 +.RB [ "\-x \fIseg,..." ]
20317 +.RB [ "\-o \fIofile" ]
20318 +.RI [ ifile ]
20319 +.SH DESCRIPTION
20320 +The
20321 +.I conv
20322 +command takes ELF executable
20323 +.I ifile
20324 +and converts it into an ASCII or encoded binary format, suitable for
20325 +downloading onto a PROM programmer or evaluation board. It can take
20326 +horizontal and/or vertical slices through the file, to cater for PROM
20327 +programmers that do not have this facility or memory capacity.
20328 +.SH OPTIONS
20329 +.TP 10
20330 +.B \-l
20331 +Lists the segments in the ELF file's program header, for possible use
20332 +in the
20333 +.B \-x
20334 +option below; does not produce any other output.
20335 +.TP 10
20336 +.B \-v
20337 +Selects verbose mode, which makes the program report its actions as it
20338 +converts the file.
20339 +.TP 10
20340 +.B \-p
20341 +Selects PROM mode: output addresses start at zero; the read-only
20342 +segments are converted first and the other segments are concatenated
20343 +to them (aligned to 16 byte boundaries). If this option is not given,
20344 +then the segments are converted in program header order, and the
20345 +output addresses are the data's actual virtual addresses.
20346 +.TP 10
20347 +.B \-y
20348 +Requests symbol output: for formats which support this the file's
20349 +symbol table is also converted and sent to the output file.
20350 +.TP 10
20351 +.B \-a \fIaddr\fR[/\fIsize\fR]
20352 +.TP 10
20353 +.B \-a \fIaddr\fR[:\fIlimit\fR]
20354 +Specifies the physical address range of the PROM, for use with the
20355 +.B \-p
20356 +option. All input data located between \fIaddr\fP and \fIlimit\fP
20357 +(i.e. between \fIaddr\fP and \fIaddr\fP+\fIsize\fP) are deemed to be
20358 +intended for PROM execution, and are placed at the relevant offset
20359 +from \fIaddr\fP. Segments outside of this address range are assumed
20360 +to be intended for relocation to RAM, and are concatenated to the end
20361 +of the last read-only segment. The default value for \fIaddr\fP is
20362 +0x1fc00000, and the default \fIsize\fP is 0x400000 (i.e. 4Mb).
20363 +.TP 10
20364 +.B \-r
20365 +Selects raw binary input mode, which ignores any ELF headers and
20366 +converts the whole input file into the output format, starting at the
20367 +selected PROM base address.
20368 +.TP 10
20369 +.B \-R \fIoffs\fR
20370 +Selects raw binary input mode as above, but places the input
20371 +at offset \fIoffs\fP from the PROM base address.
20372 +.TP 10
20373 +.B \-f \fIfmt\fP
20374 +Selects the output format, from the list below. If not specified then
20375 +the environment variable
20376 +.B DLTYPE
20377 +is used. The default if neither of these are specified is
20378 +.BR srec .
20379 +.RS
20380 +.TP 10
20381 +.B srec, s3
20382 +Motorola S-records, using S3 and S7 (32-bit address) records; symbol
20383 +output can be provided via S4 records, as supported by LSI PMON.
20384 +.TP 10
20385 +.B s2
20386 +Same as above, except using S2 and S8 (24-bit address) records, to
20387 +suit some PROM programmers.
20388 +.TP 10
20389 +.B s1
20390 +Same as above, except using S1 and S9 (16-bit address) records.
20391 +.TP 10
20392 +.B lsi
20393 +High density (radix 64) ASCII encoding for downloading by the
20394 +.I LSI PMON
20395 +monitor; symbol output is supported.
20396 +.TP 10
20397 +.B idt
20398 +Binary S-record format for downloading by the
20399 +.I IDT/sim
20400 +monitor.
20401 +.TP 10
20402 +.B stagbin
20403 +Proprietary binary format for
20404 +.I Stag
20405 +PROM programmers.
20406 +.TP 10
20407 +.B bin
20408 +Raw binary output, suitable for further conversion by another user
20409 +program.
20410 +.RE
20411 +.TP 10
20412 +.BI \-w " width"
20413 +Specifies the width of CPU data bus in bits (default: 32).
20414 +.TP 10
20415 +.BI \-b " byte,..."
20416 +The input file is read in multiples of
20417 +.I width
20418 +bits, and then these bytes are selected from it. The
20419 +default is
20420 +.RB `` 0,1,2,3 '',
20421 +which sends all bytes in their file order. To
20422 +perform a byte swap specify
20423 +.RB `` 3,2,1,0 ''.
20424 +To program four PROMs with
20425 +consecutive bytes, run
20426 +.I convert
20427 +four times with
20428 +.RB `` \-b0 '',
20429 +.RB `` \-b1 '',
20430 +.RB `` \-b2 ''
20431 +and
20432 +.RB `` \-b3 ''.
20433 +.IP
20434 +To handle interleaved PROMs, multiply the PROM width by the interleave,
20435 +(e.g.
20436 +.RB `` \-w64 ''
20437 +for two-way interleave on a 32-bit bus), and then run
20438 +.I conv
20439 +interleave \(mu byte-width times
20440 +(e.g.
20441 +.RB `` \-b0 ''
20442 +to
20443 +.RB `` \-b7 '').
20444 +.br
20445 +.ne 4
20446 +.TP 10
20447 +.BI \-i " offs"
20448 +.TP 10
20449 +.BI \-s " size"
20450 +Specified together to split a large program into multiple PROMs. The
20451 +.B \-i
20452 +flag specifies the initial offset, and
20453 +.B \-s
20454 +the size of the PROM. For example for two 128K proms:
20455 +.nf
20456 +.in +5
20457 +conv -f s3 -i 0x00000 -s 0x20000 -o prom.s31 prom
20458 +conv -f s3 -i 0x20000 -s 0x20000 -o prom.s32 prom
20459 +.in 0
20460 +.fi
20461 +.TP 10
20462 +.BI \-x " seg,..."
20463 +Exclude the following segments from the output; the segment numbers
20464 +can be determined using the
20465 +.B \-l
20466 +option above.
20467 +.TP 10
20468 +.BI "\-o " oname
20469 +Selects
20470 +.I oname
20471 +as the output file, default is standard output.
20472 +.SH SEE ALSO
20473 +edown(1)
20474 --- /dev/null
20475 +++ b/convert/conv.texi
20476 @@ -0,0 +1,232 @@
20477 +\input texinfo @c -*- Texinfo -*-
20478 +@c Copyright 1993-2003,2008
20479 +@c Free Software Foundation, Inc.
20480 +@c Contributed by MIPS Technologies, Inc.
20481 +@setfilename conv.info
20482 +
20483 +@ifinfo
20484 +@format
20485 +START-INFO-DIR-ENTRY
20486 +* Convert: (conv). The MIPS SDE tool "sde-conv"
20487 +END-INFO-DIR-ENTRY
20488 +@end format
20489 +@end ifinfo
20490 +
20491 +@ifinfo
20492 +Copyright @copyright{} 1998-2003 MIPS Technologies, Inc. All Rights Reserved.
20493 +@end ifinfo
20494 +
20495 +@synindex ky cp
20496 +@c
20497 +@c This file documents the MIPS ELF converter
20498 +@c
20499 +@c Copyright (C) 1998-2003 MIPS Technologies, Inc. All Rights Reserved.
20500 +@c
20501 +@c
20502 +
20503 +@setchapternewpage odd
20504 +@settitle MIPS SDE ELF Conversion Tool
20505 +@titlepage
20506 +@finalout
20507 +@title MIPS SDE ELF Conversion Tool
20508 +@subtitle @code{sde-conv}
20509 +@subtitle Version 5.0
20510 +@sp 1
20511 +@subtitle October 2003
20512 +@author MIPS Technologies Inc
20513 +@page
20514 +
20515 +@tex
20516 +\def\$#1${{#1}} % Kluge: collect RCS revision info without $...$
20517 +\xdef\manvers{\$Revision$} % For use in headers, footers too
20518 +{\parskip=0pt \hfill MIPS Technologies Inc\par \hfill \manvers\par \hfill
20519 +\TeX{}info \texinfoversion\par }
20520 +@end tex
20521 +
20522 +@vskip 0pt plus 1filll
20523 +Copyright @copyright{} 1998-2003 MIPS Technologies, Inc. All Rights Reserved.
20524 +
20525 +@end titlepage
20526 +
20527 +@node Top, (dir), (dir), (dir)
20528 +@chapter conv
20529 +
20530 +@kindex conv
20531 +@kindex sde-conv
20532 +@cindex convert ELF files
20533 +
20534 +@smallexample
20535 +sde-conv [ -l ] [ -v ] [ -y ] [ -p ] [ -r ]
20536 + [ -a @var{addr}[/@var{size}] ]
20537 + [ -a @var{addr}[:@var{limit}] ]
20538 + [ -f @var{fmt} ] [ -R @var{offs} ]
20539 + [ -w @var{width} ] [ -b @var{byte},... ]
20540 + [ -i @var{offs} ] [ -s @var{size} ]
20541 + [ -x @var{seg},... ] [ -o @var{ofile} ] @var{ifile}
20542 +@end smallexample
20543 +
20544 +The @code{sde-conv} utility takes ELF executable @var{ifile}
20545 +and converts it into an ASCII or encoded binary format, suitable for
20546 +downloading onto a PROM programmer or evaluation board. It can take
20547 +horizontal and/or vertical slices through the file, to cater for PROM
20548 +programmers that do not have this facility or memory capacity.
20549 +
20550 +@table @code
20551 +
20552 +@item -o @var{ofile}
20553 +Selects @var{ofile}
20554 +as the output file, the default is the standard output. Note: you must
20555 +use this for the binary output format.
20556 +
20557 +@cindex list program segments
20558 +@item -l
20559 +Lists the segments in the ELF file's program header, for possible use
20560 +in the @code{-x} option below; does not produce any other output.
20561 +
20562 +@item -v
20563 +Selects verbose mode, which makes the program report its actions as it
20564 +converts the file.
20565 +
20566 +@cindex output symbol data
20567 +@item -y
20568 +Requests symbol output: for formats which support this the file's
20569 +symbol table is also converted and sent to the output file.
20570 +
20571 +@cindex specify PROM address
20572 +@item -a @var{addr}
20573 +@itemx -a @var{addr}:@var{limit}
20574 +@itemx -a @var{addr}/@var{size}
20575 +Selects PROM output mode and specifies the physical address range of the
20576 +PROM. All input data located between @var{addr} and @var{limit} (or
20577 +between @var{addr} and @var{addr}+@var{size}) are deemed to be
20578 +PROM-resident, and are mapped to their relative offset from @var{addr}.
20579 +Segments outside of this address range are assumed to be intended for
20580 +relocation to RAM, and they are concatenated to the end of the last
20581 +PROM-resident segment (rounded to the next 16 byte boundary). The
20582 +default value for @var{addr} is @code{1fc00000}, and the default
20583 +@var{size} is @code{400000} (i.e. 4Mb).
20584 +
20585 +Note that if the code segment has a load address that doesn't fall
20586 +inside the ROM then it will get treated like an initialised data
20587 +segment. It will get mapped to the start of the ROM (the reset
20588 +exception address) if it was linked with the lowest address, and then
20589 +your reset code can be carefully written to copy the code segment
20590 +from ROM to RAM.
20591 +
20592 +@cindex create PROM image
20593 +@item -p
20594 +Selects PROM output mode, equivalent to @samp{-a@ 1fc00000/400000}.
20595 +
20596 +@cindex raw binary input
20597 +@item -r
20598 +Selects raw binary input mode, which ignores any ELF headers and
20599 +converts the whole input file into the output format, starting at the
20600 +selected PROM base address.
20601 +
20602 +@item -R @var{offs}
20603 +Selects raw binary input mode as above, but places the input
20604 +at offset @var{offs} from the PROM base address.
20605 +
20606 +@cindex output file format
20607 +@item -f @var{fmt}
20608 +Selects the output format, from the list below. If not specified then
20609 +the environment variable @code{DLTYPE}
20610 +is used. The default if neither of these are specified is
20611 +@code{srec}.
20612 +
20613 +@table @code
20614 +@cindex Motorola
20615 +@cindex S-records
20616 +@item srec
20617 +@itemx s3
20618 +Motorola S-records, using S3 and S7 (32-bit address) records. Symbol
20619 +output is provided via S4 records, as supported by LSI PMON, if the
20620 +@code{-y} option is also used.
20621 +
20622 +@item s2
20623 +Same as above, except using S2 and S8 (24-bit address) records, to
20624 +suit some PROM programmers.
20625 +
20626 +@item s1
20627 +Same as above, except using S1 and S9 (16-bit address) records.
20628 +
20629 +@cindex LSI PMON format
20630 +@item lsi
20631 +High density (radix 64) ASCII encoding for downloading by the
20632 +@samp{LSI PMON}
20633 +monitor; symbol output is supported with the @code{-y} option.
20634 +
20635 +@cindex IDT/sim binary format
20636 +@item idt
20637 +Binary S-record format for downloading by the @samp{IDT/sim} monitor.
20638 +
20639 +@cindex Stag binary format
20640 +@item stagbin
20641 +@itemx sbin
20642 +Proprietary binary format for @samp{Stag} PROM programmers.
20643 +
20644 +@cindex MIPS flash format
20645 +@cindex fl
20646 +@item fl
20647 +MIPS flash file format, suitable for downloading to a Malta
20648 +or SEAD-2 board.
20649 +
20650 +@cindex raw binary output
20651 +@item bin
20652 +Raw binary output, suitable for further conversion by another user
20653 +program.
20654 +
20655 +@cindex relocated ELF
20656 +@cindex relf
20657 +@item relf
20658 +Relocated ELF executable object file output, with the code and data
20659 +relocated to their new addresses in ROM, as selected by the @samp{-p} or
20660 +@samp{-a} options. This can be used to generate a ROM image which can be
20661 +loaded by gdb's MDI interface. Note that symbols and other debug
20662 +information are not copied to the new file, and the file's entrypoint
20663 +address is set to the base ROM address.
20664 +@end table
20665 +
20666 +@cindex PROM width
20667 +@item -w @var{width}
20668 +Specifies the width of CPU data bus in bits (default: 32).
20669 +
20670 +@cindex byte select
20671 +@cindex interleaved PROMS
20672 +@item -b @var{byte},...
20673 +The input file is read in multiples of @var{width} bits, and then these
20674 +bytes are selected from it. The default is @samp{0,1,2,3}, which sends
20675 +all bytes in their file order. To perform a byte swap specify
20676 +@samp{3,2,1,0}. To program four PROMs with consecutive bytes, run
20677 +@code{conv} four times with @samp{-b0}, @samp{-b1}, @samp{-b2} and
20678 +@samp{-b3}.
20679 +
20680 +To handle interleaved PROMs, multiply the PROM width by the interleave,
20681 +(e.g. @samp{-w64} for two-way interleave on a 32-bit bus), and then run
20682 +@code{conv} interleave times byte-width times
20683 +(e.g. @samp{-b0} to @samp{-b7}).
20684 +
20685 +@cindex split into multiple PROMS
20686 +@item -i @var{offs}
20687 +@itemx -s @var{size}
20688 +Specified together to split a large program into multiple PROMs. The
20689 +@code{-i}
20690 +flag specifies the initial offset, and
20691 +@code{-s}
20692 +the size of the PROM. For example for two 128K proms:
20693 +
20694 +@quotation
20695 +@smallexample
20696 +conv -f s3 -i 0x00000 -s 0x20000 -o prom.s3.1 prom
20697 +conv -f s3 -i 0x20000 -s 0x20000 -o prom.s3.2 prom
20698 +@end smallexample
20699 +@end quotation
20700 +
20701 +@cindex select program segments
20702 +@item -x @var{seg},...
20703 +Exclude the following segments from the output; the segment numbers
20704 +can be determined using the @code{-l} option described above.
20705 +
20706 +@end table
20707 +
20708 +@bye
20709 --- /dev/null
20710 +++ b/convert/convert.c
20711 @@ -0,0 +1,717 @@
20712 +/* convert.c -- ELF to hex (etc) file converter
20713 +
20714 + Copyright (c) 1993-2003, 2008 Free Software Foundation, Inc.
20715 + Contributed by MIPS Technologies, Inc.
20716 +
20717 + This program is free software; you can redistribute it and/or modify
20718 + it under the terms of the GNU General Public License as published by
20719 + the Free Software Foundation; either version 3, or (at your option)
20720 + any later version.
20721 +
20722 + This program is distributed in the hope that it will be useful,
20723 + but WITHOUT ANY WARRANTY; without even the implied warranty of
20724 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20725 + GNU General Public License for more details.
20726 +
20727 + You should have received a copy of the GNU General Public License
20728 + along with this program; If not, write to the Free Software
20729 + Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
20730 + 02110-1301, USA. */
20731 +
20732 +#include "sysdep.h"
20733 +#include "elfmips.h"
20734 +#include "conv-version.h"
20735 +
20736 +#include <sys/stat.h>
20737 +
20738 +#include <getopt.h>
20739 +
20740 +struct format {
20741 + const char *name;
20742 + int binary;
20743 + void (*start) (FILE *, unsigned long, int);
20744 + void (*output) (unsigned long, unsigned char);
20745 + void (*sym) (char *, unsigned long);
20746 + void (*end) (unsigned long);
20747 + const char *desc;
20748 +};
20749 +
20750 +extern void Srec3Start (FILE *, unsigned long, int);
20751 +extern void Srec2Start (FILE *, unsigned long, int);
20752 +extern void Srec1Start (FILE *, unsigned long, int);
20753 +extern void SrecOutput (unsigned long, unsigned char);
20754 +extern void SrecSym (char *, unsigned long);
20755 +extern void SrecEnd (unsigned long);
20756 +
20757 +extern void LsiStart (FILE *, unsigned long, int);
20758 +extern void LsiOutput (unsigned long, unsigned char);
20759 +extern void LsiSym (char *, unsigned long);
20760 +extern void LsiEnd (unsigned long);
20761 +
20762 +extern void StagStart (FILE *, unsigned long, int);
20763 +extern void StagOutput (unsigned long, unsigned char);
20764 +extern void StagEnd (unsigned long);
20765 +
20766 +extern void BinStart (FILE *, unsigned long, int);
20767 +extern void BinOutput (unsigned long, unsigned char);
20768 +extern void BinEnd (unsigned long);
20769 +
20770 +extern void IdtStart (FILE *, unsigned long, int);
20771 +extern void IdtOutput (unsigned long, unsigned char);
20772 +extern void IdtEnd (unsigned long);
20773 +
20774 +extern void ElfStart (FILE *, unsigned long, int);
20775 +extern void ElfOutput (unsigned long, unsigned char);
20776 +extern void ElfEnd (unsigned long);
20777 +
20778 +extern void MipsStart (FILE *, unsigned long, int);
20779 +extern void MipsOutput (unsigned long, unsigned char);
20780 +extern void MipsEnd (unsigned long);
20781 +
20782 +static const struct format formats[] = {
20783 + {"srec", 0, Srec3Start, SrecOutput, SrecSym, SrecEnd,
20784 + "Motorola S-record (32-bit address)"},
20785 + {"s3", 0, Srec3Start, SrecOutput, SrecSym, SrecEnd,
20786 + "Motorola S-record (32-bit address)"},
20787 + {"s2", 0, Srec2Start, SrecOutput, SrecSym, SrecEnd,
20788 + "Motorola S-record (24-bit address)"},
20789 + {"s1", 0, Srec1Start, SrecOutput, SrecSym, SrecEnd,
20790 + "Motorola S-record (16-bit address)"},
20791 + {"lsi", 0, LsiStart, LsiOutput, LsiSym, LsiEnd,
20792 + "LSI fast download (PMON)"},
20793 + {"fl", 0, MipsStart, MipsOutput, 0, MipsEnd,
20794 + "MIPS flash download"},
20795 + {"idt", 1, IdtStart, IdtOutput, 0, IdtEnd,
20796 + "IDT/sim binary S-record"},
20797 + {"sbin", 1, StagStart, StagOutput, 0, StagEnd,
20798 + "Stag PROM programmer"},
20799 + {"bin", 1, BinStart, BinOutput, 0, BinEnd,
20800 + "Raw binary"},
20801 + {"relf", 1, ElfStart, ElfOutput, 0, ElfEnd,
20802 + "Relocated ELF"},
20803 + {0}
20804 +};
20805 +
20806 +
20807 +char * progname;
20808 +int promflag = 0;
20809 +static int symflag = 0;
20810 +static int listflag = 0;
20811 +static int verbose = 0;
20812 +
20813 +#define MAXALIGN 16 /* align segments to 16 byte boundaries */
20814 +
20815 +#define MAXSEGS 20
20816 +static unsigned segomit[MAXSEGS];
20817 +static unsigned omitseg[MAXSEGS];
20818 +static unsigned nomit;
20819 +
20820 +#define MAXWIDTH 8
20821 +static unsigned bytelist[MAXWIDTH];
20822 +static unsigned nbytes;
20823 +static unsigned width = 4; /* in bytes */
20824 +
20825 +typedef unsigned long msize_t;
20826 + msize_t prombase = 0x1fc00000;
20827 +static msize_t promlimit = 0;
20828 +static msize_t promstart;
20829 +static msize_t promend;
20830 +\f
20831 +static void
20832 +usage (int error)
20833 +{
20834 + const struct format *fmt;
20835 + FILE* to = error ? stderr : stdout;
20836 +
20837 + fprintf(to,
20838 +"usage: %s [-lvypr] [-f fmt] [-w width] [-b byte,...] [-i offs] [-s size]\n"
20839 +" [-R offs] [-x seg,...] [-a addr] [-o file] [file]\n"
20840 +" -l list segments only, no conversion\n"
20841 +" -v verbose conversion option\n"
20842 +" -y include symbols\n"
20843 +" -p prom mode (start addresses at zero)\n"
20844 +" -a addr[:lim] address of prom (default: 1fc00000:20000000)\n"
20845 +" -a addr[/size] address of prom (default: 1fc00000/400000)\n"
20846 +" -r raw binary input (not ELF)\n"
20847 +" -R offs raw binary, start addresses at offs (default: 0)\n"
20848 +" -EB | -EL set big or little endianness\n"
20849 +" -f fmt output format (default: srec)\n"
20850 +" -w width data width in bits (default: 32)\n"
20851 +" -b byte,... select bytes (default: 0,1,2,3)\n"
20852 +" -i offs initial input offset (default: 0)\n"
20853 +" -s size prom size (default: infinite)\n"
20854 +" -x seg,... exclude segments (default: none)\n"
20855 + , progname);
20856 +
20857 + fprintf (to, "\nOutput formats (-f):\n");
20858 + for (fmt = formats; fmt->name; fmt++)
20859 + fprintf (to, " %s\t%s\n", fmt->name, fmt->desc ? fmt->desc : "");
20860 +
20861 + fprintf (to, "\nReport bugs to " CONVERT_REPORT_BUGS_TO ".\n");
20862 +
20863 + exit(error);
20864 +}
20865 +
20866 +
20867 +static int
20868 +parselist (char *arg, unsigned *list, int lsize)
20869 +{
20870 + char *s, *ep;
20871 + int n = 0;
20872 +
20873 + for (s = strtok (arg, ","); s; s = strtok (0, ",")) {
20874 + if (n >= lsize) {
20875 + fprintf (stderr, "%s: too many items in list\n", progname);
20876 + usage (1);
20877 + }
20878 + list[n++] = strtol (s, &ep, 0);
20879 + if (*ep) {
20880 + fprintf (stderr, "%s: bad number in list: %s\n", progname, s);
20881 + usage (1);
20882 + }
20883 + }
20884 + return n;
20885 +}
20886 +\f
20887 +static char *
20888 +phtype (Elf32_Phdr *ph)
20889 +{
20890 + static char buf[11];
20891 +
20892 + switch (ph->p_type) {
20893 + case PT_NULL:
20894 + return "NULL ";
20895 + case PT_LOAD:
20896 + return "LOAD ";
20897 + case PT_DYNAMIC:
20898 + return "DYNAMIC ";
20899 + case PT_INTERP:
20900 + return "INTERP ";
20901 + case PT_NOTE:
20902 + return "NOTE ";
20903 + case PT_SHLIB:
20904 + return "SHLIB ";
20905 + case PT_PHDR:
20906 + return "PHDR ";
20907 + case PT_MIPS_REGINFO:
20908 + return "REGINFO ";
20909 + default:
20910 + sprintf (buf, "%08x", ph->p_type);
20911 + return buf;
20912 + }
20913 +}
20914 +
20915 +
20916 +static char *
20917 +phflags (Elf32_Phdr *ph)
20918 +{
20919 + static char buf[4];
20920 + buf[0] = (ph->p_flags & PF_R) ? 'r' : '-';
20921 + buf[1] = (ph->p_flags & PF_W) ? 'w' : '-';
20922 + buf[2] = (ph->p_flags & PF_X) ? 'x' : '-';
20923 + buf[3] = '\0';
20924 + return buf;
20925 +}
20926 +\f
20927 +
20928 +static void
20929 +convertSegment (FILE *ifp, const struct format *fmt, Elf32_Phdr *ph)
20930 +{
20931 + unsigned char buf[MAXWIDTH];
20932 + static msize_t req_top = 0, offs_top = 0;
20933 + static unsigned int last_flags = 0;
20934 + msize_t req, offset;
20935 + unsigned long skip = 0;
20936 + long n;
20937 +
20938 + /* get requested physical address */
20939 + req = (ph->p_paddr ? ph->p_paddr : ph->p_vaddr);
20940 + if (promflag) {
20941 + offset = req & 0x1fffffff;
20942 + if (offset < prombase || offset >= promlimit) {
20943 + /* not a valid prom address: force to rom */
20944 + if (offs_top == 0) {
20945 + /* force to start, whatever it says in the file */
20946 + offset = prombase;
20947 + }
20948 + else {
20949 + unsigned long align = ph->p_align ? ph->p_align - 1 : 0;
20950 + if (req == ((req_top + align) & ~align)
20951 + && ((ph->p_flags ^ last_flags) & PF_W) == 0) {
20952 + /* segment is contiguous and of same read/write type,
20953 + then keep its relative offset the same */
20954 + offset = offs_top + (req - req_top);
20955 + }
20956 + else {
20957 + /* segment is not contiguous, or a different type,
20958 + put at next MAXALIGN boundary. */
20959 + align = MAXALIGN - 1;
20960 + offset = (offs_top + align) & ~align;
20961 + }
20962 + }
20963 + }
20964 + }
20965 + else {
20966 + /* not a prom: preserve load address */
20967 + offset = req;
20968 + }
20969 +
20970 + req_top = req + ph->p_memsz;
20971 + offs_top = offset + ph->p_memsz;
20972 + last_flags = ph->p_flags;
20973 +
20974 + if (promflag) {
20975 + /* convert to offset from start of PROM */
20976 + offset -= prombase;
20977 + /* skip as many bytes as necessary to reach requested start */
20978 + if (offset < promstart) {
20979 + skip = (promstart - offset) * (width / nbytes);
20980 + if (skip >= ph->p_filesz)
20981 + skip = ph->p_filesz;
20982 + offset += ((skip + width - 1) / width) * nbytes;
20983 + }
20984 + }
20985 +
20986 + if (skip < ph->p_filesz) {
20987 + fseek (ifp, ph->p_offset + skip, SEEK_SET);
20988 + n = ph->p_filesz - skip;
20989 +
20990 + /* convert to offset and size in prom */
20991 + offset /= (width / nbytes);
20992 + n = (n + (width / nbytes) - 1) / (width / nbytes);
20993 +
20994 + if (verbose) {
20995 + int i, j;
20996 + fprintf (stderr, "%s segment %08x:%08x -> %s %05x:%05x [",
20997 + phflags (ph), req, req + n,
20998 + fmt->name, offset, offset + n);
20999 + for (i = 0; i < width; i++) {
21000 + for (j = 0; j < nbytes; j++)
21001 + if (bytelist[j] == i)
21002 + break;
21003 + if (j < nbytes)
21004 + fprintf (stderr, "%x", j);
21005 + else
21006 + fprintf (stderr, "-");
21007 + }
21008 + fprintf (stderr, "]\n");
21009 + }
21010 +
21011 + while (n > 0 && offset < promend) {
21012 + int nr, i;
21013 + if ((nr = fread (buf, 1, width, ifp)) <= 0) {
21014 + fprintf (stderr, "%s: bad file read\n", progname);
21015 + exit (1);
21016 + }
21017 + for (i = 0; i < nbytes; i++) {
21018 + int bn = bytelist[i];
21019 + if (bn < nr)
21020 + (*fmt->output) (offset++, buf[bn]);
21021 + }
21022 + n -= nbytes;
21023 + }
21024 + }
21025 +}
21026 +\f
21027 +static void
21028 +convertSymbols (FILE *ifp, Elf32_Ehdr *eh, const struct format *fmt)
21029 +{
21030 + Elf32_Shdr *shtab, *sh;
21031 + char *strtab;
21032 + int i;
21033 +
21034 + shtab = (Elf32_Shdr *) xmalloc (eh->e_shnum * sizeof(Elf32_Shdr));
21035 +
21036 + fseek (ifp, eh->e_shoff, SEEK_SET);
21037 + if (elfShdrRead (ifp, eh, shtab, eh->e_shnum) != eh->e_shnum) {
21038 + fprintf (stderr,"%s: failed to read section headers\n", progname);
21039 + exit (1);
21040 + }
21041 +
21042 + for (i = 0; i < eh->e_shnum; i++)
21043 + if (shtab[i].sh_type == SHT_SYMTAB)
21044 + break;
21045 + if (i >= eh->e_shnum) {
21046 + free (shtab);
21047 + return;
21048 + }
21049 +
21050 + /* get string table */
21051 + sh = &shtab[shtab[i].sh_link];
21052 + strtab = (char *) xmalloc (sh->sh_size);
21053 + fseek (ifp, sh->sh_offset, SEEK_SET);
21054 + if (fread (strtab, 1, sh->sh_size, ifp) != sh->sh_size) {
21055 + fprintf (stderr, "%s: cannot read string table\n", progname);
21056 + exit (1);
21057 + }
21058 +
21059 + /* scan symbol table */
21060 + sh = &shtab[i];
21061 + fseek (ifp, sh->sh_offset, SEEK_SET);
21062 + for (i = sh->sh_size / sh->sh_entsize; i != 0; i--) {
21063 + Elf32_Sym sym;
21064 + int type;
21065 +
21066 + if (elfSymRead (ifp, eh, sh, &sym, 1) != 1) {
21067 + fprintf (stderr, "%s: cannot read symbol table\n", progname);
21068 + exit (1);
21069 + }
21070 + switch (sym.st_shndx) {
21071 + case SHN_UNDEF:
21072 + case SHN_COMMON:
21073 + continue;
21074 + }
21075 +
21076 + type = ELF32_ST_TYPE (sym.st_info);
21077 + switch (type) {
21078 + case STT_SECTION:
21079 + case STT_FILE:
21080 + continue;
21081 + }
21082 +
21083 + /* only emit globals and functions */
21084 + if (ELF32_ST_BIND (sym.st_info) != STB_GLOBAL && type != STT_FUNC)
21085 + continue;
21086 +
21087 + if (sym.st_other == 0xf0)
21088 + sym.st_value |= 1;
21089 +
21090 + (*fmt->sym) (strtab + sym.st_name, sym.st_value);
21091 + }
21092 +
21093 + free (strtab);
21094 + free (shtab);
21095 +}
21096 +
21097 +
21098 +/* comparison function for qsort() */
21099 +int
21100 +phcompar (const void *a, const void *b)
21101 +{
21102 + const Elf32_Phdr *pha = a;
21103 + const Elf32_Phdr *phb = b;
21104 + unsigned long addra = pha->p_paddr ? pha->p_paddr : pha->p_vaddr;
21105 + unsigned long addrb = phb->p_paddr ? phb->p_paddr : phb->p_vaddr;
21106 + return (addra == addrb) ? 0
21107 + : (addra < addrb) ? -1
21108 + : 1;
21109 +}
21110 +
21111 +\f
21112 +
21113 +#ifndef HAVE_STRTOUL
21114 +extern unsigned long int strtoul (const char *, char **, int);
21115 +#endif
21116 +
21117 +static const struct option long_opts[] =
21118 +{
21119 + { "version", no_argument, NULL, 'V' },
21120 + { "help", no_argument, NULL, 'h' },
21121 + { 0, 0, NULL, 0 }
21122 +};
21123 +
21124 +int
21125 +main(int argc, char **argv)
21126 +{
21127 + extern char *getenv ();
21128 + FILE *ifp, *ofp, *cfp;
21129 + Elf32_Ehdr ehdr;
21130 + Elf32_Phdr *phtab, *ph;
21131 + const struct format *fmt = 0;
21132 + char *infile = "a.out";
21133 + char *outfile = 0;
21134 + char *fmtname;
21135 + char *s;
21136 + extern char *optarg;
21137 + extern int optind;
21138 + msize_t size = 0;
21139 + int rawflag = 0;
21140 + msize_t rawoffs = 0;
21141 + int i, c;
21142 + int bigendian = 0;
21143 +
21144 + progname = argv[0];
21145 + if ((s = strrchr(progname, '/')) || (s = strrchr(progname, '\\')) ||
21146 + (s = strrchr(progname, ':')))
21147 + progname = s + 1;
21148 +
21149 + fmtname = getenv ("DLTYPE");
21150 + while ((c = getopt_long(argc,argv,"prR:vylf:x:b:s:i:w:o:t:a:E:",
21151 + &long_opts[0], NULL)) != EOF)
21152 + switch(c) {
21153 + case 'p':
21154 + promflag = 1;
21155 + break;
21156 + case 'r':
21157 + rawflag = 1;
21158 + break;
21159 + case 'R':
21160 + rawflag = 1;
21161 + rawoffs = strtoul (optarg, &s, 16);
21162 + if (*s)
21163 + usage (1);
21164 + break;
21165 + case 'v':
21166 + verbose = 1;
21167 + break;
21168 + case 'y':
21169 + symflag = 1;
21170 + break;
21171 + case 'l':
21172 + listflag = 1;
21173 + break;
21174 + case 'f':
21175 + fmtname = optarg;
21176 + break;
21177 + case 'b':
21178 + nbytes = parselist (optarg, bytelist, MAXWIDTH);
21179 + break;
21180 + case 'x':
21181 + nomit = parselist (optarg, segomit, MAXSEGS);
21182 + break;
21183 + case 'i':
21184 + promstart = strtoul (optarg, &s, 0);
21185 + if (*s)
21186 + usage (1);
21187 + break;
21188 + case 's':
21189 + size = strtoul (optarg, &s, 0);
21190 + if (*s)
21191 + usage (1);
21192 + break;
21193 + case 'a':
21194 + promflag = 1;
21195 + prombase = strtoul (optarg, &s, 16) & 0x1fffffff;
21196 + if (*s == '/' || *s == '#') {
21197 + promlimit = strtoul (++s, &s, 16) + prombase;
21198 + }
21199 + else if (*s == ':' || *s == '-') {
21200 + promlimit = strtoul (++s, &s, 16) & 0x1fffffff;
21201 + if (promlimit && (promlimit <= prombase)) {
21202 + fprintf (stderr, "%s: ROM limit below ROM base\n", progname);
21203 + usage (1);
21204 + }
21205 + }
21206 + if (*s)
21207 + usage (1);
21208 + break;
21209 + case 'w':
21210 + width = strtoul (optarg, &s, 0);
21211 + if (*s || width % 8 != 0)
21212 + usage (1);
21213 + width /= 8;
21214 + break;
21215 + case 'o':
21216 + outfile = optarg;
21217 + break;
21218 + case 't':
21219 + fprintf (stderr, "%s: -t flag deprecated and ignored\n", progname);
21220 + break;
21221 + case 'E':
21222 + if (optarg[0] == 'B' && optarg[1] == '\0')
21223 + bigendian = 1;
21224 + else if (optarg[0] == 'L' && optarg[1] == '\0')
21225 + bigendian = 0;
21226 + else {
21227 + fprintf (stderr, "%s: -E%s flag not recognised\n", progname,
21228 + optarg);
21229 + usage (1);
21230 + }
21231 + break;
21232 + case 'h':
21233 + usage (0);
21234 + break;
21235 + case 'V':
21236 + printf ("MIPS convert " CONVERT_PKGVERSION "\n");
21237 + return 0;
21238 + default:
21239 + usage (1);
21240 + }
21241 +
21242 + if(optind < argc) {
21243 + infile = argv[optind++];
21244 + if (optind < argc)
21245 + usage (1);
21246 + }
21247 +
21248 + if ((size || promstart) && !promflag) {
21249 + fprintf (stderr, "%s: -s or -i specified without -p\n", progname);
21250 + usage (1);
21251 + }
21252 +
21253 + if (width == 0 || width > MAXWIDTH) {
21254 + fprintf (stderr, "%s: bad width\n", progname);
21255 + usage (1);
21256 + }
21257 +
21258 + if (nbytes == 0) {
21259 + for (i = 0; i < width; i++)
21260 + bytelist[i] = i;
21261 + nbytes = width;
21262 + } else {
21263 + if (nbytes != (nbytes & -nbytes)) {
21264 + fprintf (stderr, "%s: number of selected bytes not power of two\n",
21265 + progname);
21266 + usage (1);
21267 + }
21268 + if (nbytes > width) {
21269 + fprintf (stderr, "%s: number of selected bytes > data width\n",
21270 + progname);
21271 + usage (1);
21272 + }
21273 + for (i = 0; i < nbytes; i++)
21274 + if (bytelist[i] >= width) {
21275 + fprintf (stderr, "%s: bad byte select %d (should be 0-%d)\n",
21276 + progname, bytelist[i], width-1);
21277 + usage (1);
21278 + }
21279 + }
21280 +
21281 + /* invert seg omit list */
21282 + for (i = 0; i < nomit; i++) {
21283 + int o = segomit[i];
21284 + if (o >= MAXSEGS) {
21285 + fprintf (stderr, "%s: bad segment number: %d\n",
21286 + progname, o);
21287 + usage (1);
21288 + }
21289 + omitseg[o] = 1;
21290 + }
21291 +
21292 + if (fmtname) {
21293 + for (fmt = formats; fmt->name; fmt++)
21294 + if (strcmp (fmtname, fmt->name) == 0)
21295 + break;
21296 + if (!fmt->name) {
21297 + fprintf (stderr, "%s: unknown output format '%s'\n", fmtname,
21298 + progname);
21299 + usage (1);
21300 + }
21301 + } else {
21302 + fmt = formats;
21303 + }
21304 +
21305 + if (size == 0)
21306 + promend = ULONG_MAX;
21307 + else
21308 + promend = promstart + size;
21309 +
21310 + if (promlimit == 0) {
21311 + if (size == 0)
21312 + promlimit = prombase + 0x400000;
21313 + else
21314 + promlimit = prombase + size / nbytes * width;
21315 + }
21316 +
21317 + if (!(ifp = fopen (infile, FOPEN_RB))) {
21318 + perror(infile);
21319 + return 1;
21320 + }
21321 +
21322 + if (outfile && strcmp(outfile, "-")) {
21323 + if (!(ofp = fopen (outfile, fmt->binary ? FOPEN_WB : FOPEN_WT))) {
21324 + perror(outfile);
21325 + return 1;
21326 + }
21327 + }
21328 + else {
21329 + ofp = stdout;
21330 +#ifdef MSDOS
21331 + if (fmt->binary)
21332 + setmode (fileno (ofp), O_BINARY);
21333 +#endif
21334 + }
21335 +
21336 + if (!rawflag) {
21337 + if (elfEhdrRead (ifp, &ehdr) != 1) {
21338 + fprintf (stderr,"%s: not an ELF object file: %s\n", progname, infile);
21339 + return 1;
21340 + }
21341 +
21342 + if (ehdr.e_type != ET_EXEC) {
21343 + fprintf(stderr,"%s: warning: not an executable ELF file: %s\n",
21344 + progname, infile);
21345 + }
21346 +
21347 + bigendian = ehdr.e_ident[5] == ELFDATA2MSB;
21348 +
21349 + if (ehdr.e_phoff == 0 || ehdr.e_phnum == 0) {
21350 + fprintf(stderr, "%s: missing ELF program header: %s\n",
21351 + progname, infile);
21352 + return 1;
21353 + }
21354 +
21355 + if (ehdr.e_phnum > MAXSEGS) {
21356 + fprintf(stderr, "%s: too many segments in ELF program header: %s\n",
21357 + progname, infile);
21358 + return 1;
21359 + }
21360 +
21361 + phtab = (Elf32_Phdr *) xmalloc (ehdr.e_phnum * sizeof(Elf32_Phdr));
21362 +
21363 + fseek (ifp, ehdr.e_phoff, SEEK_SET);
21364 + if (elfPhdrRead (ifp, &ehdr, phtab, ehdr.e_phnum) != ehdr.e_phnum) {
21365 + fprintf (stderr,"%s: failed to read program header\n", progname);
21366 + return 1;
21367 + }
21368 + }
21369 + else {
21370 + /* fake up the header etc */
21371 + struct stat stb;
21372 +
21373 + ehdr.e_phnum = 1;
21374 + ehdr.e_entry = prombase + rawoffs;
21375 + ph = phtab = (Elf32_Phdr *) xmalloc (sizeof(Elf32_Phdr));
21376 + ph->p_type = PT_LOAD;
21377 + ph->p_flags = PF_R | PF_X;
21378 + ph->p_vaddr = ph->p_paddr = prombase + rawoffs;
21379 + fstat (fileno (ifp), &stb);
21380 + ph->p_filesz = ph->p_memsz = stb.st_size;
21381 + }
21382 +
21383 + if (listflag) {
21384 + printf ("Segment List\n");
21385 + printf ("Num Type Vaddr Paddr MemSz FSize FOffs Align Flgs\n");
21386 + for (ph = phtab; ph < &phtab[ehdr.e_phnum]; ph++) {
21387 + printf (" %1d %8s %08x %08x %05x %05x %05x %05x %s%s\n",
21388 + ph-phtab, phtype(ph), ph->p_vaddr, ph->p_paddr,
21389 + ph->p_memsz, ph->p_filesz, ph->p_offset, ph->p_align,
21390 + phflags(ph), omitseg[ph-phtab]?" (omitted)":"");
21391 + }
21392 + exit (0);
21393 + }
21394 +
21395 + (*fmt->start) (ofp, ehdr.e_entry, bigendian);
21396 +
21397 + /* sort program header table into physical address order */
21398 + qsort (phtab, ehdr.e_phnum, sizeof (phtab[0]), phcompar);
21399 +
21400 + if (promflag) {
21401 + /* do prom-resident segments first */
21402 + for (ph = phtab; ph < &phtab[ehdr.e_phnum]; ph++)
21403 + if (ph->p_type == PT_LOAD) {
21404 + unsigned int offset;
21405 + offset = (ph->p_paddr ? ph->p_paddr : ph->p_vaddr)
21406 + & 0x1fffffff;
21407 + if (offset >= prombase && offset < promlimit
21408 + && !omitseg[ph - phtab]) {
21409 + convertSegment (ifp, fmt, ph);
21410 + ph->p_type = PT_NULL;
21411 + }
21412 + }
21413 + }
21414 +
21415 + /* then do all other segments in order */
21416 + for (ph = phtab; ph < &phtab[ehdr.e_phnum]; ph++)
21417 + if (ph->p_type == PT_LOAD && ph->p_filesz && !omitseg[ph - phtab])
21418 + convertSegment (ifp, fmt, ph);
21419 +
21420 + if (symflag && !rawflag && fmt->sym)
21421 + convertSymbols (ifp, &ehdr, fmt);
21422 +
21423 + (*fmt->end) (ehdr.e_entry);
21424 +
21425 + free (phtab);
21426 +
21427 + return 0;
21428 +}
21429 --- /dev/null
21430 +++ b/convert/elf.h
21431 @@ -0,0 +1,248 @@
21432 +/* elf.h: ELF data structures and values
21433 +
21434 + Copyright (c) 1993-2003, 2008 Free Software Foundation, Inc.
21435 + Contributed by MIPS Technologies, Inc.
21436 +
21437 + This program is free software; you can redistribute it and/or modify
21438 + it under the terms of the GNU General Public License as published by
21439 + the Free Software Foundation; either version 3, or (at your option)
21440 + any later version.
21441 +
21442 + This program is distributed in the hope that it will be useful,
21443 + but WITHOUT ANY WARRANTY; without even the implied warranty of
21444 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21445 + GNU General Public License for more details.
21446 +
21447 + You should have received a copy of the GNU General Public License
21448 + along with this program; If not, write to the Free Software
21449 + Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
21450 + 02110-1301, USA. */
21451 +
21452 +typedef unsigned char Elf_Char;
21453 +typedef unsigned short Elf32_Half;
21454 +typedef unsigned long Elf32_Word;
21455 +typedef long Elf32_Sword;
21456 +typedef unsigned long Elf32_Off;
21457 +typedef unsigned long Elf32_Addr;
21458 +
21459 +#define EI_NIDENT 16
21460 +
21461 +typedef struct {
21462 + Elf_Char e_ident[EI_NIDENT];
21463 + Elf32_Half e_type;
21464 + Elf32_Half e_machine;
21465 + Elf32_Word e_version;
21466 + Elf32_Addr e_entry;
21467 + Elf32_Off e_phoff;
21468 + Elf32_Off e_shoff;
21469 + Elf32_Word e_flags;
21470 + Elf32_Half e_ehsize;
21471 + Elf32_Half e_phentsize;
21472 + Elf32_Half e_phnum;
21473 + Elf32_Half e_shentsize;
21474 + Elf32_Half e_shnum;
21475 + Elf32_Half e_shstrndx;
21476 +} Elf32_Ehdr;
21477 +
21478 +typedef struct {
21479 + Elf32_Word p_type; /* Identifies program segment type */
21480 + Elf32_Off p_offset; /* Segment file offset */
21481 + Elf32_Addr p_vaddr; /* Segment virtual address */
21482 + Elf32_Addr p_paddr; /* Segment physical address */
21483 + Elf32_Word p_filesz; /* Segment size in file */
21484 + Elf32_Word p_memsz; /* Segment size in memory */
21485 + Elf32_Word p_flags; /* Segment flags */
21486 + Elf32_Word p_align; /* Segment alignment, file & memory */
21487 +} Elf32_Phdr;
21488 +
21489 +typedef struct {
21490 + Elf32_Word sh_name;
21491 + Elf32_Word sh_type;
21492 + Elf32_Word sh_flags;
21493 + Elf32_Addr sh_addr;
21494 + Elf32_Off sh_offset;
21495 + Elf32_Word sh_size;
21496 + Elf32_Word sh_link;
21497 + Elf32_Word sh_info;
21498 + Elf32_Word sh_addralign;
21499 + Elf32_Word sh_entsize;
21500 +} Elf32_Shdr;
21501 +
21502 +typedef struct {
21503 + Elf32_Word st_name;
21504 + Elf32_Addr st_value;
21505 + Elf32_Word st_size;
21506 + Elf_Char st_info;
21507 + Elf_Char st_other;
21508 + Elf32_Half st_shndx;
21509 +} Elf32_Sym;
21510 +
21511 +typedef struct {
21512 + Elf32_Addr r_offset;
21513 + Elf32_Word r_info;
21514 + Elf32_Sword r_addend;
21515 +} Elf32_Rela;
21516 +
21517 +typedef struct {
21518 + Elf32_Addr r_offset;
21519 + Elf32_Word r_info;
21520 +} Elf32_Rel;
21521 +
21522 +/* these are the external file sizes (should be absolute values) */
21523 +#define ELFEHDRSZ sizeof(Elf32_Ehdr)
21524 +#define ELFPHDRSZ sizeof(Elf32_Phdr)
21525 +#define ELFSHDRSZ sizeof(Elf32_Shdr)
21526 +#define ELFSYMSZ sizeof(Elf32_Sym)
21527 +#define ELFRELASZ sizeof(Elf32_Rela)
21528 +#define ELFRELSZ sizeof(Elf32_Rel)
21529 +
21530 +size_t elfEhdrRead(FILE *,Elf32_Ehdr *);
21531 +size_t elfEhdrWrite(FILE *,const Elf32_Ehdr *);
21532 +
21533 +size_t elfPhdrRead(FILE *, const Elf32_Ehdr *, Elf32_Phdr *, size_t);
21534 +size_t elfPhdrWrite(FILE *, const Elf32_Ehdr *, const Elf32_Phdr *, size_t);
21535 +
21536 +size_t elfShdrRead(FILE *,const Elf32_Ehdr *, Elf32_Shdr *,size_t);
21537 +size_t elfShdrWrite(FILE *,const Elf32_Ehdr *,const Elf32_Shdr *,size_t);
21538 +
21539 +size_t elfSymRead(FILE *,const Elf32_Ehdr *,const Elf32_Shdr *,
21540 + Elf32_Sym *,size_t);
21541 +size_t elfSymWrite(FILE *,const Elf32_Ehdr *,const Elf32_Shdr *,
21542 + const Elf32_Sym *,size_t);
21543 +
21544 +size_t elfRelaWrite(FILE *,const Elf32_Ehdr *,const Elf32_Shdr *,
21545 + const Elf32_Rela *,size_t);
21546 +size_t elfRelWrite(FILE *,const Elf32_Ehdr *,const Elf32_Shdr *,
21547 + const Elf32_Rel *,size_t);
21548 +
21549 +
21550 +/* ELF header */
21551 +
21552 +/* e_ident[] fields */
21553 +#define EI_MAG0 0 /* id byte 0 index */
21554 +#define ELFMAG0 0x7F /* id byte 0 value */
21555 +
21556 +#define EI_MAG1 1 /* id byte 1 index */
21557 +#define ELFMAG1 'E' /* id byte 1 value */
21558 +
21559 +#define EI_MAG2 2 /* id byte 2 index */
21560 +#define ELFMAG2 'L' /* id byte 3 value */
21561 +
21562 +#define EI_MAG3 3 /* id byte 3 index */
21563 +#define ELFMAG3 'F' /* id byte 3 value */
21564 +
21565 +#define EI_CLASS 4 /* file class */
21566 +#define ELFCLASSNONE 0 /* invalid */
21567 +#define ELFCLASS32 1 /* 32-bit */
21568 +#define ELFCLASS64 2 /* 64-bit */
21569 +
21570 +#define EI_DATA 5 /* data encoding */
21571 +#define ELFDATANONE 0 /* invalid */
21572 +#define ELFDATA2LSB 1 /* little endian */
21573 +#define ELFDATA2MSB 2 /* big endian */
21574 +
21575 +#define EI_VERSION 6 /* file format version */
21576 +
21577 +#define EI_PAD 7 /* start of padding */
21578 +
21579 +
21580 +/* e_type values */
21581 +#define ET_NONE 0 /* no file type */
21582 +#define ET_REL 1 /* relocatable */
21583 +#define ET_EXEC 2 /* executable */
21584 +#define ET_DYN 3 /* shared object */
21585 +#define ET_CORE 4 /* core file */
21586 +#define ET_LOPROC 0xFF00 /* processor-specific (lo) */
21587 +#define ET_HIPROC 0xFFFF /* processor-specific (hi) */
21588 +
21589 +/* e_machine values */
21590 +#define EM_NONE 0 /* undefined machine */
21591 +#define EM_M32 1 /* AT&T WE 32100 */
21592 +#define EM_SPARC 2 /* SUN SPARC */
21593 +#define EM_386 3 /* Intel 80386 */
21594 +#define EM_68K 4 /* Motorola M68K family */
21595 +#define EM_88K 5 /* Motorola M88K family */
21596 +#define EM_860 7 /* Intel 80860 */
21597 +#define EM_MIPS 8 /* MIPS Rx000 */
21598 +
21599 +/* e_version values */
21600 +#define EV_NONE 0 /* invalid */
21601 +#define EV_CURRENT 1 /* current version */
21602 +
21603 +/* Program header */
21604 +
21605 +/* p_type field */
21606 +#define PT_NULL 0 /* unused */
21607 +#define PT_LOAD 1 /* loadable segment */
21608 +#define PT_DYNAMIC 2 /* dynamic link information */
21609 +#define PT_INTERP 3 /* interpreter */
21610 +#define PT_NOTE 4 /* auxiliary information */
21611 +#define PT_SHLIB 5 /* shared library */
21612 +#define PT_PHDR 6 /* self */
21613 +#define PT_LOPROC 0x70000000 /* processor-specific (lo) */
21614 +#define PT_HIPROC 0x7FFFFFFF /* processor-specific (ho) */
21615 +
21616 +/* p_flags bit fields */
21617 +#define PF_X (1 << 0) /* executable */
21618 +#define PF_W (1 << 1) /* writable */
21619 +#define PF_R (1 << 2) /* readable */
21620 +#define PF_MASKPROC 0xF0000000 /* processor-specific bits */
21621 +
21622 +/* Section header */
21623 +
21624 +/* sh_type values */
21625 +#define SHT_NULL 0 /* unused */
21626 +#define SHT_PROGBITS 1 /* program code or data */
21627 +#define SHT_SYMTAB 2 /* symbol table */
21628 +#define SHT_STRTAB 3 /* string table */
21629 +#define SHT_RELA 4 /* relocation records (with addends) */
21630 +#define SHT_HASH 5 /* symbol hash table */
21631 +#define SHT_DYNAMIC 6 /* dynamic linking table */
21632 +#define SHT_NOTE 7 /* comments */
21633 +#define SHT_NOBITS 8 /* zero program data (i.e. bss)*/
21634 +#define SHT_REL 9 /* relocation records (w/o addends) */
21635 +#define SHT_SHLIB 10 /* shared library */
21636 +#define SHT_DYNSYM 11 /* dynamic linking symbol table */
21637 +#define SHT_LOPROC 0x70000000 /* processor specific (lo) */
21638 +#define SHT_HIPROC 0x7FFFFFFF /* processor specific (hi) */
21639 +#define SHT_LOUSER 0x80000000 /* user specific (lo) */
21640 +#define SHT_HIUSER 0x8FFFFFFF /* user specific (hi) */
21641 +
21642 +/* sh_flags bit fields */
21643 +#define SHF_WRITE (1 << 0) /* writable section */
21644 +#define SHF_ALLOC (1 << 1) /* allocated in program space */
21645 +#define SHF_EXECINSTR (1 << 2) /* executable instructions */
21646 +#define SHF_MASKPROC 0xF0000000 /* processor-specific bits */
21647 +
21648 +/* symbol binding */
21649 +#define STB_LOCAL 0 /* local to this file */
21650 +#define STB_GLOBAL 1 /* globally visible */
21651 +#define STB_WEAK 2 /* weakly global */
21652 +#define STB_LOPROC 13 /* processor-specific (lo) */
21653 +#define STB_HIPROC 15 /* processor-specific (hi) */
21654 +
21655 +/* symbol type */
21656 +#define STT_NOTYPE 0 /* unspecified */
21657 +#define STT_OBJECT 1 /* data object */
21658 +#define STT_FUNC 2 /* code object */
21659 +#define STT_SECTION 3 /* section symbol */
21660 +#define STT_FILE 4 /* file name symbol */
21661 +#define STT_LOPROC 13 /* processor-specific (lo) */
21662 +#define STT_HIPROC 15 /* processor-specific (hi) */
21663 +
21664 +/* special reserved values for st_shndx */
21665 +#define SHN_UNDEF 0 /* undefined (external) symbol */
21666 +#define SHN_LORESERV 0xFF00 /* reserved values (lo) */
21667 +#define SHN_LOPROC 0xFF00 /* processor-specific (lo) */
21668 +#define SHN_HIPROC 0xFF1F /* processor-specific (hi) */
21669 +#define SHN_ABS 0xFFF1 /* absolute symbol */
21670 +#define SHN_COMMON 0xFFF2 /* common symbol */
21671 +#define SHN_HIRESERVE 0xFFFF /* reserved values (hi)*/
21672 +
21673 +#define ELF32_R_SYM(i) ((i) >> 8)
21674 +#define ELF32_R_TYPE(i) ((i) & 0xff)
21675 +#define ELF32_R_INFO(sym,type) (((sym) << 8) | ((type) & 0xff))
21676 +
21677 +#define ELF32_ST_BIND(i) ((i) >> 4)
21678 +#define ELF32_ST_TYPE(i) ((i) & 0xf)
21679 +#define ELF32_ST_INFO(bind,type) (((bind) << 4) | ((type) & 0xf))
21680 --- /dev/null
21681 +++ b/convert/elfio.c
21682 @@ -0,0 +1,553 @@
21683 +/* elfio.c: ELF file i/o primitives
21684 +
21685 + Copyright (c) 1993-2003, 2008 Free Software Foundation, Inc.
21686 + Contributed by MIPS Technologies, Inc.
21687 +
21688 + This program is free software; you can redistribute it and/or modify
21689 + it under the terms of the GNU General Public License as published by
21690 + the Free Software Foundation; either version 3, or (at your option)
21691 + any later version.
21692 +
21693 + This program is distributed in the hope that it will be useful,
21694 + but WITHOUT ANY WARRANTY; without even the implied warranty of
21695 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21696 + GNU General Public License for more details.
21697 +
21698 + You should have received a copy of the GNU General Public License
21699 + along with this program; If not, write to the Free Software
21700 + Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
21701 + 02110-1301, USA. */
21702 +
21703 +#include "sysdep.h"
21704 +#include "elfmips.h"
21705 +
21706 +#define ELFINU8(b,w) \
21707 + (w = bp[0])
21708 +
21709 +#define ELFINMSBU16(b,w) \
21710 + (w = ((b)[0] << 8) | (b)[1])
21711 +
21712 +#define ELFINLSBU16(b,w) \
21713 + (w = ((b)[1] << 8) | (b)[0])
21714 +
21715 +#define ELFINMSBU32(b,w) \
21716 + (w = ((unsigned long)(b)[0] << 24) | \
21717 + ((unsigned long)(b)[1] << 16) | \
21718 + ((b)[2] << 8) | \
21719 + (b)[3])
21720 +
21721 +#define ELFINLSBU32(b,w) \
21722 + (w = ((unsigned long)(b)[3] << 24) | \
21723 + ((unsigned long)(b)[2] << 16) | \
21724 + ((b)[1] << 8) | \
21725 + (b)[0])
21726 +
21727 +#define ELFOUTU8(b,w) \
21728 + (bp[0] = w)
21729 +
21730 +#define ELFOUTMSBU16(b,w) \
21731 + ((b)[0] = (w >> 8), \
21732 + (b)[1] = w)
21733 +
21734 +#define ELFOUTLSBU16(b,w) \
21735 + ((b)[1] = (w >> 8), \
21736 + (b)[0] = w)
21737 +
21738 +#define ELFOUTMSBU32(b,w) \
21739 + ((b)[0] = (w >> 24), \
21740 + (b)[1] = (w >> 16), \
21741 + (b)[2] = (w >> 8), \
21742 + (b)[3] = w)
21743 +
21744 +#define ELFOUTLSBU32(b,w) \
21745 + ((b)[3] = (w >> 24), \
21746 + (b)[2] = (w >> 16), \
21747 + (b)[1] = (w >> 8), \
21748 + (b)[0] = w)
21749 +
21750 +static unsigned long elfinlsbu32(unsigned char *bp)
21751 +{
21752 + unsigned long v;
21753 + ELFINLSBU32(bp,v);
21754 + return v;
21755 +}
21756 +
21757 +static unsigned int elfinlsbu16(unsigned char *bp)
21758 +{
21759 + unsigned int v;
21760 + ELFINLSBU16(bp,v);
21761 + return v;
21762 +}
21763 +
21764 +static unsigned long elfinmsbu32(unsigned char *bp)
21765 +{
21766 + unsigned long v;
21767 + ELFINMSBU32(bp,v);
21768 + return v;
21769 +}
21770 +static unsigned int elfinmsbu16(unsigned char *bp)
21771 +{
21772 + unsigned int v;
21773 + ELFINMSBU16(bp,v);
21774 + return v;
21775 +}
21776 +
21777 +static void elfoutmsbu32(unsigned char *bp,unsigned long v)
21778 +{
21779 + ELFOUTMSBU32(bp,v);
21780 +}
21781 +
21782 +static void elfoutmsbu16(unsigned char *bp,unsigned int v)
21783 +{
21784 + ELFOUTMSBU16(bp,v);
21785 +}
21786 +
21787 +static void elfoutlsbu32(unsigned char *bp,unsigned long v)
21788 +{
21789 + ELFOUTLSBU32(bp,v);
21790 +}
21791 +
21792 +static void elfoutlsbu16(unsigned char *bp,unsigned int v)
21793 +{
21794 + ELFOUTLSBU16(bp,v);
21795 +}
21796 +
21797 +
21798 +#define X3
21799 +
21800 +#if defined(X1)
21801 +/* this is applaing because there is no optimisation of the test
21802 + * of format between succesive macro calls
21803 +*/
21804 +#define ELFINU16(b,w) (format?ELFINLSBU16(b,w):ELFINMSBU16(b,w))
21805 +#define ELFINU32(b,w) (format?ELFINLSBU32(b,w):ELFINMSBU32(b,w))
21806 +#define ELFOUTU16(b,w) (format?ELFOUTLSBU16(b,w):ELFOUTMSBU16(b,w))
21807 +#define ELFOUTU32(b,w) (format?ELFOUTLSBU32(b,w):ELFOUTMSBU32(b,w))
21808 +#elif defined(X2)
21809 +/* this is also appaling because there is no optimisation of the test
21810 + * of format between succesive macro calls
21811 +*/
21812 +#define ELFINU16(b,w) w = (format?elfinlsbu16(b):elfinmsbu16(b))
21813 +#define ELFINU32(b,w) w = (format?elfinlsbu32(b):elfinmsbu32(b))
21814 +#define ELFOUTU16(b,w) (format?elfoutlsbu16(b,w):elfoutmsbu16(b,w))
21815 +#define ELFOUTU32(b,w) (format?elfoutlsbu32(b,w):elfoutmsbu32(b,w))
21816 +#elif defined(X3)
21817 +/* this works better but still is poor as the function address
21818 + * is loaded from table before each call
21819 +*/
21820 +static const struct {
21821 + void (*out16)(unsigned char *bp,unsigned int v);
21822 + void (*out32)(unsigned char *bp,unsigned long v);
21823 + unsigned int (*in16)(unsigned char *bp);
21824 + unsigned long (*in32)(unsigned char *bp);
21825 +} fvec[] = {
21826 + {elfoutmsbu16,elfoutmsbu32,elfinmsbu16,elfinmsbu32},
21827 + {elfoutlsbu16,elfoutlsbu32,elfinlsbu16,elfinlsbu32}
21828 +};
21829 +
21830 +#define ELFINU16(b,w) w = fvec[format].in16(b)
21831 +#define ELFINU32(b,w) w = fvec[format].in32(b)
21832 +#define ELFOUTU16(b,w) fvec[format].out16(b,w)
21833 +#define ELFOUTU32(b,w) fvec[format].out32(b,w)
21834 +#endif
21835 +
21836 +
21837 +#define ELFINCHAR(b,w) (ELFINU8(b,w),(b)+=1)
21838 +#define ELFINHALF(b,w) (ELFINU16(b,w),(b)+=2)
21839 +#define ELFINWORD(b,w) (ELFINU32(b,w),(b)+=4)
21840 +#define ELFINADDR(b,w) (ELFINU32(b,w),(b)+=4)
21841 +#define ELFINOFF(b,w) (ELFINU32(b,w),(b)+=4)
21842 +
21843 +#define ELFOUTCHAR(b,w) (ELFOUTU8(b,w),(b)+=1)
21844 +#define ELFOUTHALF(b,w) (ELFOUTU16(b,w),(b)+=2)
21845 +#define ELFOUTWORD(b,w) (ELFOUTU32(b,w),(b)+=4)
21846 +#define ELFOUTADDR(b,w) (ELFOUTU32(b,w),(b)+=4)
21847 +#define ELFOUTOFF(b,w) (ELFOUTU32(b,w),(b)+=4)
21848 +
21849 +/* Maximum sizes of things we will consider reading
21850 + * these are a bit more than that cos of poosible compiler struct padding
21851 + */
21852 +#define MAXEHDRSIZE sizeof(Elf32_Ehdr)
21853 +#define MAXPHDRSIZE sizeof(Elf32_Phdr)
21854 +#define MAXSHDRSIZE sizeof(Elf32_Shdr)
21855 +#define MAXRELASIZE sizeof(Elf32_Rela)
21856 +#define MAXSYMSIZE sizeof(Elf32_Sym)
21857 +#define MAXGPTABSIZE sizeof(Elf32_Gptab)
21858 +#define MAXREGINFOSIZE sizeof(Elf32_Reginfo)
21859 +
21860 +#define FORMATSELECT(eh) ((eh->e_ident[5] == ELFDATA2MSB)?0:1)
21861 +
21862 +size_t elfShdrRead(FILE *fp,
21863 + const Elf32_Ehdr *eh, Elf32_Shdr *sh,size_t nhdr)
21864 +{
21865 + int format = FORMATSELECT(eh);
21866 + size_t n;
21867 +
21868 + for(n=0; n<nhdr; sh++,n++) {
21869 + unsigned char buf[MAXSHDRSIZE];
21870 + unsigned char *bp = buf;
21871 +
21872 + if(fread(buf,eh->e_shentsize,1,fp) != 1)
21873 + break;
21874 +
21875 + /* convert from bytes to numbers
21876 + */
21877 + ELFINWORD(bp,sh->sh_name);
21878 + ELFINWORD(bp,sh->sh_type);
21879 + ELFINWORD(bp,sh->sh_flags);
21880 + ELFINADDR(bp,sh->sh_addr);
21881 + ELFINOFF(bp,sh->sh_offset);
21882 + ELFINWORD(bp,sh->sh_size);
21883 + ELFINWORD(bp,sh->sh_link);
21884 + ELFINWORD(bp,sh->sh_info);
21885 + ELFINWORD(bp,sh->sh_addralign);
21886 + ELFINWORD(bp,sh->sh_entsize);
21887 + }
21888 + return n;
21889 +}
21890 +
21891 +size_t elfShdrWrite(FILE *fp,
21892 + const Elf32_Ehdr *eh,
21893 + const Elf32_Shdr *sh,size_t nhdr)
21894 +{
21895 + int format = FORMATSELECT(eh);
21896 + size_t n;
21897 +
21898 + for(n=0; n<nhdr; sh++,n++) {
21899 + unsigned char buf[MAXSHDRSIZE];
21900 + unsigned char *bp = buf;
21901 +
21902 + /* convert from numbers to bytes
21903 + */
21904 + ELFOUTWORD(bp,sh->sh_name);
21905 + ELFOUTWORD(bp,sh->sh_type);
21906 + ELFOUTWORD(bp,sh->sh_flags);
21907 + ELFOUTADDR(bp,sh->sh_addr);
21908 + ELFOUTOFF(bp,sh->sh_offset);
21909 + ELFOUTWORD(bp,sh->sh_size);
21910 + ELFOUTWORD(bp,sh->sh_link);
21911 + ELFOUTWORD(bp,sh->sh_info);
21912 + ELFOUTWORD(bp,sh->sh_addralign);
21913 + ELFOUTWORD(bp,sh->sh_entsize);
21914 +
21915 + if(fwrite(buf,bp-buf,1,fp) != 1)
21916 + break;
21917 + }
21918 + return n;
21919 +}
21920 +
21921 +size_t elfPhdrRead(FILE *fp,
21922 + const Elf32_Ehdr *eh, Elf32_Phdr *ph,size_t nhdr)
21923 +{
21924 + int format = FORMATSELECT(eh);
21925 + size_t n;
21926 +
21927 + for(n=0; n<nhdr; ph++,n++) {
21928 + unsigned char buf[MAXPHDRSIZE];
21929 + unsigned char *bp = buf;
21930 +
21931 + if(fread(buf,eh->e_phentsize,1,fp) != 1)
21932 + break;
21933 +
21934 + /* convert from bytes to numbers */
21935 + ELFINWORD(bp,ph->p_type);
21936 + ELFINOFF(bp,ph->p_offset);
21937 + ELFINADDR(bp,ph->p_vaddr);
21938 + ELFINADDR(bp,ph->p_paddr);
21939 + ELFINWORD(bp,ph->p_filesz);
21940 + ELFINWORD(bp,ph->p_memsz);
21941 + ELFINWORD(bp,ph->p_flags);
21942 + ELFINWORD(bp,ph->p_align);
21943 + }
21944 + return n;
21945 +}
21946 +
21947 +size_t elfPhdrWrite(FILE *fp,
21948 + const Elf32_Ehdr *eh,
21949 + const Elf32_Phdr *ph,size_t nhdr)
21950 +{
21951 + int format = FORMATSELECT(eh);
21952 + size_t n;
21953 +
21954 + for(n=0; n<nhdr; ph++,n++) {
21955 + unsigned char buf[MAXPHDRSIZE];
21956 + unsigned char *bp = buf;
21957 +
21958 + /* convert from numbers to bytes */
21959 + ELFOUTWORD(bp,ph->p_type);
21960 + ELFOUTOFF(bp,ph->p_offset);
21961 + ELFOUTADDR(bp,ph->p_vaddr);
21962 + ELFOUTADDR(bp,ph->p_paddr);
21963 + ELFOUTWORD(bp,ph->p_filesz);
21964 + ELFOUTWORD(bp,ph->p_memsz);
21965 + ELFOUTWORD(bp,ph->p_flags);
21966 + ELFOUTWORD(bp,ph->p_align);
21967 +
21968 + if(fwrite(buf,bp-buf,1,fp) != 1)
21969 + break;
21970 + }
21971 + return n;
21972 +}
21973 +
21974 +size_t elfSymRead(FILE *fp,
21975 + const Elf32_Ehdr *eh,
21976 + const Elf32_Shdr *sh,
21977 + Elf32_Sym *sym,size_t nsym)
21978 +{
21979 + int format = FORMATSELECT(eh);
21980 + size_t n;
21981 +
21982 + for(n=0; n<nsym; sym++,n++) {
21983 + unsigned char buf[MAXSYMSIZE];
21984 + unsigned char *bp = buf;
21985 +
21986 + if(fread(buf,sh->sh_entsize,1,fp) != 1)
21987 + break;
21988 +
21989 + /* convert from bytes to numbers
21990 + */
21991 + ELFINWORD(bp,sym->st_name);
21992 + ELFINADDR(bp,sym->st_value);
21993 + ELFINWORD(bp,sym->st_size);
21994 + ELFINCHAR(bp,sym->st_info);
21995 + ELFINCHAR(bp,sym->st_other);
21996 + ELFINHALF(bp,sym->st_shndx);
21997 + }
21998 + return n;
21999 +}
22000 +
22001 +size_t elfSymWrite(FILE *fp,
22002 + const Elf32_Ehdr *eh,
22003 + const Elf32_Shdr *sh,
22004 + const Elf32_Sym *sym,size_t nhdr)
22005 +{
22006 + int format = FORMATSELECT(eh);
22007 + size_t n;
22008 +
22009 + for(n=0; n<nhdr; sym++,n++) {
22010 + unsigned char buf[MAXSYMSIZE];
22011 + unsigned char *bp = buf;
22012 +
22013 + /* convert from numbers to bytes
22014 + */
22015 + ELFOUTWORD(bp,sym->st_name);
22016 + ELFOUTADDR(bp,sym->st_value);
22017 + ELFOUTWORD(bp,sym->st_size);
22018 + ELFOUTCHAR(bp,sym->st_info);
22019 + ELFOUTCHAR(bp,sym->st_other);
22020 + ELFOUTHALF(bp,sym->st_shndx);
22021 +
22022 + if(fwrite(buf,bp-buf,1,fp) != 1)
22023 + break;
22024 + }
22025 + return n;
22026 +}
22027 +
22028 +size_t elfRelaWrite(FILE *fp,
22029 + const Elf32_Ehdr *eh,
22030 + const Elf32_Shdr *sh,
22031 + const Elf32_Rela *rela,size_t nhdr)
22032 +{
22033 + int format = FORMATSELECT(eh);
22034 + size_t n;
22035 +
22036 + for(n=0; n<nhdr; rela++,n++) {
22037 + unsigned char buf[MAXRELASIZE];
22038 + unsigned char *bp = buf;
22039 +
22040 + /* convert from numbers to bytes
22041 + */
22042 + ELFOUTWORD(bp,rela->r_offset);
22043 + ELFOUTWORD(bp,rela->r_info);
22044 + ELFOUTWORD(bp,rela->r_addend);
22045 +
22046 + if(fwrite(buf,bp-buf,1,fp) != 1)
22047 + break;
22048 + }
22049 + return n;
22050 +}
22051 +
22052 +size_t elfEhdrWrite(FILE *fp,const Elf32_Ehdr *eh)
22053 +{
22054 + int format = FORMATSELECT(eh);
22055 + unsigned char buf[MAXEHDRSIZE];
22056 + unsigned char *bp = buf;
22057 +
22058 + memcpy(bp,eh->e_ident,EI_NIDENT);
22059 + bp += EI_NIDENT;
22060 +
22061 + ELFOUTHALF(bp,eh->e_type);
22062 + ELFOUTHALF(bp,eh->e_machine);
22063 + ELFOUTWORD(bp,eh->e_version);
22064 + ELFOUTADDR(bp,eh->e_entry);
22065 + ELFOUTOFF(bp,eh->e_phoff);
22066 + ELFOUTOFF(bp,eh->e_shoff);
22067 + ELFOUTWORD(bp,eh->e_flags);
22068 + ELFOUTHALF(bp,eh->e_ehsize);
22069 + ELFOUTHALF(bp,eh->e_phentsize);
22070 + ELFOUTHALF(bp,eh->e_phnum);
22071 + ELFOUTHALF(bp,eh->e_shentsize);
22072 + ELFOUTHALF(bp,eh->e_shnum);
22073 + ELFOUTHALF(bp,eh->e_shstrndx);
22074 +
22075 + return fwrite(&buf,bp-buf,1,fp);
22076 +}
22077 +
22078 +size_t elfEhdrRead(FILE *fp,Elf32_Ehdr *eh)
22079 +{
22080 + unsigned char buf[MAXEHDRSIZE];
22081 + unsigned char *bp = buf;
22082 +
22083 + if(fread(buf,ELFEHDRSZ,1,fp) != 1)
22084 + return 0;
22085 +
22086 + memcpy(eh->e_ident,bp,EI_NIDENT);
22087 + bp += EI_NIDENT;
22088 +
22089 + if(eh->e_ident[0] != ELFMAG0 ||
22090 + eh->e_ident[1] != ELFMAG1 ||
22091 + eh->e_ident[2] != ELFMAG2 ||
22092 + eh->e_ident[3] != ELFMAG3)
22093 + return 0;
22094 +
22095 + if(eh->e_ident[4] != ELFCLASS32)
22096 + return 0;
22097 +
22098 + if(eh->e_ident[5] != ELFDATA2MSB && eh->e_ident[5] != ELFDATA2LSB)
22099 + return 0;
22100 +
22101 +#ifdef notdef
22102 + /* what should the version in the ident be ?? */
22103 + if(eh->e_ident[6] != 1)
22104 + return 0;
22105 +#endif
22106 +
22107 + {
22108 + int i;
22109 +
22110 + for(i=7;i<EI_NIDENT;i++)
22111 + if(eh->e_ident[i] != 0)
22112 + return 0;
22113 + }
22114 + {
22115 + int format = FORMATSELECT(eh);
22116 +
22117 + ELFINHALF(bp,eh->e_type);
22118 + ELFINHALF(bp,eh->e_machine);
22119 + ELFINWORD(bp,eh->e_version);
22120 + ELFINADDR(bp,eh->e_entry);
22121 + ELFINOFF(bp,eh->e_phoff);
22122 + ELFINOFF(bp,eh->e_shoff);
22123 + ELFINWORD(bp,eh->e_flags);
22124 + ELFINHALF(bp,eh->e_ehsize);
22125 + ELFINHALF(bp,eh->e_phentsize);
22126 + ELFINHALF(bp,eh->e_phnum);
22127 + ELFINHALF(bp,eh->e_shentsize);
22128 + ELFINHALF(bp,eh->e_shnum);
22129 + ELFINHALF(bp,eh->e_shstrndx);
22130 + }
22131 + return 1;
22132 +}
22133 +
22134 +
22135 +size_t elfReginfoWrite(FILE *fp,
22136 + const Elf32_Ehdr *eh,
22137 + const Elf32_Shdr *sh,
22138 + const Elf32_Reginfo *ri,size_t nhdr)
22139 +{
22140 + int format = FORMATSELECT(eh);
22141 + size_t n;
22142 +
22143 + for(n=0; n<nhdr; ri++,n++) {
22144 + unsigned char buf[MAXREGINFOSIZE];
22145 + unsigned char *bp = buf;
22146 + int i;
22147 +
22148 + /* convert from numbers to bytes
22149 + */
22150 + ELFOUTWORD(bp,ri->ri_gprmask);
22151 + for (i = 0; i < 4; i++) {
22152 + ELFOUTWORD(bp,ri->ri_cprmask[i]);
22153 + }
22154 + ELFOUTWORD(bp,ri->ri_gp_value);
22155 +
22156 + if(fwrite(buf,bp-buf,1,fp) != 1)
22157 + break;
22158 + }
22159 + return n;
22160 +}
22161 +
22162 +
22163 +size_t elfReginfoRead (FILE *fp,
22164 + const Elf32_Ehdr *eh,
22165 + const Elf32_Shdr *sh,
22166 + Elf32_Reginfo *ri,size_t nhdr)
22167 +{
22168 + int format = FORMATSELECT(eh);
22169 + size_t n;
22170 +
22171 + for(n=0; n<nhdr; ri++,n++) {
22172 + unsigned char buf[MAXREGINFOSIZE];
22173 + unsigned char *bp = buf;
22174 + int i;
22175 +
22176 + if(fread(buf,sh->sh_entsize,1,fp) != 1)
22177 + break;
22178 +
22179 + /* convert from numbers to bytes
22180 + */
22181 + ELFINWORD(bp,ri->ri_gprmask);
22182 + for (i = 0; i < 4; i++) {
22183 + ELFINWORD(bp,ri->ri_cprmask[i]);
22184 + }
22185 + ELFINWORD(bp,ri->ri_gp_value);
22186 + }
22187 + return n;
22188 +}
22189 +
22190 +size_t elfGptabWrite(FILE *fp,
22191 + const Elf32_Ehdr *eh,
22192 + const Elf32_Shdr *sh,
22193 + const Elf32_Gptab *gt,size_t nhdr)
22194 +{
22195 + int format = FORMATSELECT(eh);
22196 + size_t n;
22197 +
22198 + for(n=0; n<nhdr; gt++,n++) {
22199 + unsigned char buf[MAXGPTABSIZE];
22200 + unsigned char *bp = buf;
22201 +
22202 + /* convert from numbers to bytes
22203 + */
22204 + ELFOUTWORD(bp,gt->gt_entry.gt_g_value);
22205 + ELFOUTWORD(bp,gt->gt_entry.gt_bytes);
22206 +
22207 + if(fwrite(buf,bp-buf,1,fp) != 1)
22208 + break;
22209 + }
22210 + return n;
22211 +}
22212 +
22213 +
22214 +size_t elfGptabRead(FILE *fp,
22215 + const Elf32_Ehdr *eh,
22216 + const Elf32_Shdr *sh,
22217 + Elf32_Gptab *gt,size_t nhdr)
22218 +{
22219 + int format = FORMATSELECT(eh);
22220 + size_t n;
22221 +
22222 + for(n=0; n<nhdr; gt++,n++) {
22223 + unsigned char buf[MAXGPTABSIZE];
22224 + unsigned char *bp = buf;
22225 +
22226 + if(fread(buf,sh->sh_entsize,1,fp) != 1)
22227 + break;
22228 +
22229 + /* convert from numbers to bytes
22230 + */
22231 + ELFINWORD(bp,gt->gt_entry.gt_g_value);
22232 + ELFINWORD(bp,gt->gt_entry.gt_bytes);
22233 + }
22234 + return n;
22235 +}
22236 --- /dev/null
22237 +++ b/convert/elfmips.h
22238 @@ -0,0 +1,122 @@
22239 +/* elfmips.h: MIPS ABI specific ELF definitions
22240 +
22241 + Copyright (c) 1993-2003, 2008 Free Software Foundation, Inc.
22242 + Contributed by MIPS Technologies, Inc.
22243 +
22244 + This program is free software; you can redistribute it and/or modify
22245 + it under the terms of the GNU General Public License as published by
22246 + the Free Software Foundation; either version 3, or (at your option)
22247 + any later version.
22248 +
22249 + This program is distributed in the hope that it will be useful,
22250 + but WITHOUT ANY WARRANTY; without even the implied warranty of
22251 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22252 + GNU General Public License for more details.
22253 +
22254 + You should have received a copy of the GNU General Public License
22255 + along with this program; If not, write to the Free Software
22256 + Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
22257 + 02110-1301, USA. */
22258 +
22259 +#include "elf.h"
22260 +
22261 +/* MIPSABI program header special */
22262 +#define PT_MIPS_REGINFO (PT_LOPROC + 0)
22263 +
22264 +/* SDEMIPS relocation (rela type) */
22265 +#define R_SDE_8 0
22266 +#define R_SDE_16 1
22267 +#define R_SDE_32 2
22268 +#define R_SDE_ILA 35
22269 +#define R_SDE_IGPREL 36
22270 +#define R_SDE_ILAHI 37
22271 +#define R_SDE_ILALO 38
22272 +#define R_SDE_IBRA 39
22273 +#define R_SDE_IJMP 40
22274 +#define R_SDE_ILITERAL 41
22275 +
22276 +/* MIPSABI relocation (rel type) */
22277 +#define R_MIPS_NONE 0
22278 +#define R_MIPS_16 1
22279 +#define R_MIPS_32 2
22280 +#define R_MIPS_REL32 3
22281 +#define R_MIPS_26 4
22282 +#define R_MIPS_HI16 5
22283 +#define R_MIPS_LO16 6
22284 +#define R_MIPS_GPREL16 7
22285 +#define R_MIPS_LITERAL 8
22286 +#define R_MIPS_GOT16 9
22287 +#define R_MIPS_PC16 10
22288 +#define R_MIPS_CALL16 11
22289 +#define R_MIPS_GPREL32 12
22290 +
22291 +/* MIPSABI special section numbers */
22292 +#define SHN_MIPS_ACOMMON (SHN_LOPROC + 0)
22293 +#define SHN_MIPS_SCOMMON (SHN_LOPROC + 3)
22294 +#define SHN_MIPS_SUNDEFINED (SHN_LOPROC + 4)
22295 +
22296 +/* MIPSABI special section types */
22297 +#define SHT_MIPS_LIBLIST (SHT_LOPROC + 0)
22298 +#define SHT_MIPS_CONFLICT (SHT_LOPROC + 2)
22299 +#define SHT_MIPS_GPTAB (SHT_LOPROC + 3)
22300 +#define SHT_MIPS_UCODE (SHT_LOPROC + 4)
22301 +#define SHT_MIPS_DEBUG (SHT_LOPROC + 5)
22302 +#define SHT_MIPS_REGINFO (SHT_LOPROC + 6)
22303 +
22304 +/* MIPSABI special section flags */
22305 +#define SHF_MIPS_GPREL 0x10000000
22306 +
22307 +/* MIPSABI processor specific flags */
22308 +#define EF_MIPS_NOREORDER 0x00000001
22309 +#define EF_MIPS_PIC 0x00000002
22310 +#define EF_MIPS_CPIC 0x00000004
22311 +#define EF_MIPS_ARCH 0xf0000000
22312 +#define E_MIPS_ARCH_1 0x00000000 /* -mips1 */
22313 +#define E_MIPS_ARCH_2 0x10000000 /* -mips2 */
22314 +#define E_MIPS_ARCH_3 0x20000000 /* -mips3 */
22315 +#define E_MIPS_ARCH_4 0x30000000 /* -mips4 */
22316 +/* The following are not MIPSABI, but SDE-MIPS only */
22317 +#define EF_MIPS_CPU 0x000f0000
22318 +#define E_MIPS_CPU_STD 0x00000000
22319 +#define E_MIPS_CPU_CW4 0x00010000
22320 +#define E_MIPS_CPU_R4100 0x00020000
22321 +#define E_MIPS_CPU_R4650 0x00030000
22322 +#define E_MIPS_CPU_R3900 0x00040000
22323 +#define E_MIPS_CPU_RM52XX 0x00050000
22324 +#define EF_MIPS_NOGPCOUNT 0x00001000
22325 +
22326 +/* MIPSABI special sections */
22327 +
22328 +/* .reginfo */
22329 +typedef struct {
22330 + Elf32_Word ri_gprmask;
22331 + Elf32_Word ri_cprmask[4];
22332 + Elf32_Sword ri_gp_value;
22333 +} Elf32_Reginfo;
22334 +
22335 +#define ELFREGINFOSZ sizeof(Elf32_Reginfo)
22336 +
22337 +size_t elfReginfoWrite(FILE *,const Elf32_Ehdr *,const Elf32_Shdr *,
22338 + const Elf32_Reginfo *,size_t);
22339 +size_t elfReginfoRead(FILE *,const Elf32_Ehdr *,const Elf32_Shdr *,
22340 + Elf32_Reginfo *,size_t);
22341 +
22342 +/* .gptab.xxx */
22343 +typedef union {
22344 + struct {
22345 + Elf32_Word gt_current_g_value;
22346 + Elf32_Word gt_unused;
22347 + } gt_header;
22348 + struct {
22349 + Elf32_Word gt_g_value;
22350 + Elf32_Word gt_bytes;
22351 + } gt_entry;
22352 +} Elf32_Gptab;
22353 +
22354 +#define ELFGPTABSZ sizeof(Elf32_Gptab)
22355 +
22356 +size_t elfGptabRead(FILE *,const Elf32_Ehdr *,const Elf32_Shdr *,
22357 + Elf32_Gptab *,size_t);
22358 +size_t elfGptabWrite(FILE *,const Elf32_Ehdr *,const Elf32_Shdr *,
22359 + const Elf32_Gptab *,size_t);
22360 +
22361 --- /dev/null
22362 +++ b/convert/elfout.c
22363 @@ -0,0 +1,188 @@
22364 +/* elfout.c -- ELF Output
22365 +
22366 + Copyright (c) 1993-2003, 2008 Free Software Foundation, Inc.
22367 + Contributed by MIPS Technologies, Inc.
22368 +
22369 + This program is free software; you can redistribute it and/or modify
22370 + it under the terms of the GNU General Public License as published by
22371 + the Free Software Foundation; either version 3, or (at your option)
22372 + any later version.
22373 +
22374 + This program is distributed in the hope that it will be useful,
22375 + but WITHOUT ANY WARRANTY; without even the implied warranty of
22376 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22377 + GNU General Public License for more details.
22378 +
22379 + You should have received a copy of the GNU General Public License
22380 + along with this program; If not, write to the Free Software
22381 + Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
22382 + 02110-1301, USA. */
22383 +
22384 +#include "sysdep.h"
22385 +#include "elfmips.h"
22386 +
22387 +#define BUFSIZE 8192 /* max bytes per block */
22388 +
22389 +static FILE *elffp;
22390 +static unsigned long elffirst = ~0;
22391 +static unsigned long elfaddr = ~0;
22392 +static long elfoffs;
22393 +static int elflen;
22394 +static unsigned char *elfbuf;
22395 +
22396 +static Elf32_Ehdr ehdr;
22397 +#define NSECTIONS 9
22398 +static Elf32_Phdr phdr[NSECTIONS];
22399 +static Elf32_Shdr shdr[NSECTIONS + 1]; /* plus 1 for shsectname */
22400 +static int nsect;
22401 +
22402 +extern char * progname;
22403 +extern int promflag;
22404 +extern unsigned long prombase;
22405 +
22406 +static void
22407 +elfFlush (int endsect)
22408 +{
22409 + if (elflen > 0) {
22410 + fwrite (elfbuf, 1, elflen, elffp);
22411 + elfoffs += elflen;
22412 + elfaddr += elflen;
22413 + elflen = 0;
22414 + }
22415 +
22416 + if (endsect && nsect > 1) {
22417 + Elf32_Shdr *sh = &shdr[nsect - 1];
22418 + sh->sh_size = elfoffs - sh->sh_offset;
22419 + }
22420 +}
22421 +
22422 +void
22423 +ElfStart (FILE *fp, unsigned long ep, int bigendian)
22424 +{
22425 + elfbuf = xmalloc (BUFSIZE);
22426 + elffp = fp;
22427 +
22428 + memset (&ehdr, 0, sizeof (ehdr));
22429 + ehdr.e_ident[EI_MAG0] = ELFMAG0;
22430 + ehdr.e_ident[EI_MAG1] = ELFMAG1;
22431 + ehdr.e_ident[EI_MAG2] = ELFMAG2;
22432 + ehdr.e_ident[EI_MAG3] = ELFMAG3;
22433 + ehdr.e_ident[EI_CLASS] = ELFCLASS32;
22434 + ehdr.e_ident[EI_DATA] = bigendian ? ELFDATA2MSB : ELFDATA2LSB;
22435 + ehdr.e_ident[EI_VERSION] = EV_CURRENT;
22436 + ehdr.e_type = ET_EXEC;
22437 + ehdr.e_machine = EM_MIPS;
22438 + ehdr.e_version = EV_CURRENT;
22439 + ehdr.e_ehsize = sizeof (Elf32_Ehdr);
22440 + ehdr.e_phentsize = sizeof (Elf32_Phdr);
22441 + ehdr.e_shentsize = sizeof (Elf32_Shdr);
22442 + elfoffs = ehdr.e_shoff + sizeof (shdr);
22443 +
22444 + nsect = 1;
22445 + fseek (elffp, elfoffs, SEEK_SET);
22446 +}
22447 +
22448 +
22449 +void
22450 +ElfOutput (unsigned long addr, unsigned char byte)
22451 +{
22452 + if (promflag)
22453 + /* convert back to PROM virtual address in KSEG1 */
22454 + addr = (addr + prombase) | 0xa0000000;
22455 +
22456 + if (addr != elfaddr + elflen) {
22457 + Elf32_Shdr *sh = &shdr[nsect];
22458 +
22459 + elfFlush (1);
22460 +
22461 + if (nsect == NSECTIONS) {
22462 + fprintf (stderr, "%s: too many ELF output sections\n",
22463 + progname);
22464 + exit (1);
22465 + }
22466 +
22467 + sh->sh_type = SHT_PROGBITS;
22468 + sh->sh_flags = SHF_ALLOC | SHF_EXECINSTR;
22469 + sh->sh_addr = addr;
22470 + sh->sh_offset = elfoffs;
22471 + sh->sh_size = 0;
22472 + sh->sh_addralign = 1;
22473 + nsect++;
22474 +
22475 + elfaddr = addr;
22476 + }
22477 +
22478 + if (elflen == BUFSIZE)
22479 + elfFlush (0);
22480 + elfbuf[elflen++] = byte;
22481 +}
22482 +
22483 +
22484 +void
22485 +ElfEnd (unsigned long ep)
22486 +{
22487 + Elf32_Shdr *sh;
22488 + Elf32_Phdr *ph;
22489 + char * strtab;
22490 + int stroffs, i;
22491 +
22492 + if (nsect <= 1)
22493 + return;
22494 +
22495 + elfFlush (1);
22496 +
22497 + strtab = xmalloc (nsect * sizeof ".psect##"
22498 + + sizeof ".shstrtab" + 1);
22499 +
22500 + /* Prepare the Section Header string table */
22501 + stroffs = 0;
22502 + strtab[stroffs++] = '\0'; /* initial null byte */
22503 + for (sh = &shdr[1], i = 1; i < nsect; sh++, i++) {
22504 + sh->sh_name = stroffs;
22505 + sprintf (&strtab[stroffs], ".psect%d", i);
22506 + stroffs += strlen (&strtab[stroffs]) + 1;
22507 + }
22508 +
22509 + /* Prepare the section header for the string table */
22510 + sh = &shdr[nsect];
22511 + sh->sh_name = stroffs;
22512 + strcpy (&strtab[stroffs], ".shstrtab");
22513 + stroffs += sizeof ".shstrtab";
22514 + sh->sh_type = SHT_STRTAB;
22515 + sh->sh_offset = elfoffs;
22516 + sh->sh_size = stroffs;
22517 +
22518 + /* Write the Section Header string table */
22519 + fwrite (strtab, 1, stroffs, elffp);
22520 + free (strtab);
22521 +
22522 + /* Prepare Program Header */
22523 + for (ph = phdr, sh = &shdr[1], i = 1; i < nsect; ph++, sh++, i++) {
22524 + ph->p_type = PT_LOAD;
22525 + ph->p_offset = sh->sh_offset;
22526 + ph->p_vaddr = sh->sh_addr;
22527 + ph->p_paddr = sh->sh_addr;
22528 + ph->p_filesz = ph->p_memsz = sh->sh_size;
22529 + ph->p_flags = PF_R | PF_X;
22530 + ph->p_align = sh->sh_addralign;
22531 + }
22532 +
22533 + /* Prepare ELF header */
22534 + ehdr.e_phnum = ph - phdr;
22535 + ehdr.e_shstrndx = nsect;
22536 + ehdr.e_shnum = nsect + 1; /* + 1 for string table */
22537 + ehdr.e_phoff = sizeof (Elf32_Ehdr);
22538 + ehdr.e_shoff = ehdr.e_phoff + sizeof (Elf32_Phdr) * ehdr.e_phnum;
22539 + if (promflag)
22540 + ehdr.e_entry = 0xbfc00000; /* should this be progreammable */
22541 + else
22542 + ehdr.e_entry = ep;
22543 +
22544 + /* Write the headers */
22545 + fseek (elffp, 0L, SEEK_SET);
22546 + elfEhdrWrite (elffp, &ehdr);
22547 + elfPhdrWrite (elffp, &ehdr, phdr, ehdr.e_phnum);
22548 + elfShdrWrite (elffp, &ehdr, shdr, ehdr.e_shnum);
22549 +
22550 + free (elfbuf);
22551 +}
22552 --- /dev/null
22553 +++ b/convert/idtbin.c
22554 @@ -0,0 +1,93 @@
22555 +/* idtbin.c -- Compressed Motorola S-Record Output for IDT/sim
22556 +
22557 + Copyright (c) 1993-2003, 2008 Free Software Foundation, Inc.
22558 + Contributed by MIPS Technologies, Inc.
22559 +
22560 + This program is free software; you can redistribute it and/or modify
22561 + it under the terms of the GNU General Public License as published by
22562 + the Free Software Foundation; either version 3, or (at your option)
22563 + any later version.
22564 +
22565 + This program is distributed in the hope that it will be useful,
22566 + but WITHOUT ANY WARRANTY; without even the implied warranty of
22567 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22568 + GNU General Public License for more details.
22569 +
22570 + You should have received a copy of the GNU General Public License
22571 + along with this program; If not, write to the Free Software
22572 + Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
22573 + 02110-1301, USA. */
22574 +
22575 +#include "sysdep.h"
22576 +
22577 +#define BUFSIZE 250
22578 +#define ADDRSIZE 4
22579 +
22580 +static FILE *idtfp;
22581 +static unsigned long idtaddr = ~0;
22582 +static int idtlen;
22583 +static unsigned char idtbuf[BUFSIZE];
22584 +
22585 +static void
22586 +idtFlush ()
22587 +{
22588 + unsigned char cksum = 0;
22589 + int n;
22590 +
22591 + if (idtlen == 0)
22592 + return;
22593 +
22594 + fprintf (idtfp, "S3%c", idtlen + ADDRSIZE + 1);
22595 + cksum += idtlen + ADDRSIZE + 1;
22596 +
22597 + for (n = (ADDRSIZE - 1) * 8; n >= 0; n -= 8) {
22598 + unsigned char ab = idtaddr >> n;
22599 + fputc (ab, idtfp);
22600 + cksum += ab;
22601 + }
22602 +
22603 + for (n = 0; n < idtlen; n++) {
22604 + putc (idtbuf[n], idtfp);
22605 + cksum += idtbuf[n];
22606 + }
22607 +
22608 + fputc (~cksum & 0xff, idtfp);
22609 + idtlen = 0;
22610 +}
22611 +
22612 +
22613 +void
22614 +IdtStart (FILE *fp, unsigned long ep)
22615 +{
22616 + idtfp = fp;
22617 +}
22618 +
22619 +void
22620 +IdtOutput (unsigned long addr, unsigned char byte)
22621 +{
22622 + if (addr != idtaddr + idtlen || idtlen == BUFSIZE) {
22623 + idtFlush ();
22624 + idtaddr = addr;
22625 + }
22626 + idtbuf[idtlen++] = byte;
22627 +}
22628 +
22629 +void
22630 +IdtEnd (unsigned long ep)
22631 +{
22632 + unsigned char cksum = 0;
22633 + int n;
22634 +
22635 + idtFlush ();
22636 +
22637 + fprintf (idtfp, "S7%c", ADDRSIZE + 1);
22638 + cksum += ADDRSIZE + 1;
22639 +
22640 + for (n = (ADDRSIZE - 1) * 8; n >= 0; n -= 8) {
22641 + unsigned char ab = ep >> n;
22642 + fputc (ab, idtfp);
22643 + cksum += ab;
22644 + }
22645 +
22646 + fputc (~cksum & 0xff, idtfp);
22647 +}
22648 --- /dev/null
22649 +++ b/convert/lsifast.c
22650 @@ -0,0 +1,219 @@
22651 +/* lsifast.c -- LSI PMON Fast ASCII Output
22652 +
22653 + Copyright (c) 1993-2003, 2008 Free Software Foundation, Inc.
22654 + Contributed by MIPS Technologies, Inc.
22655 +
22656 + This program is free software; you can redistribute it and/or modify
22657 + it under the terms of the GNU General Public License as published by
22658 + the Free Software Foundation; either version 3, or (at your option)
22659 + any later version.
22660 +
22661 + This program is distributed in the hope that it will be useful,
22662 + but WITHOUT ANY WARRANTY; without even the implied warranty of
22663 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22664 + GNU General Public License for more details.
22665 +
22666 + You should have received a copy of the GNU General Public License
22667 + along with this program; If not, write to the Free Software
22668 + Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
22669 + 02110-1301, USA. */
22670 +
22671 +#include "sysdep.h"
22672 +
22673 +/*#define MAXREC 550*/
22674 +#define MAXREC 255
22675 +#define BUFSIZE ((MAXREC-12)/4*3)
22676 +
22677 +#define ZEROS "/Z" /* record contains a count of zeros,
22678 + actually it's the number of 24-bit
22679 + records that are all zero */
22680 +#define BYTE "/B" /* record contains a single byte */
22681 +#define CHKSUM "/C" /* checksum to date */
22682 +#define CLRSUM "/K" /* klear (sic) the checksum */
22683 +#define ADDR "/A" /* double length record containing a 32 bit
22684 + address */
22685 +#define END "/E" /* end of download */
22686 +
22687 +static FILE *lsifp;
22688 +static unsigned long lsiaddr = ~0;
22689 +static int lsilen;
22690 +static unsigned char *lsibuf;
22691 +static int chksum;
22692 +
22693 +
22694 +static int
22695 +b2a(int c)
22696 +{
22697 +/* translate binary to base64 (tx form)
22698 +0..25 A-Z
22699 +26..51 a-z
22700 +52..61 0-9
22701 +62 ,
22702 +63 .
22703 +*/
22704 +
22705 + c &= 0x3f;
22706 + if (c <= 25) return('A'+c);
22707 + if (c <= 51) return('a'+c-26);
22708 + if (c <= 61) return('0'+c-52);
22709 + if (c == 62) return(',');
22710 + if (c == 63) return('.');
22711 + abort();
22712 +}
22713 +
22714 +static void
22715 +send12 (char *type, unsigned val)
22716 +{
22717 + val &= 0xfff;
22718 + chksum += val;
22719 + fputc (type[0], lsifp);
22720 + fputc (type[1], lsifp);
22721 + fputc (b2a(val>>6), lsifp);
22722 + fputc (b2a(val), lsifp);
22723 +}
22724 +
22725 +
22726 +static void
22727 +send24(unsigned long val)
22728 +{
22729 + int i;
22730 + val &= 0xffffff;
22731 + chksum += val>>12;
22732 + chksum += val&0xfff;
22733 + for (i = 18; i >= 0; i -= 6) {
22734 + char c = b2a(val >> i);
22735 + putc (c, lsifp);
22736 + }
22737 +}
22738 +
22739 +
22740 +static void
22741 +txaddr (unsigned long addr)
22742 +{
22743 + send12(ADDR, addr >> 24);
22744 + send24(addr);
22745 +}
22746 +
22747 +static void
22748 +lsiChecksum ()
22749 +{
22750 + fputc ('\n', lsifp);
22751 + send12(CHKSUM, chksum);
22752 + fputc ('\n', lsifp);
22753 + chksum = 0;
22754 +}
22755 +
22756 +static void
22757 +lsiFlush ()
22758 +{
22759 + unsigned char *buf = lsibuf;
22760 + int zcnt = 0;
22761 +
22762 + if (lsilen == 0)
22763 + return;
22764 +
22765 + while (lsilen >= 3) {
22766 + unsigned long bdat;
22767 +
22768 + bdat = (buf[0]<<16)+(buf[1]<<8)+buf[2]; /* convert to single word */
22769 + buf += 3; lsilen -= 3;
22770 +
22771 + if (bdat == 0) {
22772 + if (++zcnt < 4096)
22773 + continue;
22774 + zcnt--;
22775 + }
22776 +
22777 + if (zcnt) {
22778 + send12 (ZEROS, zcnt);
22779 + zcnt = 0;
22780 + }
22781 + send24(bdat); /* send the data */
22782 + }
22783 +
22784 + if (zcnt)
22785 + send12 (ZEROS, zcnt);
22786 +
22787 + while (lsilen != 0) {
22788 + send12 (BYTE, *buf++);
22789 + lsilen--;
22790 + }
22791 +
22792 + fputc ('\n', lsifp);
22793 +}
22794 +
22795 +void
22796 +LsiStart (FILE *fp, unsigned long ep)
22797 +{
22798 + lsibuf = (char *) xmalloc (BUFSIZE);
22799 + lsifp = fp;
22800 + send12(CLRSUM, 0);
22801 + chksum = 0;
22802 +}
22803 +
22804 +
22805 +void
22806 +LsiOutput (unsigned long addr, unsigned char byte)
22807 +{
22808 + int newaddr = (addr != lsiaddr + lsilen);
22809 + if (newaddr || lsilen >= BUFSIZE) {
22810 + lsiFlush ();
22811 + if (newaddr)
22812 + txaddr (addr);
22813 + lsiaddr = addr;
22814 + }
22815 + lsibuf[lsilen++] = byte;
22816 +}
22817 +
22818 +
22819 +void
22820 +LsiSym (char *name, unsigned long value)
22821 +{
22822 + int len = strlen(name);
22823 + char *buf = alloca (len + 10);
22824 + static int reclen = 0;
22825 + static int first = 1;
22826 +
22827 + if (first) {
22828 + lsiFlush ();
22829 + lsiChecksum ();
22830 + first = 0;
22831 + }
22832 +
22833 + if (reclen + 8 >= MAXREC) {
22834 + fputc ('\n', lsifp);
22835 + reclen = 0;
22836 + }
22837 + txaddr (value);
22838 + reclen += 8;
22839 +
22840 + len += 2; /* /S */
22841 + strcpy(buf, name);
22842 + strcat(buf, ","); len++;
22843 +
22844 + /* pad total string length to multiple of 4 */
22845 + while (len & 3) {
22846 + strcat (buf, "X");
22847 + len++;
22848 + }
22849 +
22850 + if (reclen + len >= MAXREC) {
22851 + fputc ('\n', lsifp);
22852 + reclen = 0;
22853 + }
22854 + fprintf(lsifp, "/S%s", buf);
22855 + reclen += len;
22856 +}
22857 +
22858 +
22859 +void
22860 +LsiEnd (unsigned long ep)
22861 +{
22862 + lsiFlush ();
22863 + lsiChecksum ();
22864 + txaddr(ep);
22865 + send12(END, 0);
22866 + fputc ('\n', lsifp);
22867 + free (lsibuf);
22868 +}
22869 +
22870 --- /dev/null
22871 +++ b/convert/mipsflash.c
22872 @@ -0,0 +1,161 @@
22873 +/* mipsflash.c -- MIPS eval board USB/parallel flash download format
22874 +
22875 + Copyright (c) 1993-2003, 2008 Free Software Foundation, Inc.
22876 + Contributed by MIPS Technologies, Inc.
22877 +
22878 + This program is free software; you can redistribute it and/or modify
22879 + it under the terms of the GNU General Public License as published by
22880 + the Free Software Foundation; either version 3, or (at your option)
22881 + any later version.
22882 +
22883 + This program is distributed in the hope that it will be useful,
22884 + but WITHOUT ANY WARRANTY; without even the implied warranty of
22885 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22886 + GNU General Public License for more details.
22887 +
22888 + You should have received a copy of the GNU General Public License
22889 + along with this program; If not, write to the Free Software
22890 + Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
22891 + 02110-1301, USA. */
22892 +
22893 +#include "sysdep.h"
22894 +
22895 +static FILE *mipsfp;
22896 +static unsigned long mipsaddr = ~0;
22897 +static unsigned long mipsbase = ~0;
22898 +static int mipslen;
22899 +static unsigned char *mipsbuf;
22900 +static int mipsbigendian;
22901 +
22902 +extern int promflag;
22903 +extern unsigned long prombase;
22904 +
22905 +/* data chunk size - 16 words */
22906 +#define BUFSIZE (16*4)
22907 +
22908 +/* flash sector size */
22909 +#define FLASH_BLOCK_SIZE 0x20000
22910 +
22911 +static void
22912 +mipsFlush ()
22913 +{
22914 + unsigned char *buf;
22915 + int done;
22916 +
22917 + if (mipslen == 0)
22918 + return;
22919 +
22920 + for (buf = mipsbuf, done = 0; done < BUFSIZE; buf += 4, done += 4) {
22921 + unsigned long val = 0;
22922 + int i;
22923 +
22924 + /* new line every 32 bytes (8 words) */
22925 + if (done != 0 && done % 32 == 0)
22926 + fputc ('\n', mipsfp);
22927 +
22928 + /* collect one word from input buffer using appropriate endianness. */
22929 + for (i = 0; i < 4; i++) {
22930 + unsigned int addr01 = (mipsaddr + done + i) & 0x3;
22931 + if (mipsbigendian)
22932 + val |= buf[i] << (8 * (3 - addr01));
22933 + else
22934 + val |= buf[i] << (8 * addr01);
22935 + }
22936 +
22937 + /* output one word of data */
22938 + fprintf (mipsfp, " %08lx", val);
22939 + }
22940 +
22941 + fputc ('\n', mipsfp);
22942 +
22943 + /* reset output buffer to blank */
22944 + memset (mipsbuf, 0xff, BUFSIZE);
22945 + mipslen = 0;
22946 +}
22947 +
22948 +
22949 +void
22950 +MipsStart (FILE *fp, unsigned long ep, int bigendian)
22951 +{
22952 + mipsbuf = (char *) xmalloc (BUFSIZE);
22953 + mipsfp = fp;
22954 + mipsbigendian = bigendian;
22955 +
22956 + /* Reset the loader state machine */
22957 + fprintf (fp, "!R\n");
22958 +}
22959 +
22960 +
22961 +void
22962 +MipsOutput (unsigned long addr, unsigned char byte)
22963 +{
22964 + /* XXX Rework this whole thing to gather up aligned chunks into each
22965 + buffer, don't require strictly contiguous addresses. */
22966 +
22967 + unsigned long lastaddr = mipsaddr + mipslen;
22968 + int newsector, newaddr;
22969 +
22970 + if (promflag)
22971 + /* convert back to PROM physical address */
22972 + addr += prombase;
22973 +
22974 + newsector = ((addr ^ lastaddr) & ~(FLASH_BLOCK_SIZE - 1)) != 0;
22975 + newaddr = newsector || (addr != lastaddr);
22976 +
22977 + if (newaddr || newsector || mipslen >= BUFSIZE) {
22978 + mipsFlush ();
22979 + mipsaddr = addr;
22980 + }
22981 +
22982 + if (mipsbase == ~0) {
22983 + /* first byte - remember base address */
22984 + mipsbase = addr;
22985 + if (mipsbase == 0x1fc00000)
22986 + /* unlock the flash */
22987 + fprintf (mipsfp, ">1fc00xxx @1fc00000 !C\n");
22988 + }
22989 +
22990 + if (newsector)
22991 + {
22992 + /* started new flash sector - erase it */
22993 + unsigned long base = addr & ~(FLASH_BLOCK_SIZE - 1);
22994 + fprintf (mipsfp, ">%.5xxxx ", base / 0x1000);
22995 + fprintf (mipsfp, "@%.8x !E\n", base);
22996 + if (base != addr)
22997 + newaddr = 1;
22998 + }
22999 +
23000 + if (newaddr)
23001 + /* set new write addr */
23002 + fprintf (mipsfp, "@%.8lx\n", addr);
23003 +
23004 + if (newaddr || newsector || ((addr & 0xfff == 0) && mipslen == 0))
23005 + /* update display */
23006 + fprintf (mipsfp, ">%.8lx\n", addr);
23007 +
23008 + mipsbuf[mipslen++] = byte;
23009 +}
23010 +
23011 +void
23012 +MipsEnd (unsigned long ep)
23013 +{
23014 + mipsFlush ();
23015 +
23016 + if (mipsbase == 0x1fc00000) {
23017 + /* Lock the flash */
23018 + fprintf (mipsfp, ">LOCKFLSH\n");
23019 + fprintf (mipsfp, "@1fc00000 !S\n");
23020 + fprintf (mipsfp, "@1fc20000 !S\n");
23021 + fprintf (mipsfp, "@1fc40000 !S\n");
23022 + fprintf (mipsfp, "@1fc60000 !S\n");
23023 + fprintf (mipsfp, "@1fc80000 !S\n");
23024 + fprintf (mipsfp, "@1fca0000 !S\n");
23025 + fprintf (mipsfp, "@1fcc0000 !S\n");
23026 + fprintf (mipsfp, "@1fce0000 !S\n");
23027 + }
23028 +
23029 + fprintf (mipsfp, ">#DL_DONE\n");
23030 + fprintf (mipsfp, ">FINISHED\n");
23031 + free (mipsbuf);
23032 +}
23033 +
23034 --- /dev/null
23035 +++ b/convert/srec.c
23036 @@ -0,0 +1,119 @@
23037 +/* srec.c -- Motorola S-Record Output
23038 +
23039 + Copyright (c) 1993-2003, 2008 Free Software Foundation, Inc.
23040 + Contributed by MIPS Technologies, Inc.
23041 +
23042 + This program is free software; you can redistribute it and/or modify
23043 + it under the terms of the GNU General Public License as published by
23044 + the Free Software Foundation; either version 3, or (at your option)
23045 + any later version.
23046 +
23047 + This program is distributed in the hope that it will be useful,
23048 + but WITHOUT ANY WARRANTY; without even the implied warranty of
23049 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23050 + GNU General Public License for more details.
23051 +
23052 + You should have received a copy of the GNU General Public License
23053 + along with this program; If not, write to the Free Software
23054 + Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
23055 + 02110-1301, USA. */
23056 +
23057 +#include "sysdep.h"
23058 +
23059 +#define BUFSIZE 32
23060 +
23061 +static FILE *srecfp;
23062 +static unsigned long srecaddr = ~0;
23063 +static int sreclen;
23064 +static unsigned char srecbuf[BUFSIZE];
23065 +static int addrsize;
23066 +
23067 +
23068 +static void
23069 +srecFlush ()
23070 +{
23071 + unsigned char cksum = 0;
23072 + int n;
23073 +
23074 + if (sreclen == 0)
23075 + return;
23076 +
23077 + fprintf (srecfp, "S%1d%02X", addrsize-1, sreclen + addrsize + 1);
23078 + cksum += sreclen + addrsize + 1;
23079 +
23080 + for (n = (addrsize - 1) * 8; n >= 0; n -= 8) {
23081 + unsigned char ab = srecaddr >> n;
23082 + fprintf (srecfp, "%02X", ab);
23083 + cksum += ab;
23084 + }
23085 +
23086 + for (n = 0; n < sreclen; n++) {
23087 + fprintf (srecfp, "%02X", srecbuf[n]);
23088 + cksum += srecbuf[n];
23089 + }
23090 +
23091 + fprintf (srecfp, "%02X\n", ~cksum & 0xff);
23092 + sreclen = 0;
23093 +}
23094 +
23095 +
23096 +void
23097 +Srec3Start (FILE *fp, unsigned long ep)
23098 +{
23099 + srecfp = fp;
23100 + addrsize = 4;
23101 +}
23102 +
23103 +void
23104 +Srec2Start (FILE *fp, unsigned long ep)
23105 +{
23106 + srecfp = fp;
23107 + addrsize = 3;
23108 +}
23109 +
23110 +void
23111 +Srec1Start (FILE *fp, unsigned long ep)
23112 +{
23113 + srecfp = fp;
23114 + addrsize = 2;
23115 +}
23116 +
23117 +
23118 +void
23119 +SrecOutput (unsigned long addr, unsigned char byte)
23120 +{
23121 + if (addr != srecaddr + sreclen || sreclen == BUFSIZE) {
23122 + srecFlush ();
23123 + srecaddr = addr;
23124 + }
23125 + srecbuf[sreclen++] = byte;
23126 +}
23127 +
23128 +
23129 +void
23130 +SrecSym (char *name, unsigned long value)
23131 +{
23132 + int len = strlen(name) + 8 + 2;
23133 + fprintf (srecfp, "S4%02X%08X%s,00\n", len, value, name);
23134 +}
23135 +
23136 +
23137 +void
23138 +SrecEnd (unsigned long ep)
23139 +{
23140 + unsigned char cksum = 0;
23141 + int n;
23142 +
23143 + srecFlush ();
23144 +
23145 + fprintf (srecfp, "S%1d%02X", 11 - addrsize, addrsize + 1);
23146 + cksum += addrsize + 1;
23147 +
23148 + for (n = (addrsize - 1) * 8; n >= 0; n -= 8) {
23149 + unsigned char ab = ep >> n;
23150 + fprintf (srecfp, "%02X", ab);
23151 + cksum += ab;
23152 + }
23153 +
23154 + fprintf (srecfp, "%02X\n", ~cksum & 0xff);
23155 +}
23156 --- /dev/null
23157 +++ b/convert/stagbin.c
23158 @@ -0,0 +1,105 @@
23159 +/* stag.c -- Stag Programmer Binary Output
23160 +
23161 + Copyright (c) 1993-2003, 2008 Free Software Foundation, Inc.
23162 + Contributed by MIPS Technologies, Inc.
23163 +
23164 + This program is free software; you can redistribute it and/or modify
23165 + it under the terms of the GNU General Public License as published by
23166 + the Free Software Foundation; either version 3, or (at your option)
23167 + any later version.
23168 +
23169 + This program is distributed in the hope that it will be useful,
23170 + but WITHOUT ANY WARRANTY; without even the implied warranty of
23171 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23172 + GNU General Public License for more details.
23173 +
23174 + You should have received a copy of the GNU General Public License
23175 + along with this program; If not, write to the Free Software
23176 + Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
23177 + 02110-1301, USA. */
23178 +
23179 +#include "sysdep.h"
23180 +
23181 +#define SOH 1
23182 +#define CHECKLENGTH 1024 /* # bytes between intermediate checksums */
23183 +#define BUFSIZE 8192 /* max bytes per block */
23184 +
23185 +static FILE *stagfp;
23186 +static unsigned long stagaddr = ~0;
23187 +static int staglen;
23188 +static unsigned char *stagbuf;
23189 +static int chksum;
23190 +
23191 +static void
23192 +sbinputc (unsigned char c)
23193 +{
23194 + chksum += c;
23195 + putc (c, stagfp);
23196 +}
23197 +
23198 +static void
23199 +sbinlong (unsigned i)
23200 +{
23201 + sbinputc (i >> 24);
23202 + sbinputc (i >> 16);
23203 + sbinputc (i >> 8);
23204 + sbinputc (i);
23205 +}
23206 +
23207 +static void
23208 +sbinheader (unsigned len, unsigned offs)
23209 +{
23210 + sbinputc (SOH);
23211 + chksum = 0;
23212 + sbinlong (len);
23213 + sbinlong (offs);
23214 +}
23215 +
23216 +static void
23217 +stagFlush ()
23218 +{
23219 + int i;
23220 +
23221 + if (staglen > 0) {
23222 + sbinheader (staglen, stagaddr);
23223 + for (i = 0; i < staglen; i++) {
23224 + if (i > 0 && i % CHECKLENGTH == 0)
23225 + fputc (-chksum, stagfp); /* intermediate checksum */
23226 + putc (stagbuf[i], stagfp);
23227 + chksum += stagbuf[i];
23228 + }
23229 + fputc (-chksum, stagfp); /* final checksum */
23230 + staglen = 0;
23231 + }
23232 +}
23233 +
23234 +void
23235 +StagStart (FILE *fp, unsigned long ep)
23236 +{
23237 + stagbuf = (char *) xmalloc (BUFSIZE);
23238 + stagfp = fp;
23239 +}
23240 +
23241 +
23242 +void
23243 +StagOutput (unsigned long addr, unsigned char byte)
23244 +{
23245 + if (addr != stagaddr + staglen || staglen == BUFSIZE) {
23246 + stagFlush ();
23247 + stagaddr = addr;
23248 + }
23249 + stagbuf[staglen++] = byte;
23250 +}
23251 +
23252 +
23253 +void
23254 +StagEnd (unsigned long ep)
23255 +{
23256 + stagFlush ();
23257 +
23258 + /* terminating null block */
23259 + sbinheader (0, 0); /* header */
23260 + fputc (0, stagfp); /* checksum */
23261 + free (stagbuf);
23262 +}
23263 +
23264 --- /dev/null
23265 +++ b/convert/sysdep.h
23266 @@ -0,0 +1,114 @@
23267 +#ifdef HAVE_CONFIG_H
23268 +#include "config.h"
23269 +#endif
23270 +
23271 +#ifdef HAVE_STDDEF_H
23272 +#include <stddef.h>
23273 +#endif
23274 +
23275 +#ifdef HAVE_STDLIB_H
23276 +# include <stdlib.h>
23277 +#endif
23278 +
23279 +#ifndef HAVE_STRCHR
23280 +# define strchr index
23281 +# define strrchr rindex
23282 +#endif
23283 +
23284 +#if HAVE_STRING_H
23285 +# include <string.h>
23286 +#else
23287 +char *strchr(), *strrchr();
23288 +#endif
23289 +
23290 +#ifdef HAVE_STRINGS_H
23291 +# include <strings.h>
23292 +#endif
23293 +
23294 +#ifndef HAVE_MEMCPY
23295 +# define memcpy(d, s, n) bcopy ((s), (d), (n))
23296 +# define memmove(d, s, n) bcopy ((s), (d), (n))
23297 +#endif
23298 +
23299 +#ifdef HAVE_UNISTD_H
23300 +#include <sys/types.h>
23301 +#include <unistd.h>
23302 +#endif
23303 +
23304 +#ifdef HAVE_FCNTL_H
23305 +#include <fcntl.h>
23306 +#else
23307 +#ifdef HAVE_SYS_FILE_H
23308 +#include <sys/file.h>
23309 +#endif
23310 +#endif
23311 +
23312 +#ifndef SEEK_SET
23313 +#define SEEK_SET 0
23314 +#endif
23315 +#ifndef SEEK_CUR
23316 +#define SEEK_CUR 1
23317 +#endif
23318 +
23319 +#ifdef HAVE_LIMITS_H
23320 +#include <limits.h>
23321 +#endif
23322 +
23323 +#include <stdio.h>
23324 +#include <errno.h>
23325 +
23326 +#if defined(__GNUC__) && !defined(C_ALLOCA)
23327 +# undef alloca
23328 +# define alloca __builtin_alloca
23329 +#else
23330 +# if defined(HAVE_ALLOCA_H) && !defined(C_ALLOCA)
23331 +# include <alloca.h>
23332 +# else
23333 +# ifndef alloca /* predefined by HP cc +Olibcalls */
23334 +# if !defined (__STDC__) && !defined (__hpux)
23335 +char *alloca ();
23336 +# else
23337 +void *alloca ();
23338 +# endif /* __STDC__, __hpux */
23339 +# endif /* alloca */
23340 +# endif /* HAVE_ALLOCA_H */
23341 +#endif
23342 +
23343 +#ifdef NEED_DECLARATION_MALLOC
23344 +extern void *malloc (size_t);
23345 +#endif
23346 +#ifdef NEED_DECLARATION_REALLOC
23347 +extern void *realloc (void *, size_t);
23348 +#endif
23349 +#ifdef NEED_DECLARATION_FREE
23350 +extern void free (void *);
23351 +#endif
23352 +#ifdef NEED_DECLARATION_STRTOK
23353 +extern char *strtok (char *, const char *);
23354 +#endif
23355 +
23356 +#ifdef USE_BINARY_FOPEN
23357 +#define FOPEN_RB "rb"
23358 +#define FOPEN_WB "wb"
23359 +#define FOPEN_AB "ab"
23360 +#define FOPEN_RUB "r+b"
23361 +#define FOPEN_WUB "w+b"
23362 +#define FOPEN_AUB "a+b"
23363 +#else
23364 +#define FOPEN_RB "r"
23365 +#define FOPEN_WB "w"
23366 +#define FOPEN_AB "a"
23367 +#define FOPEN_RUB "r+"
23368 +#define FOPEN_WUB "w+"
23369 +#define FOPEN_AUB "a+"
23370 +#endif
23371 +
23372 +#define FOPEN_RT "r"
23373 +#define FOPEN_WT "w"
23374 +#define FOPEN_AT "a"
23375 +#define FOPEN_RUT "r+"
23376 +#define FOPEN_WUT "w+"
23377 +#define FOPEN_AUT "a+"
23378 +
23379 +/* local utility functions */
23380 +extern void * xmalloc (size_t);
23381 --- /dev/null
23382 +++ b/convert/version.h
23383 @@ -0,0 +1,7 @@
23384 +#ifndef CONVERT_VERSION_H
23385 +#define CONVERT_VERSION_H 1
23386 +
23387 +#define CONVERT_PKGVERSION @conv_version_package@
23388 +#define CONVERT_REPORT_BUGS_TO @report_bugs_to@
23389 +
23390 +#endif
23391 --- a/gas/config/m68k-parse.h
23392 +++ b/gas/config/m68k-parse.h
23393 @@ -101,6 +101,7 @@ enum m68k_register
23394 CACR,
23395 VBR,
23396 CAAR,
23397 + CPUCR,
23398 MSP,
23399 ITT0,
23400 ITT1,
23401 --- a/gas/config/tc-arm.c
23402 +++ b/gas/config/tc-arm.c
23403 @@ -25,10 +25,10 @@
23404 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
23405 02110-1301, USA. */
23406
23407 +#include "as.h"
23408 #include <limits.h>
23409 #include <stdarg.h>
23410 #define NO_RELOC 0
23411 -#include "as.h"
23412 #include "safe-ctype.h"
23413 #include "subsegs.h"
23414 #include "obstack.h"
23415 @@ -199,6 +199,8 @@ static const arm_feature_set arm_ext_div
23416 static const arm_feature_set arm_ext_v7 = ARM_FEATURE (ARM_EXT_V7, 0);
23417 static const arm_feature_set arm_ext_v7a = ARM_FEATURE (ARM_EXT_V7A, 0);
23418 static const arm_feature_set arm_ext_v7r = ARM_FEATURE (ARM_EXT_V7R, 0);
23419 +static const arm_feature_set arm_ext_marvell_f =
23420 + ARM_FEATURE (0, ARM_CEXT_MARVELL_F);
23421 static const arm_feature_set arm_ext_m =
23422 ARM_FEATURE (ARM_EXT_V6M | ARM_EXT_V7M, 0);
23423
23424 @@ -261,6 +263,9 @@ symbolS * GOT_symbol;
23425 instructions. */
23426 static int thumb_mode = 0;
23427
23428 +/* Enables/disables automatic IT insn insertion mode. */
23429 +static int do_automatic_it = 0;
23430 +
23431 /* If unified_syntax is true, we are processing the new unified
23432 ARM/Thumb syntax. Important differences from the old ARM mode:
23433
23434 @@ -311,6 +316,18 @@ struct neon_type
23435 unsigned elems;
23436 };
23437
23438 +enum it_instruction_type
23439 +{
23440 + OUTSIDE_IT_INSN,
23441 + INSIDE_IT_INSN,
23442 + INSIDE_IT_LAST_INSN,
23443 + IF_INSIDE_IT_LAST_INSN, /* Either outside or inside;
23444 + if inside, should be the last one. */
23445 + NEUTRAL_IT_INSN, /* This could be either inside or outside,
23446 + i.e. BKPT and NOP. */
23447 + IT_INSN /* The IT insn has been parsed. */
23448 +};
23449 +
23450 struct arm_it
23451 {
23452 const char * error;
23453 @@ -333,6 +350,8 @@ struct arm_it
23454 int pc_rel;
23455 } reloc;
23456
23457 + enum it_instruction_type it_insn_type;
23458 +
23459 struct
23460 {
23461 unsigned reg;
23462 @@ -670,6 +689,9 @@ struct asm_opcode
23463 #define BAD_BRANCH _("branch must be last instruction in IT block")
23464 #define BAD_NOT_IT _("instruction not allowed in IT block")
23465 #define BAD_FPU _("selected FPU does not support instruction")
23466 +#define BAD_OUT_IT _("thumb conditional instruction should be in IT block")
23467 +#define BAD_IT_COND _("incorrect condition in IT block")
23468 +#define BAD_IT_IT _("IT falling in the range of a previous IT block")
23469
23470 static struct hash_control *arm_ops_hsh;
23471 static struct hash_control *arm_cond_hsh;
23472 @@ -691,7 +713,7 @@ static struct hash_control *arm_barrier_
23473
23474 symbolS * last_label_seen;
23475 static int label_is_thumb_function_name = FALSE;
23476 -\f
23477 +
23478 /* Literal pool structure. Held on a per-section
23479 and per-sub-section basis. */
23480
23481 @@ -711,9 +733,58 @@ typedef struct literal_pool
23482 literal_pool * list_of_pools = NULL;
23483
23484 /* State variables for IT block handling. */
23485 -static bfd_boolean current_it_mask = 0;
23486 -static int current_cc;
23487 -\f
23488 +enum it_state
23489 +{
23490 + OUTSIDE_IT_BLOCK, MANUAL_IT_BLOCK, AUTOMATIC_IT_BLOCK
23491 +};
23492 +struct current_it
23493 +{
23494 + int mask;
23495 + enum it_state state;
23496 + int cc;
23497 + int block_length;
23498 + char *insn;
23499 + int state_handled;
23500 +};
23501 +
23502 +static struct current_it current_it;
23503 +
23504 +static inline int
23505 +current_it_compatible (int cond)
23506 +{
23507 + return (cond & ~1) == (current_it.cc & ~1);
23508 +}
23509 +
23510 +static inline int
23511 +conditional_insn(void)
23512 +{
23513 + return inst.cond != COND_ALWAYS;
23514 +}
23515 +
23516 +static int
23517 +in_it_block (void);
23518 +
23519 +static int
23520 +handle_it_state (void);
23521 +
23522 +static void
23523 +force_automatic_it_block_close (void);
23524 +
23525 +#define set_it_insn_type(type) \
23526 + do{ \
23527 + inst.it_insn_type = type; \
23528 + if (handle_it_state () == FAIL) \
23529 + return; \
23530 + }while(0)
23531 +
23532 +#define set_it_insn_type_last() \
23533 + do{ \
23534 + if (inst.cond == COND_ALWAYS) \
23535 + set_it_insn_type (IF_INSIDE_IT_LAST_INSN); \
23536 + else \
23537 + set_it_insn_type (INSIDE_IT_LAST_INSN); \
23538 + }while(0)
23539 +
23540 /* Pure syntax. */
23541
23542 /* This array holds the chars that always start a comment. If the
23543 @@ -2210,7 +2281,13 @@ create_neon_reg_alias (char *newname, ch
23544 }
23545 }
23546
23547 +#ifdef TC_CASE_SENSITIVE
23548 namelen = nameend - newname;
23549 +#else
23550 + newname = original_case_string;
23551 + namelen = strlen (newname);
23552 +#endif
23553 +
23554 namebuf = alloca (namelen + 1);
23555 strncpy (namebuf, newname, namelen);
23556 namebuf[namelen] = '\0';
23557 @@ -2348,20 +2425,15 @@ s_unreq (int a ATTRIBUTE_UNUSED)
23558
23559 static enum mstate mapstate = MAP_UNDEFINED;
23560
23561 -void
23562 -mapping_state (enum mstate state)
23563 +/* Create a new mapping symbol for the transition to STATE. */
23564 +
23565 +static void
23566 +make_mapping_symbol (enum mstate state, valueT value, fragS *frag)
23567 {
23568 symbolS * symbolP;
23569 const char * symname;
23570 int type;
23571
23572 - if (mapstate == state)
23573 - /* The mapping symbol has already been emitted.
23574 - There is nothing else to do. */
23575 - return;
23576 -
23577 - mapstate = state;
23578 -
23579 switch (state)
23580 {
23581 case MAP_DATA:
23582 @@ -2376,16 +2448,11 @@ mapping_state (enum mstate state)
23583 symname = "$t";
23584 type = BSF_NO_FLAGS;
23585 break;
23586 - case MAP_UNDEFINED:
23587 - return;
23588 default:
23589 abort ();
23590 }
23591
23592 - seg_info (now_seg)->tc_segment_info_data.mapstate = state;
23593 -
23594 - symbolP = symbol_new (symname, now_seg, (valueT) frag_now_fix (), frag_now);
23595 - symbol_table_insert (symbolP);
23596 + symbolP = symbol_new (symname, now_seg, value, frag);
23597 symbol_get_bfdsym (symbolP)->flags |= type | BSF_LOCAL;
23598
23599 switch (state)
23600 @@ -2404,11 +2471,84 @@ mapping_state (enum mstate state)
23601
23602 case MAP_DATA:
23603 default:
23604 - return;
23605 + break;
23606 }
23607 +
23608 + /* Save the mapping symbols for future reference. Also check that
23609 + we do not place two mapping symbols at the same offset within a
23610 + frag. We'll handle overlap between frags in
23611 + check_mapping_symbols. */
23612 + if (value == 0)
23613 + {
23614 + know (frag->tc_frag_data.first_map == NULL);
23615 + frag->tc_frag_data.first_map = symbolP;
23616 + }
23617 + if (frag->tc_frag_data.last_map != NULL)
23618 + know (S_GET_VALUE (frag->tc_frag_data.last_map) < S_GET_VALUE (symbolP));
23619 + frag->tc_frag_data.last_map = symbolP;
23620 +}
23621 +
23622 +/* We must sometimes convert a region marked as code to data during
23623 + code alignment, if an odd number of bytes have to be padded. The
23624 + code mapping symbol is pushed to an aligned address. */
23625 +
23626 +static void
23627 +insert_data_mapping_symbol (enum mstate state,
23628 + valueT value, fragS *frag, offsetT bytes)
23629 +{
23630 + /* If there was already a mapping symbol, remove it. */
23631 + if (frag->tc_frag_data.last_map != NULL
23632 + && S_GET_VALUE (frag->tc_frag_data.last_map) == frag->fr_address + value)
23633 + {
23634 + symbolS *symp = frag->tc_frag_data.last_map;
23635 +
23636 + if (value == 0)
23637 + {
23638 + know (frag->tc_frag_data.first_map == symp);
23639 + frag->tc_frag_data.first_map = NULL;
23640 + }
23641 + frag->tc_frag_data.last_map = NULL;
23642 + symbol_remove (symp, &symbol_rootP, &symbol_lastP);
23643 + }
23644 +
23645 + make_mapping_symbol (MAP_DATA, value, frag);
23646 + make_mapping_symbol (state, value + bytes, frag);
23647 +}
23648 +
23649 +/* Set the mapping state to STATE. Only call this when about to
23650 + emit some STATE bytes to the file. */
23651 +
23652 +void
23653 +mapping_state (enum mstate state)
23654 +{
23655 + if (mapstate == state)
23656 + /* The mapping symbol has already been emitted.
23657 + There is nothing else to do. */
23658 + return;
23659 +
23660 + mapstate = state;
23661 + seg_info (now_seg)->tc_segment_info_data.mapstate = state;
23662 + make_mapping_symbol (state, (valueT) frag_now_fix (), frag_now);
23663 +}
23664 +
23665 +/* Same as mapping_state, but MAX_CHARS bytes have already been
23666 + allocated. Put the mapping symbol that far back. */
23667 +
23668 +static void
23669 +mapping_state_2 (enum mstate state, int max_chars)
23670 +{
23671 + if (mapstate == state)
23672 + /* The mapping symbol has already been emitted.
23673 + There is nothing else to do. */
23674 + return;
23675 +
23676 + mapstate = state;
23677 + seg_info (now_seg)->tc_segment_info_data.mapstate = state;
23678 + make_mapping_symbol (state, (valueT) frag_now_fix () - max_chars, frag_now);
23679 }
23680 #else
23681 #define mapping_state(x) /* nothing */
23682 +#define mapping_state_2(x, y) /* nothing */
23683 #endif
23684
23685 /* Find the real, Thumb encoded start of a Thumb function. */
23686 @@ -2462,7 +2602,6 @@ opcode_select (int width)
23687 coming from ARM mode, which is word-aligned. */
23688 record_alignment (now_seg, 1);
23689 }
23690 - mapping_state (MAP_THUMB);
23691 break;
23692
23693 case 32:
23694 @@ -2478,7 +2617,6 @@ opcode_select (int width)
23695
23696 record_alignment (now_seg, 1);
23697 }
23698 - mapping_state (MAP_ARM);
23699 break;
23700
23701 default:
23702 @@ -2717,7 +2855,10 @@ s_bss (int ignore ATTRIBUTE_UNUSED)
23703 marking in_bss, then looking at s_skip for clues. */
23704 subseg_set (bss_section, 0);
23705 demand_empty_rest_of_line ();
23706 - mapping_state (MAP_DATA);
23707 +
23708 +#ifdef md_elf_section_change_hook
23709 + md_elf_section_change_hook ();
23710 +#endif
23711 }
23712
23713 static void
23714 @@ -6114,7 +6255,7 @@ parse_operands (char *str, const unsigne
23715 #undef po_reg_or_goto
23716 #undef po_imm_or_fail
23717 #undef po_scalar_or_fail
23718 -\f
23719 +
23720 /* Shorthand macro for instruction encoding functions issuing errors. */
23721 #define constraint(expr, err) do { \
23722 if (expr) \
23723 @@ -6136,6 +6277,14 @@ parse_operands (char *str, const unsigne
23724 } \
23725 while (0)
23726
23727 +/* If REG is R13 (the stack pointer), warn that its use is
23728 + deprecated. */
23729 +#define warn_deprecated_sp(reg) \
23730 + do \
23731 + if (warn_on_deprecated && reg == REG_SP) \
23732 + as_warn (_("use of r13 is deprecated")); \
23733 + while (0)
23734 +
23735 /* Functions for operand encoding. ARM, then Thumb. */
23736
23737 #define rotate_left(v, n) (v << n | v >> (32 - n))
23738 @@ -7304,11 +7453,14 @@ do_mull (void)
23739 static void
23740 do_nop (void)
23741 {
23742 - if (inst.operands[0].present)
23743 + if (inst.operands[0].present
23744 + || ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6k))
23745 {
23746 /* Architectural NOP hints are CPSR sets with no bits selected. */
23747 inst.instruction &= 0xf0000000;
23748 - inst.instruction |= 0x0320f000 + inst.operands[0].imm;
23749 + inst.instruction |= 0x0320f000;
23750 + if (inst.operands[0].present)
23751 + inst.instruction |= inst.operands[0].imm;
23752 }
23753 }
23754
23755 @@ -8468,6 +8620,9 @@ do_t_add_sub (void)
23756 ? inst.operands[1].reg /* Rd, Rs, foo */
23757 : inst.operands[0].reg); /* Rd, foo -> Rd, Rd, foo */
23758
23759 + if (Rd == REG_PC)
23760 + set_it_insn_type_last ();
23761 +
23762 if (unified_syntax)
23763 {
23764 bfd_boolean flags;
23765 @@ -8477,9 +8632,9 @@ do_t_add_sub (void)
23766 flags = (inst.instruction == T_MNEM_adds
23767 || inst.instruction == T_MNEM_subs);
23768 if (flags)
23769 - narrow = (current_it_mask == 0);
23770 + narrow = !in_it_block ();
23771 else
23772 - narrow = (current_it_mask != 0);
23773 + narrow = in_it_block ();
23774 if (!inst.operands[2].isreg)
23775 {
23776 int add;
23777 @@ -8731,9 +8886,9 @@ do_t_arit3 (void)
23778
23779 /* See if we can do this with a 16-bit instruction. */
23780 if (THUMB_SETS_FLAGS (inst.instruction))
23781 - narrow = current_it_mask == 0;
23782 + narrow = !in_it_block ();
23783 else
23784 - narrow = current_it_mask != 0;
23785 + narrow = in_it_block ();
23786
23787 if (Rd > 7 || Rn > 7 || Rs > 7)
23788 narrow = FALSE;
23789 @@ -8819,9 +8974,9 @@ do_t_arit3c (void)
23790
23791 /* See if we can do this with a 16-bit instruction. */
23792 if (THUMB_SETS_FLAGS (inst.instruction))
23793 - narrow = current_it_mask == 0;
23794 + narrow = !in_it_block ();
23795 else
23796 - narrow = current_it_mask != 0;
23797 + narrow = in_it_block ();
23798
23799 if (Rd > 7 || Rn > 7 || Rs > 7)
23800 narrow = FALSE;
23801 @@ -8974,7 +9129,8 @@ do_t_bfx (void)
23802 static void
23803 do_t_blx (void)
23804 {
23805 - constraint (current_it_mask && current_it_mask != 0x10, BAD_BRANCH);
23806 + set_it_insn_type_last ();
23807 +
23808 if (inst.operands[0].isreg)
23809 {
23810 constraint (inst.operands[0].reg == REG_PC, BAD_PC);
23811 @@ -8985,12 +9141,7 @@ do_t_blx (void)
23812 {
23813 /* No register. This must be BLX(1). */
23814 inst.instruction = 0xf000e800;
23815 -#ifdef OBJ_ELF
23816 - if (EF_ARM_EABI_VERSION (meabi_flags) >= EF_ARM_EABI_VER4)
23817 - inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH23;
23818 - else
23819 -#endif
23820 - inst.reloc.type = BFD_RELOC_THUMB_PCREL_BLX;
23821 + inst.reloc.type = BFD_RELOC_THUMB_PCREL_BLX;
23822 inst.reloc.pc_rel = 1;
23823 }
23824 }
23825 @@ -9001,13 +9152,14 @@ do_t_branch (void)
23826 int opcode;
23827 int cond;
23828
23829 - if (current_it_mask)
23830 + cond = inst.cond;
23831 + set_it_insn_type (IF_INSIDE_IT_LAST_INSN);
23832 +
23833 + if (in_it_block ())
23834 {
23835 /* Conditional branches inside IT blocks are encoded as unconditional
23836 branches. */
23837 cond = COND_ALWAYS;
23838 - /* A branch must be the last instruction in an IT block. */
23839 - constraint (current_it_mask != 0x10, BAD_BRANCH);
23840 }
23841 else
23842 cond = inst.cond;
23843 @@ -9057,13 +9209,14 @@ do_t_bkpt (void)
23844 constraint (inst.operands[0].imm > 255,
23845 _("immediate value out of range"));
23846 inst.instruction |= inst.operands[0].imm;
23847 + set_it_insn_type (NEUTRAL_IT_INSN);
23848 }
23849 }
23850
23851 static void
23852 do_t_branch23 (void)
23853 {
23854 - constraint (current_it_mask && current_it_mask != 0x10, BAD_BRANCH);
23855 + set_it_insn_type_last ();
23856 inst.reloc.type = BFD_RELOC_THUMB_PCREL_BRANCH23;
23857 inst.reloc.pc_rel = 1;
23858
23859 @@ -9082,7 +9235,7 @@ do_t_branch23 (void)
23860 static void
23861 do_t_bx (void)
23862 {
23863 - constraint (current_it_mask && current_it_mask != 0x10, BAD_BRANCH);
23864 + set_it_insn_type_last ();
23865 inst.instruction |= inst.operands[0].reg << 3;
23866 /* ??? FIXME: Should add a hacky reloc here if reg is REG_PC. The reloc
23867 should cause the alignment to be checked once it is known. This is
23868 @@ -9094,7 +9247,7 @@ do_t_bxj (void)
23869 {
23870 int Rm;
23871
23872 - constraint (current_it_mask && current_it_mask != 0x10, BAD_BRANCH);
23873 + set_it_insn_type_last ();
23874 Rm = inst.operands[0].reg;
23875 reject_bad_reg (Rm);
23876 inst.instruction |= Rm << 16;
23877 @@ -9120,14 +9273,14 @@ do_t_clz (void)
23878 static void
23879 do_t_cps (void)
23880 {
23881 - constraint (current_it_mask, BAD_NOT_IT);
23882 + set_it_insn_type (OUTSIDE_IT_INSN);
23883 inst.instruction |= inst.operands[0].imm;
23884 }
23885
23886 static void
23887 do_t_cpsi (void)
23888 {
23889 - constraint (current_it_mask, BAD_NOT_IT);
23890 + set_it_insn_type (OUTSIDE_IT_INSN);
23891 if (unified_syntax
23892 && (inst.operands[1].present || inst.size_req == 4)
23893 && ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v6_notm))
23894 @@ -9174,7 +9327,7 @@ do_t_cpy (void)
23895 static void
23896 do_t_cbz (void)
23897 {
23898 - constraint (current_it_mask, BAD_NOT_IT);
23899 + set_it_insn_type (OUTSIDE_IT_INSN);
23900 constraint (inst.operands[0].reg > 7, BAD_HIREG);
23901 inst.instruction |= inst.operands[0].reg;
23902 inst.reloc.pc_rel = 1;
23903 @@ -9188,6 +9341,17 @@ do_t_dbg (void)
23904 }
23905
23906 static void
23907 +do_marvell_div (void)
23908 +{
23909 + /* Encode SDIV or UDIV instructions using the special Marvell
23910 + encoding utilizing MRC. */
23911 +
23912 + inst.instruction |= inst.operands[0].reg << 12;
23913 + inst.instruction |= inst.operands[1].reg << 16;
23914 + inst.instruction |= inst.operands[2].reg;
23915 +}
23916 +
23917 +static void
23918 do_t_div (void)
23919 {
23920 unsigned Rd, Rn, Rm;
23921 @@ -9220,9 +9384,9 @@ do_t_it (void)
23922 {
23923 unsigned int cond = inst.operands[0].imm;
23924
23925 - constraint (current_it_mask, BAD_NOT_IT);
23926 - current_it_mask = (inst.instruction & 0xf) | 0x10;
23927 - current_cc = cond;
23928 + set_it_insn_type (IT_INSN);
23929 + current_it.mask = (inst.instruction & 0xf) | 0x10;
23930 + current_it.cc = cond;
23931
23932 /* If the condition is a negative condition, invert the mask. */
23933 if ((cond & 0x1) == 0x0)
23934 @@ -9257,9 +9421,13 @@ encode_thumb2_ldmstm (int base, unsigned
23935 inst.error = _("SP not allowed in register list");
23936 if (load)
23937 {
23938 - if (mask & (1 << 14)
23939 - && mask & (1 << 15))
23940 - inst.error = _("LR and PC should not both be in register list");
23941 + if (mask & (1 << 15))
23942 + {
23943 + if (mask & (1 << 14))
23944 + inst.error = _("LR and PC should not both be in register list");
23945 + else
23946 + set_it_insn_type_last ();
23947 + }
23948
23949 if ((mask & (1 << base)) != 0
23950 && writeback)
23951 @@ -9435,6 +9603,13 @@ do_t_ldst (void)
23952 unsigned long opcode;
23953 int Rn;
23954
23955 + if (inst.operands[0].isreg
23956 + && !inst.operands[0].preind
23957 + && inst.operands[0].reg == REG_PC)
23958 + {
23959 + set_it_insn_type_last ();
23960 + }
23961 +
23962 opcode = inst.instruction;
23963 if (unified_syntax)
23964 {
23965 @@ -9655,6 +9830,9 @@ do_t_mov_cmp (void)
23966 Rn = inst.operands[0].reg;
23967 Rm = inst.operands[1].reg;
23968
23969 + if (Rn == REG_PC)
23970 + set_it_insn_type_last ();
23971 +
23972 if (unified_syntax)
23973 {
23974 int r0off = (inst.instruction == T_MNEM_mov
23975 @@ -9665,7 +9843,7 @@ do_t_mov_cmp (void)
23976
23977 low_regs = (Rn <= 7 && Rm <= 7);
23978 opcode = inst.instruction;
23979 - if (current_it_mask)
23980 + if (in_it_block ())
23981 narrow = opcode != T_MNEM_movs;
23982 else
23983 narrow = opcode != T_MNEM_movs || low_regs;
23984 @@ -9686,7 +9864,18 @@ do_t_mov_cmp (void)
23985 if (opcode == T_MNEM_cmp)
23986 {
23987 constraint (Rn == REG_PC, BAD_PC);
23988 - reject_bad_reg (Rm);
23989 + if (narrow)
23990 + {
23991 + /* In the Thumb-2 ISA, use of R13 as Rm is deprecated,
23992 + but valid. */
23993 + warn_deprecated_sp (Rm);
23994 + /* R15 was documented as a valid choice for Rm in ARMv6,
23995 + but as UNPREDICTABLE in ARMv7. ARM's proprietary
23996 + tools reject R15, so we do too. */
23997 + constraint (Rm == REG_PC, BAD_PC);
23998 + }
23999 + else
24000 + reject_bad_reg (Rm);
24001 }
24002 else if (opcode == T_MNEM_mov
24003 || opcode == T_MNEM_movs)
24004 @@ -9709,7 +9898,7 @@ do_t_mov_cmp (void)
24005 if (!inst.operands[1].isreg)
24006 {
24007 /* Immediate operand. */
24008 - if (current_it_mask == 0 && opcode == T_MNEM_mov)
24009 + if (!in_it_block () && opcode == T_MNEM_mov)
24010 narrow = 0;
24011 if (low_regs && narrow)
24012 {
24013 @@ -9735,7 +9924,7 @@ do_t_mov_cmp (void)
24014 /* Register shifts are encoded as separate shift instructions. */
24015 bfd_boolean flags = (inst.instruction == T_MNEM_movs);
24016
24017 - if (current_it_mask)
24018 + if (in_it_block ())
24019 narrow = !flags;
24020 else
24021 narrow = flags;
24022 @@ -9791,7 +9980,7 @@ do_t_mov_cmp (void)
24023 && (inst.instruction == T_MNEM_mov
24024 || inst.instruction == T_MNEM_movs))
24025 {
24026 - if (current_it_mask)
24027 + if (in_it_block ())
24028 narrow = (inst.instruction == T_MNEM_mov);
24029 else
24030 narrow = (inst.instruction == T_MNEM_movs);
24031 @@ -9953,9 +10142,9 @@ do_t_mvn_tst (void)
24032 else if (inst.instruction == T_MNEM_cmn)
24033 narrow = TRUE;
24034 else if (THUMB_SETS_FLAGS (inst.instruction))
24035 - narrow = (current_it_mask == 0);
24036 + narrow = !in_it_block ();
24037 else
24038 - narrow = (current_it_mask != 0);
24039 + narrow = in_it_block ();
24040
24041 if (!inst.operands[1].isreg)
24042 {
24043 @@ -10094,9 +10283,9 @@ do_t_mul (void)
24044 || Rm > 7)
24045 narrow = FALSE;
24046 else if (inst.instruction == T_MNEM_muls)
24047 - narrow = (current_it_mask == 0);
24048 + narrow = !in_it_block ();
24049 else
24050 - narrow = (current_it_mask != 0);
24051 + narrow = in_it_block ();
24052 }
24053 else
24054 {
24055 @@ -10162,6 +10351,8 @@ do_t_mull (void)
24056 static void
24057 do_t_nop (void)
24058 {
24059 + set_it_insn_type(NEUTRAL_IT_INSN);
24060 +
24061 if (unified_syntax)
24062 {
24063 if (inst.size_req == 4 || inst.operands[0].imm > 15)
24064 @@ -10198,9 +10389,9 @@ do_t_neg (void)
24065 bfd_boolean narrow;
24066
24067 if (THUMB_SETS_FLAGS (inst.instruction))
24068 - narrow = (current_it_mask == 0);
24069 + narrow = !in_it_block ();
24070 else
24071 - narrow = (current_it_mask != 0);
24072 + narrow = in_it_block ();
24073 if (inst.operands[0].reg > 7 || inst.operands[1].reg > 7)
24074 narrow = FALSE;
24075 if (inst.size_req == 4)
24076 @@ -10424,9 +10615,9 @@ do_t_rsb (void)
24077 bfd_boolean narrow;
24078
24079 if ((inst.instruction & 0x00100000) != 0)
24080 - narrow = (current_it_mask == 0);
24081 + narrow = !in_it_block ();
24082 else
24083 - narrow = (current_it_mask != 0);
24084 + narrow = in_it_block ();
24085
24086 if (Rd > 7 || Rs > 7)
24087 narrow = FALSE;
24088 @@ -10460,7 +10651,7 @@ do_t_rsb (void)
24089 static void
24090 do_t_setend (void)
24091 {
24092 - constraint (current_it_mask, BAD_NOT_IT);
24093 + set_it_insn_type (OUTSIDE_IT_INSN);
24094 if (inst.operands[0].imm)
24095 inst.instruction |= 0x8;
24096 }
24097 @@ -10490,9 +10681,9 @@ do_t_shift (void)
24098 }
24099
24100 if (THUMB_SETS_FLAGS (inst.instruction))
24101 - narrow = (current_it_mask == 0);
24102 + narrow = !in_it_block ();
24103 else
24104 - narrow = (current_it_mask != 0);
24105 + narrow = in_it_block ();
24106 if (inst.operands[0].reg > 7 || inst.operands[1].reg > 7)
24107 narrow = FALSE;
24108 if (!inst.operands[2].isreg && shift_kind == SHIFT_ROR)
24109 @@ -10778,7 +10969,7 @@ do_t_tb (void)
24110 int half;
24111
24112 half = (inst.instruction & 0x10) != 0;
24113 - constraint (current_it_mask && current_it_mask != 0x10, BAD_BRANCH);
24114 + set_it_insn_type_last ();
24115 constraint (inst.operands[0].immisreg,
24116 _("instruction requires register index"));
24117
24118 @@ -14410,6 +14601,28 @@ output_inst (const char * str)
24119 dwarf2_emit_insn (inst.size);
24120 }
24121
24122 +static char*
24123 +output_it_inst (int cond, int mask, char* to)
24124 +{
24125 + unsigned long instruction = 0xbf00;
24126 +
24127 + mask &= 0xf;
24128 + instruction |= mask;
24129 + instruction |= cond << 4;
24130 +
24131 + if (to == NULL)
24132 + {
24133 + to = frag_more (2);
24134 +#ifdef OBJ_ELF
24135 + dwarf2_emit_insn (2);
24136 +#endif
24137 + }
24138 +
24139 + md_number_to_chars (to, instruction, 2);
24140 +
24141 + return to;
24142 +}
24143 +
24144 /* Tag values used in struct asm_opcode's tag field. */
24145 enum opcode_tag
24146 {
24147 @@ -14655,6 +14868,301 @@ opcode_lookup (char **str)
24148 return 0;
24149 }
24150
24151 +/* Output an automatically inserted IT instruction. Initially this only covers
24152 + a single instruction, but may be extended later. To simply cleanup at the end
24153 + of a block we update the instruction as we go along. */
24154 +static void
24155 +new_automatic_it_block (int cond)
24156 +{
24157 + current_it.state = AUTOMATIC_IT_BLOCK;
24158 + current_it.mask = 0x18;
24159 + current_it.cc = cond;
24160 + current_it.block_length = 1;
24161 + current_it.insn = output_it_inst(cond, current_it.mask, NULL);
24162 +}
24163 +
24164 +/* Close an automatic IT block.
24165 + See comments in new_automatic_it_block (). */
24166 +static void
24167 +close_automatic_it_block (void)
24168 +{
24169 + current_it.mask = 0x10;
24170 + current_it.block_length = 0;
24171 +}
24172 +
24173 +/* Update the mask of the current automatically-generated IT
24174 + instruction. See comments in new_automatic_it_block (). */
24175 +static void
24176 +current_it_add_mask (int cond)
24177 +{
24178 +#define CLEAR_BIT(value, nbit) ((value) & ~(1 << (nbit)))
24179 +#define SET_BIT_VALUE(value, bitvalue, nbit) (CLEAR_BIT(value, nbit) \
24180 + | ((bitvalue) << (nbit)))
24181 +
24182 + const int resulting_bit = (cond & 1);
24183 + current_it.mask &= 0xf;
24184 + current_it.mask = SET_BIT_VALUE (current_it.mask,
24185 + resulting_bit,
24186 + (5 - current_it.block_length));
24187 + current_it.mask = SET_BIT_VALUE (current_it.mask,
24188 + 1,
24189 + ((5 - current_it.block_length) - 1) );
24190 + output_it_inst (current_it.cc, current_it.mask, current_it.insn);
24191 +
24192 +#undef CLEAR_BIT
24193 +#undef SET_BIT_VALUE
24194 +
24195 +}
24196 +
24197 +/* The IT blocks handling machinery is accessed through the these functions:
24198 + it_fsm_pre_encode () from md_assemble ()
24199 + set_it_insn_type () optional, from the tencode functions
24200 + set_it_insn_type_last () ditto
24201 + in_it_block () ditto
24202 + it_fsm_post_encode () from md_assemble ()
24203 + force_automatic_it_block_close () from label habdling functions
24204 +
24205 + Rationale:
24206 + 1) md_assemble () calls it_fsm_pre_encode () before calling tencode (),
24207 + initializing the IT insn type with a generic initial value depending
24208 + on the inst.condition.
24209 + 2) During the tencode function, two things may happen:
24210 + a) The tencode function overrides the IT insn type by
24211 + calling either set_it_insn_type (type) or set_it_insn_type_last ().
24212 + b) The tencode function queries the IT block state by
24213 + calling in_it_block () (i.e. to determine narrow/wide mode).
24214 +
24215 + Both set_it_insn_type and in_it_block run the internal FSM state
24216 + handling function (handle_it_state), because: a) setting the IT insn
24217 + type may incur in an invalid state (exiting the function),
24218 + and b) querying the state requires the FSM to be updated.
24219 + Specifically we want to avoid creating an IT block for conditional
24220 + branches, so it_fsm_pre_encode is actually a guess and we can't
24221 + determine whether an IT block is required until the tencode () routine
24222 + has decided what type of instruction this actually it.
24223 + Because of this, if set_it_insn_type and in_it_block have to be used,
24224 + set_it_insn_type has to be called first.
24225 +
24226 + set_it_insn_type_last () is a wrapper of set_it_insn_type (type), that
24227 + determines the insn IT type depending on the inst.cond code.
24228 + When a tencode () routine encodes an instruction that can be
24229 + either outside an IT block, or, in the case of being inside, has to be
24230 + the last one, set_it_insn_type_last () will determine the proper
24231 + IT instruction type based on the inst.cond code. Otherwise,
24232 + set_it_insn_type can be called for overriding that logic or
24233 + for covering other cases.
24234 +
24235 + Calling handle_it_state () may not transition the IT block state to
24236 + OUTSIDE_IT_BLOCK immediatelly, since the (current) state could be
24237 + still queried. Instead, if the FSM determines that the state should
24238 + be transitioned to OUTSIDE_IT_BLOCK, a flag is marked to be closed
24239 + after the tencode () function: that's what it_fsm_post_encode () does.
24240 +
24241 + Since in_it_block () calls the state handling function to get an
24242 + updated state, an error may occur (due to invalid insns combination).
24243 + In that case, inst.error is set.
24244 + Therefore, inst.error has to be checked after the execution of
24245 + the tencode () routine.
24246 +
24247 + 3) Back in md_assemble(), it_fsm_post_encode () is called to commit
24248 + any pending state change (if any) that didn't take place in
24249 + handle_it_state () as explained above. */
24250 +
24251 +static void
24252 +it_fsm_pre_encode (void)
24253 +{
24254 + if (inst.cond != COND_ALWAYS)
24255 + inst.it_insn_type = INSIDE_IT_INSN;
24256 + else
24257 + inst.it_insn_type = OUTSIDE_IT_INSN;
24258 +
24259 + current_it.state_handled = 0;
24260 +}
24261 +
24262 +/* IT state FSM handling function. */
24263 +static int
24264 +handle_it_state (void)
24265 +{
24266 + current_it.state_handled = 1;
24267 +
24268 + switch(current_it.state)
24269 + {
24270 + case OUTSIDE_IT_BLOCK:
24271 + switch (inst.it_insn_type)
24272 + {
24273 + case OUTSIDE_IT_INSN:
24274 + break;
24275 +
24276 + case INSIDE_IT_INSN:
24277 + case INSIDE_IT_LAST_INSN:
24278 + if (do_automatic_it)
24279 + {
24280 + /* Automatically generate the IT instruction. */
24281 + new_automatic_it_block (inst.cond);
24282 + if (inst.it_insn_type == INSIDE_IT_LAST_INSN)
24283 + close_automatic_it_block ();
24284 + }
24285 + else
24286 + {
24287 + inst.error = BAD_OUT_IT;
24288 + return FAIL;
24289 + }
24290 + break;
24291 +
24292 + case IF_INSIDE_IT_LAST_INSN:
24293 + case NEUTRAL_IT_INSN:
24294 + break;
24295 +
24296 + case IT_INSN:
24297 + current_it.state = MANUAL_IT_BLOCK;
24298 + current_it.block_length = 0;
24299 + break;
24300 + }
24301 + break;
24302 +
24303 + case AUTOMATIC_IT_BLOCK:
24304 + /* Three things may happen now:
24305 + a) We should increment current it block size;
24306 + b) We should close current it block (closing insn or 4 insns);
24307 + c) We should close current it block and start a new one (due
24308 + to incompatible conditions or
24309 + 4 insns-length block reached). */
24310 +
24311 + switch (inst.it_insn_type)
24312 + {
24313 + case OUTSIDE_IT_INSN:
24314 + /* The closure of the block shall happen immediatelly,
24315 + so any in_it_block () call reports the block as closed. */
24316 + force_automatic_it_block_close ();
24317 + break;
24318 +
24319 + case INSIDE_IT_INSN:
24320 + case INSIDE_IT_LAST_INSN:
24321 + case IF_INSIDE_IT_LAST_INSN:
24322 + current_it.block_length++;
24323 +
24324 + if (current_it.block_length > 4
24325 + || !current_it_compatible (inst.cond))
24326 + {
24327 + force_automatic_it_block_close ();
24328 + if (inst.it_insn_type != IF_INSIDE_IT_LAST_INSN)
24329 + new_automatic_it_block (inst.cond);
24330 + }
24331 + else
24332 + {
24333 + current_it_add_mask (inst.cond);
24334 + }
24335 +
24336 + if (current_it.state == AUTOMATIC_IT_BLOCK
24337 + && (inst.it_insn_type == INSIDE_IT_LAST_INSN
24338 + || inst.it_insn_type == IF_INSIDE_IT_LAST_INSN))
24339 + close_automatic_it_block ();
24340 + break;
24341 +
24342 + case NEUTRAL_IT_INSN:
24343 + current_it.block_length++;
24344 +
24345 + if (current_it.block_length > 4)
24346 + force_automatic_it_block_close ();
24347 + else
24348 + current_it_add_mask (current_it.cc & 1);
24349 + break;
24350 +
24351 + case IT_INSN:
24352 + close_automatic_it_block ();
24353 + current_it.state = MANUAL_IT_BLOCK;
24354 + break;
24355 + }
24356 + break;
24357 +
24358 + case MANUAL_IT_BLOCK:
24359 + {
24360 + /* Check conditional suffixes. */
24361 + const int cond = current_it.cc ^ ((current_it.mask >> 4) & 1) ^ 1;
24362 + int is_last;
24363 + current_it.mask <<= 1;
24364 + current_it.mask &= 0x1f;
24365 + is_last = (current_it.mask == 0x10);
24366 +
24367 + switch (inst.it_insn_type)
24368 + {
24369 + case OUTSIDE_IT_INSN:
24370 + inst.error = BAD_NOT_IT;
24371 + return FAIL;
24372 +
24373 + case INSIDE_IT_INSN:
24374 + if (cond != inst.cond)
24375 + {
24376 + inst.error = BAD_IT_COND;
24377 + return FAIL;
24378 + }
24379 + break;
24380 +
24381 + case INSIDE_IT_LAST_INSN:
24382 + case IF_INSIDE_IT_LAST_INSN:
24383 + if (cond != inst.cond)
24384 + {
24385 + inst.error = BAD_IT_COND;
24386 + return FAIL;
24387 + }
24388 + if (!is_last)
24389 + {
24390 + inst.error = BAD_BRANCH;
24391 + return FAIL;
24392 + }
24393 + break;
24394 +
24395 + case NEUTRAL_IT_INSN:
24396 + /* The BKPT instruction is unconditional even in an IT block. */
24397 + break;
24398 +
24399 + case IT_INSN:
24400 + inst.error = BAD_IT_IT;
24401 + return FAIL;
24402 + }
24403 + }
24404 + break;
24405 + }
24406 +
24407 + return SUCCESS;
24408 +}
24409 +
24410 +static void
24411 +it_fsm_post_encode (void)
24412 +{
24413 + int is_last;
24414 +
24415 + if (!current_it.state_handled)
24416 + handle_it_state ();
24417 +
24418 + is_last = (current_it.mask == 0x10);
24419 + if (is_last)
24420 + {
24421 + current_it.state = OUTSIDE_IT_BLOCK;
24422 + current_it.mask = 0;
24423 + }
24424 +}
24425 +
24426 +static void
24427 +force_automatic_it_block_close (void)
24428 +{
24429 + if (current_it.state == AUTOMATIC_IT_BLOCK)
24430 + {
24431 + close_automatic_it_block ();
24432 + current_it.state = OUTSIDE_IT_BLOCK;
24433 + current_it.mask = 0;
24434 + }
24435 +}
24436 +
24437 +static int
24438 +in_it_block (void)
24439 +{
24440 + if (!current_it.state_handled)
24441 + handle_it_state ();
24442 +
24443 + return current_it.state != OUTSIDE_IT_BLOCK;
24444 +}
24445 +
24446 void
24447 md_assemble (char *str)
24448 {
24449 @@ -14719,40 +15227,24 @@ md_assemble (char *str)
24450 /* Implicit require narrow instructions on Thumb-1. This avoids
24451 relaxation accidentally introducing Thumb-2 instructions. */
24452 if (opcode->tencode != do_t_blx && opcode->tencode != do_t_branch23
24453 - && !ARM_CPU_HAS_FEATURE(*opcode->tvariant, arm_ext_msr))
24454 + && !(ARM_CPU_HAS_FEATURE(*opcode->tvariant, arm_ext_msr)
24455 + || ARM_CPU_HAS_FEATURE(*opcode->tvariant, arm_ext_barrier)))
24456 inst.size_req = 2;
24457 }
24458
24459 - /* Check conditional suffixes. */
24460 - if (current_it_mask)
24461 - {
24462 - int cond;
24463 - cond = current_cc ^ ((current_it_mask >> 4) & 1) ^ 1;
24464 - current_it_mask <<= 1;
24465 - current_it_mask &= 0x1f;
24466 - /* The BKPT instruction is unconditional even in an IT block. */
24467 - if (!inst.error
24468 - && cond != inst.cond && opcode->tencode != do_t_bkpt)
24469 - {
24470 - as_bad (_("incorrect condition in IT block"));
24471 - return;
24472 - }
24473 - }
24474 - else if (inst.cond != COND_ALWAYS && opcode->tencode != do_t_branch)
24475 - {
24476 - as_bad (_("thumb conditional instruction not in IT block"));
24477 - return;
24478 - }
24479 -
24480 mapping_state (MAP_THUMB);
24481 inst.instruction = opcode->tvalue;
24482
24483 if (!parse_operands (p, opcode->operands))
24484 - opcode->tencode ();
24485 + {
24486 + /* Prepare the it_insn_type for those encodings that don't set
24487 + it. */
24488 + it_fsm_pre_encode ();
24489
24490 - /* Clear current_it_mask at the end of an IT block. */
24491 - if (current_it_mask == 0x10)
24492 - current_it_mask = 0;
24493 + opcode->tencode ();
24494 +
24495 + it_fsm_post_encode ();
24496 + }
24497
24498 if (!(inst.error || inst.relax))
24499 {
24500 @@ -14777,7 +15269,8 @@ md_assemble (char *str)
24501 This is overly pessimistic for relaxable instructions. */
24502 if (((inst.size == 4 && (inst.instruction & 0xf800e800) != 0xf000e800)
24503 || inst.relax)
24504 - && !ARM_CPU_HAS_FEATURE(*opcode->tvariant, arm_ext_msr))
24505 + && !(ARM_CPU_HAS_FEATURE(*opcode->tvariant, arm_ext_msr)
24506 + || ARM_CPU_HAS_FEATURE(*opcode->tvariant, arm_ext_barrier)))
24507 ARM_MERGE_FEATURE_SETS (thumb_arch_used, thumb_arch_used,
24508 arm_ext_v6t2);
24509 }
24510 @@ -14847,6 +15340,8 @@ arm_frob_label (symbolS * sym)
24511 ARM_SET_INTERWORK (sym, support_interwork);
24512 #endif
24513
24514 + force_automatic_it_block_close ();
24515 +
24516 /* Note - do not allow local symbols (.Lxxx) to be labelled
24517 as Thumb functions. This is because these labels, whilst
24518 they exist inside Thumb code, are not the entry points for
24519 @@ -15834,11 +16329,14 @@ static const struct asm_opcode insns[] =
24520 TCE(tbb, 0, e8d0f000, 1, (TB), 0, t_tb),
24521 TCE(tbh, 0, e8d0f010, 1, (TB), 0, t_tb),
24522
24523 - /* Thumb-2 hardware division instructions (R and M profiles only). */
24524 + /* Thumb-2 hardware division instructions (R and M profiles only) and
24525 + Marvell-specific encoding of sdiv and udiv as mrc. */
24526 #undef THUMB_VARIANT
24527 #define THUMB_VARIANT &arm_ext_div
24528 - TCE(sdiv, 0, fb90f0f0, 3, (RR, oRR, RR), 0, t_div),
24529 - TCE(udiv, 0, fbb0f0f0, 3, (RR, oRR, RR), 0, t_div),
24530 +#undef ARM_VARIANT
24531 +#define ARM_VARIANT &arm_ext_marvell_f
24532 + TCE(sdiv, e300690, fb90f0f0, 3, (RR, oRR, RR), marvell_div, t_div),
24533 + TCE(udiv, e300610, fbb0f0f0, 3, (RR, oRR, RR), marvell_div, t_div),
24534
24535 /* ARM V6M/V7 instructions. */
24536 #undef ARM_VARIANT
24537 @@ -17550,14 +18048,39 @@ md_section_align (segT segment ATTRIBUT
24538 void
24539 arm_handle_align (fragS * fragP)
24540 {
24541 - static char const arm_noop[4] = { 0x00, 0x00, 0xa0, 0xe1 };
24542 - static char const thumb_noop[2] = { 0xc0, 0x46 };
24543 - static char const arm_bigend_noop[4] = { 0xe1, 0xa0, 0x00, 0x00 };
24544 - static char const thumb_bigend_noop[2] = { 0x46, 0xc0 };
24545 -
24546 - int bytes, fix, noop_size;
24547 + static char const arm_noop[2][2][4] =
24548 + {
24549 + { /* ARMv1 */
24550 + {0x00, 0x00, 0xa0, 0xe1}, /* LE */
24551 + {0xe1, 0xa0, 0x00, 0x00}, /* BE */
24552 + },
24553 + { /* ARMv6k */
24554 + {0x00, 0xf0, 0x20, 0xe3}, /* LE */
24555 + {0xe3, 0x20, 0xf0, 0x00}, /* BE */
24556 + },
24557 + };
24558 + static char const thumb_noop[2][2][2] =
24559 + {
24560 + { /* Thumb-1 */
24561 + {0xc0, 0x46}, /* LE */
24562 + {0x46, 0xc0}, /* BE */
24563 + },
24564 + { /* Thumb-2 */
24565 + {0x00, 0xbf}, /* LE */
24566 + {0xbf, 0x00} /* BE */
24567 + }
24568 + };
24569 + static char const wide_thumb_noop[2][4] =
24570 + { /* Wide Thumb-2 */
24571 + {0xaf, 0xf3, 0x00, 0x80}, /* LE */
24572 + {0xf3, 0xaf, 0x80, 0x00}, /* BE */
24573 + };
24574 +
24575 + unsigned bytes, fix, noop_size;
24576 char * p;
24577 const char * noop;
24578 + const char *narrow_noop = NULL;
24579 + enum mstate state;
24580
24581 if (fragP->fr_type != rs_align_code)
24582 return;
24583 @@ -17569,31 +18092,52 @@ arm_handle_align (fragS * fragP)
24584 if (bytes > MAX_MEM_FOR_RS_ALIGN_CODE)
24585 bytes &= MAX_MEM_FOR_RS_ALIGN_CODE;
24586
24587 - if (fragP->tc_frag_data)
24588 + if (fragP->tc_frag_data.thumb_mode)
24589 {
24590 - if (target_big_endian)
24591 - noop = thumb_bigend_noop;
24592 + if (ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6t2))
24593 + {
24594 + narrow_noop = thumb_noop[1][target_big_endian];
24595 + noop = wide_thumb_noop[target_big_endian];
24596 + }
24597 else
24598 - noop = thumb_noop;
24599 - noop_size = sizeof (thumb_noop);
24600 + noop = thumb_noop[0][target_big_endian];
24601 + noop_size = 2;
24602 + state = MAP_THUMB;
24603 }
24604 else
24605 {
24606 - if (target_big_endian)
24607 - noop = arm_bigend_noop;
24608 - else
24609 - noop = arm_noop;
24610 - noop_size = sizeof (arm_noop);
24611 + noop = arm_noop[ARM_CPU_HAS_FEATURE (selected_cpu, arm_ext_v6k) != 0]
24612 + [target_big_endian];
24613 + noop_size = 4;
24614 + state = MAP_ARM;
24615 }
24616 -
24617 +
24618 + fragP->fr_var = noop_size;
24619 +
24620 if (bytes & (noop_size - 1))
24621 {
24622 fix = bytes & (noop_size - 1);
24623 + insert_data_mapping_symbol (state, fragP->fr_fix, fragP, fix);
24624 memset (p, 0, fix);
24625 p += fix;
24626 bytes -= fix;
24627 }
24628
24629 + if (narrow_noop)
24630 + {
24631 + if (bytes & noop_size)
24632 + {
24633 + /* Insert a narrow noop. */
24634 + memcpy (p, narrow_noop, noop_size);
24635 + p += noop_size;
24636 + bytes -= noop_size;
24637 + fix += noop_size;
24638 + }
24639 +
24640 + /* Use wide noops for the remainder */
24641 + noop_size = 4;
24642 + }
24643 +
24644 while (bytes >= noop_size)
24645 {
24646 memcpy (p, noop, noop_size);
24647 @@ -17603,7 +18147,6 @@ arm_handle_align (fragS * fragP)
24648 }
24649
24650 fragP->fr_fix += fix;
24651 - fragP->fr_var = noop_size;
24652 }
24653
24654 /* Called from md_do_align. Used to create an alignment
24655 @@ -17615,9 +18158,15 @@ arm_frag_align_code (int n, int max)
24656 char * p;
24657
24658 /* We assume that there will never be a requirement
24659 - to support alignments greater than 32 bytes. */
24660 + to support alignments greater than [MAX_MEM_FOR_RS_ALIGN_CODE] bytes. */
24661 if (max > MAX_MEM_FOR_RS_ALIGN_CODE)
24662 - as_fatal (_("alignments greater than 32 bytes not supported in .text sections."));
24663 + {
24664 + char err_msg[128];
24665 + sprintf (err_msg,
24666 + _("alignments greater than %d bytes not supported in .text sections."),
24667 + MAX_MEM_FOR_RS_ALIGN_CODE + 1);
24668 + as_fatal (err_msg);
24669 + }
24670
24671 p = frag_var (rs_align_code,
24672 MAX_MEM_FOR_RS_ALIGN_CODE,
24673 @@ -17632,10 +18181,26 @@ arm_frag_align_code (int n, int max)
24674 /* Perform target specific initialisation of a frag. */
24675
24676 void
24677 -arm_init_frag (fragS * fragP)
24678 +arm_init_frag (fragS * fragP, int max_chars)
24679 {
24680 /* Record whether this frag is in an ARM or a THUMB area. */
24681 - fragP->tc_frag_data = thumb_mode;
24682 + fragP->tc_frag_data.thumb_mode = thumb_mode;
24683 +
24684 + /* Record a mapping symbol for alignment frags. We will delete this
24685 + later if the alignment ends up empty. */
24686 + switch (fragP->fr_type)
24687 + {
24688 + case rs_align:
24689 + case rs_align_test:
24690 + case rs_fill:
24691 + mapping_state_2 (MAP_DATA, max_chars);
24692 + break;
24693 + case rs_align_code:
24694 + mapping_state_2 (thumb_mode ? MAP_THUMB : MAP_ARM, max_chars);
24695 + break;
24696 + default:
24697 + break;
24698 + }
24699 }
24700
24701 #ifdef OBJ_ELF
24702 @@ -18127,9 +18692,13 @@ md_pcrel_from_section (fixS * fixP, segT
24703 case BFD_RELOC_THUMB_PCREL_BRANCH20:
24704 case BFD_RELOC_THUMB_PCREL_BRANCH23:
24705 case BFD_RELOC_THUMB_PCREL_BRANCH25:
24706 - case BFD_RELOC_THUMB_PCREL_BLX:
24707 return base + 4;
24708
24709 + /* BLX is like branches above, but forces the low two bits of PC to
24710 + zero. */
24711 + case BFD_RELOC_THUMB_PCREL_BLX:
24712 + return (base + 4) & ~3;
24713 +
24714 /* ARM mode branches are offset by +8. However, the Windows CE
24715 loader expects the relocation not to take this into account. */
24716 case BFD_RELOC_ARM_PCREL_BRANCH:
24717 @@ -18499,6 +19068,15 @@ md_apply_fix (fixS * fixP,
24718 break;
24719 }
24720
24721 + if (fixP->fx_addsy
24722 + && S_GET_SEGMENT (fixP->fx_addsy) != seg)
24723 + {
24724 + as_bad_where (fixP->fx_file, fixP->fx_line,
24725 + _("symbol %s is in a different section"),
24726 + S_GET_NAME (fixP->fx_addsy));
24727 + break;
24728 + }
24729 +
24730 newimm = encode_arm_immediate (value);
24731 temp = md_chars_to_number (buf, INSN_SIZE);
24732
24733 @@ -18522,6 +19100,24 @@ md_apply_fix (fixS * fixP,
24734 unsigned int highpart = 0;
24735 unsigned int newinsn = 0xe1a00000; /* nop. */
24736
24737 + if (fixP->fx_addsy
24738 + && ! S_IS_DEFINED (fixP->fx_addsy))
24739 + {
24740 + as_bad_where (fixP->fx_file, fixP->fx_line,
24741 + _("undefined symbol %s used as an immediate value"),
24742 + S_GET_NAME (fixP->fx_addsy));
24743 + break;
24744 + }
24745 +
24746 + if (fixP->fx_addsy
24747 + && S_GET_SEGMENT (fixP->fx_addsy) != seg)
24748 + {
24749 + as_bad_where (fixP->fx_file, fixP->fx_line,
24750 + _("symbol %s is in a different section"),
24751 + S_GET_NAME (fixP->fx_addsy));
24752 + break;
24753 + }
24754 +
24755 newimm = encode_arm_immediate (value);
24756 temp = md_chars_to_number (buf, INSN_SIZE);
24757
24758 @@ -19624,7 +20220,6 @@ tc_gen_reloc (asection *section, fixS *f
24759 case BFD_RELOC_THUMB_PCREL_BRANCH20:
24760 case BFD_RELOC_THUMB_PCREL_BRANCH23:
24761 case BFD_RELOC_THUMB_PCREL_BRANCH25:
24762 - case BFD_RELOC_THUMB_PCREL_BLX:
24763 case BFD_RELOC_VTABLE_ENTRY:
24764 case BFD_RELOC_VTABLE_INHERIT:
24765 #ifdef TE_PE
24766 @@ -19633,6 +20228,15 @@ tc_gen_reloc (asection *section, fixS *f
24767 code = fixp->fx_r_type;
24768 break;
24769
24770 + case BFD_RELOC_THUMB_PCREL_BLX:
24771 +#ifdef OBJ_ELF
24772 + if (EF_ARM_EABI_VERSION (meabi_flags) >= EF_ARM_EABI_VER4)
24773 + code = BFD_RELOC_THUMB_PCREL_BRANCH23;
24774 + else
24775 +#endif
24776 + code = BFD_RELOC_THUMB_PCREL_BLX;
24777 + break;
24778 +
24779 case BFD_RELOC_ARM_LITERAL:
24780 case BFD_RELOC_ARM_HWLITERAL:
24781 /* If this is called then the a literal has
24782 @@ -19992,6 +20596,73 @@ arm_cleanup (void)
24783 }
24784 }
24785
24786 +#ifdef OBJ_ELF
24787 +/* Remove any excess mapping symbols generated for alignment frags in
24788 + SEC. We may have created a mapping symbol before a zero byte
24789 + alignment; remove it if there's a mapping symbol after the
24790 + alignment. */
24791 +static void
24792 +check_mapping_symbols (bfd *abfd ATTRIBUTE_UNUSED, asection *sec,
24793 + void *dummy ATTRIBUTE_UNUSED)
24794 +{
24795 + segment_info_type *seginfo = seg_info (sec);
24796 + fragS *fragp;
24797 +
24798 + if (seginfo == NULL || seginfo->frchainP == NULL)
24799 + return;
24800 +
24801 + for (fragp = seginfo->frchainP->frch_root;
24802 + fragp != NULL;
24803 + fragp = fragp->fr_next)
24804 + {
24805 + symbolS *sym = fragp->tc_frag_data.last_map;
24806 + fragS *next = fragp->fr_next;
24807 +
24808 + /* Variable-sized frags have been converted to fixed size by
24809 + this point. But if this was variable-sized to start with,
24810 + there will be a fixed-size frag after it. So don't handle
24811 + next == NULL. */
24812 + if (sym == NULL || next == NULL)
24813 + continue;
24814 +
24815 + if (S_GET_VALUE (sym) < next->fr_address)
24816 + /* Not at the end of this frag. */
24817 + continue;
24818 + know (S_GET_VALUE (sym) == next->fr_address);
24819 +
24820 + do
24821 + {
24822 + if (next->tc_frag_data.first_map != NULL)
24823 + {
24824 + /* Next frag starts with a mapping symbol. Discard this
24825 + one. */
24826 + symbol_remove (sym, &symbol_rootP, &symbol_lastP);
24827 + break;
24828 + }
24829 +
24830 + if (next->fr_next == NULL)
24831 + {
24832 + /* This mapping symbol is at the end of the section. Discard
24833 + it. */
24834 + know (next->fr_fix == 0 && next->fr_var == 0);
24835 + symbol_remove (sym, &symbol_rootP, &symbol_lastP);
24836 + break;
24837 + }
24838 +
24839 + /* As long as we have empty frags without any mapping symbols,
24840 + keep looking. */
24841 + /* If the next frag is non-empty and does not start with a
24842 + mapping symbol, then this mapping symbol is required. */
24843 + if (next->fr_address != next->fr_next->fr_address)
24844 + break;
24845 +
24846 + next = next->fr_next;
24847 + }
24848 + while (next != NULL);
24849 + }
24850 +}
24851 +#endif
24852 +
24853 /* Adjust the symbol table. This marks Thumb symbols as distinct from
24854 ARM ones. */
24855
24856 @@ -20066,6 +20737,9 @@ arm_adjust_symtab (void)
24857 }
24858 }
24859 }
24860 +
24861 + /* Remove any overlapping mapping symbols generated by alignment frags. */
24862 + bfd_map_over_sections (stdoutput, check_mapping_symbols, (char *) 0);
24863 #endif
24864 }
24865
24866 @@ -20154,7 +20828,7 @@ md_begin (void)
24867 }
24868 else if (!mfpu_opt)
24869 {
24870 -#if !(defined (TE_LINUX) || defined (TE_NetBSD) || defined (TE_VXWORKS))
24871 +#if !(defined (EABI_DEFAULT) || defined (TE_NetBSD) || defined (TE_VXWORKS))
24872 /* Some environments specify a default FPU. If they don't, infer it
24873 from the processor. */
24874 if (mcpu_fpu_opt)
24875 @@ -20414,6 +21088,8 @@ struct arm_option_table arm_opts[] =
24876 {"mthumb", N_("assemble Thumb code"), &thumb_mode, 1, NULL},
24877 {"mthumb-interwork", N_("support ARM/Thumb interworking"),
24878 &support_interwork, 1, NULL},
24879 + {"mauto-it", N_("Enables/disables automatic IT insn insertion mode"),
24880 + &do_automatic_it, 1, NULL},
24881 {"mapcs-32", N_("code uses 32-bit program counter"), &uses_apcs_26, 0, NULL},
24882 {"mapcs-26", N_("code uses 26-bit program counter"), &uses_apcs_26, 1, NULL},
24883 {"mapcs-float", N_("floating point args are in fp regs"), &uses_apcs_float,
24884 @@ -20660,6 +21336,7 @@ static const struct arm_cpu_option_table
24885 NULL},
24886 {"cortex-r4", ARM_ARCH_V7R, FPU_NONE, NULL},
24887 {"cortex-m3", ARM_ARCH_V7M, FPU_NONE, NULL},
24888 + {"cortex-m0", ARM_ARCH_V6M, FPU_NONE, NULL},
24889 {"cortex-m1", ARM_ARCH_V6M, FPU_NONE, NULL},
24890 /* ??? XSCALE is really an architecture. */
24891 {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2, NULL},
24892 @@ -20669,6 +21346,8 @@ static const struct arm_cpu_option_table
24893 {"i80200", ARM_ARCH_XSCALE, FPU_ARCH_VFP_V2, NULL},
24894 /* Maverick */
24895 {"ep9312", ARM_FEATURE(ARM_AEXT_V4T, ARM_CEXT_MAVERICK), FPU_ARCH_MAVERICK, "ARM920T"},
24896 + /* Marvell */
24897 + {"marvell-f", ARM_ARCH_MARVELL_F, FPU_ARCH_VFP_V2, NULL},
24898 {NULL, ARM_ARCH_NONE, ARM_ARCH_NONE, NULL}
24899 };
24900
24901 @@ -20722,6 +21401,7 @@ static const struct arm_arch_option_tabl
24902 {"xscale", ARM_ARCH_XSCALE, FPU_ARCH_VFP},
24903 {"iwmmxt", ARM_ARCH_IWMMXT, FPU_ARCH_VFP},
24904 {"iwmmxt2", ARM_ARCH_IWMMXT2,FPU_ARCH_VFP},
24905 + {"marvell-f", ARM_ARCH_MARVELL_F,FPU_ARCH_VFP},
24906 {NULL, ARM_ARCH_NONE, ARM_ARCH_NONE}
24907 };
24908
24909 --- a/gas/config/tc-arm.h
24910 +++ b/gas/config/tc-arm.h
24911 @@ -179,13 +179,27 @@ void arm_copy_symbol_attributes (symbolS
24912
24913 #define TC_CONS_FIX_NEW cons_fix_new_arm
24914
24915 -#define MAX_MEM_FOR_RS_ALIGN_CODE 31
24916 +#define MAX_MEM_ALIGNMENT_BYTES 6
24917 +#define MAX_MEM_FOR_RS_ALIGN_CODE ((1 << MAX_MEM_ALIGNMENT_BYTES) - 1)
24918
24919 /* For frags in code sections we need to record whether they contain
24920 ARM code or THUMB code. This is that if they have to be aligned,
24921 they can contain the correct type of no-op instruction. */
24922 -#define TC_FRAG_TYPE int
24923 -#define TC_FRAG_INIT(fragp) arm_init_frag (fragp)
24924 +struct arm_frag_type
24925 +{
24926 + int thumb_mode;
24927 +#ifdef OBJ_ELF
24928 + /* If there is a mapping symbol at offset 0 in this frag,
24929 + it will be saved in FIRST_MAP. If there are any mapping
24930 + symbols in this frag, the last one will be saved in
24931 + LAST_MAP. */
24932 + symbolS *first_map, *last_map;
24933 +#endif
24934 +};
24935 +
24936 +#define TC_FRAG_TYPE struct arm_frag_type
24937 +/* NOTE: max_chars is a local variable from frag_var / frag_variant. */
24938 +#define TC_FRAG_INIT(fragp) arm_init_frag (fragp, max_chars)
24939 #define HANDLE_ALIGN(fragp) arm_handle_align (fragp)
24940
24941 #define md_do_align(N, FILL, LEN, MAX, LABEL) \
24942 @@ -269,7 +283,7 @@ extern char * arm_canonicalize_symbol_na
24943 extern void arm_adjust_symtab (void);
24944 extern void armelf_frob_symbol (symbolS *, int *);
24945 extern void cons_fix_new_arm (fragS *, int, int, expressionS *);
24946 -extern void arm_init_frag (struct frag *);
24947 +extern void arm_init_frag (struct frag *, int);
24948 extern void arm_handle_align (struct frag *);
24949 extern bfd_boolean arm_fix_adjustable (struct fix *);
24950 extern int arm_elf_section_type (const char *, size_t);
24951 --- a/gas/config/tc-m68k.c
24952 +++ b/gas/config/tc-m68k.c
24953 @@ -181,8 +181,8 @@ static const enum m68k_register mcf_ctrl
24954 RAMBAR0, RAMBAR1, RAMBAR, MBAR,
24955 0
24956 };
24957 -static const enum m68k_register mcf51qe_ctrl[] = {
24958 - VBR,
24959 +static const enum m68k_register mcf51_ctrl[] = {
24960 + VBR, CPUCR,
24961 0
24962 };
24963 static const enum m68k_register mcf5206_ctrl[] = {
24964 @@ -210,13 +210,21 @@ static const enum m68k_register mcf52223
24965 0
24966 };
24967 static const enum m68k_register mcf52235_ctrl[] = {
24968 - VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR, RAMBAR1,
24969 + VBR, FLASHBAR, RAMBAR, RAMBAR1,
24970 0
24971 };
24972 static const enum m68k_register mcf5225_ctrl[] = {
24973 VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR, MBAR, RAMBAR1,
24974 0
24975 };
24976 +static const enum m68k_register mcf52259_ctrl[] = {
24977 + VBR, FLASHBAR, RAMBAR, RAMBAR1,
24978 + 0
24979 +};
24980 +static const enum m68k_register mcf52277_ctrl[] = {
24981 + VBR, CACR, ACR0, ACR1, RAMBAR, RAMBAR1,
24982 + 0
24983 +};
24984 static const enum m68k_register mcf5235_ctrl[] = {
24985 VBR, CACR, ACR0, ACR1, RAMBAR, RAMBAR1,
24986 0
24987 @@ -249,8 +257,12 @@ static const enum m68k_register mcf5282_
24988 VBR, CACR, ACR0, ACR1, FLASHBAR, RAMBAR, RAMBAR1,
24989 0
24990 };
24991 +static const enum m68k_register mcf53017_ctrl[] = {
24992 + VBR, CACR, ACR0, ACR1, RAMBAR, RAMBAR1,
24993 + 0
24994 +};
24995 static const enum m68k_register mcf5307_ctrl[] = {
24996 - CACR, ACR0, ACR1, VBR, RAMBAR0, RAMBAR_ALT, MBAR,
24997 + VBR, CACR, ACR0, ACR1, RAMBAR0, RAMBAR_ALT, MBAR,
24998 0
24999 };
25000 static const enum m68k_register mcf5329_ctrl[] = {
25001 @@ -525,6 +537,9 @@ static const struct m68k_cpu m68k_archs[
25002 {0,0,NULL, 0}
25003 };
25004
25005 +/* For -mno-mac we want to turn off all types of mac. */
25006 +static const unsigned no_mac = mcfmac | mcfemac;
25007 +
25008 /* Architecture extensions, here 'alias' -1 for m68k, +1 for cf and 0
25009 for either. */
25010 static const struct m68k_cpu m68k_extensions[] =
25011 @@ -537,7 +552,7 @@ static const struct m68k_cpu m68k_extens
25012
25013 {mcfhwdiv, NULL, "div", 1},
25014 {mcfusp, NULL, "usp", 1},
25015 - {mcfmac, NULL, "mac", 1},
25016 + {mcfmac, (void *)&no_mac, "mac", 1},
25017 {mcfemac, NULL, "emac", 1},
25018
25019 {0,NULL,NULL, 0}
25020 @@ -579,7 +594,12 @@ static const struct m68k_cpu m68k_cpus[]
25021 {cpu32|m68881, cpu32_ctrl, "68349", 1},
25022 {cpu32|m68881, cpu32_ctrl, "68360", 1},
25023
25024 - {mcfisa_a|mcfisa_c|mcfusp, mcf51qe_ctrl, "51qe", 0},
25025 + {mcfisa_a|mcfisa_c|mcfusp, mcf51_ctrl, "51", 0},
25026 + {mcfisa_a|mcfisa_c|mcfusp, mcf51_ctrl, "51ac", 1},
25027 + {mcfisa_a|mcfisa_c|mcfusp, mcf51_ctrl, "51cn", 1},
25028 + {mcfisa_a|mcfisa_c|mcfusp|mcfmac, mcf51_ctrl, "51em", 1},
25029 + {mcfisa_a|mcfisa_c|mcfusp, mcf51_ctrl, "51jm", 1},
25030 + {mcfisa_a|mcfisa_c|mcfusp, mcf51_ctrl, "51qe", 1},
25031
25032 {mcfisa_a, mcf_ctrl, "5200", 0},
25033 {mcfisa_a, mcf_ctrl, "5202", 1},
25034 @@ -613,6 +633,9 @@ static const struct m68k_cpu m68k_cpus[]
25035 {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, mcf5225_ctrl, "5224", -1},
25036 {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfmac|mcfusp, mcf5225_ctrl, "5225", 0},
25037
25038 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52277_ctrl, "52274", -1},
25039 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52277_ctrl, "52277", 0},
25040 +
25041 {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5235_ctrl, "5232", -1},
25042 {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5235_ctrl, "5233", -1},
25043 {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5235_ctrl, "5234", -1},
25044 @@ -622,7 +645,14 @@ static const struct m68k_cpu m68k_cpus[]
25045 {mcfisa_a|mcfhwdiv|mcfemac, mcf5249_ctrl, "5249", 0},
25046 {mcfisa_a|mcfhwdiv|mcfemac, mcf5250_ctrl, "5250", 0},
25047 {mcfisa_a|mcfhwdiv|mcfemac, mcf5253_ctrl, "5253", 0},
25048 -
25049 +
25050 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52259_ctrl, "52252", -1},
25051 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52259_ctrl, "52254", -1},
25052 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52259_ctrl, "52255", -1},
25053 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52259_ctrl, "52256", -1},
25054 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52259_ctrl, "52258", -1},
25055 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf52259_ctrl, "52259", 0},
25056 +
25057 {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5271_ctrl, "5270", -1},
25058 {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5271_ctrl, "5271", 0},
25059
25060 @@ -636,6 +666,14 @@ static const struct m68k_cpu m68k_cpus[]
25061 {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5282_ctrl, "5282", -1},
25062 {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5282_ctrl, "528x", 0},
25063
25064 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53011", -1},
25065 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53012", -1},
25066 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53013", -1},
25067 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53014", -1},
25068 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53015", -1},
25069 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53016", -1},
25070 + {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf53017_ctrl, "53017", 0},
25071 +
25072 {mcfisa_a|mcfhwdiv|mcfmac, mcf5307_ctrl, "5307", 0},
25073
25074 {mcfisa_a|mcfisa_aa|mcfhwdiv|mcfemac|mcfusp, mcf5329_ctrl, "5327", -1},
25075 @@ -3275,6 +3313,7 @@ m68k_ip (char *instring)
25076 tmpreg = 0x801;
25077 break;
25078 case CAAR:
25079 + case CPUCR:
25080 tmpreg = 0x802;
25081 break;
25082 case MSP:
25083 @@ -4036,6 +4075,7 @@ static const struct init_entry init_tabl
25084 { "dfcr", DFC },
25085 { "cacr", CACR }, /* Cache Control Register. */
25086 { "caar", CAAR }, /* Cache Address Register. */
25087 + { "cpucr", CPUCR }, /* CPU Control Register. */
25088
25089 { "usp", USP }, /* User Stack Pointer. */
25090 { "vbr", VBR }, /* Vector Base Register. */
25091 @@ -7407,7 +7447,8 @@ m68k_set_extension (char const *name, in
25092 }
25093
25094 if (negated)
25095 - not_current_architecture |= ext->arch;
25096 + not_current_architecture |= (ext->control_regs
25097 + ? *(unsigned *)ext->control_regs: ext->arch);
25098 else
25099 current_architecture |= ext->arch;
25100 return 1;
25101 --- a/gas/config/tc-mips.c
25102 +++ b/gas/config/tc-mips.c
25103 @@ -73,6 +73,8 @@ static int mips_output_flavor (void) { r
25104
25105 int mips_flag_mdebug = -1;
25106
25107 +static int octeon_use_unalign = 0;
25108 +
25109 /* Control generation of .pdr sections. Off by default on IRIX: the native
25110 linker doesn't know about and discards them, but relocations against them
25111 remain, leading to rld crashes. */
25112 @@ -391,6 +393,12 @@ static int mips_32bitmode = 0;
25113 ((ISA) == ISA_MIPS32R2 \
25114 || (ISA) == ISA_MIPS64R2)
25115
25116 +/* Return true if ISA supports ins instructions. */
25117 +#define ISA_HAS_INS(ISA) ( \
25118 + (ISA) == ISA_MIPS32R2 \
25119 + || (ISA) == ISA_MIPS64R2 \
25120 + )
25121 +
25122 #define HAVE_32BIT_GPRS \
25123 (mips_opts.gp32 || !ISA_HAS_64BIT_REGS (mips_opts.isa))
25124
25125 @@ -653,18 +661,21 @@ static int mips_debug = 0;
25126 /* The maximum number of NOPs needed to avoid the VR4130 mflo/mfhi errata. */
25127 #define MAX_VR4130_NOPS 4
25128
25129 +/* The number of MOVN.Ds needed to avoid the ICE9A errata. */
25130 +#define ICE9A_MOVNDS 5
25131 +
25132 /* The maximum number of NOPs needed to fill delay slots. */
25133 #define MAX_DELAY_NOPS 2
25134
25135 -/* The maximum number of NOPs needed for any purpose. */
25136 -#define MAX_NOPS 4
25137 +/* The maximum number of insns needed for any purpose. */
25138 +#define MAX_HIST_INSNS 5
25139
25140 /* A list of previous instructions, with index 0 being the most recent.
25141 - We need to look back MAX_NOPS instructions when filling delay slots
25142 - or working around processor errata. We need to look back one
25143 + We need to look back MAX_HIST_INSNS instructions when filling delay
25144 + slots or working around processor errata. We need to look back one
25145 instruction further if we're thinking about using history[0] to
25146 fill a branch delay slot. */
25147 -static struct mips_cl_insn history[1 + MAX_NOPS];
25148 +static struct mips_cl_insn history[1 + MAX_HIST_INSNS];
25149
25150 /* Nop instructions used by emit_nop. */
25151 static struct mips_cl_insn nop_insn, mips16_nop_insn;
25152 @@ -760,6 +771,12 @@ static int mips_fix_vr4120;
25153 /* ...likewise -mfix-vr4130. */
25154 static int mips_fix_vr4130;
25155
25156 +/* ...likewise -mfix-ice9a. */
25157 +static int mips_fix_ice9a;
25158 +
25159 +/* ...likewise -mfix-24k. */
25160 +static int mips_fix_24k;
25161 +
25162 /* We don't relax branches by default, since this causes us to expand
25163 `la .l2 - .l1' if there's a branch between .l1 and .l2, because we
25164 fail to compute the offset before expanding the macro to the most
25165 @@ -1789,6 +1806,84 @@ reg_lookup (char **s, unsigned int types
25166 return reg >= 0;
25167 }
25168
25169 +#define INSN_ERET 0x42000018
25170 +#define INSN_DERET 0x4200001f
25171 +
25172 +/* Implement the ERET/DERET Errata for MIPS 24k.
25173 +
25174 + If an ERET/DERET is encountered in a noreorder block,
25175 + warn if the ERET/DERET is followed by a branch instruction.
25176 + Also warn if the ERET/DERET is the last instruction in the
25177 + noreorder block.
25178 +
25179 + IF an ERET/DERET is in a reorder block and is followed by a
25180 + branch instruction, insert a nop. */
25181 +
25182 +static void
25183 +check_for_24k_errata (struct mips_cl_insn *insn, int eret_ndx)
25184 +{
25185 + bfd_boolean next_insn_is_branch = FALSE;
25186 +
25187 + /* eret_ndx will be -1 for the last instruction in a section. */
25188 + if (insn
25189 + && eret_ndx == -1
25190 + && (insn->insn_opcode == INSN_ERET
25191 + || insn->insn_opcode == INSN_DERET)
25192 + && insn->noreorder_p)
25193 + {
25194 + as_warn (_("ERET and DERET must be followed by a NOP on the 24K."));
25195 + return;
25196 + }
25197 +
25198 + if (history[eret_ndx].insn_opcode != INSN_ERET
25199 + && history[eret_ndx].insn_opcode != INSN_DERET)
25200 + return;
25201 +
25202 + if (!insn)
25203 + {
25204 + if (history[eret_ndx].noreorder_p)
25205 + as_warn (_("ERET and DERET must be followed by a NOP on the 24K."));
25206 + return;
25207 + }
25208 +
25209 + next_insn_is_branch = ((insn->insn_opcode == INSN_ERET)
25210 + || (insn->insn_opcode == INSN_DERET)
25211 + || (insn->insn_mo->pinfo
25212 + & (INSN_UNCOND_BRANCH_DELAY
25213 + | INSN_COND_BRANCH_DELAY
25214 + | INSN_COND_BRANCH_LIKELY)));
25215 +
25216 + if (next_insn_is_branch && history[eret_ndx].noreorder_p)
25217 + {
25218 + as_warn (_("ERET and DERET must be followed by a NOP on the 24K."));
25219 + return;
25220 + }
25221 +
25222 + /* Emit nop if the next instruction is a branch. */
25223 + if (next_insn_is_branch)
25224 + {
25225 + long nop_where, br_where;
25226 + struct frag *nop_frag, *br_frag;
25227 + struct mips_cl_insn br_insn, nop_insn;
25228 +
25229 + emit_nop ();
25230 +
25231 + nop_insn = history[eret_ndx - 1];
25232 + nop_frag = history[eret_ndx - 1].frag;
25233 + nop_where = history[eret_ndx - 1].where;
25234 +
25235 + br_insn = history[eret_ndx];
25236 + br_frag = history[eret_ndx].frag;
25237 + br_where = history[eret_ndx].where;
25238 +
25239 + move_insn (&nop_insn, br_frag, br_where);
25240 + move_insn (&br_insn, nop_frag, nop_where);
25241 +
25242 + history[eret_ndx-1] = br_insn;
25243 + history[eret_ndx] = nop_insn;
25244 + }
25245 +}
25246 +
25247 /* Return TRUE if opcode MO is valid on the currently selected ISA and
25248 architecture. If EXPANSIONP is TRUE then this check is done while
25249 expanding a macro. Use is_opcode_valid_16 for MIPS16 opcodes. */
25250 @@ -1876,6 +1971,12 @@ md_begin (void)
25251 as_bad (_("-G may not be used in position-independent code"));
25252 g_switch_value = 0;
25253 }
25254 + else if (mips_abicalls)
25255 + {
25256 + if (g_switch_seen && g_switch_value != 0)
25257 + as_bad (_("-G may not be used with abicalls"));
25258 + g_switch_value = 0;
25259 + }
25260
25261 if (! bfd_set_arch_mach (stdoutput, bfd_arch_mips, file_mips_arch))
25262 as_warn (_("Could not set architecture and machine"));
25263 @@ -2074,6 +2175,9 @@ md_begin (void)
25264 void
25265 md_mips_end (void)
25266 {
25267 + if (mips_fix_24k)
25268 + check_for_24k_errata ((struct mips_cl_insn *) &history[0], -1);
25269 +
25270 if (! ECOFF_DEBUGGING)
25271 md_obj_end ();
25272 }
25273 @@ -2616,8 +2720,111 @@ nops_for_vr4130 (const struct mips_cl_in
25274 return 0;
25275 }
25276
25277 +/* Return true if the instruction called NAME is a double-precision
25278 + multiplication instruction placing an FP stall hazard needed
25279 + to be tackled with -mfix-ice9a. */
25280 +
25281 +static bfd_boolean
25282 +ice9a_fp_stall_hazard_p (const char *name)
25283 +{
25284 + return (strcmp (name, "madd.d") == 0
25285 + || strcmp (name, "msub.d") == 0
25286 + || strcmp (name, "mul.d") == 0
25287 + || strcmp (name, "nmadd.d") == 0
25288 + || strcmp (name, "nmsub.d") == 0
25289 + || strcmp (name, "recip.d") == 0
25290 + || strcmp (name, "rsqrt.d") == 0);
25291 +}
25292 +
25293 +/* Return true if the instruction called NAME is a double-precision
25294 + multiplication instruction placing an FP round hazard needed
25295 + to be tackled with -mfix-ice9a. This happens to be a superset
25296 + of the above. */
25297 +
25298 +static bfd_boolean
25299 +ice9a_fp_round_hazard_p (const char *name)
25300 +{
25301 + return (ice9a_fp_stall_hazard_p (name) || strcmp (name, "sqrt.d") == 0);
25302 +}
25303 +
25304 +/* Return true if the instruction INSN is the "movn.d $f30, <reg>, $zero"
25305 + designated as the workaround for the purpose of -mfix-ice9a. */
25306 +
25307 +static bfd_boolean
25308 +ice9a_movnd_workaround_p (const struct mips_cl_insn *insn, unsigned int reg)
25309 +{
25310 + return (strcmp (insn->insn_mo->name, "movn.d") == 0
25311 + && EXTRACT_OPERAND (RT, *insn) == ZERO
25312 + && EXTRACT_OPERAND (FS, *insn) == reg
25313 + && EXTRACT_OPERAND (FD, *insn) == 30);
25314 +}
25315 +
25316 +/* Return true if the instruction INSN accesses $f30 in any way. */
25317 +
25318 +static bfd_boolean
25319 +ice9a_insn_accesses_f30_p (const struct mips_cl_insn *insn)
25320 +{
25321 + unsigned long pinfo;
25322 +
25323 + pinfo = insn->insn_mo->pinfo;
25324 + return (((pinfo & (INSN_WRITE_FPR_S | INSN_READ_FPR_S)) != 0
25325 + && (EXTRACT_OPERAND (FS, *insn) == 30))
25326 + || ((pinfo & (INSN_WRITE_FPR_T | INSN_READ_FPR_T)) != 0
25327 + && (EXTRACT_OPERAND (FT, *insn) == 30))
25328 + || ((pinfo & INSN_WRITE_FPR_D) != 0
25329 + && (EXTRACT_OPERAND (FD, *insn) == 30))
25330 + || ((pinfo & INSN_READ_FPR_R) != 0
25331 + && (EXTRACT_OPERAND (FR, *insn) == 30)));
25332 +}
25333 +
25334 +/* Check for the ICE9A_MOVNDS MOVN.D instructions needed before and after
25335 + some FP instructions to work around the ICE9A errata. Also check for
25336 + $f30 references other than the workaround. */
25337 +
25338 +static void
25339 +check_for_ice9a (const struct mips_cl_insn *history,
25340 + const struct mips_cl_insn *insn)
25341 +{
25342 + bfd_boolean f30_access_ok = FALSE;
25343 + int i;
25344 +
25345 + if (ice9a_fp_round_hazard_p (history->insn_mo->name))
25346 + {
25347 + if (insn == NULL
25348 + || (history->insn_mo->pinfo & INSN_WRITE_FPR_D) == 0
25349 + || ! ice9a_movnd_workaround_p (insn, EXTRACT_OPERAND (FD, *history)))
25350 + as_bad (_("Hazardous instruction missing the ICE9A workaround"));
25351 + else
25352 + f30_access_ok = TRUE;
25353 + }
25354 +
25355 + if (insn == NULL)
25356 + return;
25357 +
25358 + if (ice9a_fp_stall_hazard_p (insn->insn_mo->name))
25359 + for (i = 0; i < ICE9A_MOVNDS; i++)
25360 + if (! ice9a_movnd_workaround_p (history + i, 28))
25361 + {
25362 + as_bad (_("Hazardous instruction missing the ICE9A workaround"));
25363 + break;
25364 + }
25365 +
25366 + if (! f30_access_ok
25367 + && ! ice9a_movnd_workaround_p (insn, 28)
25368 + && ice9a_insn_accesses_f30_p (insn))
25369 + as_bad (_("Instruction used $f30, reserved for the ICE9A workaround"));
25370 +}
25371 +
25372 +/* Check the last instruction assembled for the ICE9A errata workaround. */
25373 +
25374 +void mips_cleanup (void)
25375 +{
25376 + if (mips_fix_ice9a)
25377 + check_for_ice9a (history, NULL);
25378 +}
25379 +
25380 /* Return the number of nops that would be needed if instruction INSN
25381 - immediately followed the MAX_NOPS instructions given by HISTORY,
25382 + immediately followed the MAX_HIST_INSNS instructions given by HISTORY,
25383 where HISTORY[0] is the most recent instruction. If INSN is null,
25384 return the worse-case number of nops for any instruction. */
25385
25386 @@ -2643,6 +2850,9 @@ nops_for_insn (const struct mips_cl_insn
25387 nops = tmp_nops;
25388 }
25389
25390 + if (mips_fix_ice9a)
25391 + check_for_ice9a (history, insn);
25392 +
25393 return nops;
25394 }
25395
25396 @@ -2654,13 +2864,13 @@ static int
25397 nops_for_sequence (int num_insns, const struct mips_cl_insn *history, ...)
25398 {
25399 va_list args;
25400 - struct mips_cl_insn buffer[MAX_NOPS];
25401 + struct mips_cl_insn buffer[MAX_HIST_INSNS];
25402 struct mips_cl_insn *cursor;
25403 int nops;
25404
25405 va_start (args, history);
25406 cursor = buffer + num_insns;
25407 - memcpy (cursor, history, (MAX_NOPS - num_insns) * sizeof (*cursor));
25408 + memcpy (cursor, history, (MAX_HIST_INSNS - num_insns) * sizeof (*cursor));
25409 while (cursor > buffer)
25410 *--cursor = *va_arg (args, const struct mips_cl_insn *);
25411
25412 @@ -2705,6 +2915,7 @@ append_insn (struct mips_cl_insn *ip, ex
25413 bfd_reloc_code_real_type *reloc_type)
25414 {
25415 unsigned long prev_pinfo, pinfo;
25416 + int hndx_24k = 0;
25417 relax_stateT prev_insn_frag_type = 0;
25418 bfd_boolean relaxed_branch = FALSE;
25419 segment_info_type *si = seg_info (now_seg);
25420 @@ -3238,7 +3449,15 @@ append_insn (struct mips_cl_insn *ip, ex
25421 || (mips_opts.mips16 && history[0].fixp[0])
25422 /* If the previous instruction is a sync, sync.l, or
25423 sync.p, we can not swap. */
25424 - || (prev_pinfo & INSN_SYNC))
25425 + || (prev_pinfo & INSN_SYNC)
25426 + /* If we're assembling for the 24k errata and the previous
25427 + instruction is an ERET or DERET, avoid the swap. */
25428 + || (history[0].insn_opcode == INSN_ERET)
25429 + || (history[0].insn_opcode == INSN_DERET)
25430 + /* FIXME: Disable MIPS16 branch swapping for now as it
25431 + breaks DWARF-2 line information irrecoverably.
25432 + --macro */
25433 + || mips_opts.mips16)
25434 {
25435 if (mips_opts.mips16
25436 && (pinfo & INSN_UNCOND_BRANCH_DELAY)
25437 @@ -3258,6 +3477,8 @@ append_insn (struct mips_cl_insn *ip, ex
25438 slot, and bump the destination address. */
25439 insert_into_history (0, 1, ip);
25440 emit_nop ();
25441 + if (mips_fix_24k)
25442 + hndx_24k++;
25443 }
25444
25445 if (mips_relax.sequence)
25446 @@ -3297,7 +3518,14 @@ append_insn (struct mips_cl_insn *ip, ex
25447 /* If that was an unconditional branch, forget the previous
25448 insn information. */
25449 if (pinfo & INSN_UNCOND_BRANCH_DELAY)
25450 - mips_no_prev_insn ();
25451 + {
25452 + /* Check for eret/deret before clearing history. */
25453 + if (mips_fix_24k)
25454 + check_for_24k_errata (
25455 + (struct mips_cl_insn *) &history[hndx_24k],
25456 + hndx_24k+1);
25457 + mips_no_prev_insn ();
25458 + }
25459 }
25460 else if (pinfo & INSN_COND_BRANCH_LIKELY)
25461 {
25462 @@ -3307,6 +3535,8 @@ append_insn (struct mips_cl_insn *ip, ex
25463 the next instruction. */
25464 insert_into_history (0, 1, ip);
25465 emit_nop ();
25466 + if (mips_fix_24k)
25467 + hndx_24k++;
25468 }
25469 else
25470 insert_into_history (0, 1, ip);
25471 @@ -3314,6 +3544,10 @@ append_insn (struct mips_cl_insn *ip, ex
25472 else
25473 insert_into_history (0, 1, ip);
25474
25475 + if (mips_fix_24k)
25476 + check_for_24k_errata ((struct mips_cl_insn *) &history[hndx_24k],
25477 + hndx_24k+1);
25478 +
25479 /* We just output an insn, so the next one doesn't have a label. */
25480 mips_clear_insn_labels ();
25481 }
25482 @@ -3400,6 +3634,9 @@ start_noreorder (void)
25483 static void
25484 end_noreorder (void)
25485 {
25486 + if (mips_fix_24k)
25487 + check_for_24k_errata (NULL, 0);
25488 +
25489 mips_opts.noreorder--;
25490 if (mips_opts.noreorder == 0 && prev_nop_frag != NULL)
25491 {
25492 @@ -7273,6 +7510,47 @@ macro (struct mips_cl_insn *ip)
25493 macro_build (&offset_expr, s, "t,o(b)", treg + 1, BFD_RELOC_LO16, breg);
25494 break;
25495
25496 + case M_SAA_AB:
25497 + s = "saa";
25498 + goto saa_saad;
25499 +
25500 + case M_SAAD_AB:
25501 + s = "saad";
25502 +
25503 + saa_saad:
25504 + /* The "saa/saad" instructions are new in CN58XX. These instructions
25505 + do not specify offset. When invoked with address or symbol, then
25506 + load the address or value of symbol in a register using the dla macro
25507 + into AT, and pass the register for emitting "saa/saad" instruction.
25508 + This will get expanded to
25509 +
25510 + dla AT, constant/label
25511 + saa/saad $treg,(AT) */
25512 + {
25513 + char *name = "dla";
25514 + char *fmt = "t,A(b)";
25515 + const struct mips_opcode *mo;
25516 + struct mips_cl_insn insn;
25517 +
25518 + mo = hash_find (op_hash, name);
25519 + assert (strcmp (name, mo->name) == 0);
25520 + assert (strcmp (fmt, mo->args) == 0);
25521 + create_insn (&insn, mo);
25522 +
25523 + insn.insn_opcode = insn.insn_mo->match;
25524 +
25525 + used_at = 1;
25526 + INSERT_OPERAND (RT, insn, AT);
25527 + if (breg)
25528 + INSERT_OPERAND (RS, insn, breg);
25529 +
25530 + /* The address part is forwarded through the global offset_expr. */
25531 + macro (&insn);
25532 +
25533 + macro_build (NULL, s, "t,(b)", treg, AT);
25534 + break;
25535 + }
25536 +
25537 /* New code added to support COPZ instructions.
25538 This code builds table entries out of the macros in mip_opcodes.
25539 R4000 uses interlocks to handle coproc delays.
25540 @@ -7980,8 +8258,13 @@ macro2 (struct mips_cl_insn *ip)
25541 else
25542 ++offset_expr.X_add_number;
25543 macro_build (&offset_expr, "lbu", "t,o(b)", treg, BFD_RELOC_LO16, breg);
25544 - macro_build (NULL, "sll", "d,w,<", AT, AT, 8);
25545 - macro_build (NULL, "or", "d,v,t", treg, treg, AT);
25546 + if (ISA_HAS_INS (mips_opts.isa))
25547 + macro_build (NULL, "ins", "t,r,+A,+B", treg, AT, 8, 31);
25548 + else
25549 + {
25550 + macro_build (NULL, "sll", "d,w,<", AT, AT, 8);
25551 + macro_build (NULL, "or", "d,v,t", treg, treg, AT);
25552 + }
25553 break;
25554
25555 case M_ULD:
25556 @@ -8021,11 +8304,21 @@ macro2 (struct mips_cl_insn *ip)
25557 break;
25558
25559 case M_ULD_A:
25560 + if (mips_opts.arch == CPU_OCTEON && octeon_use_unalign)
25561 + {
25562 + s = "uld";
25563 + goto ld;
25564 + }
25565 s = "ldl";
25566 s2 = "ldr";
25567 off = 7;
25568 goto ulwa;
25569 case M_ULW_A:
25570 + if (mips_opts.arch == CPU_OCTEON && octeon_use_unalign)
25571 + {
25572 + s = "ulw";
25573 + goto ld;
25574 + }
25575 s = "lwl";
25576 s2 = "lwr";
25577 off = 3;
25578 @@ -8052,17 +8345,25 @@ macro2 (struct mips_cl_insn *ip)
25579 load_address (AT, &offset_expr, &used_at);
25580 if (breg != 0)
25581 macro_build (NULL, ADDRESS_ADD_INSN, "d,v,t", AT, AT, breg);
25582 - if (target_big_endian)
25583 - expr1.X_add_number = 0;
25584 - macro_build (&expr1, mask == M_ULH_A ? "lb" : "lbu", "t,o(b)",
25585 - treg, BFD_RELOC_LO16, AT);
25586 - if (target_big_endian)
25587 - expr1.X_add_number = 1;
25588 + if (ISA_HAS_INS (mips_opts.isa))
25589 + {
25590 + expr1.X_add_number = target_big_endian ? 1 : 0;
25591 + macro_build (&expr1, "lbu", "t,o(b)", treg, BFD_RELOC_LO16, AT);
25592 + expr1.X_add_number = target_big_endian ? 0 : 1;
25593 + macro_build (&expr1, mask == M_ULH_A ? "lb" : "lbu", "t,o(b)",
25594 + AT, BFD_RELOC_LO16, AT);
25595 + macro_build (NULL, "ins", "t,r,+A,+B", treg, AT, 8, 31);
25596 + }
25597 else
25598 - expr1.X_add_number = 0;
25599 - macro_build (&expr1, "lbu", "t,o(b)", AT, BFD_RELOC_LO16, AT);
25600 - macro_build (NULL, "sll", "d,w,<", treg, treg, 8);
25601 - macro_build (NULL, "or", "d,v,t", treg, treg, AT);
25602 + {
25603 + expr1.X_add_number = target_big_endian ? 0 : 1;
25604 + macro_build (&expr1, mask == M_ULH_A ? "lb" : "lbu", "t,o(b)",
25605 + treg, BFD_RELOC_LO16, AT);
25606 + expr1.X_add_number = target_big_endian ? 1 : 0;
25607 + macro_build (&expr1, "lbu", "t,o(b)", AT, BFD_RELOC_LO16, AT);
25608 + macro_build (NULL, "sll", "d,w,<", treg, treg, 8);
25609 + macro_build (NULL, "or", "d,v,t", treg, treg, AT);
25610 + }
25611 break;
25612
25613 case M_USH:
25614 @@ -8103,11 +8404,21 @@ macro2 (struct mips_cl_insn *ip)
25615 break;
25616
25617 case M_USD_A:
25618 + if (mips_opts.arch == CPU_OCTEON && octeon_use_unalign)
25619 + {
25620 + s = "usd";
25621 + goto st;
25622 + }
25623 s = "sdl";
25624 s2 = "sdr";
25625 off = 7;
25626 goto uswa;
25627 case M_USW_A:
25628 + if (mips_opts.arch == CPU_OCTEON && octeon_use_unalign)
25629 + {
25630 + s = "usw";
25631 + goto st;
25632 + }
25633 s = "swl";
25634 s2 = "swr";
25635 off = 3;
25636 @@ -8674,6 +8985,36 @@ mips_ip (char *str, struct mips_cl_insn
25637 assert (strcmp (insn->name, str) == 0);
25638
25639 ok = is_opcode_valid (insn, FALSE);
25640 +
25641 + if (insn->pinfo != INSN_MACRO)
25642 + {
25643 + if (mips_opts.arch == CPU_OCTEON
25644 + && !octeon_use_unalign
25645 + && (strcmp (insn->name, "ulw") == 0
25646 + || strcmp (insn->name, "uld") == 0
25647 + || strcmp (insn->name, "usw") == 0
25648 + || strcmp (insn->name, "usd") == 0))
25649 + ok = FALSE;
25650 +
25651 + if (mips_opts.arch == CPU_OCTEON
25652 + && octeon_use_unalign
25653 + && (strcmp (insn->name, "lwl") == 0
25654 + || strcmp (insn->name, "lwr") == 0
25655 + || strcmp (insn->name, "ldl") == 0
25656 + || strcmp (insn->name, "ldr") == 0
25657 + || strcmp (insn->name, "sdl") == 0
25658 + || strcmp (insn->name, "sdr") == 0
25659 + || strcmp (insn->name, "swr") == 0
25660 + || strcmp (insn->name, "swl") == 0))
25661 + {
25662 + static char buf[100];
25663 + sprintf (buf, _("Unaligned load/store instructions are not "
25664 + "allowed with -mocteon-useun"));
25665 + insn_error = buf;
25666 + return;
25667 + }
25668 + }
25669 +
25670 if (! ok)
25671 {
25672 if (insn + 1 < &mips_opcodes[NUMOPCODES]
25673 @@ -11165,6 +11506,8 @@ enum options
25674 OPTION_NO_SMARTMIPS,
25675 OPTION_DSPR2,
25676 OPTION_NO_DSPR2,
25677 + OPTION_MIPS16E,
25678 + OPTION_NO_MIPS16E,
25679 OPTION_COMPAT_ARCH_BASE,
25680 OPTION_M4650,
25681 OPTION_NO_M4650,
25682 @@ -11175,11 +11518,15 @@ enum options
25683 OPTION_M3900,
25684 OPTION_NO_M3900,
25685 OPTION_M7000_HILO_FIX,
25686 - OPTION_MNO_7000_HILO_FIX,
25687 + OPTION_MNO_7000_HILO_FIX,
25688 + OPTION_FIX_24K,
25689 + OPTION_NO_FIX_24K,
25690 OPTION_FIX_VR4120,
25691 OPTION_NO_FIX_VR4120,
25692 OPTION_FIX_VR4130,
25693 OPTION_NO_FIX_VR4130,
25694 + OPTION_FIX_ICE9A,
25695 + OPTION_NO_FIX_ICE9A,
25696 OPTION_TRAP,
25697 OPTION_BREAK,
25698 OPTION_EB,
25699 @@ -11200,6 +11547,8 @@ enum options
25700 OPTION_HARD_FLOAT,
25701 OPTION_SINGLE_FLOAT,
25702 OPTION_DOUBLE_FLOAT,
25703 + OPTION_OCTEON_UNALIGNED,
25704 + OPTION_NO_OCTEON_UNALIGNED,
25705 OPTION_32,
25706 #ifdef OBJ_ELF
25707 OPTION_CALL_SHARED,
25708 @@ -11214,6 +11563,7 @@ enum options
25709 OPTION_PDR,
25710 OPTION_NO_PDR,
25711 OPTION_MVXWORKS_PIC,
25712 + OPTION_NON_PIC_ABICALLS,
25713 #endif /* OBJ_ELF */
25714 OPTION_END_OF_ENUM
25715 };
25716 @@ -11249,6 +11599,9 @@ struct option md_longopts[] =
25717 {"mno-smartmips", no_argument, NULL, OPTION_NO_SMARTMIPS},
25718 {"mdspr2", no_argument, NULL, OPTION_DSPR2},
25719 {"mno-dspr2", no_argument, NULL, OPTION_NO_DSPR2},
25720 + /* SDE backward compatibility alias. */
25721 + {"mips16e", no_argument, NULL, OPTION_MIPS16},
25722 + {"no-mips16e", no_argument, NULL, OPTION_NO_MIPS16},
25723
25724 /* Old-style architecture options. Don't add more of these. */
25725 {"m4650", no_argument, NULL, OPTION_M4650},
25726 @@ -11268,6 +11621,10 @@ struct option md_longopts[] =
25727 {"mno-fix-vr4120", no_argument, NULL, OPTION_NO_FIX_VR4120},
25728 {"mfix-vr4130", no_argument, NULL, OPTION_FIX_VR4130},
25729 {"mno-fix-vr4130", no_argument, NULL, OPTION_NO_FIX_VR4130},
25730 + {"mfix-ice9a", no_argument, NULL, OPTION_FIX_ICE9A},
25731 + {"mno-fix-ice9a", no_argument, NULL, OPTION_NO_FIX_ICE9A},
25732 + {"mfix-24k", no_argument, NULL, OPTION_FIX_24K},
25733 + {"mno-fix-24k", no_argument, NULL, OPTION_NO_FIX_24K},
25734
25735 /* Miscellaneous options. */
25736 {"trap", no_argument, NULL, OPTION_TRAP},
25737 @@ -11292,6 +11649,8 @@ struct option md_longopts[] =
25738 {"mhard-float", no_argument, NULL, OPTION_HARD_FLOAT},
25739 {"msingle-float", no_argument, NULL, OPTION_SINGLE_FLOAT},
25740 {"mdouble-float", no_argument, NULL, OPTION_DOUBLE_FLOAT},
25741 + {"mocteon-useun", no_argument, NULL, OPTION_OCTEON_UNALIGNED},
25742 + {"mno-octeon-useun", no_argument, NULL, OPTION_NO_OCTEON_UNALIGNED},
25743
25744 /* Strictly speaking this next option is ELF specific,
25745 but we allow it for other ports as well in order to
25746 @@ -11313,6 +11672,7 @@ struct option md_longopts[] =
25747 {"mpdr", no_argument, NULL, OPTION_PDR},
25748 {"mno-pdr", no_argument, NULL, OPTION_NO_PDR},
25749 {"mvxworks-pic", no_argument, NULL, OPTION_MVXWORKS_PIC},
25750 + {"mnon-pic-abicalls", no_argument, NULL, OPTION_NON_PIC_ABICALLS},
25751 #endif /* OBJ_ELF */
25752
25753 {NULL, no_argument, NULL, 0}
25754 @@ -11521,6 +11881,14 @@ md_parse_option (int c, char *arg)
25755 mips_opts.ase_smartmips = 0;
25756 break;
25757
25758 + case OPTION_FIX_24K:
25759 + mips_fix_24k = 1;
25760 + break;
25761 +
25762 + case OPTION_NO_FIX_24K:
25763 + mips_fix_24k = 0;
25764 + break;
25765 +
25766 case OPTION_FIX_VR4120:
25767 mips_fix_vr4120 = 1;
25768 break;
25769 @@ -11537,6 +11905,14 @@ md_parse_option (int c, char *arg)
25770 mips_fix_vr4130 = 0;
25771 break;
25772
25773 + case OPTION_FIX_ICE9A:
25774 + mips_fix_ice9a = 1;
25775 + break;
25776 +
25777 + case OPTION_NO_FIX_ICE9A:
25778 + mips_fix_ice9a = 0;
25779 + break;
25780 +
25781 case OPTION_RELAX_BRANCH:
25782 mips_relax_branch = 1;
25783 break;
25784 @@ -11561,6 +11937,14 @@ md_parse_option (int c, char *arg)
25785 mips_opts.sym32 = FALSE;
25786 break;
25787
25788 + case OPTION_OCTEON_UNALIGNED:
25789 + octeon_use_unalign = 1;
25790 + break;
25791 +
25792 + case OPTION_NO_OCTEON_UNALIGNED:
25793 + octeon_use_unalign = 0;
25794 + break;
25795 +
25796 #ifdef OBJ_ELF
25797 /* When generating ELF code, we permit -KPIC and -call_shared to
25798 select SVR4_PIC, and -non_shared to select no PIC. This is
25799 @@ -11729,6 +12113,11 @@ md_parse_option (int c, char *arg)
25800 case OPTION_MVXWORKS_PIC:
25801 mips_pic = VXWORKS_PIC;
25802 break;
25803 +
25804 + case OPTION_NON_PIC_ABICALLS:
25805 + mips_pic = NO_PIC;
25806 + mips_abicalls = TRUE;
25807 + break;
25808 #endif /* OBJ_ELF */
25809
25810 default:
25811 @@ -12468,6 +12857,10 @@ s_change_sec (int sec)
25812 #endif
25813
25814 mips_emit_delays ();
25815 +
25816 + if (mips_fix_24k)
25817 + check_for_24k_errata ((struct mips_cl_insn *) &history[0], -1);
25818 +
25819 switch (sec)
25820 {
25821 case 't':
25822 @@ -12526,6 +12919,9 @@ s_change_section (int ignore ATTRIBUTE_U
25823 if (!IS_ELF)
25824 return;
25825
25826 + if (mips_fix_24k)
25827 + check_for_24k_errata ((struct mips_cl_insn *) &history[0], -1);
25828 +
25829 section_name = input_line_pointer;
25830 c = get_symbol_end ();
25831 if (c)
25832 @@ -15234,7 +15630,10 @@ static const struct mips_cpu_info mips_c
25833 { "octeon", 0, ISA_MIPS64R2, CPU_OCTEON },
25834
25835 /* RMI Xlr */
25836 - { "xlr", 0, ISA_MIPS64, CPU_XLR },
25837 + { "xlr", 0, ISA_MIPS64, CPU_XLR },
25838 +
25839 + /* SiCortex ice9 */
25840 + { "ice9", 0, ISA_MIPS64, CPU_MIPS64 },
25841
25842 /* End marker */
25843 { NULL, 0, 0, 0 }
25844 @@ -15457,13 +15856,17 @@ MIPS options:\n\
25845 fprintf (stream, _("\
25846 -mfix-vr4120 work around certain VR4120 errata\n\
25847 -mfix-vr4130 work around VR4130 mflo/mfhi errata\n\
25848 +-mfix-ice9a detect the lack of the ICE9A double float multiplication errata workaround\n\
25849 +-mfix-24k insert a nop after ERET and DERET instructions\n\
25850 -mgp32 use 32-bit GPRs, regardless of the chosen ISA\n\
25851 -mfp32 use 32-bit FPRs, regardless of the chosen ISA\n\
25852 -msym32 assume all symbols have 32-bit values\n\
25853 -O0 remove unneeded NOPs, do not swap branches\n\
25854 -O remove unneeded NOPs and swap branches\n\
25855 --trap, --no-break trap exception on div by 0 and mult overflow\n\
25856 ---break, --no-trap break exception on div by 0 and mult overflow\n"));
25857 +--break, --no-trap break exception on div by 0 and mult overflow\n\
25858 +-mocteon-useun use Octeon-specific unaligned loads/stores for 32/64-bit data (default)\n\
25859 +-mno-octeon-useun do not use Octeon-specific unaligned loads/stores for 32/64-bit data\n"));
25860 fprintf (stream, _("\
25861 -mhard-float allow floating-point instructions\n\
25862 -msoft-float do not allow floating-point instructions\n\
25863 --- a/gas/config/tc-mips.h
25864 +++ b/gas/config/tc-mips.h
25865 @@ -53,6 +53,9 @@ extern int mips_relax_frag (asection *,
25866 #define md_undefined_symbol(name) (0)
25867 #define md_operand(x)
25868
25869 +extern void mips_cleanup (void);
25870 +#define md_cleanup() mips_cleanup ()
25871 +
25872 extern char mips_nop_opcode (void);
25873 #define NOP_OPCODE (mips_nop_opcode ())
25874
25875 --- a/gas/config/tc-ppc.c
25876 +++ b/gas/config/tc-ppc.c
25877 @@ -905,6 +905,10 @@ parse_cpu (const char *arg)
25878 }
25879 /* -mppc64 and -m620 mean to assemble for the 64-bit PowerPC
25880 620. */
25881 + else if (strcmp (arg, "pmr") == 0)
25882 + {
25883 + ppc_cpu |= PPC_OPCODE_PMR;
25884 + }
25885 else if (strcmp (arg, "ppc64") == 0 || strcmp (arg, "620") == 0)
25886 {
25887 ppc_cpu = PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_64;
25888 --- a/gas/config/te-armeabi.h
25889 +++ b/gas/config/te-armeabi.h
25890 @@ -18,7 +18,7 @@
25891 02110-1301, USA. */
25892
25893 /* The EABI requires the use of VFP. */
25894 -#define FPU_DEFAULT FPU_ARCH_VFP_V2
25895 +#define FPU_DEFAULT FPU_ARCH_VFP
25896 #define EABI_DEFAULT EF_ARM_EABI_VER5
25897
25898 #define LOCAL_LABELS_DOLLAR 1
25899 --- a/gas/config/te-armlinuxeabi.h
25900 +++ b/gas/config/te-armlinuxeabi.h
25901 @@ -20,5 +20,5 @@
25902 #include "te-linux.h"
25903
25904 /* The EABI requires the use of VFP. */
25905 -#define FPU_DEFAULT FPU_ARCH_VFP_V2
25906 +#define FPU_DEFAULT FPU_ARCH_VFP
25907 #define EABI_DEFAULT EF_ARM_EABI_VER5
25908 --- a/gas/configure
25909 +++ b/gas/configure
25910 @@ -12167,6 +12167,9 @@ echo "$as_me: error: $target_cpu isn't a
25911 esac
25912 # Decide which ABI to target by default.
25913 case ${target} in
25914 + mips64el-sicortex-linux-gnu)
25915 + mips_default_abi=N64_ABI
25916 + ;;
25917 mips64*-linux* | mips-sgi-irix6*)
25918 mips_default_abi=N32_ABI
25919 ;;
25920 --- a/gas/configure.in
25921 +++ b/gas/configure.in
25922 @@ -245,6 +245,9 @@ changequote([,])dnl
25923 esac
25924 # Decide which ABI to target by default.
25925 case ${target} in
25926 + mips64el-sicortex-linux-gnu)
25927 + mips_default_abi=N64_ABI
25928 + ;;
25929 mips64*-linux* | mips-sgi-irix6*)
25930 mips_default_abi=N32_ABI
25931 ;;
25932 --- a/gas/configure.tgt
25933 +++ b/gas/configure.tgt
25934 @@ -287,6 +287,8 @@ case ${generic_target} in
25935 mips-*-riscos*) fmt=ecoff ;;
25936 mips*-*-linux*) fmt=elf em=tmips ;;
25937 mips-*-sysv4*MP* | mips-*-gnu*) fmt=elf em=tmips ;;
25938 + mips-wrs-elf*) fmt=elf em=tmips ;;
25939 + mips-montavista-elf*) fmt=elf em=tmips ;;
25940 mips*-sde-elf*) fmt=elf em=tmips ;;
25941 mips-*-sysv*) fmt=ecoff ;;
25942 mips-*-elf* | mips-*-rtems*) fmt=elf ;;
25943 --- a/gas/doc/as.texinfo
25944 +++ b/gas/doc/as.texinfo
25945 @@ -375,6 +375,7 @@ gcc(1), ld(1), and the Info entries for
25946 [@b{-construct-floats}] [@b{-no-construct-floats}]
25947 [@b{-trap}] [@b{-no-break}] [@b{-break}] [@b{-no-trap}]
25948 [@b{-mfix7000}] [@b{-mno-fix7000}]
25949 + [@b{-mfix-ice9a}] [@b{-mno-fix-ice9a}]
25950 [@b{-mips16}] [@b{-no-mips16}]
25951 [@b{-msmartmips}] [@b{-mno-smartmips}]
25952 [@b{-mips3d}] [@b{-no-mips3d}]
25953 --- a/gas/doc/c-arm.texi
25954 +++ b/gas/doc/c-arm.texi
25955 @@ -116,6 +116,8 @@ recognized:
25956 @code{cortex-a9},
25957 @code{cortex-r4},
25958 @code{cortex-m3},
25959 +@code{cortex-m1},
25960 +@code{cortex-m0},
25961 @code{ep9312} (ARM920 with Cirrus Maverick coprocessor),
25962 @code{i80200} (Intel XScale processor)
25963 @code{iwmmxt} (Intel(r) XScale processor with Wireless MMX(tm) technology coprocessor)
25964 @@ -194,6 +196,7 @@ The following format options are recogni
25965 @code{vfp},
25966 @code{vfp10},
25967 @code{vfp10-r0},
25968 +@code{vfp3}
25969 @code{vfp9},
25970 @code{vfpxd},
25971 @code{vfpv2}
25972 @@ -225,6 +228,12 @@ instructions; that is, it should behave
25973 This option specifies that the output generated by the assembler should
25974 be marked as supporting interworking.
25975
25976 +@cindex @code{-mauto-it} command line option, ARM
25977 +@item -mauto-it
25978 +This option enables the automatic generation of IT instructions for Thumb-2
25979 +conditional instructions. Explicit IT instructons are still accepted and
25980 +checked. This option has no effect on ARM mode code.
25981 +
25982 @cindex @code{-mapcs} command line option, ARM
25983 @item -mapcs @code{[26|32]}
25984 This option specifies that the output generated by the assembler should
25985 --- a/gas/doc/c-mips.texi
25986 +++ b/gas/doc/c-mips.texi
25987 @@ -182,6 +182,16 @@ all problems in hand-written assembler c
25988 @itemx -no-mfix-vr4130
25989 Insert nops to work around the VR4130 @samp{mflo}/@samp{mfhi} errata.
25990
25991 +@item -mfix-ice9a
25992 +@itemx -mno-fix-ice9a
25993 +Detect missing @code{movn.d $f30, <reg>, $zero} instructions required for
25994 +the ICE9A double floating-point multiplication errata and invalid @code{$f30}
25995 +references conflicting with same. Raise an error if so.
25996 +
25997 +@item -mfix-24k
25998 +@itemx -no-mfix-24k
25999 +Insert nops to work around the 24K @samp{eret}/@samp{deret} errata.
26000 +
26001 @item -m4010
26002 @itemx -no-m4010
26003 Generate code for the LSI @sc{r4010} chip. This tells the assembler to
26004 --- a/gas/read.c
26005 +++ b/gas/read.c
26006 @@ -1920,6 +1920,10 @@ s_fill (int ignore ATTRIBUTE_UNUSED)
26007 md_flush_pending_output ();
26008 #endif
26009
26010 +#ifdef md_cons_align
26011 + md_cons_align (1);
26012 +#endif
26013 +
26014 get_known_segmented_expression (&rep_exp);
26015 if (*input_line_pointer == ',')
26016 {
26017 @@ -3119,6 +3123,10 @@ s_space (int mult)
26018 md_flush_pending_output ();
26019 #endif
26020
26021 +#ifdef md_cons_align
26022 + md_cons_align (1);
26023 +#endif
26024 +
26025 if (flag_mri)
26026 stop = mri_comment_field (&stopc);
26027
26028 @@ -3290,6 +3298,10 @@ s_float_space (int float_type)
26029 char *stop = NULL;
26030 char stopc = 0;
26031
26032 +#ifdef md_cons_align
26033 + md_cons_align (1);
26034 +#endif
26035 +
26036 if (flag_mri)
26037 stop = mri_comment_field (&stopc);
26038
26039 @@ -3792,7 +3804,15 @@ cons_worker (register int nbytes, /* 1=.
26040 parse_mri_cons (&exp, (unsigned int) nbytes);
26041 else
26042 #endif
26043 - TC_PARSE_CONS_EXPRESSION (&exp, (unsigned int) nbytes);
26044 + {
26045 + if (*input_line_pointer == '"')
26046 + {
26047 + as_bad (_("unexpected \" in expression"));
26048 + ignore_rest_of_line ();
26049 + return;
26050 + }
26051 + TC_PARSE_CONS_EXPRESSION (&exp, (unsigned int) nbytes);
26052 + }
26053
26054 if (rva)
26055 {
26056 @@ -4631,6 +4651,10 @@ float_cons (/* Clobbers input_line-point
26057 md_flush_pending_output ();
26058 #endif
26059
26060 +#ifdef md_cons_align
26061 + md_cons_align (1);
26062 +#endif
26063 +
26064 do
26065 {
26066 /* input_line_pointer->1st char of a flonum (we hope!). */
26067 @@ -5075,6 +5099,10 @@ stringer (int bits_appendzero)
26068 md_flush_pending_output ();
26069 #endif
26070
26071 +#ifdef md_cons_align
26072 + md_cons_align (1);
26073 +#endif
26074 +
26075 /* The following awkward logic is to parse ZERO or more strings,
26076 comma separated. Recall a string expression includes spaces
26077 before the opening '\"' and spaces after the closing '\"'.
26078 @@ -5453,6 +5481,10 @@ s_incbin (int x ATTRIBUTE_UNUSED)
26079 md_flush_pending_output ();
26080 #endif
26081
26082 +#ifdef md_cons_align
26083 + md_cons_align (1);
26084 +#endif
26085 +
26086 SKIP_WHITESPACE ();
26087 filename = demand_copy_string (& len);
26088 if (filename == NULL)
26089 --- a/gprof/cg_print.c
26090 +++ b/gprof/cg_print.c
26091 @@ -58,6 +58,10 @@ extern void fsf_callg_blurb (FILE * fp);
26092
26093 double print_time = 0.0;
26094
26095 +static double child_max;
26096 +static int self_wid;
26097 +static int child_wid;
26098 +static int prec;
26099
26100 static void
26101 print_header ()
26102 @@ -79,8 +83,8 @@ print_header ()
26103 (long) hist_scale * (long) sizeof (UNIT));
26104
26105 if (print_time > 0.0)
26106 - printf (_(" for %.2f%% of %.2f seconds\n\n"),
26107 - 100.0 / print_time, print_time / hz);
26108 + printf (_(" for %.2f%% of %.2f %s\n\n"),
26109 + 100.0 / print_time, print_time / hz, hist_dimension);
26110 else
26111 {
26112 printf (_(" no time propagated\n\n"));
26113 @@ -100,10 +104,10 @@ print_header ()
26114 "", "", "", "", _("called"), _("total"), _("children"));
26115 printf ("\n");
26116 }
26117 + else if (child_max / hz >= 100000.0)
26118 + printf (_("index %% time self children called name\n"));
26119 else
26120 - {
26121 - printf (_("index %% time self children called name\n"));
26122 - }
26123 + printf (_("index %% time self children called name\n"));
26124 }
26125
26126 /* Print a cycle header. */
26127 @@ -114,12 +118,11 @@ print_cycle (Sym *cyc)
26128 char buf[BUFSIZ];
26129
26130 sprintf (buf, "[%d]", cyc->cg.index);
26131 - printf (bsd_style_output
26132 - ? "%-6.6s %5.1f %7.2f %11.2f %7lu"
26133 - : "%-6.6s %5.1f %7.2f %7.2f %7lu", buf,
26134 + printf ("%-6.6s %5.1f %*.*f %*.*f %7lu", buf,
26135 100 * (cyc->cg.prop.self + cyc->cg.prop.child) / print_time,
26136 - cyc->cg.prop.self / hz, cyc->cg.prop.child / hz, cyc->ncalls);
26137 -
26138 + self_wid, prec, cyc->cg.prop.self / hz,
26139 + child_wid, prec, cyc->cg.prop.child / hz,
26140 + cyc->ncalls);
26141 if (cyc->cg.self_calls != 0)
26142 printf ("+%-7lu", cyc->cg.self_calls);
26143 else
26144 @@ -192,10 +195,10 @@ print_members (Sym *cyc)
26145
26146 for (member = cyc->cg.cyc.next; member; member = member->cg.cyc.next)
26147 {
26148 - printf (bsd_style_output
26149 - ? "%6.6s %5.5s %7.2f %11.2f %7lu"
26150 - : "%6.6s %5.5s %7.2f %7.2f %7lu",
26151 - "", "", member->cg.prop.self / hz, member->cg.prop.child / hz,
26152 + printf ("%6.6s %5.5s %*.*f %*.*f %7lu",
26153 + "", "",
26154 + self_wid, prec, member->cg.prop.self / hz,
26155 + child_wid, prec, member->cg.prop.child / hz,
26156 member->ncalls);
26157
26158 if (member->cg.self_calls != 0)
26159 @@ -350,10 +353,11 @@ print_parents (Sym *child)
26160
26161 if (!child->cg.parents)
26162 {
26163 - printf (bsd_style_output
26164 - ? _("%6.6s %5.5s %7.7s %11.11s %7.7s %7.7s <spontaneous>\n")
26165 - : _("%6.6s %5.5s %7.7s %7.7s %7.7s %7.7s <spontaneous>\n"),
26166 - "", "", "", "", "", "");
26167 + printf (_("%6.6s %5.5s %*.*s %*.*s %7.7s %7.7s <spontaneous>\n"),
26168 + "", "",
26169 + self_wid, self_wid, "",
26170 + child_wid, child_wid, "",
26171 + "", "");
26172 return;
26173 }
26174
26175 @@ -365,23 +369,22 @@ print_parents (Sym *child)
26176 if (child == parent || (child->cg.cyc.num != 0
26177 && parent->cg.cyc.num == child->cg.cyc.num))
26178 {
26179 - /* Selfcall or call among siblings. */
26180 - printf (bsd_style_output
26181 - ? "%6.6s %5.5s %7.7s %11.11s %7lu %7.7s "
26182 - : "%6.6s %5.5s %7.7s %7.7s %7lu %7.7s ",
26183 - "", "", "", "",
26184 + /* Selfcall or call among siblings. */
26185 + printf ("%6.6s %5.5s %*.*s %*.*s %7lu %7.7s ",
26186 + "", "",
26187 + self_wid, self_wid, "",
26188 + child_wid, child_wid, "",
26189 arc->count, "");
26190 print_name (parent);
26191 printf ("\n");
26192 }
26193 else
26194 {
26195 - /* Regular parent of child. */
26196 - printf (bsd_style_output
26197 - ? "%6.6s %5.5s %7.2f %11.2f %7lu/%-7lu "
26198 - : "%6.6s %5.5s %7.2f %7.2f %7lu/%-7lu ",
26199 + /* Regular parent of child. */
26200 + printf ("%6.6s %5.5s %*.*f %*.*f %7lu/%-7lu ",
26201 "", "",
26202 - arc->time / hz, arc->child_time / hz,
26203 + self_wid, prec, arc->time / hz,
26204 + child_wid, prec, arc->child_time / hz,
26205 arc->count, cycle_head->ncalls);
26206 print_name (parent);
26207 printf ("\n");
26208 @@ -438,22 +441,22 @@ print_children (Sym *parent)
26209 if (child == parent || (child->cg.cyc.num != 0
26210 && child->cg.cyc.num == parent->cg.cyc.num))
26211 {
26212 - /* Self call or call to sibling. */
26213 - printf (bsd_style_output
26214 - ? "%6.6s %5.5s %7.7s %11.11s %7lu %7.7s "
26215 - : "%6.6s %5.5s %7.7s %7.7s %7lu %7.7s ",
26216 - "", "", "", "", arc->count, "");
26217 + /* Self call or call to sibling. */
26218 + printf ("%6.6s %5.5s %*.*s %*.*s %7lu %7.7s ",
26219 + "", "",
26220 + self_wid, self_wid, "",
26221 + child_wid, child_wid, "",
26222 + arc->count, "");
26223 print_name (child);
26224 printf ("\n");
26225 }
26226 else
26227 {
26228 - /* Regular child of parent. */
26229 - printf (bsd_style_output
26230 - ? "%6.6s %5.5s %7.2f %11.2f %7lu/%-7lu "
26231 - : "%6.6s %5.5s %7.2f %7.2f %7lu/%-7lu ",
26232 + /* Regular child of parent. */
26233 + printf ("%6.6s %5.5s %*.*f %*.*f %7lu/%-7lu ",
26234 "", "",
26235 - arc->time / hz, arc->child_time / hz,
26236 + self_wid, prec, arc->time / hz,
26237 + child_wid, prec, arc->child_time / hz,
26238 arc->count, child->cg.cyc.head->ncalls);
26239 print_name (child);
26240 printf ("\n");
26241 @@ -468,25 +471,21 @@ print_line (Sym *np)
26242 char buf[BUFSIZ];
26243
26244 sprintf (buf, "[%d]", np->cg.index);
26245 - printf (bsd_style_output
26246 - ? "%-6.6s %5.1f %7.2f %11.2f"
26247 - : "%-6.6s %5.1f %7.2f %7.2f", buf,
26248 + printf ("%-6.6s %5.1f %*.*f %*.*f", buf,
26249 100 * (np->cg.prop.self + np->cg.prop.child) / print_time,
26250 - np->cg.prop.self / hz, np->cg.prop.child / hz);
26251 -
26252 + self_wid, prec, np->cg.prop.self / hz,
26253 + child_wid, prec, np->cg.prop.child / hz);
26254 if ((np->ncalls + np->cg.self_calls) != 0)
26255 {
26256 printf (" %7lu", np->ncalls);
26257
26258 if (np->cg.self_calls != 0)
26259 - printf ("+%-7lu ", np->cg.self_calls);
26260 + printf ("+%-7lu ", np->cg.self_calls);
26261 else
26262 - printf (" %7.7s ", "");
26263 + printf (" %7.7s ", "");
26264 }
26265 else
26266 - {
26267 - printf (" %7.7s %7.7s ", "", "");
26268 - }
26269 + printf (" %7.7s %7.7s ", "", "");
26270
26271 print_name (np);
26272 printf ("\n");
26273 @@ -504,6 +503,20 @@ cg_print (Sym ** timesortsym)
26274 if (print_descriptions && bsd_style_output)
26275 bsd_callg_blurb (stdout);
26276
26277 + child_max = 0.0;
26278 + for (index = 0; index < symtab.len; index++)
26279 + {
26280 + Sym *sym = &symtab.base[index];
26281 + if (sym->cg.prop.child > child_max)
26282 + child_max = sym->cg.prop.child;
26283 + }
26284 + if (bsd_style_output)
26285 + self_wid = 7, child_wid = 11, prec = 2;
26286 + else if (child_max / hz >= 100000.0)
26287 + self_wid = 10, child_wid = 10, prec = 0;
26288 + else
26289 + self_wid = 7, child_wid = 7, prec = 2;
26290 +
26291 print_header ();
26292
26293 for (index = 0; index < symtab.len + num_cycles; ++index)
26294 --- a/gprof/corefile.c
26295 +++ b/gprof/corefile.c
26296 @@ -29,6 +29,11 @@
26297 #include "corefile.h"
26298 #include "safe-ctype.h"
26299
26300 +/* FIXME: These are needed to figure out if this is a mips16 symbol or
26301 + not. It would be better to think of a cleaner way to do this. */
26302 +#include "elf-bfd.h"
26303 +#include "elf/mips.h"
26304 +
26305 bfd *core_bfd;
26306 static int core_num_syms;
26307 static asymbol **core_syms;
26308 @@ -233,6 +238,10 @@ core_init (const char *aout_name)
26309 min_insn_size = 4;
26310 break;
26311
26312 + case bfd_arch_mips:
26313 + min_insn_size = 2;
26314 + break;
26315 +
26316 default:
26317 break;
26318 }
26319 @@ -528,6 +537,17 @@ core_create_function_syms ()
26320 if (sym_sec)
26321 symtab.limit->addr += bfd_get_section_vma (sym_sec->owner, sym_sec);
26322
26323 + /* Flag mips16 symbols by making them odd (we don't have a
26324 + handle on the original bfd symbol after this point). */
26325 + if (bfd_get_arch (core_bfd) == bfd_arch_mips
26326 + && bfd_get_flavour (core_bfd) == bfd_target_elf_flavour)
26327 + {
26328 + elf_symbol_type *es = elf_symbol_from (core_bfd, core_syms[i]);
26329 +
26330 + if (es && es->internal_elf_sym.st_other == STO_MIPS16)
26331 + symtab.limit->addr |= 1;
26332 + }
26333 +
26334 if (symbol_map_count
26335 && !strcmp (core_syms[i]->name, symbol_map[found].function_name))
26336 {
26337 --- a/gprof/gmon_io.c
26338 +++ b/gprof/gmon_io.c
26339 @@ -430,8 +430,8 @@ gmon_out_read (const char *filename)
26340 goto bad_gmon_file;
26341
26342 if (!histograms)
26343 - hz = profrate;
26344 - else if (hz != (int) profrate)
26345 + hz_int = profrate;
26346 + else if (hz_int != (int) profrate)
26347 {
26348 fprintf (stderr,
26349 _("%s: profiling rate incompatible with first gmon file\n"),
26350 @@ -553,15 +553,15 @@ gmon_out_read (const char *filename)
26351
26352 fclose (ifp);
26353
26354 - if (hz == HZ_WRONG)
26355 + if (hz_int == HZ_WRONG)
26356 {
26357 - /* How many ticks per second? If we can't tell, report
26358 - time in ticks. */
26359 - hz = hertz ();
26360 -
26361 - if (hz == HZ_WRONG)
26362 + /*
26363 + How many ticks per second? If we can't tell, report
26364 + time in ticks. */
26365 + hz_int = hertz ();
26366 + if (hz_int == HZ_WRONG)
26367 {
26368 - hz = 1;
26369 + hz_int = 1;
26370 fprintf (stderr, _("time is in ticks, not seconds\n"));
26371 }
26372 }
26373 @@ -573,6 +573,15 @@ gmon_out_read (const char *filename)
26374 done (1);
26375 }
26376
26377 +#ifdef HERTZ_FLOAT
26378 + if (hz_int < 0)
26379 + hz = 1.0 / -hz_int;
26380 + else
26381 + hz = hz_int;
26382 +#else
26383 + hz = hz_int;
26384 +#endif
26385 +
26386 if (output_style & STYLE_GMON_INFO)
26387 {
26388 printf (_("File `%s' (version %d) contains:\n"),
26389 @@ -645,7 +654,7 @@ gmon_out_write (const char *filename)
26390 header if explicitly specified, or if the profiling rate is
26391 non-standard. Otherwise, use the old BSD format. */
26392 if (file_format == FF_BSD44
26393 - || hz != hertz())
26394 + || hz_int != hertz ())
26395 {
26396 padsize = 3*4;
26397 switch (gmon_get_ptr_size ())
26398 @@ -692,10 +701,10 @@ gmon_out_write (const char *filename)
26399
26400 /* Write out the 4.4BSD header bits, if that's what we're using. */
26401 if (file_format == FF_BSD44
26402 - || hz != hertz())
26403 + || hz_int != hertz())
26404 {
26405 if (gmon_io_write_32 (ofp, GMONVERSION)
26406 - || gmon_io_write_32 (ofp, (unsigned int) hz))
26407 + || gmon_io_write_32 (ofp, (unsigned int) hz_int))
26408 {
26409 perror (filename);
26410 done (1);
26411 --- a/gprof/gprof.c
26412 +++ b/gprof/gprof.c
26413 @@ -50,7 +50,12 @@ static void usage (FILE *, int) ATTRIBUT
26414 const char *whoami;
26415 const char *function_mapping_file;
26416 const char *a_out_name = A_OUTNAME;
26417 -long hz = HZ_WRONG;
26418 +#ifdef HERTZ_FLOAT
26419 +double hz;
26420 +#else
26421 +long hz;
26422 +#endif
26423 +long hz_int = HZ_WRONG;
26424
26425 /*
26426 * Default options values:
26427 --- a/gprof/gprof.h
26428 +++ b/gprof/gprof.h
26429 @@ -29,6 +29,10 @@
26430 #ifndef gprof_h
26431 #define gprof_h
26432
26433 +#include "gconfig.h"
26434 +
26435 +#undef PACKAGE
26436 +
26437 /* Include the BFD sysdep.h file. */
26438 #include "sysdep.h"
26439 #include "bfd.h"
26440 @@ -109,7 +113,15 @@ typedef unsigned char UNIT[2]; /* unit o
26441 extern const char *whoami; /* command-name, for error messages */
26442 extern const char *function_mapping_file; /* file mapping functions to files */
26443 extern const char *a_out_name; /* core filename */
26444 +extern char hist_dimension[]; /* histogram label */
26445 +
26446 +#define HERTZ_FLOAT
26447 +#ifdef HERTZ_FLOAT
26448 +extern double hz; /* ticks per second */
26449 +#else
26450 extern long hz; /* ticks per second */
26451 +#endif
26452 +extern long hz_int;
26453
26454 /*
26455 * Command-line options:
26456 --- a/gprof/hist.c
26457 +++ b/gprof/hist.c
26458 @@ -49,7 +49,7 @@ static histogram *find_histogram (bfd_vm
26459 static histogram *find_histogram_for_pc (bfd_vma pc);
26460
26461 double hist_scale;
26462 -static char hist_dimension[16] = "seconds";
26463 +char hist_dimension[16] = "seconds";
26464 static char hist_dimension_abbrev = 's';
26465
26466 static double accum_time; /* Accumulated time so far for print_line(). */
26467 @@ -86,7 +86,7 @@ SItab[] =
26468 that the new histogram is compatible with already-set values
26469 of those variables and emits an error if that's not so. */
26470 static void
26471 -read_histogram_header (histogram *record,
26472 +read_histogram_header (histogram *record,
26473 FILE *ifp, const char *filename,
26474 int first)
26475 {
26476 @@ -108,28 +108,28 @@ read_histogram_header (histogram *record
26477 done (1);
26478 }
26479
26480 - n_hist_scale = (double)((record->highpc - record->lowpc) / sizeof (UNIT))
26481 + n_hist_scale = (double)((record->highpc - record->lowpc) / sizeof (UNIT))
26482 / record->num_bins;
26483
26484 if (first)
26485 {
26486 - /* We don't try to veryfy profrate is the same for all histogram
26487 + /* We don't try to verify profrate is the same for all histogram
26488 records. If we have two histogram records for the same
26489 address range and profiling samples is done as often
26490 as possible as opposed on timer, then the actual profrate will
26491 be slightly different. Most of the time the difference does not
26492 matter and insisting that profiling rate is exactly the same
26493 will only create inconvenient. */
26494 - hz = profrate;
26495 + hz_int = profrate;
26496 memcpy (hist_dimension, n_hist_dimension, 15);
26497 hist_dimension_abbrev = n_hist_dimension_abbrev;
26498 - hist_scale = n_hist_scale;
26499 + hist_scale = n_hist_scale;
26500 }
26501 else
26502 {
26503 if (strncmp (n_hist_dimension, hist_dimension, 15) != 0)
26504 {
26505 - fprintf (stderr,
26506 + fprintf (stderr,
26507 _("%s: dimension unit changed between histogram records\n"
26508 "%s: from '%s'\n"
26509 "%s: to '%s'\n"),
26510 @@ -139,12 +139,12 @@ read_histogram_header (histogram *record
26511
26512 if (n_hist_dimension_abbrev != hist_dimension_abbrev)
26513 {
26514 - fprintf (stderr,
26515 + fprintf (stderr,
26516 _("%s: dimension abbreviation changed between histogram records\n"
26517 "%s: from '%c'\n"
26518 "%s: to '%c'\n"),
26519 whoami, whoami, hist_dimension_abbrev, whoami, n_hist_dimension_abbrev);
26520 - done (1);
26521 + done (1);
26522 }
26523
26524 /* The only reason we require the same scale for histograms is that
26525 @@ -153,10 +153,10 @@ read_histogram_header (histogram *record
26526 things for different functions. */
26527 if (fabs (hist_scale - n_hist_scale) > 0.000001)
26528 {
26529 - fprintf (stderr,
26530 + fprintf (stderr,
26531 _("%s: different scales in histogram records"),
26532 whoami);
26533 - done (1);
26534 + done (1);
26535 }
26536 }
26537 }
26538 @@ -190,10 +190,10 @@ hist_read_rec (FILE * ifp, const char *f
26539 hist_clip_symbol_address (&lowpc, &highpc);
26540 if (lowpc != highpc)
26541 {
26542 - fprintf (stderr,
26543 + fprintf (stderr,
26544 _("%s: overlapping histogram records\n"),
26545 whoami);
26546 - done (1);
26547 + done (1);
26548 }
26549
26550 /* This is new record. Add it to global array and allocate space for
26551 @@ -202,10 +202,10 @@ hist_read_rec (FILE * ifp, const char *f
26552 sizeof (histogram) * (num_histograms + 1));
26553 memcpy (histograms + num_histograms,
26554 &n_record, sizeof (histogram));
26555 - record = &histograms[num_histograms];
26556 + record = &histograms[num_histograms];
26557 ++num_histograms;
26558
26559 - record->sample = (int *) xmalloc (record->num_bins
26560 + record->sample = (int *) xmalloc (record->num_bins
26561 * sizeof (record->sample[0]));
26562 memset (record->sample, 0, record->num_bins * sizeof (record->sample[0]));
26563 }
26564 @@ -216,9 +216,9 @@ hist_read_rec (FILE * ifp, const char *f
26565
26566 DBG (SAMPLEDEBUG,
26567 printf ("[hist_read_rec] n_lowpc 0x%lx n_highpc 0x%lx ncnt %u\n",
26568 - (unsigned long) record->lowpc, (unsigned long) record->highpc,
26569 + (unsigned long) record->lowpc, (unsigned long) record->highpc,
26570 record->num_bins));
26571 -
26572 +
26573 for (i = 0; i < record->num_bins; ++i)
26574 {
26575 UNIT count;
26576 @@ -232,8 +232,8 @@ hist_read_rec (FILE * ifp, const char *f
26577 record->sample[i] += bfd_get_16 (core_bfd, (bfd_byte *) & count[0]);
26578 DBG (SAMPLEDEBUG,
26579 printf ("[hist_read_rec] 0x%lx: %u\n",
26580 - (unsigned long) (record->lowpc
26581 - + i * (record->highpc - record->lowpc)
26582 + (unsigned long) (record->lowpc
26583 + + i * (record->highpc - record->lowpc)
26584 / record->num_bins),
26585 record->sample[i]));
26586 }
26587 @@ -259,7 +259,7 @@ hist_write_hist (FILE * ofp, const char
26588 || gmon_io_write_vma (ofp, record->lowpc)
26589 || gmon_io_write_vma (ofp, record->highpc)
26590 || gmon_io_write_32 (ofp, record->num_bins)
26591 - || gmon_io_write_32 (ofp, hz)
26592 + || gmon_io_write_32 (ofp, hz_int)
26593 || gmon_io_write (ofp, hist_dimension, 15)
26594 || gmon_io_write (ofp, &hist_dimension_abbrev, 1))
26595 {
26596 @@ -484,12 +484,24 @@ print_header (int prefix)
26597 total_time = 1.0;
26598 }
26599
26600 - printf ("%5.5s %10.10s %8.8s %8.8s %8.8s %8.8s %-8.8s\n",
26601 - "% ", _("cumulative"), _("self "), "", _("self "), _("total "),
26602 - "");
26603 - printf ("%5.5s %9.9s %8.8s %8.8s %8.8s %8.8s %-8.8s\n",
26604 - _("time"), hist_dimension, hist_dimension, _("calls"), unit, unit,
26605 - _("name"));
26606 + if (total_time / hz_int >= 100000.0 && ! bsd_style_output)
26607 + {
26608 + printf ("%5.5s %13.13s %11.11s %8.8s %8.8s %8.8s %-8.8s\n",
26609 + "% ", _("cumulative"), _("self "), "", _("self "),
26610 + _("total "), "");
26611 + printf ("%5.5s %12.12s %11.11s %8.8s %8.8s %8.8s %-8.8s\n",
26612 + _("time"), hist_dimension, hist_dimension, _("calls"), unit,
26613 + unit, _("name"));
26614 + }
26615 + else
26616 + {
26617 + printf ("%5.5s %10.10s %8.8s %8.8s %8.8s %8.8s %-8.8s\n",
26618 + "% ", _("cumulative"), _("self "), "", _("self "),
26619 + _("total "), "");
26620 + printf ("%5.5s %9.9s %8.8s %8.8s %8.8s %8.8s %-8.8s\n",
26621 + _("time"), hist_dimension, hist_dimension, _("calls"), unit,
26622 + unit, _("name"));
26623 + }
26624 }
26625
26626
26627 @@ -505,6 +517,10 @@ print_line (Sym *sym, double scale)
26628 printf ("%5.1f %10.2f %8.2f",
26629 total_time > 0.0 ? 100 * sym->hist.time / total_time : 0.0,
26630 accum_time / hz, sym->hist.time / hz);
26631 + else if (total_time / hz >= 100000.0)
26632 + printf ("%6.2f %12.0f %11.0f",
26633 + 100 * sym->hist.time / total_time,
26634 + accum_time / hz, sym->hist.time / hz);
26635 else
26636 printf ("%6.2f %9.2f %8.2f",
26637 total_time > 0.0 ? 100 * sym->hist.time / total_time : 0.0,
26638 @@ -610,7 +626,12 @@ hist_print ()
26639 for (index = 0; index < symtab.len; ++index)
26640 {
26641 sym = time_sorted_syms[index];
26642 -
26643 + /* Don't let this symbol affect the scaling if it's not going
26644 + to be included in the histogram. */
26645 + if ((syms[INCL_FLAT].len != 0
26646 + && ! sym_lookup (&syms[INCL_FLAT], sym->addr))
26647 + || sym_lookup (&syms[EXCL_FLAT], sym->addr))
26648 + continue;
26649 if (sym->ncalls != 0)
26650 {
26651 time = (sym->hist.time + sym->cg.child_time) / sym->ncalls;
26652 @@ -631,7 +652,7 @@ hist_print ()
26653 {
26654 double scaled_value = SItab[log_scale].scale * top_time;
26655
26656 - if (scaled_value >= 1.0 && scaled_value < 1000.0)
26657 + if (scaled_value >= 1.0 && scaled_value < 1000.0)
26658 break;
26659 }
26660 }
26661 @@ -669,7 +690,7 @@ hist_check_address (unsigned address)
26662 if (histograms[i].lowpc <= address && address < histograms[i].highpc)
26663 return 1;
26664
26665 - return 0;
26666 + return 0;
26667 }
26668
26669 #if ! defined(min)
26670 @@ -744,5 +765,5 @@ find_histogram_for_pc (bfd_vma pc)
26671 if (histograms[i].lowpc <= pc && pc < histograms[i].highpc)
26672 return &histograms[i];
26673 }
26674 - return 0;
26675 + return 0;
26676 }
26677 --- a/gprof/mips.c
26678 +++ b/gprof/mips.c
26679 @@ -46,6 +46,7 @@ mips_find_call (Sym *parent, bfd_vma p_l
26680 int offset;
26681 Sym *child;
26682 static bfd_boolean inited = FALSE;
26683 + int mips16;
26684
26685 if (!inited)
26686 {
26687 @@ -55,46 +56,123 @@ mips_find_call (Sym *parent, bfd_vma p_l
26688 indirect_child.cg.prop.fract = 1.0;
26689 indirect_child.cg.cyc.head = &indirect_child;
26690 }
26691 + mips16 = (p_lowpc & 1) != 0;
26692 + p_lowpc &= ~1;
26693 + p_highpc &= ~1;
26694
26695 - DBG (CALLDEBUG, printf (_("[find_call] %s: 0x%lx to 0x%lx\n"),
26696 + DBG (CALLDEBUG, printf (_("[find_call] %s: 0x%lx to 0x%lx%s\n"),
26697 parent->name, (unsigned long) p_lowpc,
26698 - (unsigned long) p_highpc));
26699 - for (pc = p_lowpc; pc < p_highpc; pc += 4)
26700 + (unsigned long) p_highpc,
26701 + mips16 ? " (mips16)" : ""));
26702 + for (pc = p_lowpc; pc < p_highpc;)
26703 {
26704 - op = bfd_get_32 (core_bfd, ((unsigned char *)core_text_space
26705 - + pc - core_text_sect->vma));
26706 - if ((op & 0xfc000000) == 0x0c000000)
26707 + if (!mips16)
26708 {
26709 - /* This is a "jal" instruction. Check that the destination
26710 - is the address of a function. */
26711 - DBG (CALLDEBUG,
26712 - printf (_("[find_call] 0x%lx: jal"), (unsigned long) pc));
26713 - offset = (op & 0x03ffffff) << 2;
26714 - dest_pc = (pc & ~(bfd_vma) 0xfffffff) | offset;
26715 - if (hist_check_address (dest_pc))
26716 + op = bfd_get_32 (core_bfd, &((char *)core_text_space)[pc - p_lowpc]);
26717 + pc += 4;
26718 + if ((op & 0xfc000000) == 0x0c000000) /* jal */
26719 + {
26720 + DBG (CALLDEBUG,
26721 + printf (_("[find_call] 0x%lx: jal"), (unsigned long) pc-4));
26722 + offset = (op & 0x03ffffff) << 2;
26723 + dest_pc = (pc & ~(bfd_vma) 0xfffffff) | offset;
26724 + pc += 4; /* skip delay slot */
26725 + }
26726 + else if ((op & 0xfc000000) == 0x74000000) /* jalx */
26727 {
26728 - child = sym_lookup (&symtab, dest_pc);
26729 DBG (CALLDEBUG,
26730 - printf (" 0x%lx\t; name=%s, addr=0x%lx",
26731 - (unsigned long) dest_pc, child->name,
26732 - (unsigned long) child->addr));
26733 - if (child->addr == dest_pc)
26734 - {
26735 - DBG (CALLDEBUG, printf ("\n"));
26736 - /* a hit: */
26737 - arc_add (parent, child, (unsigned long) 0);
26738 - continue;
26739 - }
26740 + printf (_("[find_call] 0x%lx: jalx"), (unsigned long) pc-4));
26741 + offset = (op & 0x03ffffff) << 2;
26742 + dest_pc = (pc & ~(bfd_vma) 0xfffffff) | offset | 1;
26743 + pc += 4; /* skip delay slot */
26744 + }
26745 + else if ((op & 0xfc1f07ff) == 0x00000009) /* jalr */
26746 + {
26747 + DBG (CALLDEBUG, printf ("[find_call]\t0x%lx:jalr\n" ,
26748 + (unsigned long)pc-4));
26749 + arc_add (parent, &indirect_child, (long)0);
26750 + pc += 4; /* skip delay slot */
26751 + continue;
26752 }
26753 - /* Something funny going on. */
26754 - DBG (CALLDEBUG, printf ("\tbut it's a botch\n"));
26755 + else if ((op & 0xfc1c0000) == 0x04100000) /* bxxzal */
26756 + {
26757 + DBG (CALLDEBUG, printf ("[find_call]\t0x%lx:bal" ,
26758 + (unsigned long)pc-4));
26759 + dest_pc = pc + ((short)op << 2) + 4;
26760 + pc += 4; /* skip delay slot */
26761 + }
26762 + else
26763 + continue;
26764 }
26765 - else if ((op & 0xfc00f83f) == 0x0000f809)
26766 + else
26767 {
26768 - /* This is a "jalr" instruction (indirect call). */
26769 + /* MIPS16 function */
26770 + op = bfd_get_16 (core_bfd, &((char *)core_text_space)[pc - p_lowpc]);
26771 + pc += 2;
26772 + if ((op & 0xfc00) == 0x1800 /* jal */
26773 + || (op & 0xfc00) == 0x1c00) /* jalx */
26774 + {
26775 + DBG (CALLDEBUG, printf ("[find_call]\t0x%lx:jal%s",
26776 + (unsigned long)pc-2,
26777 + (op & 0xfc00) == 0x1c00 ? "x" : ""));
26778 + offset = bfd_get_16 (core_bfd,
26779 + &((char *)core_text_space)[pc - p_lowpc]);
26780 + pc += 2;
26781 + offset |= (op & 0x1f) << 21;
26782 + offset |= (op & 0x3e0) << (16 - 5);
26783 + dest_pc = (pc & ~(bfd_vma)0x0fffffff)
26784 + + ((offset & 0x3ffffff) << 2);
26785 + if ((op & 0xfc00) == 0x1800) /* jal */
26786 + dest_pc |= 1;
26787 + pc += 2; /* skip delay slot */
26788 + }
26789 + else if ((op & 0xf8ff) == 0xe840) /* jalr */
26790 + {
26791 + DBG (CALLDEBUG, printf ("[find_call]\t0x%lx:jalr\n" ,
26792 + (unsigned long)pc-2));
26793 + arc_add (parent, &indirect_child, (long)0);
26794 + pc += 2; /* skip delay slot */
26795 + continue;
26796 + }
26797 + else if ((op & 0xf8ff) == 0xe8c0) /* jalrc */
26798 + {
26799 + DBG (CALLDEBUG, printf ("[find_call]\t0x%lx:jalrc\n" ,
26800 + (unsigned long)pc-2));
26801 + arc_add (parent, &indirect_child, (long)0);
26802 + continue;
26803 + }
26804 + else if ((op & 0xff7f) == 0xe820 /* jr/jrc $31 */
26805 + || (op & 0xff7f) == 0xef00 /* jr/jrc $7 */
26806 + || (op & 0xff80) == 0x6400 /* restore */
26807 + || (op & 0xff1f) == 0xed09 /* exit */
26808 + || (op & 0xff1f) == 0xee09 /* exit */
26809 + || (op & 0xff1f) == 0xef09) /* exit */
26810 + {
26811 + /* Skip constants after the end of the function. */
26812 + DBG (CALLDEBUG, printf ("[find_call]\t0x%lx:end\n" ,
26813 + (unsigned long)pc-2));
26814 + return;
26815 + }
26816 + else
26817 + continue;
26818 + }
26819 +
26820 + if (dest_pc >= p_lowpc && dest_pc <= p_highpc)
26821 + {
26822 + child = sym_lookup (&symtab, dest_pc);
26823 DBG (CALLDEBUG,
26824 - printf (_("[find_call] 0x%lx: jalr\n"), (unsigned long) pc));
26825 - arc_add (parent, &indirect_child, (unsigned long) 0);
26826 + printf (" 0x%lx\t; name=%s, addr=0x%lx",
26827 + (unsigned long) dest_pc, child->name,
26828 + (unsigned long) child->addr));
26829 + if (child->addr == dest_pc)
26830 + {
26831 + DBG (CALLDEBUG, printf ("\n"));
26832 + /* a hit: */
26833 + arc_add (parent, child, (unsigned long) 0);
26834 + continue;
26835 + }
26836 }
26837 + /* Something funny going on. */
26838 + DBG (CALLDEBUG, printf ("\tbut it's a botch\n"));
26839 }
26840 }
26841 --- a/include/elf/arm.h
26842 +++ b/include/elf/arm.h
26843 @@ -71,9 +71,11 @@
26844 #define STT_ARM_16BIT STT_HIPROC /* A Thumb label. */
26845
26846 /* Additional section types. */
26847 -#define SHT_ARM_EXIDX 0x70000001 /* Section holds ARM unwind info. */
26848 -#define SHT_ARM_PREEMPTMAP 0x70000002 /* Section pre-emption details. */
26849 -#define SHT_ARM_ATTRIBUTES 0x70000003 /* Section holds attributes. */
26850 +#define SHT_ARM_EXIDX 0x70000001 /* Section holds ARM unwind info. */
26851 +#define SHT_ARM_PREEMPTMAP 0x70000002 /* Section pre-emption details. */
26852 +#define SHT_ARM_ATTRIBUTES 0x70000003 /* Section holds attributes. */
26853 +#define SHT_ARM_DEBUGOVERLAY 0x70000004 /* Section holds overlay debug info. */
26854 +#define SHT_ARM_OVERLAYSECTION 0x70000005 /* Section holds GDB and overlay integration info. */
26855
26856 /* ARM-specific values for sh_flags. */
26857 #define SHF_ENTRYSECT 0x10000000 /* Section contains an entry point. */
26858 --- a/include/libiberty.h
26859 +++ b/include/libiberty.h
26860 @@ -591,6 +591,10 @@ extern int pexecute (const char *, char
26861
26862 extern int pwait (int, int *, int);
26863
26864 +/* Convert a Cygwin path to a Windows path. */
26865 +
26866 +extern int cygpath (const char *, char []);
26867 +
26868 #if !HAVE_DECL_ASPRINTF
26869 /* Like sprintf but provides a pointer to malloc'd storage, which must
26870 be freed by the caller. */
26871 --- a/include/opcode/arm.h
26872 +++ b/include/opcode/arm.h
26873 @@ -53,6 +53,7 @@
26874 #define ARM_CEXT_MAVERICK 0x00000002 /* Use Cirrus/DSP coprocessor. */
26875 #define ARM_CEXT_IWMMXT 0x00000004 /* Intel Wireless MMX technology coprocessor. */
26876 #define ARM_CEXT_IWMMXT2 0x00000008 /* Intel Wireless MMX technology coprocessor version 2. */
26877 +#define ARM_CEXT_MARVELL_F 0x00000010 /* Marvell division extension. */
26878
26879 #define FPU_ENDIAN_PURE 0x80000000 /* Pure-endian doubles. */
26880 #define FPU_ENDIAN_BIG 0 /* Double words-big-endian. */
26881 @@ -116,6 +117,8 @@
26882 ARM_FEATURE (ARM_AEXT_V5TE, ARM_CEXT_XSCALE | ARM_CEXT_IWMMXT)
26883 #define ARM_ARCH_IWMMXT2 \
26884 ARM_FEATURE (ARM_AEXT_V5TE, ARM_CEXT_XSCALE | ARM_CEXT_IWMMXT | ARM_CEXT_IWMMXT2)
26885 +#define ARM_ARCH_MARVELL_F \
26886 + ARM_FEATURE (ARM_AEXT_V5TE, ARM_CEXT_MARVELL_F)
26887
26888 #define FPU_VFP_V1xD (FPU_VFP_EXT_V1xD | FPU_ENDIAN_PURE)
26889 #define FPU_VFP_V1 (FPU_VFP_V1xD | FPU_VFP_EXT_V1)
26890 --- a/include/opcode/mips.h
26891 +++ b/include/opcode/mips.h
26892 @@ -843,6 +843,8 @@ enum
26893 M_S_DOB,
26894 M_S_DAB,
26895 M_S_S,
26896 + M_SAA_AB,
26897 + M_SAAD_AB,
26898 M_SC_AB,
26899 M_SCD_AB,
26900 M_SD_A,
26901 --- a/ld/Makefile.am
26902 +++ b/ld/Makefile.am
26903 @@ -163,6 +163,12 @@ ALL_EMULATIONS = \
26904 eelf32bfinfd.o \
26905 eelf32cr16.o \
26906 eelf32cr16c.o \
26907 + eelf32ebocteon.o \
26908 + eelf32elocteon.o \
26909 + eelf32ebocteonn32.o \
26910 + eelf32elocteonn32.o \
26911 + eelf64ebocteon.o \
26912 + eelf64elocteon.o \
26913 eelf32bmip.o \
26914 eelf32bmipn32.o \
26915 eelf32btsmip.o \
26916 @@ -789,6 +795,35 @@ eelf32cr16c.c: $(srcdir)/emulparams/elf3
26917 $(ELF_DEPS) \
26918 $(srcdir)/scripttempl/elf32cr16c.sc ${GEN_DEPENDS}
26919 ${GENSCRIPTS} elf32cr16c "$(tdir_elf32cr16c)"
26920 +eelf32ebocteon.c: $(srcdir)/emulparams/elf32ebocteon.sh \
26921 + $(srcdir)/emulparams/elf32bmip.sh \
26922 + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/octeonelf.em \
26923 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26924 + ${GENSCRIPTS} elf32ebocteon "$(tdir_elf32ebocteon)"
26925 +eelf32elocteon.c: $(srcdir)/emulparams/elf32elocteon.sh \
26926 + $(srcdir)/emulparams/elf32ebocteon.sh $(srcdir)/emulparams/elf32bmip.sh \
26927 + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/octeonelf.em \
26928 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26929 + ${GENSCRIPTS} elf32elocteon "$(tdir_elf32elocteon)"
26930 +eelf32ebocteonn32.c: $(srcdir)/emulparams/elf32ebocteonn32.sh \
26931 + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/octeonelf.em \
26932 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26933 + ${GENSCRIPTS} elf32ebocteonn32 "$(tdir_elf32ebocteonn32)"
26934 +eelf32elocteonn32.c: $(srcdir)/emulparams/elf32elocteonn32.sh \
26935 + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/octeonelf.em \
26936 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26937 + ${GENSCRIPTS} elf32elocteonn32 "$(tdir_elf32elocteonn32)"
26938 +eelf64ebocteon.c: $(srcdir)/emulparams/elf64ebocteon.sh \
26939 + $(srcdir)/emulparams/elf32ebocteon.sh \
26940 + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/octeonelf.em \
26941 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26942 + ${GENSCRIPTS} elf64ebocteon "$(tdir_elf64ebocteon)"
26943 +eelf64elocteon.c: $(srcdir)/emulparams/elf64elocteon.sh \
26944 + $(srcdir)/emulparams/elf64ebocteon.sh \
26945 + $(srcdir)/emulparams/elf32ebocteon.sh \
26946 + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/octeonelf.em \
26947 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26948 + ${GENSCRIPTS} elf64elocteon "$(tdir_elf64elocteon)"
26949 eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
26950 $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26951 ${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)"
26952 --- a/ld/Makefile.in
26953 +++ b/ld/Makefile.in
26954 @@ -427,6 +427,12 @@ ALL_EMULATIONS = \
26955 eelf32bfinfd.o \
26956 eelf32cr16.o \
26957 eelf32cr16c.o \
26958 + eelf32ebocteon.o \
26959 + eelf32elocteon.o \
26960 + eelf32ebocteonn32.o \
26961 + eelf32elocteonn32.o \
26962 + eelf64ebocteon.o \
26963 + eelf64elocteon.o \
26964 eelf32bmip.o \
26965 eelf32bmipn32.o \
26966 eelf32btsmip.o \
26967 @@ -1635,6 +1641,35 @@ eelf32cr16c.c: $(srcdir)/emulparams/elf3
26968 $(ELF_DEPS) \
26969 $(srcdir)/scripttempl/elf32cr16c.sc ${GEN_DEPENDS}
26970 ${GENSCRIPTS} elf32cr16c "$(tdir_elf32cr16c)"
26971 +eelf32ebocteon.c: $(srcdir)/emulparams/elf32ebocteon.sh \
26972 + $(srcdir)/emulparams/elf32bmip.sh \
26973 + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/octeonelf.em \
26974 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26975 + ${GENSCRIPTS} elf32ebocteon "$(tdir_elf32ebocteon)"
26976 +eelf32elocteon.c: $(srcdir)/emulparams/elf32elocteon.sh \
26977 + $(srcdir)/emulparams/elf32ebocteon.sh $(srcdir)/emulparams/elf32bmip.sh \
26978 + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/octeonelf.em \
26979 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26980 + ${GENSCRIPTS} elf32elocteon "$(tdir_elf32elocteon)"
26981 +eelf32ebocteonn32.c: $(srcdir)/emulparams/elf32ebocteonn32.sh \
26982 + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/octeonelf.em \
26983 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26984 + ${GENSCRIPTS} elf32ebocteonn32 "$(tdir_elf32ebocteonn32)"
26985 +eelf32elocteonn32.c: $(srcdir)/emulparams/elf32elocteonn32.sh \
26986 + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/octeonelf.em \
26987 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26988 + ${GENSCRIPTS} elf32elocteonn32 "$(tdir_elf32elocteonn32)"
26989 +eelf64ebocteon.c: $(srcdir)/emulparams/elf64ebocteon.sh \
26990 + $(srcdir)/emulparams/elf32ebocteon.sh \
26991 + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/octeonelf.em \
26992 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26993 + ${GENSCRIPTS} elf64ebocteon "$(tdir_elf64ebocteon)"
26994 +eelf64elocteon.c: $(srcdir)/emulparams/elf64elocteon.sh \
26995 + $(srcdir)/emulparams/elf64ebocteon.sh \
26996 + $(srcdir)/emulparams/elf32ebocteon.sh \
26997 + $(srcdir)/emultempl/elf32.em $(srcdir)/emultempl/octeonelf.em \
26998 + $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
26999 + ${GENSCRIPTS} elf64elocteon "$(tdir_elf64elocteon)"
27000 eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh $(ELF_DEPS) \
27001 $(srcdir)/emultempl/mipself.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
27002 ${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)"
27003 --- a/ld/config.in
27004 +++ b/ld/config.in
27005 @@ -4,6 +4,9 @@
27006 language is requested. */
27007 #undef ENABLE_NLS
27008
27009 +/* Define to warn for use of native system library directories */
27010 +#undef ENABLE_POISON_SYSTEM_DIRECTORIES
27011 +
27012 /* Additional extension a shared object might have. */
27013 #undef EXTRA_SHLIB_EXTENSION
27014
27015 --- a/ld/configure
27016 +++ b/ld/configure
27017 @@ -1004,6 +1004,8 @@ Optional Features:
27018 --enable-dependency-tracking do not reject slow dependency extractors
27019 --enable-targets alternative target configurations
27020 --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)
27021 + --enable-poison-system-directories
27022 + warn for use of native system library directories
27023 --enable-got=<type> GOT handling scheme (target, single, negative,
27024 multigot)
27025 --enable-werror treat compile warnings as errors
27026 @@ -3341,6 +3343,21 @@ fi;
27027
27028
27029
27030 +# Check whether --enable-poison-system-directories or --disable-poison-system-directories was given.
27031 +if test "${enable_poison_system_directories+set}" = set; then
27032 + enableval="$enable_poison_system_directories"
27033 +
27034 +else
27035 + enable_poison_system_directories=no
27036 +fi;
27037 +if test "x${enable_poison_system_directories}" = "xyes"; then
27038 +
27039 +cat >>confdefs.h <<\_ACEOF
27040 +#define ENABLE_POISON_SYSTEM_DIRECTORIES 1
27041 +_ACEOF
27042 +
27043 +fi
27044 +
27045 # Check whether --enable-got or --disable-got was given.
27046 if test "${enable_got+set}" = set; then
27047 enableval="$enable_got"
27048 @@ -5795,13 +5812,13 @@ if test "${lt_cv_nm_interface+set}" = se
27049 else
27050 lt_cv_nm_interface="BSD nm"
27051 echo "int some_variable = 0;" > conftest.$ac_ext
27052 - (eval echo "\"\$as_me:5798: $ac_compile\"" >&5)
27053 + (eval echo "\"\$as_me:5815: $ac_compile\"" >&5)
27054 (eval "$ac_compile" 2>conftest.err)
27055 cat conftest.err >&5
27056 - (eval echo "\"\$as_me:5801: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
27057 + (eval echo "\"\$as_me:5818: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
27058 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
27059 cat conftest.err >&5
27060 - (eval echo "\"\$as_me:5804: output\"" >&5)
27061 + (eval echo "\"\$as_me:5821: output\"" >&5)
27062 cat conftest.out >&5
27063 if $GREP 'External.*some_variable' conftest.out > /dev/null; then
27064 lt_cv_nm_interface="MS dumpbin"
27065 @@ -6958,7 +6975,7 @@ ia64-*-hpux*)
27066 ;;
27067 *-*-irix6*)
27068 # Find out which ABI we are using.
27069 - echo '#line 6961 "configure"' > conftest.$ac_ext
27070 + echo '#line 6978 "configure"' > conftest.$ac_ext
27071 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
27072 (eval $ac_compile) 2>&5
27073 ac_status=$?
27074 @@ -8264,11 +8281,11 @@ else
27075 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
27076 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
27077 -e 's:$: $lt_compiler_flag:'`
27078 - (eval echo "\"\$as_me:8267: $lt_compile\"" >&5)
27079 + (eval echo "\"\$as_me:8284: $lt_compile\"" >&5)
27080 (eval "$lt_compile" 2>conftest.err)
27081 ac_status=$?
27082 cat conftest.err >&5
27083 - echo "$as_me:8271: \$? = $ac_status" >&5
27084 + echo "$as_me:8288: \$? = $ac_status" >&5
27085 if (exit $ac_status) && test -s "$ac_outfile"; then
27086 # The compiler can only warn and ignore the option if not recognized
27087 # So say no if there are warnings other than the usual output.
27088 @@ -8603,11 +8620,11 @@ else
27089 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
27090 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
27091 -e 's:$: $lt_compiler_flag:'`
27092 - (eval echo "\"\$as_me:8606: $lt_compile\"" >&5)
27093 + (eval echo "\"\$as_me:8623: $lt_compile\"" >&5)
27094 (eval "$lt_compile" 2>conftest.err)
27095 ac_status=$?
27096 cat conftest.err >&5
27097 - echo "$as_me:8610: \$? = $ac_status" >&5
27098 + echo "$as_me:8627: \$? = $ac_status" >&5
27099 if (exit $ac_status) && test -s "$ac_outfile"; then
27100 # The compiler can only warn and ignore the option if not recognized
27101 # So say no if there are warnings other than the usual output.
27102 @@ -8708,11 +8725,11 @@ else
27103 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
27104 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
27105 -e 's:$: $lt_compiler_flag:'`
27106 - (eval echo "\"\$as_me:8711: $lt_compile\"" >&5)
27107 + (eval echo "\"\$as_me:8728: $lt_compile\"" >&5)
27108 (eval "$lt_compile" 2>out/conftest.err)
27109 ac_status=$?
27110 cat out/conftest.err >&5
27111 - echo "$as_me:8715: \$? = $ac_status" >&5
27112 + echo "$as_me:8732: \$? = $ac_status" >&5
27113 if (exit $ac_status) && test -s out/conftest2.$ac_objext
27114 then
27115 # The compiler can only warn and ignore the option if not recognized
27116 @@ -8763,11 +8780,11 @@ else
27117 -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
27118 -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
27119 -e 's:$: $lt_compiler_flag:'`
27120 - (eval echo "\"\$as_me:8766: $lt_compile\"" >&5)
27121 + (eval echo "\"\$as_me:8783: $lt_compile\"" >&5)
27122 (eval "$lt_compile" 2>out/conftest.err)
27123 ac_status=$?
27124 cat out/conftest.err >&5
27125 - echo "$as_me:8770: \$? = $ac_status" >&5
27126 + echo "$as_me:8787: \$? = $ac_status" >&5
27127 if (exit $ac_status) && test -s out/conftest2.$ac_objext
27128 then
27129 # The compiler can only warn and ignore the option if not recognized
27130 @@ -11575,7 +11592,7 @@ else
27131 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
27132 lt_status=$lt_dlunknown
27133 cat > conftest.$ac_ext <<_LT_EOF
27134 -#line 11578 "configure"
27135 +#line 11595 "configure"
27136 #include "confdefs.h"
27137
27138 #if HAVE_DLFCN_H
27139 @@ -11671,7 +11688,7 @@ else
27140 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
27141 lt_status=$lt_dlunknown
27142 cat > conftest.$ac_ext <<_LT_EOF
27143 -#line 11674 "configure"
27144 +#line 11691 "configure"
27145 #include "confdefs.h"
27146
27147 #if HAVE_DLFCN_H
27148 --- a/ld/configure.in
27149 +++ b/ld/configure.in
27150 @@ -68,6 +68,16 @@ AC_SUBST(use_sysroot)
27151 AC_SUBST(TARGET_SYSTEM_ROOT)
27152 AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
27153
27154 +AC_ARG_ENABLE([poison-system-directories],
27155 + AS_HELP_STRING([--enable-poison-system-directories],
27156 + [warn for use of native system library directories]),,
27157 + [enable_poison_system_directories=no])
27158 +if test "x${enable_poison_system_directories}" = "xyes"; then
27159 + AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
27160 + [1],
27161 + [Define to warn for use of native system library directories])
27162 +fi
27163 +
27164 AC_ARG_ENABLE([got],
27165 AS_HELP_STRING([--enable-got=<type>],
27166 [GOT handling scheme (target, single, negative, multigot)]),
27167 --- a/ld/configure.tgt
27168 +++ b/ld/configure.tgt
27169 @@ -380,6 +380,9 @@ mips*vr4100el-*-elf*) targ_emul=elf32l43
27170 mips*vr4100-*-elf*) targ_emul=elf32b4300 ;;
27171 mips*vr5000el-*-elf*) targ_emul=elf32l4300 ;;
27172 mips*vr5000-*-elf*) targ_emul=elf32b4300 ;;
27173 +mips64octeon*-*-elf*) targ_emul=elf32ebocteon
27174 + targ_extra_emuls="elf32elocteon elf32ebocteonn32 elf32elocteonn32 elf64ebocteon elf64elocteon"
27175 + ;;
27176 mips*el-sde-elf*) targ_emul=elf32ltsmip
27177 targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip" ;;
27178 mips*-sde-elf*) targ_emul=elf32btsmip
27179 @@ -392,6 +395,10 @@ mips*el-*-vxworks*) targ_emul=elf32elmip
27180 mips*-*-vxworks*) targ_emul=elf32ebmipvxworks
27181 targ_extra_emuls="elf32elmipvxworks" ;;
27182 mips*-*-windiss) targ_emul=elf32mipswindiss ;;
27183 +mips64el-sicortex-linux-gnu)
27184 + targ_emul=elf64ltsmip
27185 + targ_extra_emuls="elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip elf64btsmip"
27186 + targ_extra_libpath=$targ_extra_emuls ;;
27187 mips64*el-*-linux-*) targ_emul=elf32ltsmipn32
27188 targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
27189 targ_extra_libpath=$targ_extra_emuls ;;
27190 --- a/ld/emulparams/armelf.sh
27191 +++ b/ld/emulparams/armelf.sh
27192 @@ -6,7 +6,7 @@ LITTLE_OUTPUT_FORMAT="elf32-littlearm"
27193 TEXT_START_ADDR=0x8000
27194 TEMPLATE_NAME=elf32
27195 EXTRA_EM_FILE=armelf
27196 -OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.v4_bx)'
27197 +OTHER_TEXT_SECTIONS='*(.glue_7t) *(.glue_7) *(.vfp11_veneer) *(.janus_2cc_veneer) *(.v4_bx)'
27198 OTHER_BSS_SYMBOLS='__bss_start__ = .;'
27199 OTHER_BSS_END_SYMBOLS='_bss_end__ = . ; __bss_end__ = . ;'
27200 OTHER_END_SYMBOLS='__end__ = . ;'
27201 --- a/ld/emulparams/elf32ebmipvxworks.sh
27202 +++ b/ld/emulparams/elf32ebmipvxworks.sh
27203 @@ -13,6 +13,9 @@ OTHER_READWRITE_SECTIONS="
27204 .rdata ${RELOCATING-0} : ONLY_IF_RW { *(.rdata) }
27205 "
27206 unset OTHER_GOT_SYMBOLS
27207 +unset GOT
27208 +unset GOTPLT
27209 +unset DATA_GOTPLT
27210 SHLIB_TEXT_START_ADDR=0
27211 unset TEXT_DYNAMIC
27212 unset DATA_ADDR
27213 --- /dev/null
27214 +++ b/ld/emulparams/elf32ebocteon.sh
27215 @@ -0,0 +1,45 @@
27216 +# If you change this file, please also look at files which source this one:
27217 +# elf32locteon.sh
27218 +
27219 +EMBEDDED=yes
27220 +. ${srcdir}/emulparams/elf32btsmip.sh
27221 +
27222 +# Entry point symbol.
27223 +ENTRY=__start
27224 +
27225 +# Start of the .text section
27226 +TEXT_START_ADDR=0x10000000
27227 +
27228 +# Data and .cmvx_shared are 32M pages. Unlike what the documentation says we
27229 +# always use (ALIGN(MAXPAGESIZE) + (. & (MAXPAGESIZE - COMMONPAGESIZE))) to
27230 +# align data. On-disk image will have at most 4K (ELF_MAXPAGESIZE) padding
27231 +# before data.
27232 +MAXPAGESIZE=32M
27233 +COMMONPAGESIZE=32M
27234 +# Needed to disable demand paging.
27235 +EXTRA_EM_FILE=octeonelf
27236 +
27237 +# If defined, the genscripts.sh script sets TEXT_START_ADDR to its value
27238 +# for the -n/-N options.
27239 +# Define this as the TEXT_START_ADDR is different to overright the one
27240 +# defined in elf32bmip.sh
27241 +NONPAGED_TEXT_START_ADDR=0x10000000
27242 +
27243 +# Create new macro to place .cvmx_shared at the end of _end.
27244 +OCTEON_SPECIAL_SECTIONS='
27245 + . = ALIGN(32M); /* RBF added alignment of data */
27246 + __cvmx_shared_start = .;
27247 + .cvmx_shared : { *(.cvmx_shared .cvmx_shared.linkonce.*) }
27248 + .cvmx_shared_bss : { *(.cvmx_shared_bss .cvmx_shared_bss.linkonce.*) }
27249 + __cvmx_shared_end = .;'
27250 +
27251 +OTHER_END_SYMBOLS='
27252 + /* All symbols above this (32 bit compat space) the simulator will attribute
27253 + to the bootloader. */
27254 + __bootloader = 0xFFFFFFF8;'
27255 +
27256 +EXECUTABLE_SYMBOLS='
27257 + PROVIDE(__cvmx_app_init = 0);
27258 + PROVIDE(__cvmx_app_exit = 0);
27259 + PROVIDE(__cvmx_pci_console_write = 0);
27260 + PROVIDE(__cvmx_pci_console_read = 0);'
27261 --- /dev/null
27262 +++ b/ld/emulparams/elf32ebocteonn32.sh
27263 @@ -0,0 +1,6 @@
27264 +EMBEDDED=yes
27265 +. ${srcdir}/emulparams/elf32ebocteon.sh
27266 +
27267 +OUTPUT_FORMAT="elf32-ntradbigmips"
27268 +BIG_OUTPUT_FORMAT="elf32-ntradbigmips"
27269 +LITTLE_OUTPUT_FORMAT="elf32-ntradlittlemips"
27270 --- a/ld/emulparams/elf32elmipvxworks.sh
27271 +++ b/ld/emulparams/elf32elmipvxworks.sh
27272 @@ -4,6 +4,9 @@ OUTPUT_FORMAT="elf32-littlemips-vxworks"
27273 BIG_OUTPUT_FORMAT="elf32-bigmips-vxworks"
27274 LITTLE_OUTPUT_FORMAT="elf32-littlemips-vxworks"
27275 unset OTHER_GOT_SYMBOLS
27276 +unset GOT
27277 +unset GOTPLT
27278 +unset DATA_GOTPLT
27279 SHLIB_TEXT_START_ADDR=0
27280 unset TEXT_DYNAMIC
27281 unset DATA_ADDR
27282 --- /dev/null
27283 +++ b/ld/emulparams/elf32elocteon.sh
27284 @@ -0,0 +1,2 @@
27285 +. ${srcdir}/emulparams/elf32ebocteon.sh
27286 +OUTPUT_FORMAT=$LITTLE_OUTPUT_FORMAT
27287 --- /dev/null
27288 +++ b/ld/emulparams/elf32elocteonn32.sh
27289 @@ -0,0 +1,2 @@
27290 +. ${srcdir}/emulparams/elf32ebocteonn32.sh
27291 +OUTPUT_FORMAT="elf32-ntradlittlemips"
27292 --- /dev/null
27293 +++ b/ld/emulparams/elf64ebocteon.sh
27294 @@ -0,0 +1,6 @@
27295 +EMBEDDED=yes
27296 +. ${srcdir}/emulparams/elf32ebocteon.sh
27297 +
27298 +OUTPUT_FORMAT="elf64-tradbigmips"
27299 +BIG_OUTPUT_FORMAT="elf64-tradbigmips"
27300 +LITTLE_OUTPUT_FORMAT="elf64-tradlittlemips"
27301 --- /dev/null
27302 +++ b/ld/emulparams/elf64elocteon.sh
27303 @@ -0,0 +1,2 @@
27304 +. ${srcdir}/emulparams/elf64ebocteon.sh
27305 +OUTPUT_FORMAT=$LITTLE_OUTPUT_FORMAT
27306 --- a/ld/emultempl/armelf.em
27307 +++ b/ld/emultempl/armelf.em
27308 @@ -31,13 +31,14 @@ fragment <<EOF
27309 #include "elf/arm.h"
27310
27311 static char *thumb_entry_symbol = NULL;
27312 -static bfd *bfd_for_interwork;
27313 static int byteswap_code = 0;
27314 static int target1_is_rel = 0${TARGET1_IS_REL};
27315 static char *target2_type = "${TARGET2_TYPE}";
27316 static int fix_v4bx = 0;
27317 static int use_blx = 0;
27318 static bfd_arm_vfp11_fix vfp11_denorm_fix = BFD_ARM_VFP11_FIX_DEFAULT;
27319 +static int fix_janus_2cc = 0;
27320 +static int fix_cortex_a8 = -1;
27321 static int no_enum_size_warning = 0;
27322 static int no_wchar_size_warning = 0;
27323 static int pic_veneer = 0;
27324 @@ -53,67 +54,21 @@ gld${EMULATION_NAME}_before_parse (void)
27325 }
27326
27327 static void
27328 -arm_elf_after_open (void)
27329 -{
27330 - {
27331 - LANG_FOR_EACH_INPUT_STATEMENT (is)
27332 - {
27333 - bfd_elf32_arm_add_glue_sections_to_bfd (is->the_bfd, & link_info);
27334 - }
27335 - }
27336 -
27337 - /* Call the standard elf routine. */
27338 - gld${EMULATION_NAME}_after_open ();
27339 -}
27340 -
27341 -static void
27342 -arm_elf_set_bfd_for_interworking (lang_statement_union_type *statement)
27343 -{
27344 - if (statement->header.type == lang_input_section_enum)
27345 - {
27346 - asection *i = statement->input_section.section;
27347 -
27348 - if (!((lang_input_statement_type *) i->owner->usrdata)->just_syms_flag
27349 - && (i->flags & SEC_EXCLUDE) == 0)
27350 - {
27351 - asection *output_section = i->output_section;
27352 -
27353 - ASSERT (output_section->owner == link_info.output_bfd);
27354 -
27355 - /* Don't attach the interworking stubs to a dynamic object, to
27356 - an empty section, etc. */
27357 - if ((output_section->flags & SEC_HAS_CONTENTS) != 0
27358 - && (i->flags & SEC_NEVER_LOAD) == 0
27359 - && ! (i->owner->flags & DYNAMIC))
27360 - bfd_for_interwork = i->owner;
27361 - }
27362 - }
27363 -}
27364 -
27365 -static void
27366 arm_elf_before_allocation (void)
27367 {
27368 - if (link_info.input_bfds != NULL)
27369 - {
27370 - /* The interworking bfd must be the last one in the link. */
27371 - bfd_for_interwork = NULL;
27372 -
27373 - lang_for_each_statement (arm_elf_set_bfd_for_interworking);
27374 -
27375 - /* If bfd_for_interwork is NULL, then there are no loadable sections
27376 - with real contents to be linked, so we are not going to have to
27377 - create any interworking stubs, so it is OK not to call
27378 - bfd_elf32_arm_get_bfd_for_interworking. */
27379 - if (bfd_for_interwork != NULL)
27380 - bfd_elf32_arm_get_bfd_for_interworking (bfd_for_interwork, &link_info);
27381 - }
27382 -
27383 bfd_elf32_arm_set_byteswap_code (&link_info, byteswap_code);
27384
27385 /* Choose type of VFP11 erratum fix, or warn if specified fix is unnecessary
27386 due to architecture version. */
27387 bfd_elf32_arm_set_vfp11_fix (link_info.output_bfd, &link_info);
27388
27389 + /* Make sure we haven't selected the Janus 2CC fix on an architecture for
27390 + which it is unnecessary. */
27391 + bfd_elf32_arm_validate_janus_2cc_fix (link_info.output_bfd, &link_info);
27392 +
27393 + /* Auto-select Cortex-A8 erratum fix if it wasn't explicitly specified. */
27394 + bfd_elf32_arm_set_cortex_a8_fix (link_info.output_bfd, &link_info);
27395 +
27396 /* We should be able to set the size of the interworking stub section. We
27397 can't do it until later if we have dynamic sections, though. */
27398 if (! elf_hash_table (&link_info)->dynamic_sections_created)
27399 @@ -126,17 +81,19 @@ arm_elf_before_allocation (void)
27400
27401 if (!bfd_elf32_arm_process_before_allocation (is->the_bfd,
27402 &link_info)
27403 - || !bfd_elf32_arm_vfp11_erratum_scan (is->the_bfd, &link_info))
27404 + || !bfd_elf32_arm_vfp11_erratum_scan (is->the_bfd, &link_info)
27405 + || !bfd_elf32_arm_janus_2cc_erratum_scan (is->the_bfd,
27406 + &link_info))
27407 /* xgettext:c-format */
27408 einfo (_("Errors encountered processing file %s"), is->filename);
27409 }
27410 +
27411 + /* We have seen it all. Allocate it, and carry on. */
27412 + bfd_elf32_arm_allocate_interworking_sections (& link_info);
27413 }
27414
27415 /* Call the standard elf routine. */
27416 gld${EMULATION_NAME}_before_allocation ();
27417 -
27418 - /* We have seen it all. Allocate it, and carry on. */
27419 - bfd_elf32_arm_allocate_interworking_sections (& link_info);
27420 }
27421
27422 static void
27423 @@ -150,7 +107,7 @@ arm_elf_after_allocation (void)
27424 {
27425 /* Figure out where VFP11 erratum veneers (and the labels returning
27426 from same) have been placed. */
27427 - bfd_elf32_arm_vfp11_fix_veneer_locations (is->the_bfd, &link_info);
27428 + bfd_elf32_arm_fix_veneer_locations (is->the_bfd, &link_info);
27429 }
27430 }
27431 }
27432 @@ -213,9 +170,9 @@ hook_in_stub (struct hook_stub_info *inf
27433 if (l->input_section.section == info->input_section)
27434 {
27435 /* We've found our section. Insert the stub immediately
27436 - before its associated input section. */
27437 - *lp = info->add.head;
27438 - *(info->add.tail) = l;
27439 + after its associated input section. */
27440 + *(info->add.tail) = l->header.next;
27441 + l->header.next = info->add.head;
27442 return TRUE;
27443 }
27444 break;
27445 @@ -244,7 +201,7 @@ hook_in_stub (struct hook_stub_info *inf
27446 /* Call-back for elf32_arm_size_stubs. */
27447
27448 /* Create a new stub section, and arrange for it to be linked
27449 - immediately before INPUT_SECTION. */
27450 + immediately after INPUT_SECTION. */
27451
27452 static asection *
27453 elf32_arm_add_stub_section (const char *stub_sec_name,
27454 @@ -312,10 +269,78 @@ build_section_lists (lang_statement_unio
27455 }
27456 }
27457
27458 +static int
27459 +compare_output_sec_vma (const void *a, const void *b)
27460 +{
27461 + asection *asec = *(asection **) a, *bsec = *(asection **) b;
27462 + asection *aout = asec->output_section, *bout = bsec->output_section;
27463 + bfd_vma avma, bvma;
27464 +
27465 + /* If there's no output section for some reason, compare equal. */
27466 + if (!aout || !bout)
27467 + return 0;
27468 +
27469 + avma = aout->vma + asec->output_offset;
27470 + bvma = bout->vma + bsec->output_offset;
27471 +
27472 + if (avma > bvma)
27473 + return 1;
27474 + else if (avma < bvma)
27475 + return -1;
27476 +
27477 + return 0;
27478 +}
27479 +
27480 static void
27481 gld${EMULATION_NAME}_finish (void)
27482 {
27483 struct bfd_link_hash_entry * h;
27484 + unsigned int list_size = 10;
27485 + asection **sec_list = xmalloc (list_size * sizeof (asection *));
27486 + unsigned int sec_count = 0;
27487 +
27488 + if (!link_info.relocatable)
27489 + {
27490 + /* Build a sorted list of input text sections, then use that to process
27491 + the unwind table index. */
27492 + LANG_FOR_EACH_INPUT_STATEMENT (is)
27493 + {
27494 + bfd *abfd = is->the_bfd;
27495 + asection *sec;
27496 +
27497 + if ((abfd->flags & (EXEC_P | DYNAMIC)) != 0)
27498 + continue;
27499 +
27500 + for (sec = abfd->sections; sec != NULL; sec = sec->next)
27501 + {
27502 + asection *out_sec = sec->output_section;
27503 +
27504 + if (out_sec
27505 + && elf_section_type (sec) == SHT_PROGBITS
27506 + && (elf_section_flags (sec) & SHF_EXECINSTR) != 0
27507 + && (sec->flags & SEC_EXCLUDE) == 0
27508 + && sec->sec_info_type != ELF_INFO_TYPE_JUST_SYMS
27509 + && out_sec != bfd_abs_section_ptr)
27510 + {
27511 + if (sec_count == list_size)
27512 + {
27513 + list_size *= 2;
27514 + sec_list = xrealloc (sec_list,
27515 + list_size * sizeof (asection *));
27516 + }
27517 +
27518 + sec_list[sec_count++] = sec;
27519 + }
27520 + }
27521 + }
27522 +
27523 + qsort (sec_list, sec_count, sizeof (asection *), &compare_output_sec_vma);
27524 +
27525 + if (elf32_arm_fix_exidx_coverage (sec_list, sec_count, &link_info))
27526 + need_laying_out = 1;
27527 +
27528 + free (sec_list);
27529 + }
27530
27531 /* bfd_elf32_discard_info just plays with debugging sections,
27532 ie. doesn't affect any code, so we can delay resizing the
27533 @@ -444,7 +469,7 @@ arm_elf_create_output_section_statements
27534 target2_type, fix_v4bx, use_blx,
27535 vfp11_denorm_fix, no_enum_size_warning,
27536 no_wchar_size_warning,
27537 - pic_veneer);
27538 + pic_veneer, fix_janus_2cc, fix_cortex_a8);
27539
27540 stub_file = lang_add_input_file ("linker stubs",
27541 lang_input_file_is_fake_enum,
27542 @@ -461,6 +486,10 @@ arm_elf_create_output_section_statements
27543
27544 stub_file->the_bfd->flags |= BFD_LINKER_CREATED;
27545 ldlang_add_file (stub_file);
27546 +
27547 + /* Also use the stub file for stubs placed in a single output section. */
27548 + bfd_elf32_arm_add_glue_sections_to_bfd (stub_file->the_bfd, &link_info);
27549 + bfd_elf32_arm_get_bfd_for_interworking (stub_file->the_bfd, &link_info);
27550 }
27551
27552 /* Avoid processing the fake stub_file in vercheck, stat_needed and
27553 @@ -500,8 +529,11 @@ PARSE_AND_LIST_PROLOGUE='
27554 #define OPTION_NO_ENUM_SIZE_WARNING 309
27555 #define OPTION_PIC_VENEER 310
27556 #define OPTION_FIX_V4BX_INTERWORKING 311
27557 -#define OPTION_STUBGROUP_SIZE 312
27558 +#define OPTION_STUBGROUP_SIZE 312
27559 #define OPTION_NO_WCHAR_SIZE_WARNING 313
27560 +#define OPTION_FIX_JANUS_2CC 314
27561 +#define OPTION_FIX_CORTEX_A8 315
27562 +#define OPTION_NO_FIX_CORTEX_A8 316
27563 '
27564
27565 PARSE_AND_LIST_SHORTOPTS=p
27566 @@ -521,6 +553,9 @@ PARSE_AND_LIST_LONGOPTS='
27567 { "pic-veneer", no_argument, NULL, OPTION_PIC_VENEER},
27568 { "stub-group-size", required_argument, NULL, OPTION_STUBGROUP_SIZE },
27569 { "no-wchar-size-warning", no_argument, NULL, OPTION_NO_WCHAR_SIZE_WARNING},
27570 + { "fix-janus-2cc", no_argument, NULL, OPTION_FIX_JANUS_2CC},
27571 + { "fix-cortex-a8", no_argument, NULL, OPTION_FIX_CORTEX_A8},
27572 + { "no-fix-cortex-a8", no_argument, NULL, OPTION_NO_FIX_CORTEX_A8},
27573 '
27574
27575 PARSE_AND_LIST_OPTIONS='
27576 @@ -541,12 +576,14 @@ PARSE_AND_LIST_OPTIONS='
27577 fprintf (file, _("\
27578 --stub-group-size=N Maximum size of a group of input sections that can be\n\
27579 handled by one stub section. A negative value\n\
27580 - locates all stubs before their branches (with a\n\
27581 + locates all stubs after their branches (with a\n\
27582 group size of -N), while a positive value allows\n\
27583 two groups of input sections, one before, and one\n\
27584 after each stub section. Values of +/-1 indicate\n\
27585 the linker should choose suitable defaults.\n"
27586 ));
27587 + fprintf (file, _(" --fix-janus-2cc Enable Janus 2CC erratum fix\n"));
27588 + fprintf (file, _(" --[no-]fix-cortex-a8 Disable/enable Cortex-A8 Thumb-2 branch erratum fix\n"));
27589 '
27590
27591 PARSE_AND_LIST_ARGS_CASES='
27592 @@ -618,11 +655,22 @@ PARSE_AND_LIST_ARGS_CASES='
27593 einfo (_("%P%F: invalid number `%s'\''\n"), optarg);
27594 }
27595 break;
27596 +
27597 + case OPTION_FIX_JANUS_2CC:
27598 + fix_janus_2cc = 1;
27599 + break;
27600 +
27601 + case OPTION_FIX_CORTEX_A8:
27602 + fix_cortex_a8 = 1;
27603 + break;
27604 +
27605 + case OPTION_NO_FIX_CORTEX_A8:
27606 + fix_cortex_a8 = 0;
27607 + break;
27608 '
27609
27610 -# We have our own after_open and before_allocation functions, but they call
27611 +# We have our own before_allocation etc. functions, but they call
27612 # the standard routines, so give them a different name.
27613 -LDEMUL_AFTER_OPEN=arm_elf_after_open
27614 LDEMUL_BEFORE_ALLOCATION=arm_elf_before_allocation
27615 LDEMUL_AFTER_ALLOCATION=arm_elf_after_allocation
27616 LDEMUL_CREATE_OUTPUT_SECTION_STATEMENTS=arm_elf_create_output_section_statements
27617 --- a/ld/emultempl/m68kelf.em
27618 +++ b/ld/emultempl/m68kelf.em
27619 @@ -33,10 +33,7 @@ esac
27620
27621 case ${target} in
27622 *-linux*)
27623 -# Don't use multi-GOT by default due to glibc linker's assumption
27624 -# that GOT pointer points to GOT[0].
27625 -# got_handling_target_default=GOT_HANDLING_MULTIGOT
27626 - got_handling_target_default=GOT_HANDLING_SINGLE
27627 + got_handling_target_default=GOT_HANDLING_MULTIGOT
27628 ;;
27629 *)
27630 got_handling_target_default=GOT_HANDLING_SINGLE
27631 --- /dev/null
27632 +++ b/ld/emultempl/octeonelf.em
27633 @@ -0,0 +1,42 @@
27634 +# This shell script emits a C file. -*- C -*-
27635 +# Copyright (C) 2007 Cavium Networks.
27636 +#
27637 +# This file is part of GLD, the Gnu Linker.
27638 +#
27639 +# This program is free software; you can redistribute it and/or modify
27640 +# it under the terms of the GNU General Public License as published by
27641 +# the Free Software Foundation; either version 2 of the License, or
27642 +# (at your option) any later version.
27643 +#
27644 +# This program is distributed in the hope that it will be useful,
27645 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
27646 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27647 +# GNU General Public License for more details.
27648 +#
27649 +# You should have received a copy of the GNU General Public License
27650 +# along with this program; if not, write to the Free Software
27651 +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
27652 +#
27653 +
27654 +# This file is sourced from elf32.em and used to define OCTEON and ELF
27655 +# specific things.
27656 +
27657 +source_em ${srcdir}/emultempl/mipself.em
27658 +
27659 +fragment <<EOF
27660 +
27661 +static void
27662 +elfocteon_before_parse (void)
27663 +{
27664 + gld${EMULATION_NAME}_before_parse ();
27665 +
27666 + /* To be able to directly map file blocks to memory blocks, demand paging
27667 + requires addresses and file offsets to be equal modulo the page size
27668 + (64K). We also want segment virtual addresses to be 32M aligned which
27669 + would require extensive padding in the file up to pagesize. Instead
27670 + disable demand paging which is not used on our embedded target. */
27671 + config.magic_demand_paged = FALSE;
27672 +}
27673 +EOF
27674 +
27675 +LDEMUL_BEFORE_PARSE=elfocteon_before_parse
27676 --- a/ld/ld.h
27677 +++ b/ld/ld.h
27678 @@ -177,6 +177,14 @@ typedef struct {
27679 input files. */
27680 bfd_boolean accept_unknown_input_arch;
27681
27682 + /* If TRUE (the default) warn for uses of system directories when
27683 + cross linking. */
27684 + bfd_boolean poison_system_directories;
27685 +
27686 + /* If TRUE (default FALSE) give an error for uses of system
27687 + directories when cross linking instead of a warning. */
27688 + bfd_boolean error_poison_system_directories;
27689 +
27690 /* Big or little endian as set on command line. */
27691 enum { ENDIAN_UNSET = 0, ENDIAN_BIG, ENDIAN_LITTLE } endian;
27692
27693 --- a/ld/ld.texinfo
27694 +++ b/ld/ld.texinfo
27695 @@ -335,11 +335,20 @@ prefixed by @samp{-Wl,} (or whatever is
27696 compiler driver) like this:
27697
27698 @smallexample
27699 - gcc -Wl,--startgroup foo.o bar.o -Wl,--endgroup
27700 + gcc -Wl,--start-group foo.o bar.o -Wl,--end-group
27701 @end smallexample
27702
27703 This is important, because otherwise the compiler driver program may
27704 -silently drop the linker options, resulting in a bad link.
27705 +silently drop the linker options, resulting in a bad link. Confusion
27706 +may also arise when passing options that require values through a
27707 +driver, as the use of a space between option and argument acts as
27708 +a separator, and causes the driver to pass only the option to the linker
27709 +and the argument to the compiler. In this case, it is simplest to use
27710 +the joined forms of both single- and multiple-letter options, such as:
27711 +
27712 +@smallexample
27713 + gcc foo.o bar.o -Wl,-eENTRY -Wl,-Map=a.map
27714 +@end smallexample
27715
27716 Here is a table of the generic command line switches accepted by the GNU
27717 linker:
27718 @@ -347,8 +356,8 @@ linker:
27719 @table @gcctabopt
27720 @include at-file.texi
27721
27722 -@kindex -a@var{keyword}
27723 -@item -a@var{keyword}
27724 +@kindex -a @var{keyword}
27725 +@item -a @var{keyword}
27726 This option is supported for HP/UX compatibility. The @var{keyword}
27727 argument must be one of the strings @samp{archive}, @samp{shared}, or
27728 @samp{default}. @samp{-aarchive} is functionally equivalent to
27729 @@ -357,8 +366,8 @@ to @samp{-Bdynamic}. This option may be
27730
27731 @ifset I960
27732 @cindex architectures
27733 -@kindex -A@var{arch}
27734 -@item -A@var{architecture}
27735 +@kindex -A @var{arch}
27736 +@item -A @var{architecture}
27737 @kindex --architecture=@var{arch}
27738 @itemx --architecture=@var{architecture}
27739 In the current release of @command{ld}, this option is useful only for the
27740 @@ -514,10 +523,10 @@ Link big-endian objects. This affects t
27741 Link little-endian objects. This affects the default output format.
27742 @end ifclear
27743
27744 -@kindex -f
27745 -@kindex --auxiliary
27746 -@item -f
27747 -@itemx --auxiliary @var{name}
27748 +@kindex -f @var{name}
27749 +@kindex --auxiliary=@var{name}
27750 +@item -f @var{name}
27751 +@itemx --auxiliary=@var{name}
27752 When creating an ELF shared object, set the internal DT_AUXILIARY field
27753 to the specified name. This tells the dynamic linker that the symbol
27754 table of the shared object should be used as an auxiliary filter on the
27755 @@ -536,10 +545,10 @@ machine specific performance.
27756 This option may be specified more than once. The DT_AUXILIARY entries
27757 will be created in the order in which they appear on the command line.
27758
27759 -@kindex -F
27760 -@kindex --filter
27761 +@kindex -F @var{name}
27762 +@kindex --filter=@var{name}
27763 @item -F @var{name}
27764 -@itemx --filter @var{name}
27765 +@itemx --filter=@var{name}
27766 When creating an ELF shared object, set the internal DT_FILTER field to
27767 the specified name. This tells the dynamic linker that the symbol table
27768 of the shared object which is being created should be used as a filter
27769 @@ -566,8 +575,8 @@ The @sc{gnu} linker will ignore the @opt
27770 creating an ELF shared object.
27771
27772 @cindex finalization function
27773 -@kindex -fini
27774 -@item -fini @var{name}
27775 +@kindex -fini=@var{name}
27776 +@item -fini=@var{name}
27777 When creating an ELF executable or shared object, call NAME when the
27778 executable or shared object is unloaded, by setting DT_FINI to the
27779 address of the function. By default, the linker uses @code{_fini} as
27780 @@ -577,10 +586,10 @@ the function to call.
27781 @item -g
27782 Ignored. Provided for compatibility with other tools.
27783
27784 -@kindex -G
27785 -@kindex --gpsize
27786 +@kindex -G @var{value}
27787 +@kindex --gpsize=@var{value}
27788 @cindex object size
27789 -@item -G@var{value}
27790 +@item -G @var{value}
27791 @itemx --gpsize=@var{value}
27792 Set the maximum size of objects to be optimized using the GP register to
27793 @var{size}. This is only meaningful for object file formats such as
27794 @@ -588,9 +597,9 @@ MIPS ECOFF which supports putting large
27795 sections. This is ignored for other object file formats.
27796
27797 @cindex runtime library name
27798 -@kindex -h@var{name}
27799 +@kindex -h @var{name}
27800 @kindex -soname=@var{name}
27801 -@item -h@var{name}
27802 +@item -h @var{name}
27803 @itemx -soname=@var{name}
27804 When creating an ELF shared object, set the internal DT_SONAME field to
27805 the specified name. When an executable is linked with a shared object
27806 @@ -604,17 +613,17 @@ field rather than the using the file nam
27807 Perform an incremental link (same as option @samp{-r}).
27808
27809 @cindex initialization function
27810 -@kindex -init
27811 -@item -init @var{name}
27812 +@kindex -init=@var{name}
27813 +@item -init=@var{name}
27814 When creating an ELF executable or shared object, call NAME when the
27815 executable or shared object is loaded, by setting DT_INIT to the address
27816 of the function. By default, the linker uses @code{_init} as the
27817 function to call.
27818
27819 @cindex archive files, from cmd line
27820 -@kindex -l@var{namespec}
27821 +@kindex -l @var{namespec}
27822 @kindex --library=@var{namespec}
27823 -@item -l@var{namespec}
27824 +@item -l @var{namespec}
27825 @itemx --library=@var{namespec}
27826 Add the archive or object file specified by @var{namespec} to the
27827 list of files to link. This option may be used any number of times.
27828 @@ -650,9 +659,9 @@ behaviour of the AIX linker.
27829 @end ifset
27830
27831 @cindex search directory, from cmd line
27832 -@kindex -L@var{dir}
27833 +@kindex -L @var{dir}
27834 @kindex --library-path=@var{dir}
27835 -@item -L@var{searchdir}
27836 +@item -L @var{searchdir}
27837 @itemx --library-path=@var{searchdir}
27838 Add path @var{searchdir} to the list of paths that @command{ld} will search
27839 for archive libraries and @command{ld} control scripts. You may use this
27840 @@ -660,7 +669,9 @@ option any number of times. The directo
27841 in which they are specified on the command line. Directories specified
27842 on the command line are searched before the default directories. All
27843 @option{-L} options apply to all @option{-l} options, regardless of the
27844 -order in which the options appear.
27845 +order in which the options appear. @option{-L} options do not affect
27846 +how @command{ld} searches for a linker script unless @option{-T}
27847 +option is specified.
27848
27849 If @var{searchdir} begins with @code{=}, then the @code{=} will be replaced
27850 by the @dfn{sysroot prefix}, a path specified when the linker is configured.
27851 @@ -677,7 +688,7 @@ at the point in which the linker script
27852
27853 @cindex emulation
27854 @kindex -m @var{emulation}
27855 -@item -m@var{emulation}
27856 +@item -m @var{emulation}
27857 Emulate the @var{emulation} linker. You can list the available
27858 emulations with the @samp{--verbose} or @samp{-V} options.
27859
27860 @@ -1244,8 +1255,8 @@ duplicate when there are many dynamic mo
27861 paths for runtime symbol resolution.
27862
27863 @cindex symbols, from command line
27864 -@kindex --defsym @var{symbol}=@var{exp}
27865 -@item --defsym @var{symbol}=@var{expression}
27866 +@kindex --defsym=@var{symbol}=@var{exp}
27867 +@item --defsym=@var{symbol}=@var{expression}
27868 Create a global symbol in the output file, containing the absolute
27869 address given by @var{expression}. You may use this option as many
27870 times as necessary to define multiple symbols in the command line. A
27871 @@ -1275,8 +1286,9 @@ is set. These options may be used to ov
27872
27873 @cindex dynamic linker, from command line
27874 @kindex -I@var{file}
27875 -@kindex --dynamic-linker @var{file}
27876 -@item --dynamic-linker @var{file}
27877 +@kindex --dynamic-linker=@var{file}
27878 +@item -I@var{file}
27879 +@itemx --dynamic-linker=@var{file}
27880 Set the name of the dynamic linker. This is only meaningful when
27881 generating dynamically linked ELF executables. The default dynamic
27882 linker is normally correct; don't use this unless you know what you are
27883 @@ -1347,8 +1359,8 @@ Print a summary of the command-line opti
27884 @item --target-help
27885 Print a summary of all target specific options on the standard output and exit.
27886
27887 -@kindex -Map
27888 -@item -Map @var{mapfile}
27889 +@kindex -Map=@var{mapfile}
27890 +@item -Map=@var{mapfile}
27891 Print a link map to the file @var{mapfile}. See the description of the
27892 @option{-M} option, above.
27893
27894 @@ -1463,8 +1475,8 @@ command line. Library directories speci
27895 (including linker scripts specified on the command line) are ignored.
27896
27897 @ifclear SingleFormat
27898 -@kindex --oformat
27899 -@item --oformat @var{output-format}
27900 +@kindex --oformat=@var{output-format}
27901 +@item --oformat=@var{output-format}
27902 @command{ld} may be configured to support more than one kind of object
27903 file. If your @command{ld} is configured this way, you can use the
27904 @samp{--oformat} option to specify the binary format for the output
27905 @@ -1542,7 +1554,8 @@ but ignored.
27906 @cindex retaining specified symbols
27907 @cindex stripping all but some symbols
27908 @cindex symbols, retaining selectively
27909 -@item --retain-symbols-file @var{filename}
27910 +@kindex --retain-symbols-file=@var{filename}
27911 +@item --retain-symbols-file=@var{filename}
27912 Retain @emph{only} the symbols listed in the file @var{filename},
27913 discarding all others. @var{filename} is simply a flat file, with one
27914 symbol name per line. This option is especially useful in environments
27915 @@ -1559,9 +1572,9 @@ You may only specify @samp{--retain-symb
27916 line. It overrides @samp{-s} and @samp{-S}.
27917
27918 @ifset GENERIC
27919 -@item -rpath @var{dir}
27920 +@item -rpath=@var{dir}
27921 @cindex runtime library search path
27922 -@kindex -rpath
27923 +@kindex -rpath=@var{dir}
27924 Add a directory to the runtime library search path. This is used when
27925 linking an ELF executable with shared objects. All @option{-rpath}
27926 arguments are concatenated and passed to the runtime linker, which uses
27927 @@ -1587,8 +1600,8 @@ the @option{-rpath} option.
27928
27929 @ifset GENERIC
27930 @cindex link-time runtime library search path
27931 -@kindex -rpath-link
27932 -@item -rpath-link @var{DIR}
27933 +@kindex -rpath-link=@var{dir}
27934 +@item -rpath-link=@var{dir}
27935 When using ELF or SunOS, one shared library may require another. This
27936 happens when an @code{ld -shared} link includes a shared library as one
27937 of the input files.
27938 @@ -1656,8 +1669,10 @@ and SunOS platforms. On SunOS, the link
27939 shared library if the @option{-e} option is not used and there are
27940 undefined symbols in the link.
27941
27942 -@item --sort-common [= ascending | descending]
27943 @kindex --sort-common
27944 +@item --sort-common
27945 +@itemx --sort-common=ascending
27946 +@itemx --sort-common=descending
27947 This option tells @command{ld} to sort the common symbols by alignment in
27948 ascending or descending order when it places them in the appropriate output
27949 sections. The symbol alignments considered are sixteen-byte or larger,
27950 @@ -1665,24 +1680,24 @@ eight-byte, four-byte, two-byte, and one
27951 between symbols due to alignment constraints. If no sorting order is
27952 specified, then descending order is assumed.
27953
27954 -@kindex --sort-section name
27955 -@item --sort-section name
27956 +@kindex --sort-section=name
27957 +@item --sort-section=name
27958 This option will apply @code{SORT_BY_NAME} to all wildcard section
27959 patterns in the linker script.
27960
27961 -@kindex --sort-section alignment
27962 -@item --sort-section alignment
27963 +@kindex --sort-section=alignment
27964 +@item --sort-section=alignment
27965 This option will apply @code{SORT_BY_ALIGNMENT} to all wildcard section
27966 patterns in the linker script.
27967
27968 @kindex --split-by-file
27969 -@item --split-by-file [@var{size}]
27970 +@item --split-by-file[=@var{size}]
27971 Similar to @option{--split-by-reloc} but creates a new output section for
27972 each input file when @var{size} is reached. @var{size} defaults to a
27973 size of 1 if not given.
27974
27975 @kindex --split-by-reloc
27976 -@item --split-by-reloc [@var{count}]
27977 +@item --split-by-reloc[=@var{count}]
27978 Tries to creates extra sections in the output file so that no single
27979 output section in the file contains more than @var{count} relocations.
27980 This is useful when generating huge relocatable files for downloading into
27981 @@ -1699,7 +1714,7 @@ many relocations. @var{count} defaults
27982 Compute and display statistics about the operation of the linker, such
27983 as execution time and memory usage.
27984
27985 -@kindex --sysroot
27986 +@kindex --sysroot=@var{directory}
27987 @item --sysroot=@var{directory}
27988 Use @var{directory} as the location of the sysroot, overriding the
27989 configure-time default. This option is only supported by linkers
27990 @@ -1720,8 +1735,8 @@ full debugging information by over 30 pe
27991 trouble). The @samp{--traditional-format} switch tells @command{ld} to not
27992 combine duplicate entries.
27993
27994 -@kindex --section-start @var{sectionname}=@var{org}
27995 -@item --section-start @var{sectionname}=@var{org}
27996 +@kindex --section-start=@var{sectionname}=@var{org}
27997 +@item --section-start=@var{sectionname}=@var{org}
27998 Locate a section in the output file at the absolute
27999 address given by @var{org}. You may use this option as many
28000 times as necessary to locate multiple sections in the command
28001 @@ -1732,18 +1747,18 @@ for compatibility with other linkers, yo
28002 should be no white space between @var{sectionname}, the equals
28003 sign (``@key{=}''), and @var{org}.
28004
28005 -@kindex -Tbss @var{org}
28006 -@kindex -Tdata @var{org}
28007 -@kindex -Ttext @var{org}
28008 +@kindex -Tbss=@var{org}
28009 +@kindex -Tdata=@var{org}
28010 +@kindex -Ttext=@var{org}
28011 @cindex segment origins, cmd line
28012 -@item -Tbss @var{org}
28013 -@itemx -Tdata @var{org}
28014 -@itemx -Ttext @var{org}
28015 -Same as --section-start, with @code{.bss}, @code{.data} or
28016 +@item -Tbss=@var{org}
28017 +@itemx -Tdata=@var{org}
28018 +@itemx -Ttext=@var{org}
28019 +Same as @option{--section-start}, with @code{.bss}, @code{.data} or
28020 @code{.text} as the @var{sectionname}.
28021
28022 -@kindex -Ttext-segment @var{org}
28023 -@itemx -Ttext-segment @var{org}
28024 +@kindex -Ttext-segment=@var{org}
28025 +@item -Ttext-segment=@var{org}
28026 @cindex text segment origin, cmd line
28027 When creating an ELF executable or shared object, it will set the address
28028 of the first byte of the text segment.
28029 @@ -1789,7 +1804,7 @@ the linker script being used by the link
28030
28031 @kindex --version-script=@var{version-scriptfile}
28032 @cindex version script, symbol versions
28033 -@itemx --version-script=@var{version-scriptfile}
28034 +@item --version-script=@var{version-scriptfile}
28035 Specify the name of a version script to the linker. This is typically
28036 used when creating shared libraries to specify additional information
28037 about the version hierarchy for the library being created. This option
28038 @@ -1949,8 +1964,8 @@ Second, don't forget to use @option{-Wl,
28039 list of archives, because gcc will add its own list of archives to
28040 your link and you may not want this flag to affect those as well.
28041
28042 -@kindex --wrap
28043 -@item --wrap @var{symbol}
28044 +@kindex --wrap=@var{symbol}
28045 +@item --wrap=@var{symbol}
28046 Use a wrapper function for @var{symbol}. Any undefined reference to
28047 @var{symbol} will be resolved to @code{__wrap_@var{symbol}}. Any
28048 undefined reference to @code{__real_@var{symbol}} will be resolved to
28049 @@ -2054,6 +2069,18 @@ string identifying the original linked f
28050
28051 Passing @code{none} for @var{style} disables the setting from any
28052 @code{--build-id} options earlier on the command line.
28053 +
28054 +@kindex --no-poison-system-directories
28055 +@item --no-poison-system-directories
28056 +Do not warn for @option{-L} options using system directories such as
28057 +@file{/usr/lib} when cross linking. This option is intended for use
28058 +in chroot environments when such directories contain the correct
28059 +libraries for the target system rather than the host.
28060 +
28061 +@kindex --error-poison-system-directories
28062 +@item --error-poison-system-directories
28063 +Give an error instead of a warning for @option{-L} options using
28064 +system directories when cross linking.
28065 @end table
28066
28067 @c man end
28068 @@ -5743,12 +5770,12 @@ intervening instructions if vector mode
28069 full-compliance floating-point mode: you do not need this workaround if
28070 you are using "runfast" mode. Please contact ARM for further details.
28071
28072 -If you know you are using buggy VFP11 hardware, you can
28073 -enable this workaround by specifying the linker option
28074 -@samp{--vfp-denorm-fix=scalar} if you are using the VFP11 scalar
28075 -mode only, or @samp{--vfp-denorm-fix=vector} if you are using
28076 -vector mode (the latter also works for scalar code). The default is
28077 -@samp{--vfp-denorm-fix=none}.
28078 +This workaround is enabled for scalar code by default for
28079 +pre-ARMv7 architectures, but disabled by default for later
28080 +architectures. If you know you are not using buggy VFP11 hardware,
28081 +you can disable the workaround by specifying the linker option
28082 +@samp{--vfp-denorm-fix=none}. If you are using VFP vector mode, you
28083 +should specify @samp{--vfp-denorm-fix=vector}.
28084
28085 If the workaround is enabled, instructions are scanned for
28086 potentially-troublesome sequences, and a veneer is created for each
28087 @@ -5797,7 +5824,7 @@ where they should be placed.
28088
28089 The value of @samp{N}, the parameter to the
28090 @option{--stub-group-size=} option controls where the stub groups are
28091 -placed. If it is negative then all stubs are placed before the first
28092 +placed. If it is negative then all stubs are placed after the first
28093 branch that needs them. If it is positive then the stubs can be
28094 placed either before or after the branches that need them. If the
28095 value of @samp{N} is 1 (either +1 or -1) then the linker will choose
28096 @@ -5813,6 +5840,30 @@ Farcalls stubs insertion is fully suppor
28097 only, because it relies on object files properties not present
28098 otherwise.
28099
28100 +@cindex FIX_JANUS_2CC
28101 +@kindex --fix-janus-2cc
28102 +The @samp{--fix-janus-2cc} switch enables a link-time workaround for
28103 +an erratum in an early Janus 2CC chip revision, concerning ALU
28104 +operations using register-specified shifter operands. If you enable
28105 +this option, the executable code of the linked program is scanned for
28106 +problematic code sequences. For most cases in code using the ARM
28107 +instruction set, the linker inserts code veneers to correct the
28108 +problem automatically. If problematic sequences are detected in Thumb
28109 +code, or if any unfixable ARM instructions are encountered, an error
28110 +message is emitted to signal that code must be rewritten manually to
28111 +avoid the erratum.
28112 +
28113 +This option should only be used when targeting the ARMv4t architecture.
28114 +Do not use it unless you know your target CPU suffers from the erratum
28115 +in question.
28116 +
28117 +@cindex Cortex-A8 erratum workaround
28118 +@kindex --fix-cortex-a8
28119 +@kindex --no-fix-cortex-a8
28120 +The @samp{--fix-cortex-a8} switch enables a link-time workaround for an erratum in certain Cortex-A8 processors. The workaround is enabled by default if you are targeting the ARM v7-A architecture profile. It can be enabled otherwise by specifying @samp{--fix-cortex-a8}, or disabled unconditionally by specifying @samp{--no-fix-cortex-a8}.
28121 +
28122 +The erratum only affects Thumb-2 code. Please contact ARM for further details.
28123 +
28124 @ifclear GENERIC
28125 @lowersections
28126 @end ifclear
28127 --- a/ld/ldexp.c
28128 +++ b/ld/ldexp.c
28129 @@ -815,6 +815,20 @@ exp_fold_tree_1 (etree_type *tree)
28130 h->u.def.section = expld.result.section;
28131 if (tree->type.node_class == etree_provide)
28132 tree->type.node_class = etree_provided;
28133 +
28134 + /* Copy the symbol type if this is a simple assignment of
28135 + one symbol to annother. */
28136 + if (tree->assign.src->type.node_class == etree_name)
28137 + {
28138 + struct bfd_link_hash_entry *hsrc;
28139 +
28140 + hsrc = bfd_link_hash_lookup (link_info.hash,
28141 + tree->assign.src->name.name,
28142 + FALSE, FALSE, TRUE);
28143 + if (hsrc)
28144 + bfd_copy_link_hash_symbol_type (link_info.output_bfd, h,
28145 + hsrc);
28146 + }
28147 }
28148 }
28149 break;
28150 --- a/ld/ldfile.c
28151 +++ b/ld/ldfile.c
28152 @@ -120,6 +120,22 @@ ldfile_add_library_path (const char *nam
28153 {
28154 new->name = xstrdup (name);
28155 new->sysrooted = is_sysrooted_pathname (name, FALSE);
28156 +
28157 +#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
28158 + if (command_line.poison_system_directories
28159 + && ((!strncmp (name, "/lib", 4))
28160 + || (!strncmp (name, "/usr/lib", 8))
28161 + || (!strncmp (name, "/usr/local/lib", 14))
28162 + || (!strncmp (name, "/usr/X11R6/lib", 14))))
28163 + {
28164 + if (command_line.error_poison_system_directories)
28165 + einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
28166 + "cross-compilation\n"), name);
28167 + else
28168 + einfo (_("%P: warning: library search path \"%s\" is unsafe for "
28169 + "cross-compilation\n"), name);
28170 + }
28171 +#endif
28172 }
28173 }
28174
28175 @@ -542,22 +558,27 @@ find_scripts_dir (void)
28176 return NULL;
28177 }
28178
28179 -/* Try to open NAME; if that fails, look for it in the default script
28180 - directory, then in any directories specified with -L, without and
28181 - with EXTEND appended. */
28182 +/* If DEFAULT_ONLY is false, try to open NAME; if that fails, look for
28183 + it in directories specified with -L, then in the default script
28184 + directory, without and with EXTEND appended. If DEFAULT_ONLY is
28185 + true, the search is restricted to the default script location. */
28186
28187 static FILE *
28188 -ldfile_find_command_file (const char *name, const char *extend)
28189 +ldfile_find_command_file (const char *name, const char *extend,
28190 + bfd_boolean default_only)
28191 {
28192 search_dirs_type *search;
28193 - FILE *result;
28194 + FILE *result = NULL;
28195 char *buffer;
28196 static search_dirs_type *script_search;
28197
28198 - /* First try raw name. */
28199 - result = try_open (name, "");
28200 - if (result != NULL)
28201 - return result;
28202 + if (!default_only)
28203 + {
28204 + /* First try raw name. */
28205 + result = try_open (name, "");
28206 + if (result != NULL)
28207 + return result;
28208 + }
28209
28210 if (!script_search)
28211 {
28212 @@ -569,16 +590,17 @@ ldfile_find_command_file (const char *na
28213 ldfile_add_library_path (script_dir, TRUE);
28214 search_tail_ptr = save_tail_ptr;
28215 }
28216 - if (!script_search)
28217 - script_search = search_head;
28218 - else
28219 - script_search->next = search_head;
28220 }
28221
28222 + /* Temporarily append script_search to the path list so that the
28223 + paths specified with -L will be searched first. */
28224 + *search_tail_ptr = script_search;
28225 +
28226 /* Try now prefixes. */
28227 - for (search = script_search; search != NULL; search = search->next)
28228 + for (search = default_only ? script_search : search_head;
28229 + search != NULL;
28230 + search = search->next)
28231 {
28232 -
28233 buffer = concat (search->name, slash, name, (const char *) NULL);
28234 result = try_open (buffer, extend);
28235 free (buffer);
28236 @@ -586,14 +608,19 @@ ldfile_find_command_file (const char *na
28237 break;
28238 }
28239
28240 + /* Restore the original path list. */
28241 + *search_tail_ptr = NULL;
28242 +
28243 return result;
28244 }
28245
28246 -void
28247 -ldfile_open_command_file (const char *name)
28248 +/* Open command file NAME. */
28249 +
28250 +static void
28251 +ldfile_open_command_file_1 (const char *name, bfd_boolean default_only)
28252 {
28253 FILE *ldlex_input_stack;
28254 - ldlex_input_stack = ldfile_find_command_file (name, "");
28255 + ldlex_input_stack = ldfile_find_command_file (name, "", default_only);
28256
28257 if (ldlex_input_stack == NULL)
28258 {
28259 @@ -609,6 +636,23 @@ ldfile_open_command_file (const char *na
28260 saved_script_handle = ldlex_input_stack;
28261 }
28262
28263 +/* Open command file NAME in the current directory, -L directories,
28264 + the default script location, in that order. */
28265 +
28266 +void
28267 +ldfile_open_command_file (const char *name)
28268 +{
28269 + ldfile_open_command_file_1 (name, FALSE);
28270 +}
28271 +
28272 +/* Open command file NAME at the default script location. */
28273 +
28274 +void
28275 +ldfile_open_default_command_file (const char *name)
28276 +{
28277 + ldfile_open_command_file_1 (name, TRUE);
28278 +}
28279 +
28280 void
28281 ldfile_add_arch (const char *in_name)
28282 {
28283 --- a/ld/ldfile.h
28284 +++ b/ld/ldfile.h
28285 @@ -50,6 +50,8 @@ extern void ldfile_add_library_path
28286 (const char *, bfd_boolean cmdline);
28287 extern void ldfile_open_command_file
28288 (const char *name);
28289 +extern void ldfile_open_default_command_file
28290 + (const char *name);
28291 extern void ldfile_open_file
28292 (struct lang_input_statement_struct *);
28293 extern bfd_boolean ldfile_try_open_bfd
28294 --- a/ld/ldlang.c
28295 +++ b/ld/ldlang.c
28296 @@ -20,6 +20,8 @@
28297 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
28298 MA 02110-1301, USA. */
28299
28300 +#include "config.h"
28301 +
28302 #include <limits.h>
28303
28304 #include "sysdep.h"
28305 @@ -6467,6 +6469,15 @@ lang_leave_output_section_statement (fil
28306 memspec, lma_memspec,
28307 current_section->load_base != NULL,
28308 current_section->addr_tree != NULL);
28309 +
28310 + /* If this section has no load region or base, but has the same
28311 + region as the previous section, then propagate the previous
28312 + section's load region. */
28313 +
28314 + if (!current_section->lma_region && !current_section->load_base
28315 + && current_section->region == current_section->prev->region)
28316 + current_section->lma_region = current_section->prev->lma_region;
28317 +
28318 current_section->fill = fill;
28319 current_section->phdrs = phdrs;
28320 stat_ptr = &statement_list;
28321 --- a/ld/ldmain.c
28322 +++ b/ld/ldmain.c
28323 @@ -252,6 +252,8 @@ main (int argc, char **argv)
28324 command_line.warn_mismatch = TRUE;
28325 command_line.warn_search_mismatch = TRUE;
28326 command_line.check_section_addresses = -1;
28327 + command_line.poison_system_directories = TRUE;
28328 + command_line.error_poison_system_directories = FALSE;
28329
28330 /* We initialize DEMANGLING based on the environment variable
28331 COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
28332 @@ -376,7 +378,7 @@ main (int argc, char **argv)
28333 char *s = ldemul_get_script (&isfile);
28334
28335 if (isfile)
28336 - ldfile_open_command_file (s);
28337 + ldfile_open_default_command_file (s);
28338 else
28339 {
28340 lex_string = s;
28341 --- a/ld/lexsup.c
28342 +++ b/ld/lexsup.c
28343 @@ -164,7 +164,9 @@ enum option_values
28344 OPTION_ERROR_UNRESOLVED_SYMBOLS,
28345 OPTION_WARN_SHARED_TEXTREL,
28346 OPTION_REDUCE_MEMORY_OVERHEADS,
28347 - OPTION_DEFAULT_SCRIPT
28348 + OPTION_DEFAULT_SCRIPT,
28349 + OPTION_NO_POISON_SYSTEM_DIRECTORIES,
28350 + OPTION_ERROR_POISON_SYSTEM_DIRECTORIES
28351 };
28352
28353 /* The long options. This structure is used for both the option
28354 @@ -566,6 +568,14 @@ static const struct ld_option ld_options
28355 TWO_DASHES },
28356 { {"wrap", required_argument, NULL, OPTION_WRAP},
28357 '\0', N_("SYMBOL"), N_("Use wrapper functions for SYMBOL"), TWO_DASHES },
28358 + { {"no-poison-system-directories", no_argument, NULL,
28359 + OPTION_NO_POISON_SYSTEM_DIRECTORIES},
28360 + '\0', NULL, N_("Do not warn for -L options using system directories"),
28361 + TWO_DASHES },
28362 + { {"error-poison-system-directories", no_argument, NULL,
28363 + OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
28364 + '\0', NULL, N_("Give an error for -L options using system directories"),
28365 + TWO_DASHES },
28366 };
28367
28368 #define OPTION_COUNT ARRAY_SIZE (ld_options)
28369 @@ -1462,6 +1472,14 @@ parse_args (unsigned argc, char **argv)
28370 einfo (_("%P%X: --hash-size needs a numeric argument\n"));
28371 }
28372 break;
28373 +
28374 + case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
28375 + command_line.poison_system_directories = FALSE;
28376 + break;
28377 +
28378 + case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
28379 + command_line.error_poison_system_directories = TRUE;
28380 + break;
28381 }
28382 }
28383
28384 --- a/ld/scripttempl/elf.sc
28385 +++ b/ld/scripttempl/elf.sc
28386 @@ -174,6 +174,9 @@ if test -z "${SDATA_GOT}"; then
28387 SDATA_GOT=" "
28388 fi
28389 fi
28390 +if test -n "${DATA_GOT+set}"; then
28391 + DATA_GOTPLT=" "
28392 +fi
28393 test -n "$SEPARATE_GOTPLT" && SEPARATE_GOTPLT=" "
28394 test "${LARGE_SECTIONS}" = "yes" && REL_LARGE="
28395 .rel.ldata ${RELOCATING-0} : { *(.rel.ldata${RELOCATING+ .rel.ldata.* .rel.gnu.linkonce.l.*}) }
28396 @@ -451,11 +454,11 @@ cat <<EOF
28397 ${OTHER_RELRO_SECTIONS}
28398 ${TEXT_DYNAMIC-${DYNAMIC}}
28399 ${DATA_GOT+${RELRO_NOW+${GOT}}}
28400 - ${DATA_GOT+${RELRO_NOW+${GOTPLT}}}
28401 + ${DATA_GOTPLT+${RELRO_NOW+${GOTPLT}}}
28402 ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT+${GOT}}}}
28403 ${RELOCATING+${DATA_SEGMENT_RELRO_END}}
28404 ${DATA_GOT+${RELRO_NOW-${SEPARATE_GOTPLT-${GOT}}}}
28405 - ${DATA_GOT+${RELRO_NOW-${GOTPLT}}}
28406 + ${DATA_GOTPLT+${RELRO_NOW-${GOTPLT}}}
28407
28408 ${DATA_PLT+${PLT_BEFORE_GOT-${PLT}}}
28409
28410 @@ -500,6 +503,7 @@ cat <<EOF
28411 ${RELOCATING+. = ALIGN(${ALIGNMENT});}
28412 ${RELOCATING+${OTHER_END_SYMBOLS}}
28413 ${RELOCATING+${END_SYMBOLS-${USER_LABEL_PREFIX}_end = .; PROVIDE (${USER_LABEL_PREFIX}end = .);}}
28414 + ${RELOCATING+${OCTEON_SPECIAL_SECTIONS}}
28415 ${RELOCATING+${DATA_SEGMENT_END}}
28416 EOF
28417
28418 --- a/ld/testsuite/ChangeLog
28419 +++ b/ld/testsuite/ChangeLog
28420 @@ -1,7 +1,3 @@
28421 -2009-02-05 Joseph Myers <joseph@codesourcery.com>
28422 -
28423 - * ld-arm/arm-elf.exp (armeabitests): Restore thumb2-b-interwork.
28424 -
28425 2009-02-03 Maxim Kuvyrkov <maxim@codesourcery.com>
28426
28427 * ld-m68k/got-multigot-12-13-14-34-35-ok.d: Update.
28428 --- a/ld/testsuite/ld-arm/arm-elf.exp
28429 +++ b/ld/testsuite/ld-arm/arm-elf.exp
28430 @@ -161,6 +161,50 @@ set armelftests {
28431 "-EL --vfp11-denorm-fix=scalar -Ttext=0x8000" "-EL -mfpu=vfpxd" {vfp11-fix-none.s}
28432 {{objdump -dr vfp11-fix-none.d}}
28433 "vfp11-fix-none"}
28434 + {"Cortex-A8 erratum fix, b.w"
28435 + "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-b.s}
28436 + {{objdump -dr cortex-a8-fix-b.d}}
28437 + "cortex-a8-fix-b"}
28438 + {"Cortex-A8 erratum fix, bl.w"
28439 + "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-bl.s}
28440 + {{objdump -dr cortex-a8-fix-bl.d}}
28441 + "cortex-a8-fix-bl"}
28442 + {"Cortex-A8 erratum fix, bcc.w"
28443 + "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-bcc.s}
28444 + {{objdump -dr cortex-a8-fix-bcc.d}}
28445 + "cortex-a8-fix-bcc"}
28446 + {"Cortex-A8 erratum fix, blx.w"
28447 + "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-fix-blx.s}
28448 + {{objdump -dr cortex-a8-fix-blx.d}}
28449 + "cortex-a8-fix-blx"}
28450 + {"Cortex-A8 erratum fix, relocate b.w to ARM"
28451 + "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-b-rel.s}
28452 + {{objdump -dr cortex-a8-fix-b-rel-arm.d}}
28453 + "cortex-a8-fix-b-rel-arm"}
28454 + {"Cortex-A8 erratum fix, relocate b.w to Thumb"
28455 + "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-b-rel.s}
28456 + {{objdump -dr cortex-a8-fix-b-rel-thumb.d}}
28457 + "cortex-a8-fix-b-rel-thumb"}
28458 + {"Cortex-A8 erratum fix, relocate bl.w to ARM"
28459 + "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-bl-rel.s}
28460 + {{objdump -dr cortex-a8-fix-bl-rel-arm.d}}
28461 + "cortex-a8-fix-bl-rel-arm"}
28462 + {"Cortex-A8 erratum fix, relocate bl.w to Thumb"
28463 + "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bl-rel.s}
28464 + {{objdump -dr cortex-a8-fix-bl-rel-thumb.d}}
28465 + "cortex-a8-fix-bl-rel-thumb"}
28466 + {"Cortex-A8 erratum fix, relocate b<cond>.w to Thumb"
28467 + "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-bcc-rel.s}
28468 + {{objdump -dr cortex-a8-fix-bcc-rel-thumb.d}}
28469 + "cortex-a8-fix-bcc-rel-thumb"}
28470 + {"Cortex-A8 erratum fix, relocate blx.w to ARM"
28471 + "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-arm-target.s cortex-a8-fix-blx-rel.s}
28472 + {{objdump -dr cortex-a8-fix-blx-rel-arm.d}}
28473 + "cortex-a8-fix-blx-rel-arm"}
28474 + {"Cortex-A8 erratum fix, relocate blx.w to Thumb"
28475 + "-EL -Ttext=0x8f00 --fix-cortex-a8" "-EL" {cortex-a8-thumb-target.s cortex-a8-fix-blx-rel.s}
28476 + {{objdump -dr cortex-a8-fix-blx-rel-thumb.d}}
28477 + "cortex-a8-fix-blx-rel-thumb"}
28478 {"Unwinding and -gc-sections" "-gc-sections" "" {gc-unwind.s}
28479 {{objdump -sj.data gc-unwind.d}}
28480 "gc-unwind"}
28481 @@ -174,6 +218,9 @@ set armelftests {
28482 {"jump19" "-static -T arm.ld" "" {jump19.s}
28483 {{objdump -dr jump19.d}}
28484 "jump19"}
28485 + {"script-type" "-static -T script-type.ld" "" {script-type.s}
28486 + {{readelf -s script-type.sym}}
28487 + "script-type"}
28488 {"callweak" "-static -T arm.ld" "" {callweak.s}
28489 {{objdump -dr callweak.d}}
28490 "callweak"}
28491 @@ -190,10 +237,20 @@ run_dump_test "emit-relocs1"
28492 # Exclude non-ARM-EABI targets.
28493
28494 if { ![istarget "arm*-*-*eabi"] } {
28495 - # Special variants of these tests, as no farcall stub is generated
28496 - # for a non-ARM-EABI target
28497 - run_dump_test "thumb2-bl-as-thumb1-bad-noeabi"
28498 - run_dump_test "thumb2-bl-bad-noeabi"
28499 + # Special variants of these tests, as a different farcall stub is
28500 + # generated for a non-ARM-EABI target: indeed in such a case,
28501 + # there are no attributes to indicate that blx can be used.
28502 +
28503 + set arm_noeabi_tests {
28504 + {"Thumb-2-as-Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" {thumb2-bl-as-thumb1-bad.s}
28505 + {{objdump -d thumb2-bl-as-thumb1-bad-noeabi.d}}
28506 + "thumb2-bl-as-thumb1-bad"}
28507 + {"Thumb-2 BL bad" "-Ttext 0x1000 --section-start .foo=0x100100c" "" {thumb2-bl-bad.s}
28508 + {{objdump -d thumb2-bl-bad-noeabi.d}}
28509 + "thumb2-bl-bad"}
28510 + }
28511 + run_ld_link_tests $arm_noeabi_tests
28512 +
28513 return
28514 }
28515
28516 @@ -232,6 +289,9 @@ set armeabitests {
28517 {"Thumb-2 Interworked branch" "-T arm.ld" "" {thumb2-b-interwork.s}
28518 {{objdump -dr thumb2-b-interwork.d}}
28519 "thumb2-b-interwork"}
28520 + {"BL/BLX interworking" "-T arm.ld" "" {thumb2-bl-blx-interwork.s}
28521 + {{objdump -dr thumb2-bl-blx-interwork.d}}
28522 + "thumb2-bl-blx-interwork"}
28523 {"ARMv4 interworking" "-static -T arm.ld --fix-v4bx-interworking" "--fix-v4bx -meabi=4" {armv4-bx.s}
28524 {{objdump -d armv4-bx.d}}
28525 "armv4-bx"}
28526 @@ -241,7 +301,7 @@ set armeabitests {
28527 {"MOVW/MOVT against shared libraries" "tmpdir/arm-lib.so" "" {arm-app-movw.s}
28528 {{objdump -Rw arm-app.r}}
28529 "arm-app-movw"}
28530 - {"Thumb-2-as-Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x40100c" "" {thumb2-bl-as-thumb1-bad.s}
28531 + {"Thumb-2-as-Thumb-1 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" {thumb2-bl-as-thumb1-bad.s}
28532 {{objdump -d thumb2-bl-as-thumb1-bad.d}}
28533 "thumb2-bl-as-thumb1-bad"}
28534 {"Thumb-2 BL" "-Ttext 0x1000 --section-start .foo=0x100100c" "" {thumb2-bl-bad.s}
28535 @@ -257,6 +317,9 @@ set armeabitests {
28536 {"ARM-ARM farcall (BE8)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB --be8" "-EB" {farcall-arm-arm.s}
28537 {{objdump -d farcall-arm-arm-be8.d}}
28538 "farcall-arm-arm-be8"}
28539 + {"ARM-ARM farcall (BE)" "-Ttext 0x1000 --section-start .foo=0x2001020 -EB" "-EB" {farcall-arm-arm.s}
28540 + {{objdump -d farcall-arm-arm.d}}
28541 + "farcall-arm-arm-be"}
28542
28543 {"ARM-Thumb farcall" "-Ttext 0x1000 --section-start .foo=0x2001014" "" {farcall-arm-thumb.s}
28544 {{objdump -d farcall-arm-thumb.d}}
28545 @@ -277,6 +340,9 @@ set armeabitests {
28546 {"Thumb-Thumb farcall M profile" "-Ttext 0x1000 --section-start .foo=0x2001014" "-march=armv7m" {farcall-thumb-thumb.s}
28547 {{objdump -d farcall-thumb-thumb-m.d}}
28548 "farcall-thumb-thumb-m"}
28549 + {"Thumb-Thumb farcall" "-Ttext 0x1000 --section-start .foo=0x2001014" "-march=armv4t" {farcall-thumb-thumb.s}
28550 + {{objdump -d farcall-thumb-thumb.d}}
28551 + "farcall-thumb-thumb"}
28552 {"Thumb-Thumb farcall with BLX (PIC veneer)" "-Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer" "-march=armv5t" {farcall-thumb-thumb.s}
28553 {{objdump -d farcall-thumb-thumb-blx-pic-veneer.d}}
28554 "farcall-thumb-thumb-blx-pic-veneer"}
28555 @@ -284,6 +350,12 @@ set armeabitests {
28556 {"Thumb-ARM farcall" "-Ttext 0x1000 --section-start .foo=0x2001014" "-W" {farcall-thumb-arm.s}
28557 {{objdump -d farcall-thumb-arm.d}}
28558 "farcall-thumb-arm"}
28559 + {"Thumb-ARM farcall (BE8)" "-Ttext 0x1000 --section-start .foo=0x2001014 -EB --be8" "-W -EB" {farcall-thumb-arm.s}
28560 + {{objdump -d farcall-thumb-arm-be8.d}}
28561 + "farcall-thumb-arm-be8"}
28562 + {"Thumb-ARM farcall (BE)" "-Ttext 0x1000 --section-start .foo=0x2001014 -EB" "-W -EB" {farcall-thumb-arm.s}
28563 + {{objdump -d farcall-thumb-arm.d}}
28564 + "farcall-thumb-arm-be"}
28565 {"Thumb-ARM (short) call" "-Ttext 0x1000 --section-start .foo=0x0002014" "-W" {farcall-thumb-arm-short.s}
28566 {{objdump -d farcall-thumb-arm-short.d}}
28567 "farcall-thumb-arm-short"}
28568 @@ -328,7 +400,6 @@ run_dump_test "attr-merge-wchar-24-nowar
28569 run_dump_test "attr-merge-wchar-40-nowarn"
28570 run_dump_test "attr-merge-wchar-42-nowarn"
28571 run_dump_test "attr-merge-wchar-44-nowarn"
28572 -run_dump_test "farcall-thumb-thumb"
28573 run_dump_test "farcall-thumb-thumb-pic-veneer"
28574 run_dump_test "farcall-thumb-thumb-m-pic-veneer"
28575 run_dump_test "farcall-thumb-arm-pic-veneer"
28576 @@ -337,3 +408,7 @@ run_dump_test "attr-merge-unknown-1"
28577 run_dump_test "attr-merge-unknown-2"
28578 run_dump_test "attr-merge-unknown-2r"
28579 run_dump_test "attr-merge-unknown-3"
28580 +run_dump_test "unwind-1"
28581 +run_dump_test "unwind-2"
28582 +run_dump_test "unwind-3"
28583 +run_dump_test "unwind-4"
28584 --- a/ld/testsuite/ld-arm/arm.ld
28585 +++ b/ld/testsuite/ld-arm/arm.ld
28586 @@ -10,9 +10,11 @@ SECTIONS
28587 *(.before)
28588 *(.text)
28589 *(.after)
28590 + *(.ARM.extab*)
28591 *(.glue_7)
28592 *(.v4_bx)
28593 } =0
28594 + .ARM.exidx : { *(.ARM.exidx*) }
28595 . = 0x9000;
28596 .got : { *(.got) *(.got.plt)}
28597 . = 0x12340000;
28598 --- /dev/null
28599 +++ b/ld/testsuite/ld-arm/cortex-a8-arm-target.s
28600 @@ -0,0 +1,9 @@
28601 + .syntax unified
28602 + .cpu cortex-a8
28603 + .text
28604 + .arm
28605 + .align 3
28606 + .global targetfn
28607 + .type targetfn, %function
28608 +targetfn:
28609 + bx lr
28610 --- /dev/null
28611 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-b-rel-arm.d
28612 @@ -0,0 +1,85 @@
28613 +
28614 +.*: file format .*
28615 +
28616 +
28617 +Disassembly of section \.text:
28618 +
28619 +00008f00 <targetfn>:
28620 + 8f00: e12fff1e bx lr
28621 + 8f04: e320f000 nop \{0\}
28622 +
28623 +00008f08 <_start>:
28624 + 8f08: bf00 nop
28625 + 8f0a: eb01 0002 add\.w r0, r1, r2
28626 + 8f0e: f000 b87f b\.w 9010 <__targetfn_from_thumb>
28627 + 8f12: eb01 0002 add\.w r0, r1, r2
28628 + 8f16: f000 b87b b\.w 9010 <__targetfn_from_thumb>
28629 + 8f1a: eb01 0002 add\.w r0, r1, r2
28630 + 8f1e: f000 b877 b\.w 9010 <__targetfn_from_thumb>
28631 + 8f22: eb01 0002 add\.w r0, r1, r2
28632 + 8f26: f000 b873 b\.w 9010 <__targetfn_from_thumb>
28633 + 8f2a: eb01 0002 add\.w r0, r1, r2
28634 + 8f2e: f000 b86f b\.w 9010 <__targetfn_from_thumb>
28635 + 8f32: eb01 0002 add\.w r0, r1, r2
28636 + 8f36: f000 b86b b\.w 9010 <__targetfn_from_thumb>
28637 + 8f3a: eb01 0002 add\.w r0, r1, r2
28638 + 8f3e: f000 b867 b\.w 9010 <__targetfn_from_thumb>
28639 + 8f42: eb01 0002 add\.w r0, r1, r2
28640 + 8f46: f000 b863 b\.w 9010 <__targetfn_from_thumb>
28641 + 8f4a: eb01 0002 add\.w r0, r1, r2
28642 + 8f4e: f000 b85f b\.w 9010 <__targetfn_from_thumb>
28643 + 8f52: eb01 0002 add\.w r0, r1, r2
28644 + 8f56: f000 b85b b\.w 9010 <__targetfn_from_thumb>
28645 + 8f5a: eb01 0002 add\.w r0, r1, r2
28646 + 8f5e: f000 b857 b\.w 9010 <__targetfn_from_thumb>
28647 + 8f62: eb01 0002 add\.w r0, r1, r2
28648 + 8f66: f000 b853 b\.w 9010 <__targetfn_from_thumb>
28649 + 8f6a: eb01 0002 add\.w r0, r1, r2
28650 + 8f6e: f000 b84f b\.w 9010 <__targetfn_from_thumb>
28651 + 8f72: eb01 0002 add\.w r0, r1, r2
28652 + 8f76: f000 b84b b\.w 9010 <__targetfn_from_thumb>
28653 + 8f7a: eb01 0002 add\.w r0, r1, r2
28654 + 8f7e: f000 b847 b\.w 9010 <__targetfn_from_thumb>
28655 + 8f82: eb01 0002 add\.w r0, r1, r2
28656 + 8f86: f000 b843 b\.w 9010 <__targetfn_from_thumb>
28657 + 8f8a: eb01 0002 add\.w r0, r1, r2
28658 + 8f8e: f000 b83f b\.w 9010 <__targetfn_from_thumb>
28659 + 8f92: eb01 0002 add\.w r0, r1, r2
28660 + 8f96: f000 b83b b\.w 9010 <__targetfn_from_thumb>
28661 + 8f9a: eb01 0002 add\.w r0, r1, r2
28662 + 8f9e: f000 b837 b\.w 9010 <__targetfn_from_thumb>
28663 + 8fa2: eb01 0002 add\.w r0, r1, r2
28664 + 8fa6: f000 b833 b\.w 9010 <__targetfn_from_thumb>
28665 + 8faa: eb01 0002 add\.w r0, r1, r2
28666 + 8fae: f000 b82f b\.w 9010 <__targetfn_from_thumb>
28667 + 8fb2: eb01 0002 add\.w r0, r1, r2
28668 + 8fb6: f000 b82b b\.w 9010 <__targetfn_from_thumb>
28669 + 8fba: eb01 0002 add\.w r0, r1, r2
28670 + 8fbe: f000 b827 b\.w 9010 <__targetfn_from_thumb>
28671 + 8fc2: eb01 0002 add\.w r0, r1, r2
28672 + 8fc6: f000 b823 b\.w 9010 <__targetfn_from_thumb>
28673 + 8fca: eb01 0002 add\.w r0, r1, r2
28674 + 8fce: f000 b81f b\.w 9010 <__targetfn_from_thumb>
28675 + 8fd2: eb01 0002 add\.w r0, r1, r2
28676 + 8fd6: f000 b81b b\.w 9010 <__targetfn_from_thumb>
28677 + 8fda: eb01 0002 add\.w r0, r1, r2
28678 + 8fde: f000 b817 b\.w 9010 <__targetfn_from_thumb>
28679 + 8fe2: eb01 0002 add\.w r0, r1, r2
28680 + 8fe6: f000 b813 b\.w 9010 <__targetfn_from_thumb>
28681 + 8fea: eb01 0002 add\.w r0, r1, r2
28682 + 8fee: f000 b80f b\.w 9010 <__targetfn_from_thumb>
28683 + 8ff2: eb01 0002 add\.w r0, r1, r2
28684 + 8ff6: f000 b80b b\.w 9010 <__targetfn_from_thumb>
28685 + 8ffa: eb01 0002 add\.w r0, r1, r2
28686 + 8ffe: f000 b807 b\.w 9010 <__targetfn_from_thumb>
28687 + 9002: eb01 0002 add\.w r0, r1, r2
28688 + 9006: f000 b803 b\.w 9010 <__targetfn_from_thumb>
28689 + 900a: 4770 bx lr
28690 + 900c: f3af 8000 nop\.w
28691 +
28692 +00009010 <__targetfn_from_thumb>:
28693 + 9010: 4778 bx pc
28694 + 9012: 46c0 nop \(mov r8, r8\)
28695 +
28696 +00009014 <__targetfn_change_to_arm>:
28697 + 9014: eaffffb9 b 8f00 <targetfn>
28698 --- /dev/null
28699 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-b-rel-thumb.d
28700 @@ -0,0 +1,80 @@
28701 +
28702 +.*: file format .*
28703 +
28704 +
28705 +Disassembly of section \.text:
28706 +
28707 +00008f00 <targetfn>:
28708 + 8f00: 4770 bx lr
28709 + 8f02: bf00 nop
28710 + 8f04: f3af 8000 nop\.w
28711 +
28712 +00008f08 <_start>:
28713 + 8f08: bf00 nop
28714 + 8f0a: eb01 0002 add\.w r0, r1, r2
28715 + 8f0e: f7ff bff7 b\.w 8f00 <targetfn>
28716 + 8f12: eb01 0002 add\.w r0, r1, r2
28717 + 8f16: f7ff bff3 b\.w 8f00 <targetfn>
28718 + 8f1a: eb01 0002 add\.w r0, r1, r2
28719 + 8f1e: f7ff bfef b\.w 8f00 <targetfn>
28720 + 8f22: eb01 0002 add\.w r0, r1, r2
28721 + 8f26: f7ff bfeb b\.w 8f00 <targetfn>
28722 + 8f2a: eb01 0002 add\.w r0, r1, r2
28723 + 8f2e: f7ff bfe7 b\.w 8f00 <targetfn>
28724 + 8f32: eb01 0002 add\.w r0, r1, r2
28725 + 8f36: f7ff bfe3 b\.w 8f00 <targetfn>
28726 + 8f3a: eb01 0002 add\.w r0, r1, r2
28727 + 8f3e: f7ff bfdf b\.w 8f00 <targetfn>
28728 + 8f42: eb01 0002 add\.w r0, r1, r2
28729 + 8f46: f7ff bfdb b\.w 8f00 <targetfn>
28730 + 8f4a: eb01 0002 add\.w r0, r1, r2
28731 + 8f4e: f7ff bfd7 b\.w 8f00 <targetfn>
28732 + 8f52: eb01 0002 add\.w r0, r1, r2
28733 + 8f56: f7ff bfd3 b\.w 8f00 <targetfn>
28734 + 8f5a: eb01 0002 add\.w r0, r1, r2
28735 + 8f5e: f7ff bfcf b\.w 8f00 <targetfn>
28736 + 8f62: eb01 0002 add\.w r0, r1, r2
28737 + 8f66: f7ff bfcb b\.w 8f00 <targetfn>
28738 + 8f6a: eb01 0002 add\.w r0, r1, r2
28739 + 8f6e: f7ff bfc7 b\.w 8f00 <targetfn>
28740 + 8f72: eb01 0002 add\.w r0, r1, r2
28741 + 8f76: f7ff bfc3 b\.w 8f00 <targetfn>
28742 + 8f7a: eb01 0002 add\.w r0, r1, r2
28743 + 8f7e: f7ff bfbf b\.w 8f00 <targetfn>
28744 + 8f82: eb01 0002 add\.w r0, r1, r2
28745 + 8f86: f7ff bfbb b\.w 8f00 <targetfn>
28746 + 8f8a: eb01 0002 add\.w r0, r1, r2
28747 + 8f8e: f7ff bfb7 b\.w 8f00 <targetfn>
28748 + 8f92: eb01 0002 add\.w r0, r1, r2
28749 + 8f96: f7ff bfb3 b\.w 8f00 <targetfn>
28750 + 8f9a: eb01 0002 add\.w r0, r1, r2
28751 + 8f9e: f7ff bfaf b\.w 8f00 <targetfn>
28752 + 8fa2: eb01 0002 add\.w r0, r1, r2
28753 + 8fa6: f7ff bfab b\.w 8f00 <targetfn>
28754 + 8faa: eb01 0002 add\.w r0, r1, r2
28755 + 8fae: f7ff bfa7 b\.w 8f00 <targetfn>
28756 + 8fb2: eb01 0002 add\.w r0, r1, r2
28757 + 8fb6: f7ff bfa3 b\.w 8f00 <targetfn>
28758 + 8fba: eb01 0002 add\.w r0, r1, r2
28759 + 8fbe: f7ff bf9f b\.w 8f00 <targetfn>
28760 + 8fc2: eb01 0002 add\.w r0, r1, r2
28761 + 8fc6: f7ff bf9b b\.w 8f00 <targetfn>
28762 + 8fca: eb01 0002 add\.w r0, r1, r2
28763 + 8fce: f7ff bf97 b\.w 8f00 <targetfn>
28764 + 8fd2: eb01 0002 add\.w r0, r1, r2
28765 + 8fd6: f7ff bf93 b\.w 8f00 <targetfn>
28766 + 8fda: eb01 0002 add\.w r0, r1, r2
28767 + 8fde: f7ff bf8f b\.w 8f00 <targetfn>
28768 + 8fe2: eb01 0002 add\.w r0, r1, r2
28769 + 8fe6: f7ff bf8b b\.w 8f00 <targetfn>
28770 + 8fea: eb01 0002 add\.w r0, r1, r2
28771 + 8fee: f7ff bf87 b\.w 8f00 <targetfn>
28772 + 8ff2: eb01 0002 add\.w r0, r1, r2
28773 + 8ff6: f7ff bf83 b\.w 8f00 <targetfn>
28774 + 8ffa: eb01 0002 add\.w r0, r1, r2
28775 + 8ffe: f000 b807 b\.w 9010 <_start\+0x108>
28776 + 9002: eb01 0002 add\.w r0, r1, r2
28777 + 9006: f7ff bf7b b\.w 8f00 <targetfn>
28778 + 900a: 4770 bx lr
28779 + 900c: f3af 8000 nop\.w
28780 + 9010: f7ff bf76 b\.w 8f00 <targetfn>
28781 --- /dev/null
28782 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-b-rel.s
28783 @@ -0,0 +1,41 @@
28784 + .syntax unified
28785 + .cpu cortex-a8
28786 + .thumb
28787 + .text
28788 +
28789 + @ expansion 32 bytes
28790 + .macro bw1
28791 +1:
28792 + add.w r0, r1, r2
28793 + b.w targetfn
28794 + add.w r0, r1, r2
28795 + b.w targetfn
28796 + add.w r0, r1, r2
28797 + b.w targetfn
28798 + add.w r0, r1, r2
28799 + b.w targetfn
28800 + .endm
28801 +
28802 + @ expansion 128 bytes
28803 + .macro bw2
28804 + bw1
28805 + bw1
28806 + bw1
28807 + bw1
28808 + .endm
28809 +
28810 + .align 3
28811 + .global _start
28812 + .thumb
28813 + .thumb_func
28814 + .type _start, %function
28815 +_start:
28816 + nop
28817 +
28818 + @ If branching to an ARM destination, we *don't* want to create a
28819 + @ Cortex-A8 stub: the Thumb-to-ARM stub will suffice (and we need it
28820 + @ to change mode).
28821 + bw2
28822 + bw2
28823 +
28824 + bx lr
28825 --- /dev/null
28826 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-b.d
28827 @@ -0,0 +1,75 @@
28828 +
28829 +.*: file format .*
28830 +
28831 +
28832 +Disassembly of section \.text:
28833 +
28834 +00008f00 <_start>:
28835 + 8f00: bf00 nop
28836 + 8f02: eb01 0002 add\.w r0, r1, r2
28837 + 8f06: f7ff bffc b\.w 8f02 <_start\+0x2>
28838 + 8f0a: eb01 0002 add\.w r0, r1, r2
28839 + 8f0e: f7ff bff8 b\.w 8f02 <_start\+0x2>
28840 + 8f12: eb01 0002 add\.w r0, r1, r2
28841 + 8f16: f7ff bff4 b\.w 8f02 <_start\+0x2>
28842 + 8f1a: eb01 0002 add\.w r0, r1, r2
28843 + 8f1e: f7ff bff0 b\.w 8f02 <_start\+0x2>
28844 + 8f22: eb01 0002 add\.w r0, r1, r2
28845 + 8f26: f7ff bffc b\.w 8f22 <_start\+0x22>
28846 + 8f2a: eb01 0002 add\.w r0, r1, r2
28847 + 8f2e: f7ff bff8 b\.w 8f22 <_start\+0x22>
28848 + 8f32: eb01 0002 add\.w r0, r1, r2
28849 + 8f36: f7ff bff4 b\.w 8f22 <_start\+0x22>
28850 + 8f3a: eb01 0002 add\.w r0, r1, r2
28851 + 8f3e: f7ff bff0 b\.w 8f22 <_start\+0x22>
28852 + 8f42: eb01 0002 add\.w r0, r1, r2
28853 + 8f46: f7ff bffc b\.w 8f42 <_start\+0x42>
28854 + 8f4a: eb01 0002 add\.w r0, r1, r2
28855 + 8f4e: f7ff bff8 b\.w 8f42 <_start\+0x42>
28856 + 8f52: eb01 0002 add\.w r0, r1, r2
28857 + 8f56: f7ff bff4 b\.w 8f42 <_start\+0x42>
28858 + 8f5a: eb01 0002 add\.w r0, r1, r2
28859 + 8f5e: f7ff bff0 b\.w 8f42 <_start\+0x42>
28860 + 8f62: eb01 0002 add\.w r0, r1, r2
28861 + 8f66: f7ff bffc b\.w 8f62 <_start\+0x62>
28862 + 8f6a: eb01 0002 add\.w r0, r1, r2
28863 + 8f6e: f7ff bff8 b\.w 8f62 <_start\+0x62>
28864 + 8f72: eb01 0002 add\.w r0, r1, r2
28865 + 8f76: f7ff bff4 b\.w 8f62 <_start\+0x62>
28866 + 8f7a: eb01 0002 add\.w r0, r1, r2
28867 + 8f7e: f7ff bff0 b\.w 8f62 <_start\+0x62>
28868 + 8f82: eb01 0002 add\.w r0, r1, r2
28869 + 8f86: f7ff bffc b\.w 8f82 <_start\+0x82>
28870 + 8f8a: eb01 0002 add\.w r0, r1, r2
28871 + 8f8e: f7ff bff8 b\.w 8f82 <_start\+0x82>
28872 + 8f92: eb01 0002 add\.w r0, r1, r2
28873 + 8f96: f7ff bff4 b\.w 8f82 <_start\+0x82>
28874 + 8f9a: eb01 0002 add\.w r0, r1, r2
28875 + 8f9e: f7ff bff0 b\.w 8f82 <_start\+0x82>
28876 + 8fa2: eb01 0002 add\.w r0, r1, r2
28877 + 8fa6: f7ff bffc b\.w 8fa2 <_start\+0xa2>
28878 + 8faa: eb01 0002 add\.w r0, r1, r2
28879 + 8fae: f7ff bff8 b\.w 8fa2 <_start\+0xa2>
28880 + 8fb2: eb01 0002 add\.w r0, r1, r2
28881 + 8fb6: f7ff bff4 b\.w 8fa2 <_start\+0xa2>
28882 + 8fba: eb01 0002 add\.w r0, r1, r2
28883 + 8fbe: f7ff bff0 b\.w 8fa2 <_start\+0xa2>
28884 + 8fc2: eb01 0002 add\.w r0, r1, r2
28885 + 8fc6: f7ff bffc b\.w 8fc2 <_start\+0xc2>
28886 + 8fca: eb01 0002 add\.w r0, r1, r2
28887 + 8fce: f7ff bff8 b\.w 8fc2 <_start\+0xc2>
28888 + 8fd2: eb01 0002 add\.w r0, r1, r2
28889 + 8fd6: f7ff bff4 b\.w 8fc2 <_start\+0xc2>
28890 + 8fda: eb01 0002 add\.w r0, r1, r2
28891 + 8fde: f7ff bff0 b\.w 8fc2 <_start\+0xc2>
28892 + 8fe2: eb01 0002 add\.w r0, r1, r2
28893 + 8fe6: f7ff bffc b\.w 8fe2 <_start\+0xe2>
28894 + 8fea: eb01 0002 add\.w r0, r1, r2
28895 + 8fee: f7ff bff8 b\.w 8fe2 <_start\+0xe2>
28896 + 8ff2: eb01 0002 add\.w r0, r1, r2
28897 + 8ff6: f7ff bff4 b\.w 8fe2 <_start\+0xe2>
28898 + 8ffa: eb01 0002 add\.w r0, r1, r2
28899 + 8ffe: f000 b803 b\.w 9008 <_start\+0x108>
28900 + 9002: 4770 bx lr
28901 + 9004: f3af 8000 nop\.w
28902 + 9008: f7ff bfeb b\.w 8fe2 <_start\+0xe2>
28903 --- /dev/null
28904 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-b.s
28905 @@ -0,0 +1,39 @@
28906 + .syntax unified
28907 + .cpu cortex-a8
28908 + .thumb
28909 + .text
28910 +
28911 + @ expansion 32 bytes
28912 + .macro bw1
28913 +1:
28914 + add.w r0, r1, r2
28915 + b.w 1b
28916 + add.w r0, r1, r2
28917 + b.w 1b
28918 + add.w r0, r1, r2
28919 + b.w 1b
28920 + add.w r0, r1, r2
28921 + b.w 1b
28922 + .endm
28923 +
28924 + @ expansion 128 bytes
28925 + .macro bw2
28926 + bw1
28927 + bw1
28928 + bw1
28929 + bw1
28930 + .endm
28931 +
28932 + .align 3
28933 + .global _start
28934 + .thumb
28935 + .thumb_func
28936 + .type _start, %function
28937 +_start:
28938 + nop
28939 +
28940 + @ Trigger Cortex-A8 erratum workaround with b instructions.
28941 + bw2
28942 + bw2
28943 +
28944 + bx lr
28945 --- /dev/null
28946 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-bcc-rel-thumb.d
28947 @@ -0,0 +1,82 @@
28948 +
28949 +.*: file format .*
28950 +
28951 +
28952 +Disassembly of section \.text:
28953 +
28954 +00008f00 <targetfn>:
28955 + 8f00: 4770 bx lr
28956 + 8f02: bf00 nop
28957 + 8f04: f3af 8000 nop\.w
28958 +
28959 +00008f08 <_start>:
28960 + 8f08: bf00 nop
28961 + 8f0a: eb01 0002 add\.w r0, r1, r2
28962 + 8f0e: f53f aff7 bmi\.w 8f00 <targetfn>
28963 + 8f12: eb01 0002 add\.w r0, r1, r2
28964 + 8f16: f53f aff3 bmi\.w 8f00 <targetfn>
28965 + 8f1a: eb01 0002 add\.w r0, r1, r2
28966 + 8f1e: f53f afef bmi\.w 8f00 <targetfn>
28967 + 8f22: eb01 0002 add\.w r0, r1, r2
28968 + 8f26: f53f afeb bmi\.w 8f00 <targetfn>
28969 + 8f2a: eb01 0002 add\.w r0, r1, r2
28970 + 8f2e: f53f afe7 bmi\.w 8f00 <targetfn>
28971 + 8f32: eb01 0002 add\.w r0, r1, r2
28972 + 8f36: f53f afe3 bmi\.w 8f00 <targetfn>
28973 + 8f3a: eb01 0002 add\.w r0, r1, r2
28974 + 8f3e: f53f afdf bmi\.w 8f00 <targetfn>
28975 + 8f42: eb01 0002 add\.w r0, r1, r2
28976 + 8f46: f53f afdb bmi\.w 8f00 <targetfn>
28977 + 8f4a: eb01 0002 add\.w r0, r1, r2
28978 + 8f4e: f53f afd7 bmi\.w 8f00 <targetfn>
28979 + 8f52: eb01 0002 add\.w r0, r1, r2
28980 + 8f56: f53f afd3 bmi\.w 8f00 <targetfn>
28981 + 8f5a: eb01 0002 add\.w r0, r1, r2
28982 + 8f5e: f53f afcf bmi\.w 8f00 <targetfn>
28983 + 8f62: eb01 0002 add\.w r0, r1, r2
28984 + 8f66: f53f afcb bmi\.w 8f00 <targetfn>
28985 + 8f6a: eb01 0002 add\.w r0, r1, r2
28986 + 8f6e: f53f afc7 bmi\.w 8f00 <targetfn>
28987 + 8f72: eb01 0002 add\.w r0, r1, r2
28988 + 8f76: f53f afc3 bmi\.w 8f00 <targetfn>
28989 + 8f7a: eb01 0002 add\.w r0, r1, r2
28990 + 8f7e: f53f afbf bmi\.w 8f00 <targetfn>
28991 + 8f82: eb01 0002 add\.w r0, r1, r2
28992 + 8f86: f53f afbb bmi\.w 8f00 <targetfn>
28993 + 8f8a: eb01 0002 add\.w r0, r1, r2
28994 + 8f8e: f53f afb7 bmi\.w 8f00 <targetfn>
28995 + 8f92: eb01 0002 add\.w r0, r1, r2
28996 + 8f96: f53f afb3 bmi\.w 8f00 <targetfn>
28997 + 8f9a: eb01 0002 add\.w r0, r1, r2
28998 + 8f9e: f53f afaf bmi\.w 8f00 <targetfn>
28999 + 8fa2: eb01 0002 add\.w r0, r1, r2
29000 + 8fa6: f53f afab bmi\.w 8f00 <targetfn>
29001 + 8faa: eb01 0002 add\.w r0, r1, r2
29002 + 8fae: f53f afa7 bmi\.w 8f00 <targetfn>
29003 + 8fb2: eb01 0002 add\.w r0, r1, r2
29004 + 8fb6: f53f afa3 bmi\.w 8f00 <targetfn>
29005 + 8fba: eb01 0002 add\.w r0, r1, r2
29006 + 8fbe: f53f af9f bmi\.w 8f00 <targetfn>
29007 + 8fc2: eb01 0002 add\.w r0, r1, r2
29008 + 8fc6: f53f af9b bmi\.w 8f00 <targetfn>
29009 + 8fca: eb01 0002 add\.w r0, r1, r2
29010 + 8fce: f53f af97 bmi\.w 8f00 <targetfn>
29011 + 8fd2: eb01 0002 add\.w r0, r1, r2
29012 + 8fd6: f53f af93 bmi\.w 8f00 <targetfn>
29013 + 8fda: eb01 0002 add\.w r0, r1, r2
29014 + 8fde: f53f af8f bmi\.w 8f00 <targetfn>
29015 + 8fe2: eb01 0002 add\.w r0, r1, r2
29016 + 8fe6: f53f af8b bmi\.w 8f00 <targetfn>
29017 + 8fea: eb01 0002 add\.w r0, r1, r2
29018 + 8fee: f53f af87 bmi\.w 8f00 <targetfn>
29019 + 8ff2: eb01 0002 add\.w r0, r1, r2
29020 + 8ff6: f53f af83 bmi\.w 8f00 <targetfn>
29021 + 8ffa: eb01 0002 add\.w r0, r1, r2
29022 + 8ffe: f000 b807 b\.w 9010 <_start\+0x108>
29023 + 9002: eb01 0002 add\.w r0, r1, r2
29024 + 9006: f53f af7b bmi\.w 8f00 <targetfn>
29025 + 900a: 4770 bx lr
29026 + 900c: f3af 8000 nop\.w
29027 + 9010: d401 bmi\.n 9016 <_start\+0x10e>
29028 + 9012: f7ff bff6 b\.w 9002 <_start\+0xfa>
29029 + 9016: f7ff bf73 b\.w 8f00 <targetfn>
29030 --- /dev/null
29031 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-bcc-rel.s
29032 @@ -0,0 +1,38 @@
29033 + .syntax unified
29034 + .cpu cortex-a8
29035 + .thumb
29036 + .text
29037 +
29038 + @ expansion 32 bytes
29039 + .macro bw1
29040 +1:
29041 + add.w r0, r1, r2
29042 + bmi.w targetfn
29043 + add.w r0, r1, r2
29044 + bmi.w targetfn
29045 + add.w r0, r1, r2
29046 + bmi.w targetfn
29047 + add.w r0, r1, r2
29048 + bmi.w targetfn
29049 + .endm
29050 +
29051 + @ expansion 128 bytes
29052 + .macro bw2
29053 + bw1
29054 + bw1
29055 + bw1
29056 + bw1
29057 + .endm
29058 +
29059 + .align 3
29060 + .global _start
29061 + .thumb
29062 + .thumb_func
29063 + .type _start, %function
29064 +_start:
29065 + nop
29066 +
29067 + bw2
29068 + bw2
29069 +
29070 + bx lr
29071 --- /dev/null
29072 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-bcc.d
29073 @@ -0,0 +1,77 @@
29074 +
29075 +.*: file format .*
29076 +
29077 +
29078 +Disassembly of section \.text:
29079 +
29080 +00008f00 <_start>:
29081 + 8f00: bf00 nop
29082 + 8f02: eb01 0002 add\.w r0, r1, r2
29083 + 8f06: f4ff affc bcc\.w 8f02 <_start\+0x2>
29084 + 8f0a: eb01 0002 add\.w r0, r1, r2
29085 + 8f0e: f4ff aff8 bcc\.w 8f02 <_start\+0x2>
29086 + 8f12: eb01 0002 add\.w r0, r1, r2
29087 + 8f16: f4ff aff4 bcc\.w 8f02 <_start\+0x2>
29088 + 8f1a: eb01 0002 add\.w r0, r1, r2
29089 + 8f1e: f4ff aff0 bcc\.w 8f02 <_start\+0x2>
29090 + 8f22: eb01 0002 add\.w r0, r1, r2
29091 + 8f26: f4ff affc bcc\.w 8f22 <_start\+0x22>
29092 + 8f2a: eb01 0002 add\.w r0, r1, r2
29093 + 8f2e: f4ff aff8 bcc\.w 8f22 <_start\+0x22>
29094 + 8f32: eb01 0002 add\.w r0, r1, r2
29095 + 8f36: f4ff aff4 bcc\.w 8f22 <_start\+0x22>
29096 + 8f3a: eb01 0002 add\.w r0, r1, r2
29097 + 8f3e: f4ff aff0 bcc\.w 8f22 <_start\+0x22>
29098 + 8f42: eb01 0002 add\.w r0, r1, r2
29099 + 8f46: f4ff affc bcc\.w 8f42 <_start\+0x42>
29100 + 8f4a: eb01 0002 add\.w r0, r1, r2
29101 + 8f4e: f4ff aff8 bcc\.w 8f42 <_start\+0x42>
29102 + 8f52: eb01 0002 add\.w r0, r1, r2
29103 + 8f56: f4ff aff4 bcc\.w 8f42 <_start\+0x42>
29104 + 8f5a: eb01 0002 add\.w r0, r1, r2
29105 + 8f5e: f4ff aff0 bcc\.w 8f42 <_start\+0x42>
29106 + 8f62: eb01 0002 add\.w r0, r1, r2
29107 + 8f66: f4ff affc bcc\.w 8f62 <_start\+0x62>
29108 + 8f6a: eb01 0002 add\.w r0, r1, r2
29109 + 8f6e: f4ff aff8 bcc\.w 8f62 <_start\+0x62>
29110 + 8f72: eb01 0002 add\.w r0, r1, r2
29111 + 8f76: f4ff aff4 bcc\.w 8f62 <_start\+0x62>
29112 + 8f7a: eb01 0002 add\.w r0, r1, r2
29113 + 8f7e: f4ff aff0 bcc\.w 8f62 <_start\+0x62>
29114 + 8f82: eb01 0002 add\.w r0, r1, r2
29115 + 8f86: f4ff affc bcc\.w 8f82 <_start\+0x82>
29116 + 8f8a: eb01 0002 add\.w r0, r1, r2
29117 + 8f8e: f4ff aff8 bcc\.w 8f82 <_start\+0x82>
29118 + 8f92: eb01 0002 add\.w r0, r1, r2
29119 + 8f96: f4ff aff4 bcc\.w 8f82 <_start\+0x82>
29120 + 8f9a: eb01 0002 add\.w r0, r1, r2
29121 + 8f9e: f4ff aff0 bcc\.w 8f82 <_start\+0x82>
29122 + 8fa2: eb01 0002 add\.w r0, r1, r2
29123 + 8fa6: f4ff affc bcc\.w 8fa2 <_start\+0xa2>
29124 + 8faa: eb01 0002 add\.w r0, r1, r2
29125 + 8fae: f4ff aff8 bcc\.w 8fa2 <_start\+0xa2>
29126 + 8fb2: eb01 0002 add\.w r0, r1, r2
29127 + 8fb6: f4ff aff4 bcc\.w 8fa2 <_start\+0xa2>
29128 + 8fba: eb01 0002 add\.w r0, r1, r2
29129 + 8fbe: f4ff aff0 bcc\.w 8fa2 <_start\+0xa2>
29130 + 8fc2: eb01 0002 add\.w r0, r1, r2
29131 + 8fc6: f4ff affc bcc\.w 8fc2 <_start\+0xc2>
29132 + 8fca: eb01 0002 add\.w r0, r1, r2
29133 + 8fce: f4ff aff8 bcc\.w 8fc2 <_start\+0xc2>
29134 + 8fd2: eb01 0002 add\.w r0, r1, r2
29135 + 8fd6: f4ff aff4 bcc\.w 8fc2 <_start\+0xc2>
29136 + 8fda: eb01 0002 add\.w r0, r1, r2
29137 + 8fde: f4ff aff0 bcc\.w 8fc2 <_start\+0xc2>
29138 + 8fe2: eb01 0002 add\.w r0, r1, r2
29139 + 8fe6: f4ff affc bcc\.w 8fe2 <_start\+0xe2>
29140 + 8fea: eb01 0002 add\.w r0, r1, r2
29141 + 8fee: f4ff aff8 bcc\.w 8fe2 <_start\+0xe2>
29142 + 8ff2: eb01 0002 add\.w r0, r1, r2
29143 + 8ff6: f4ff aff4 bcc\.w 8fe2 <_start\+0xe2>
29144 + 8ffa: eb01 0002 add\.w r0, r1, r2
29145 + 8ffe: f000 b803 b\.w 9008 <_start\+0x108>
29146 + 9002: 4770 bx lr
29147 + 9004: f3af 8000 nop\.w
29148 + 9008: d301 bcc\.n 900e <_start\+0x10e>
29149 + 900a: f7ff bffa b\.w 9002 <_start\+0x102>
29150 + 900e: f7ff bfe8 b\.w 8fe2 <_start\+0xe2>
29151 --- /dev/null
29152 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-bcc.s
29153 @@ -0,0 +1,39 @@
29154 + .syntax unified
29155 + .cpu cortex-a8
29156 + .thumb
29157 + .text
29158 +
29159 + @ expansion 32 bytes
29160 + .macro bw1
29161 +1:
29162 + add.w r0, r1, r2
29163 + bcc.w 1b
29164 + add.w r0, r1, r2
29165 + bcc.w 1b
29166 + add.w r0, r1, r2
29167 + bcc.w 1b
29168 + add.w r0, r1, r2
29169 + bcc.w 1b
29170 + .endm
29171 +
29172 + @ expansion 128 bytes
29173 + .macro bw2
29174 + bw1
29175 + bw1
29176 + bw1
29177 + bw1
29178 + .endm
29179 +
29180 + .align 3
29181 + .global _start
29182 + .thumb
29183 + .thumb_func
29184 + .type _start, %function
29185 +_start:
29186 + nop
29187 +
29188 + @ Trigger Cortex-A8 erratum workaround with conditional branches.
29189 + bw2
29190 + bw2
29191 +
29192 + bx lr
29193 --- /dev/null
29194 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-bl-rel-arm.d
29195 @@ -0,0 +1,79 @@
29196 +
29197 +.*: file format .*
29198 +
29199 +
29200 +Disassembly of section \.text:
29201 +
29202 +00008f00 <targetfn>:
29203 + 8f00: e12fff1e bx lr
29204 + 8f04: e320f000 nop \{0\}
29205 +
29206 +00008f08 <_start>:
29207 + 8f08: bf00 nop
29208 + 8f0a: eb01 0002 add\.w r0, r1, r2
29209 + 8f0e: f7ff eff8 blx 8f00 <targetfn>
29210 + 8f12: eb01 0002 add\.w r0, r1, r2
29211 + 8f16: f7ff eff4 blx 8f00 <targetfn>
29212 + 8f1a: eb01 0002 add\.w r0, r1, r2
29213 + 8f1e: f7ff eff0 blx 8f00 <targetfn>
29214 + 8f22: eb01 0002 add\.w r0, r1, r2
29215 + 8f26: f7ff efec blx 8f00 <targetfn>
29216 + 8f2a: eb01 0002 add\.w r0, r1, r2
29217 + 8f2e: f7ff efe8 blx 8f00 <targetfn>
29218 + 8f32: eb01 0002 add\.w r0, r1, r2
29219 + 8f36: f7ff efe4 blx 8f00 <targetfn>
29220 + 8f3a: eb01 0002 add\.w r0, r1, r2
29221 + 8f3e: f7ff efe0 blx 8f00 <targetfn>
29222 + 8f42: eb01 0002 add\.w r0, r1, r2
29223 + 8f46: f7ff efdc blx 8f00 <targetfn>
29224 + 8f4a: eb01 0002 add\.w r0, r1, r2
29225 + 8f4e: f7ff efd8 blx 8f00 <targetfn>
29226 + 8f52: eb01 0002 add\.w r0, r1, r2
29227 + 8f56: f7ff efd4 blx 8f00 <targetfn>
29228 + 8f5a: eb01 0002 add\.w r0, r1, r2
29229 + 8f5e: f7ff efd0 blx 8f00 <targetfn>
29230 + 8f62: eb01 0002 add\.w r0, r1, r2
29231 + 8f66: f7ff efcc blx 8f00 <targetfn>
29232 + 8f6a: eb01 0002 add\.w r0, r1, r2
29233 + 8f6e: f7ff efc8 blx 8f00 <targetfn>
29234 + 8f72: eb01 0002 add\.w r0, r1, r2
29235 + 8f76: f7ff efc4 blx 8f00 <targetfn>
29236 + 8f7a: eb01 0002 add\.w r0, r1, r2
29237 + 8f7e: f7ff efc0 blx 8f00 <targetfn>
29238 + 8f82: eb01 0002 add\.w r0, r1, r2
29239 + 8f86: f7ff efbc blx 8f00 <targetfn>
29240 + 8f8a: eb01 0002 add\.w r0, r1, r2
29241 + 8f8e: f7ff efb8 blx 8f00 <targetfn>
29242 + 8f92: eb01 0002 add\.w r0, r1, r2
29243 + 8f96: f7ff efb4 blx 8f00 <targetfn>
29244 + 8f9a: eb01 0002 add\.w r0, r1, r2
29245 + 8f9e: f7ff efb0 blx 8f00 <targetfn>
29246 + 8fa2: eb01 0002 add\.w r0, r1, r2
29247 + 8fa6: f7ff efac blx 8f00 <targetfn>
29248 + 8faa: eb01 0002 add\.w r0, r1, r2
29249 + 8fae: f7ff efa8 blx 8f00 <targetfn>
29250 + 8fb2: eb01 0002 add\.w r0, r1, r2
29251 + 8fb6: f7ff efa4 blx 8f00 <targetfn>
29252 + 8fba: eb01 0002 add\.w r0, r1, r2
29253 + 8fbe: f7ff efa0 blx 8f00 <targetfn>
29254 + 8fc2: eb01 0002 add\.w r0, r1, r2
29255 + 8fc6: f7ff ef9c blx 8f00 <targetfn>
29256 + 8fca: eb01 0002 add\.w r0, r1, r2
29257 + 8fce: f7ff ef98 blx 8f00 <targetfn>
29258 + 8fd2: eb01 0002 add\.w r0, r1, r2
29259 + 8fd6: f7ff ef94 blx 8f00 <targetfn>
29260 + 8fda: eb01 0002 add\.w r0, r1, r2
29261 + 8fde: f7ff ef90 blx 8f00 <targetfn>
29262 + 8fe2: eb01 0002 add\.w r0, r1, r2
29263 + 8fe6: f7ff ef8c blx 8f00 <targetfn>
29264 + 8fea: eb01 0002 add\.w r0, r1, r2
29265 + 8fee: f7ff ef88 blx 8f00 <targetfn>
29266 + 8ff2: eb01 0002 add\.w r0, r1, r2
29267 + 8ff6: f7ff ef84 blx 8f00 <targetfn>
29268 + 8ffa: eb01 0002 add\.w r0, r1, r2
29269 + 8ffe: f000 e808 blx 9010 <_start\+0x108>
29270 + 9002: eb01 0002 add\.w r0, r1, r2
29271 + 9006: f7ff ef7c blx 8f00 <targetfn>
29272 + 900a: 4770 bx lr
29273 + 900c: f3af 8000 nop\.w
29274 + 9010: eaffffba b 8f00 <targetfn>
29275 --- /dev/null
29276 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-bl-rel-thumb.d
29277 @@ -0,0 +1,80 @@
29278 +
29279 +.*: file format .*
29280 +
29281 +
29282 +Disassembly of section \.text:
29283 +
29284 +00008f00 <targetfn>:
29285 + 8f00: 4770 bx lr
29286 + 8f02: bf00 nop
29287 + 8f04: f3af 8000 nop\.w
29288 +
29289 +00008f08 <_start>:
29290 + 8f08: bf00 nop
29291 + 8f0a: eb01 0002 add\.w r0, r1, r2
29292 + 8f0e: f7ff fff7 bl 8f00 <targetfn>
29293 + 8f12: eb01 0002 add\.w r0, r1, r2
29294 + 8f16: f7ff fff3 bl 8f00 <targetfn>
29295 + 8f1a: eb01 0002 add\.w r0, r1, r2
29296 + 8f1e: f7ff ffef bl 8f00 <targetfn>
29297 + 8f22: eb01 0002 add\.w r0, r1, r2
29298 + 8f26: f7ff ffeb bl 8f00 <targetfn>
29299 + 8f2a: eb01 0002 add\.w r0, r1, r2
29300 + 8f2e: f7ff ffe7 bl 8f00 <targetfn>
29301 + 8f32: eb01 0002 add\.w r0, r1, r2
29302 + 8f36: f7ff ffe3 bl 8f00 <targetfn>
29303 + 8f3a: eb01 0002 add\.w r0, r1, r2
29304 + 8f3e: f7ff ffdf bl 8f00 <targetfn>
29305 + 8f42: eb01 0002 add\.w r0, r1, r2
29306 + 8f46: f7ff ffdb bl 8f00 <targetfn>
29307 + 8f4a: eb01 0002 add\.w r0, r1, r2
29308 + 8f4e: f7ff ffd7 bl 8f00 <targetfn>
29309 + 8f52: eb01 0002 add\.w r0, r1, r2
29310 + 8f56: f7ff ffd3 bl 8f00 <targetfn>
29311 + 8f5a: eb01 0002 add\.w r0, r1, r2
29312 + 8f5e: f7ff ffcf bl 8f00 <targetfn>
29313 + 8f62: eb01 0002 add\.w r0, r1, r2
29314 + 8f66: f7ff ffcb bl 8f00 <targetfn>
29315 + 8f6a: eb01 0002 add\.w r0, r1, r2
29316 + 8f6e: f7ff ffc7 bl 8f00 <targetfn>
29317 + 8f72: eb01 0002 add\.w r0, r1, r2
29318 + 8f76: f7ff ffc3 bl 8f00 <targetfn>
29319 + 8f7a: eb01 0002 add\.w r0, r1, r2
29320 + 8f7e: f7ff ffbf bl 8f00 <targetfn>
29321 + 8f82: eb01 0002 add\.w r0, r1, r2
29322 + 8f86: f7ff ffbb bl 8f00 <targetfn>
29323 + 8f8a: eb01 0002 add\.w r0, r1, r2
29324 + 8f8e: f7ff ffb7 bl 8f00 <targetfn>
29325 + 8f92: eb01 0002 add\.w r0, r1, r2
29326 + 8f96: f7ff ffb3 bl 8f00 <targetfn>
29327 + 8f9a: eb01 0002 add\.w r0, r1, r2
29328 + 8f9e: f7ff ffaf bl 8f00 <targetfn>
29329 + 8fa2: eb01 0002 add\.w r0, r1, r2
29330 + 8fa6: f7ff ffab bl 8f00 <targetfn>
29331 + 8faa: eb01 0002 add\.w r0, r1, r2
29332 + 8fae: f7ff ffa7 bl 8f00 <targetfn>
29333 + 8fb2: eb01 0002 add\.w r0, r1, r2
29334 + 8fb6: f7ff ffa3 bl 8f00 <targetfn>
29335 + 8fba: eb01 0002 add\.w r0, r1, r2
29336 + 8fbe: f7ff ff9f bl 8f00 <targetfn>
29337 + 8fc2: eb01 0002 add\.w r0, r1, r2
29338 + 8fc6: f7ff ff9b bl 8f00 <targetfn>
29339 + 8fca: eb01 0002 add\.w r0, r1, r2
29340 + 8fce: f7ff ff97 bl 8f00 <targetfn>
29341 + 8fd2: eb01 0002 add\.w r0, r1, r2
29342 + 8fd6: f7ff ff93 bl 8f00 <targetfn>
29343 + 8fda: eb01 0002 add\.w r0, r1, r2
29344 + 8fde: f7ff ff8f bl 8f00 <targetfn>
29345 + 8fe2: eb01 0002 add\.w r0, r1, r2
29346 + 8fe6: f7ff ff8b bl 8f00 <targetfn>
29347 + 8fea: eb01 0002 add\.w r0, r1, r2
29348 + 8fee: f7ff ff87 bl 8f00 <targetfn>
29349 + 8ff2: eb01 0002 add\.w r0, r1, r2
29350 + 8ff6: f7ff ff83 bl 8f00 <targetfn>
29351 + 8ffa: eb01 0002 add\.w r0, r1, r2
29352 + 8ffe: f000 f807 bl 9010 <_start\+0x108>
29353 + 9002: eb01 0002 add\.w r0, r1, r2
29354 + 9006: f7ff ff7b bl 8f00 <targetfn>
29355 + 900a: 4770 bx lr
29356 + 900c: f3af 8000 nop\.w
29357 + 9010: f7ff bf76 b\.w 8f00 <targetfn>
29358 --- /dev/null
29359 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-bl-rel.s
29360 @@ -0,0 +1,40 @@
29361 + .syntax unified
29362 + .cpu cortex-a8
29363 + .thumb
29364 + .text
29365 +
29366 + @ expansion 32 bytes
29367 + .macro bw1
29368 +1:
29369 + add.w r0, r1, r2
29370 + bl.w targetfn
29371 + add.w r0, r1, r2
29372 + bl.w targetfn
29373 + add.w r0, r1, r2
29374 + bl.w targetfn
29375 + add.w r0, r1, r2
29376 + bl.w targetfn
29377 + .endm
29378 +
29379 + @ expansion 128 bytes
29380 + .macro bw2
29381 + bw1
29382 + bw1
29383 + bw1
29384 + bw1
29385 + .endm
29386 +
29387 + .align 3
29388 + .global _start
29389 + .thumb
29390 + .thumb_func
29391 + .type _start, %function
29392 +_start:
29393 + nop
29394 +
29395 + @ If calling an ARM destination, we *don't* want to create a
29396 + @ Cortex-A8 stub: the Thumb-to-ARM stub will suffice.
29397 + bw2
29398 + bw2
29399 +
29400 + bx lr
29401 --- /dev/null
29402 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-bl.d
29403 @@ -0,0 +1,75 @@
29404 +
29405 +.*: file format .*
29406 +
29407 +
29408 +Disassembly of section \.text:
29409 +
29410 +00008f00 <_start>:
29411 + 8f00: bf00 nop
29412 + 8f02: eb01 0002 add\.w r0, r1, r2
29413 + 8f06: f7ff fffc bl 8f02 <_start\+0x2>
29414 + 8f0a: eb01 0002 add\.w r0, r1, r2
29415 + 8f0e: f7ff fff8 bl 8f02 <_start\+0x2>
29416 + 8f12: eb01 0002 add\.w r0, r1, r2
29417 + 8f16: f7ff fff4 bl 8f02 <_start\+0x2>
29418 + 8f1a: eb01 0002 add\.w r0, r1, r2
29419 + 8f1e: f7ff fff0 bl 8f02 <_start\+0x2>
29420 + 8f22: eb01 0002 add\.w r0, r1, r2
29421 + 8f26: f7ff fffc bl 8f22 <_start\+0x22>
29422 + 8f2a: eb01 0002 add\.w r0, r1, r2
29423 + 8f2e: f7ff fff8 bl 8f22 <_start\+0x22>
29424 + 8f32: eb01 0002 add\.w r0, r1, r2
29425 + 8f36: f7ff fff4 bl 8f22 <_start\+0x22>
29426 + 8f3a: eb01 0002 add\.w r0, r1, r2
29427 + 8f3e: f7ff fff0 bl 8f22 <_start\+0x22>
29428 + 8f42: eb01 0002 add\.w r0, r1, r2
29429 + 8f46: f7ff fffc bl 8f42 <_start\+0x42>
29430 + 8f4a: eb01 0002 add\.w r0, r1, r2
29431 + 8f4e: f7ff fff8 bl 8f42 <_start\+0x42>
29432 + 8f52: eb01 0002 add\.w r0, r1, r2
29433 + 8f56: f7ff fff4 bl 8f42 <_start\+0x42>
29434 + 8f5a: eb01 0002 add\.w r0, r1, r2
29435 + 8f5e: f7ff fff0 bl 8f42 <_start\+0x42>
29436 + 8f62: eb01 0002 add\.w r0, r1, r2
29437 + 8f66: f7ff fffc bl 8f62 <_start\+0x62>
29438 + 8f6a: eb01 0002 add\.w r0, r1, r2
29439 + 8f6e: f7ff fff8 bl 8f62 <_start\+0x62>
29440 + 8f72: eb01 0002 add\.w r0, r1, r2
29441 + 8f76: f7ff fff4 bl 8f62 <_start\+0x62>
29442 + 8f7a: eb01 0002 add\.w r0, r1, r2
29443 + 8f7e: f7ff fff0 bl 8f62 <_start\+0x62>
29444 + 8f82: eb01 0002 add\.w r0, r1, r2
29445 + 8f86: f7ff fffc bl 8f82 <_start\+0x82>
29446 + 8f8a: eb01 0002 add\.w r0, r1, r2
29447 + 8f8e: f7ff fff8 bl 8f82 <_start\+0x82>
29448 + 8f92: eb01 0002 add\.w r0, r1, r2
29449 + 8f96: f7ff fff4 bl 8f82 <_start\+0x82>
29450 + 8f9a: eb01 0002 add\.w r0, r1, r2
29451 + 8f9e: f7ff fff0 bl 8f82 <_start\+0x82>
29452 + 8fa2: eb01 0002 add\.w r0, r1, r2
29453 + 8fa6: f7ff fffc bl 8fa2 <_start\+0xa2>
29454 + 8faa: eb01 0002 add\.w r0, r1, r2
29455 + 8fae: f7ff fff8 bl 8fa2 <_start\+0xa2>
29456 + 8fb2: eb01 0002 add\.w r0, r1, r2
29457 + 8fb6: f7ff fff4 bl 8fa2 <_start\+0xa2>
29458 + 8fba: eb01 0002 add\.w r0, r1, r2
29459 + 8fbe: f7ff fff0 bl 8fa2 <_start\+0xa2>
29460 + 8fc2: eb01 0002 add\.w r0, r1, r2
29461 + 8fc6: f7ff fffc bl 8fc2 <_start\+0xc2>
29462 + 8fca: eb01 0002 add\.w r0, r1, r2
29463 + 8fce: f7ff fff8 bl 8fc2 <_start\+0xc2>
29464 + 8fd2: eb01 0002 add\.w r0, r1, r2
29465 + 8fd6: f7ff fff4 bl 8fc2 <_start\+0xc2>
29466 + 8fda: eb01 0002 add\.w r0, r1, r2
29467 + 8fde: f7ff fff0 bl 8fc2 <_start\+0xc2>
29468 + 8fe2: eb01 0002 add\.w r0, r1, r2
29469 + 8fe6: f7ff fffc bl 8fe2 <_start\+0xe2>
29470 + 8fea: eb01 0002 add\.w r0, r1, r2
29471 + 8fee: f7ff fff8 bl 8fe2 <_start\+0xe2>
29472 + 8ff2: eb01 0002 add\.w r0, r1, r2
29473 + 8ff6: f7ff fff4 bl 8fe2 <_start\+0xe2>
29474 + 8ffa: eb01 0002 add\.w r0, r1, r2
29475 + 8ffe: f000 f803 bl 9008 <_start\+0x108>
29476 + 9002: 4770 bx lr
29477 + 9004: f3af 8000 nop\.w
29478 + 9008: f7ff bfeb b\.w 8fe2 <_start\+0xe2>
29479 --- /dev/null
29480 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-bl.s
29481 @@ -0,0 +1,39 @@
29482 + .syntax unified
29483 + .cpu cortex-a8
29484 + .thumb
29485 + .text
29486 +
29487 + @ expansion 32 bytes
29488 + .macro bw1
29489 +1:
29490 + add.w r0, r1, r2
29491 + bl.w 1b
29492 + add.w r0, r1, r2
29493 + bl.w 1b
29494 + add.w r0, r1, r2
29495 + bl.w 1b
29496 + add.w r0, r1, r2
29497 + bl.w 1b
29498 + .endm
29499 +
29500 + @ expansion 128 bytes
29501 + .macro bw2
29502 + bw1
29503 + bw1
29504 + bw1
29505 + bw1
29506 + .endm
29507 +
29508 + .align 3
29509 + .global _start
29510 + .thumb
29511 + .thumb_func
29512 + .type _start, %function
29513 +_start:
29514 + nop
29515 +
29516 + @ Trigger Cortex-A8 erratum workaround with bl instructions.
29517 + bw2
29518 + bw2
29519 +
29520 + bx lr
29521 --- /dev/null
29522 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-blx-rel-arm.d
29523 @@ -0,0 +1,79 @@
29524 +
29525 +.*: file format .*
29526 +
29527 +
29528 +Disassembly of section \.text:
29529 +
29530 +00008f00 <targetfn>:
29531 + 8f00: e12fff1e bx lr
29532 + 8f04: e320f000 nop \{0\}
29533 +
29534 +00008f08 <_start>:
29535 + 8f08: bf00 nop
29536 + 8f0a: eb01 0002 add\.w r0, r1, r2
29537 + 8f0e: f7ff eff8 blx 8f00 <targetfn>
29538 + 8f12: eb01 0002 add\.w r0, r1, r2
29539 + 8f16: f7ff eff4 blx 8f00 <targetfn>
29540 + 8f1a: eb01 0002 add\.w r0, r1, r2
29541 + 8f1e: f7ff eff0 blx 8f00 <targetfn>
29542 + 8f22: eb01 0002 add\.w r0, r1, r2
29543 + 8f26: f7ff efec blx 8f00 <targetfn>
29544 + 8f2a: eb01 0002 add\.w r0, r1, r2
29545 + 8f2e: f7ff efe8 blx 8f00 <targetfn>
29546 + 8f32: eb01 0002 add\.w r0, r1, r2
29547 + 8f36: f7ff efe4 blx 8f00 <targetfn>
29548 + 8f3a: eb01 0002 add\.w r0, r1, r2
29549 + 8f3e: f7ff efe0 blx 8f00 <targetfn>
29550 + 8f42: eb01 0002 add\.w r0, r1, r2
29551 + 8f46: f7ff efdc blx 8f00 <targetfn>
29552 + 8f4a: eb01 0002 add\.w r0, r1, r2
29553 + 8f4e: f7ff efd8 blx 8f00 <targetfn>
29554 + 8f52: eb01 0002 add\.w r0, r1, r2
29555 + 8f56: f7ff efd4 blx 8f00 <targetfn>
29556 + 8f5a: eb01 0002 add\.w r0, r1, r2
29557 + 8f5e: f7ff efd0 blx 8f00 <targetfn>
29558 + 8f62: eb01 0002 add\.w r0, r1, r2
29559 + 8f66: f7ff efcc blx 8f00 <targetfn>
29560 + 8f6a: eb01 0002 add\.w r0, r1, r2
29561 + 8f6e: f7ff efc8 blx 8f00 <targetfn>
29562 + 8f72: eb01 0002 add\.w r0, r1, r2
29563 + 8f76: f7ff efc4 blx 8f00 <targetfn>
29564 + 8f7a: eb01 0002 add\.w r0, r1, r2
29565 + 8f7e: f7ff efc0 blx 8f00 <targetfn>
29566 + 8f82: eb01 0002 add\.w r0, r1, r2
29567 + 8f86: f7ff efbc blx 8f00 <targetfn>
29568 + 8f8a: eb01 0002 add\.w r0, r1, r2
29569 + 8f8e: f7ff efb8 blx 8f00 <targetfn>
29570 + 8f92: eb01 0002 add\.w r0, r1, r2
29571 + 8f96: f7ff efb4 blx 8f00 <targetfn>
29572 + 8f9a: eb01 0002 add\.w r0, r1, r2
29573 + 8f9e: f7ff efb0 blx 8f00 <targetfn>
29574 + 8fa2: eb01 0002 add\.w r0, r1, r2
29575 + 8fa6: f7ff efac blx 8f00 <targetfn>
29576 + 8faa: eb01 0002 add\.w r0, r1, r2
29577 + 8fae: f7ff efa8 blx 8f00 <targetfn>
29578 + 8fb2: eb01 0002 add\.w r0, r1, r2
29579 + 8fb6: f7ff efa4 blx 8f00 <targetfn>
29580 + 8fba: eb01 0002 add\.w r0, r1, r2
29581 + 8fbe: f7ff efa0 blx 8f00 <targetfn>
29582 + 8fc2: eb01 0002 add\.w r0, r1, r2
29583 + 8fc6: f7ff ef9c blx 8f00 <targetfn>
29584 + 8fca: eb01 0002 add\.w r0, r1, r2
29585 + 8fce: f7ff ef98 blx 8f00 <targetfn>
29586 + 8fd2: eb01 0002 add\.w r0, r1, r2
29587 + 8fd6: f7ff ef94 blx 8f00 <targetfn>
29588 + 8fda: eb01 0002 add\.w r0, r1, r2
29589 + 8fde: f7ff ef90 blx 8f00 <targetfn>
29590 + 8fe2: eb01 0002 add\.w r0, r1, r2
29591 + 8fe6: f7ff ef8c blx 8f00 <targetfn>
29592 + 8fea: eb01 0002 add\.w r0, r1, r2
29593 + 8fee: f7ff ef88 blx 8f00 <targetfn>
29594 + 8ff2: eb01 0002 add\.w r0, r1, r2
29595 + 8ff6: f7ff ef84 blx 8f00 <targetfn>
29596 + 8ffa: eb01 0002 add\.w r0, r1, r2
29597 + 8ffe: f000 e808 blx 9010 <_start\+0x108>
29598 + 9002: eb01 0002 add\.w r0, r1, r2
29599 + 9006: f7ff ef7c blx 8f00 <targetfn>
29600 + 900a: 4770 bx lr
29601 + 900c: f3af 8000 nop\.w
29602 + 9010: eaffffba b 8f00 <targetfn>
29603 --- /dev/null
29604 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-blx-rel-thumb.d
29605 @@ -0,0 +1,80 @@
29606 +
29607 +.*: file format .*
29608 +
29609 +
29610 +Disassembly of section \.text:
29611 +
29612 +00008f00 <targetfn>:
29613 + 8f00: 4770 bx lr
29614 + 8f02: bf00 nop
29615 + 8f04: f3af 8000 nop\.w
29616 +
29617 +00008f08 <_start>:
29618 + 8f08: bf00 nop
29619 + 8f0a: eb01 0002 add\.w r0, r1, r2
29620 + 8f0e: f7ff fff7 bl 8f00 <targetfn>
29621 + 8f12: eb01 0002 add\.w r0, r1, r2
29622 + 8f16: f7ff fff3 bl 8f00 <targetfn>
29623 + 8f1a: eb01 0002 add\.w r0, r1, r2
29624 + 8f1e: f7ff ffef bl 8f00 <targetfn>
29625 + 8f22: eb01 0002 add\.w r0, r1, r2
29626 + 8f26: f7ff ffeb bl 8f00 <targetfn>
29627 + 8f2a: eb01 0002 add\.w r0, r1, r2
29628 + 8f2e: f7ff ffe7 bl 8f00 <targetfn>
29629 + 8f32: eb01 0002 add\.w r0, r1, r2
29630 + 8f36: f7ff ffe3 bl 8f00 <targetfn>
29631 + 8f3a: eb01 0002 add\.w r0, r1, r2
29632 + 8f3e: f7ff ffdf bl 8f00 <targetfn>
29633 + 8f42: eb01 0002 add\.w r0, r1, r2
29634 + 8f46: f7ff ffdb bl 8f00 <targetfn>
29635 + 8f4a: eb01 0002 add\.w r0, r1, r2
29636 + 8f4e: f7ff ffd7 bl 8f00 <targetfn>
29637 + 8f52: eb01 0002 add\.w r0, r1, r2
29638 + 8f56: f7ff ffd3 bl 8f00 <targetfn>
29639 + 8f5a: eb01 0002 add\.w r0, r1, r2
29640 + 8f5e: f7ff ffcf bl 8f00 <targetfn>
29641 + 8f62: eb01 0002 add\.w r0, r1, r2
29642 + 8f66: f7ff ffcb bl 8f00 <targetfn>
29643 + 8f6a: eb01 0002 add\.w r0, r1, r2
29644 + 8f6e: f7ff ffc7 bl 8f00 <targetfn>
29645 + 8f72: eb01 0002 add\.w r0, r1, r2
29646 + 8f76: f7ff ffc3 bl 8f00 <targetfn>
29647 + 8f7a: eb01 0002 add\.w r0, r1, r2
29648 + 8f7e: f7ff ffbf bl 8f00 <targetfn>
29649 + 8f82: eb01 0002 add\.w r0, r1, r2
29650 + 8f86: f7ff ffbb bl 8f00 <targetfn>
29651 + 8f8a: eb01 0002 add\.w r0, r1, r2
29652 + 8f8e: f7ff ffb7 bl 8f00 <targetfn>
29653 + 8f92: eb01 0002 add\.w r0, r1, r2
29654 + 8f96: f7ff ffb3 bl 8f00 <targetfn>
29655 + 8f9a: eb01 0002 add\.w r0, r1, r2
29656 + 8f9e: f7ff ffaf bl 8f00 <targetfn>
29657 + 8fa2: eb01 0002 add\.w r0, r1, r2
29658 + 8fa6: f7ff ffab bl 8f00 <targetfn>
29659 + 8faa: eb01 0002 add\.w r0, r1, r2
29660 + 8fae: f7ff ffa7 bl 8f00 <targetfn>
29661 + 8fb2: eb01 0002 add\.w r0, r1, r2
29662 + 8fb6: f7ff ffa3 bl 8f00 <targetfn>
29663 + 8fba: eb01 0002 add\.w r0, r1, r2
29664 + 8fbe: f7ff ff9f bl 8f00 <targetfn>
29665 + 8fc2: eb01 0002 add\.w r0, r1, r2
29666 + 8fc6: f7ff ff9b bl 8f00 <targetfn>
29667 + 8fca: eb01 0002 add\.w r0, r1, r2
29668 + 8fce: f7ff ff97 bl 8f00 <targetfn>
29669 + 8fd2: eb01 0002 add\.w r0, r1, r2
29670 + 8fd6: f7ff ff93 bl 8f00 <targetfn>
29671 + 8fda: eb01 0002 add\.w r0, r1, r2
29672 + 8fde: f7ff ff8f bl 8f00 <targetfn>
29673 + 8fe2: eb01 0002 add\.w r0, r1, r2
29674 + 8fe6: f7ff ff8b bl 8f00 <targetfn>
29675 + 8fea: eb01 0002 add\.w r0, r1, r2
29676 + 8fee: f7ff ff87 bl 8f00 <targetfn>
29677 + 8ff2: eb01 0002 add\.w r0, r1, r2
29678 + 8ff6: f7ff ff83 bl 8f00 <targetfn>
29679 + 8ffa: eb01 0002 add\.w r0, r1, r2
29680 + 8ffe: f000 f807 bl 9010 <_start\+0x108>
29681 + 9002: eb01 0002 add\.w r0, r1, r2
29682 + 9006: f7ff ff7b bl 8f00 <targetfn>
29683 + 900a: 4770 bx lr
29684 + 900c: f3af 8000 nop\.w
29685 + 9010: f7ff bf76 b\.w 8f00 <targetfn>
29686 --- /dev/null
29687 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-blx-rel.s
29688 @@ -0,0 +1,38 @@
29689 + .syntax unified
29690 + .cpu cortex-a8
29691 + .thumb
29692 + .text
29693 +
29694 + @ expansion 32 bytes
29695 + .macro bw1
29696 +1:
29697 + add.w r0, r1, r2
29698 + blx.w targetfn
29699 + add.w r0, r1, r2
29700 + blx.w targetfn
29701 + add.w r0, r1, r2
29702 + blx.w targetfn
29703 + add.w r0, r1, r2
29704 + blx.w targetfn
29705 + .endm
29706 +
29707 + @ expansion 128 bytes
29708 + .macro bw2
29709 + bw1
29710 + bw1
29711 + bw1
29712 + bw1
29713 + .endm
29714 +
29715 + .align 3
29716 + .global _start
29717 + .thumb
29718 + .thumb_func
29719 + .type _start, %function
29720 +_start:
29721 + nop
29722 +
29723 + bw2
29724 + bw2
29725 +
29726 + bx lr
29727 --- /dev/null
29728 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-blx.d
29729 @@ -0,0 +1,79 @@
29730 +
29731 +.*: file format .*
29732 +
29733 +
29734 +Disassembly of section \.text:
29735 +
29736 +00008f00 <armfn>:
29737 + 8f00: e1a02413 lsl r2, r3, r4
29738 + 8f04: e12fff1e bx lr
29739 +
29740 +00008f08 <_start>:
29741 + 8f08: bf00 nop
29742 + 8f0a: eb01 0002 add\.w r0, r1, r2
29743 + 8f0e: f7ff eff8 blx 8f00 <armfn>
29744 + 8f12: eb01 0002 add\.w r0, r1, r2
29745 + 8f16: f7ff eff4 blx 8f00 <armfn>
29746 + 8f1a: eb01 0002 add\.w r0, r1, r2
29747 + 8f1e: f7ff eff0 blx 8f00 <armfn>
29748 + 8f22: eb01 0002 add\.w r0, r1, r2
29749 + 8f26: f7ff efec blx 8f00 <armfn>
29750 + 8f2a: eb01 0002 add\.w r0, r1, r2
29751 + 8f2e: f7ff efe8 blx 8f00 <armfn>
29752 + 8f32: eb01 0002 add\.w r0, r1, r2
29753 + 8f36: f7ff efe4 blx 8f00 <armfn>
29754 + 8f3a: eb01 0002 add\.w r0, r1, r2
29755 + 8f3e: f7ff efe0 blx 8f00 <armfn>
29756 + 8f42: eb01 0002 add\.w r0, r1, r2
29757 + 8f46: f7ff efdc blx 8f00 <armfn>
29758 + 8f4a: eb01 0002 add\.w r0, r1, r2
29759 + 8f4e: f7ff efd8 blx 8f00 <armfn>
29760 + 8f52: eb01 0002 add\.w r0, r1, r2
29761 + 8f56: f7ff efd4 blx 8f00 <armfn>
29762 + 8f5a: eb01 0002 add\.w r0, r1, r2
29763 + 8f5e: f7ff efd0 blx 8f00 <armfn>
29764 + 8f62: eb01 0002 add\.w r0, r1, r2
29765 + 8f66: f7ff efcc blx 8f00 <armfn>
29766 + 8f6a: eb01 0002 add\.w r0, r1, r2
29767 + 8f6e: f7ff efc8 blx 8f00 <armfn>
29768 + 8f72: eb01 0002 add\.w r0, r1, r2
29769 + 8f76: f7ff efc4 blx 8f00 <armfn>
29770 + 8f7a: eb01 0002 add\.w r0, r1, r2
29771 + 8f7e: f7ff efc0 blx 8f00 <armfn>
29772 + 8f82: eb01 0002 add\.w r0, r1, r2
29773 + 8f86: f7ff efbc blx 8f00 <armfn>
29774 + 8f8a: eb01 0002 add\.w r0, r1, r2
29775 + 8f8e: f7ff efb8 blx 8f00 <armfn>
29776 + 8f92: eb01 0002 add\.w r0, r1, r2
29777 + 8f96: f7ff efb4 blx 8f00 <armfn>
29778 + 8f9a: eb01 0002 add\.w r0, r1, r2
29779 + 8f9e: f7ff efb0 blx 8f00 <armfn>
29780 + 8fa2: eb01 0002 add\.w r0, r1, r2
29781 + 8fa6: f7ff efac blx 8f00 <armfn>
29782 + 8faa: eb01 0002 add\.w r0, r1, r2
29783 + 8fae: f7ff efa8 blx 8f00 <armfn>
29784 + 8fb2: eb01 0002 add\.w r0, r1, r2
29785 + 8fb6: f7ff efa4 blx 8f00 <armfn>
29786 + 8fba: eb01 0002 add\.w r0, r1, r2
29787 + 8fbe: f7ff efa0 blx 8f00 <armfn>
29788 + 8fc2: eb01 0002 add\.w r0, r1, r2
29789 + 8fc6: f7ff ef9c blx 8f00 <armfn>
29790 + 8fca: eb01 0002 add\.w r0, r1, r2
29791 + 8fce: f7ff ef98 blx 8f00 <armfn>
29792 + 8fd2: eb01 0002 add\.w r0, r1, r2
29793 + 8fd6: f7ff ef94 blx 8f00 <armfn>
29794 + 8fda: eb01 0002 add\.w r0, r1, r2
29795 + 8fde: f7ff ef90 blx 8f00 <armfn>
29796 + 8fe2: eb01 0002 add\.w r0, r1, r2
29797 + 8fe6: f7ff ef8c blx 8f00 <armfn>
29798 + 8fea: eb01 0002 add\.w r0, r1, r2
29799 + 8fee: f7ff ef88 blx 8f00 <armfn>
29800 + 8ff2: eb01 0002 add\.w r0, r1, r2
29801 + 8ff6: f7ff ef84 blx 8f00 <armfn>
29802 + 8ffa: eb01 0002 add\.w r0, r1, r2
29803 + 8ffe: f000 e808 blx 9010 <_start\+0x108>
29804 + 9002: eb01 0002 add\.w r0, r1, r2
29805 + 9006: f7ff ef7c blx 8f00 <armfn>
29806 + 900a: 4770 bx lr
29807 + 900c: f3af 8000 nop\.w
29808 + 9010: eaffffba b 8f00 <armfn>
29809 --- /dev/null
29810 +++ b/ld/testsuite/ld-arm/cortex-a8-fix-blx.s
29811 @@ -0,0 +1,44 @@
29812 + .syntax unified
29813 + .cpu cortex-a8
29814 + .text
29815 +
29816 + @ expansion 32 bytes
29817 + .macro bw1
29818 + add.w r0, r1, r2
29819 + blx.w armfn
29820 + add.w r0, r1, r2
29821 + blx.w armfn
29822 + add.w r0, r1, r2
29823 + blx.w armfn
29824 + add.w r0, r1, r2
29825 + blx.w armfn
29826 + .endm
29827 +
29828 + @ expansion 128 bytes
29829 + .macro bw2
29830 + bw1
29831 + bw1
29832 + bw1
29833 + bw1
29834 + .endm
29835 +
29836 + .arm
29837 + .align 2
29838 +armfn:
29839 + mov r2, r3, asl r4
29840 + bx lr
29841 +
29842 + .global _start
29843 +
29844 + .thumb
29845 + .thumb_func
29846 + .align 3
29847 + .type _start, %function
29848 +_start:
29849 + nop
29850 +
29851 + @ Trigger Cortex-A8 erratum workaround with blx instructions.
29852 + bw2
29853 + bw2
29854 +
29855 + bx lr
29856 --- /dev/null
29857 +++ b/ld/testsuite/ld-arm/cortex-a8-thumb-target.s
29858 @@ -0,0 +1,10 @@
29859 + .syntax unified
29860 + .cpu cortex-a8
29861 + .text
29862 + .thumb
29863 + .thumb_func
29864 + .align 3
29865 + .global targetfn
29866 + .type targetfn, %function
29867 +targetfn:
29868 + bx lr
29869 --- a/ld/testsuite/ld-arm/farcall-arm-arm-be8.d
29870 +++ b/ld/testsuite/ld-arm/farcall-arm-arm-be8.d
29871 @@ -2,13 +2,14 @@
29872
29873 Disassembly of section .text:
29874
29875 -00001000 <__bar_veneer>:
29876 - 1000: 04f01fe5 .*
29877 - 1004: 02001020 .word 0x02001020
29878 +00001000 <_start>:
29879 + 1000: 000000eb bl 1008 <__bar_veneer>
29880 + 1004: 00000000 andeq r0, r0, r0
29881
29882 -00001008 <_start>:
29883 - 1008: fcffffeb .*
29884 +00001008 <__bar_veneer>:
29885 + 1008: 04f01fe5 ldr pc, \[pc, #-4\] ; 100c <__bar_veneer\+0x4>
29886 + 100c: 02001020 .word 0x02001020
29887 Disassembly of section .foo:
29888
29889 02001020 <bar>:
29890 - 2001020: 1eff2fe1 .*
29891 + 2001020: 1eff2fe1 bx lr
29892 --- a/ld/testsuite/ld-arm/farcall-arm-arm-pic-veneer.d
29893 +++ b/ld/testsuite/ld-arm/farcall-arm-arm-pic-veneer.d
29894 @@ -2,14 +2,15 @@
29895
29896 Disassembly of section .text:
29897
29898 -00001000 <__bar_veneer>:
29899 - 1000: e59fc000 ldr ip, \[pc, #0\] ; 1008 <__bar_veneer\+0x8>
29900 - 1004: e08ff00c add pc, pc, ip
29901 - 1008: 02000018 .word 0x02000018
29902 - 100c: 00000000 .word 0x00000000
29903 +00001000 <_start>:
29904 + 1000: eb000000 bl 1008 <__bar_veneer>
29905 + 1004: 00000000 andeq r0, r0, r0
29906
29907 -00001010 <_start>:
29908 - 1010: ebfffffa bl 1000 <__bar_veneer>
29909 +00001008 <__bar_veneer>:
29910 + 1008: e59fc000 ldr ip, \[pc, #0\] ; 1010 <__bar_veneer\+0x8>
29911 + 100c: e08ff00c add pc, pc, ip
29912 + 1010: 0200000c .word 0x0200000c
29913 + 1014: 00000000 .word 0x00000000
29914 Disassembly of section .foo:
29915
29916 02001020 <bar>:
29917 --- a/ld/testsuite/ld-arm/farcall-arm-arm.d
29918 +++ b/ld/testsuite/ld-arm/farcall-arm-arm.d
29919 @@ -2,12 +2,13 @@
29920
29921 Disassembly of section .text:
29922
29923 -00001000 <__bar_veneer>:
29924 - 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <__bar_veneer\+0x4>
29925 - 1004: 02001020 .word 0x02001020
29926 +00001000 <_start>:
29927 + 1000: eb000000 bl 1008 <__bar_veneer>
29928 + 1004: 00000000 andeq r0, r0, r0
29929
29930 -00001008 <_start>:
29931 - 1008: ebfffffc bl 1000 <__bar_veneer>
29932 +00001008 <__bar_veneer>:
29933 + 1008: e51ff004 ldr pc, \[pc, #-4\] ; 100c <__bar_veneer\+0x4>
29934 + 100c: 02001020 .word 0x02001020
29935 Disassembly of section .foo:
29936
29937 02001020 <bar>:
29938 --- a/ld/testsuite/ld-arm/farcall-arm-thumb-blx-pic-veneer.d
29939 +++ b/ld/testsuite/ld-arm/farcall-arm-thumb-blx-pic-veneer.d
29940 @@ -2,14 +2,15 @@
29941
29942 Disassembly of section .text:
29943
29944 -00001000 <__bar_from_arm>:
29945 - 1000: e59fc000 ldr ip, \[pc, #0\] ; 1008 <__bar_from_arm\+0x8>
29946 - 1004: e08ff00c add pc, pc, ip
29947 - 1008: 0200000d .word 0x0200000d
29948 - 100c: 00000000 .word 0x00000000
29949 +00001000 <_start>:
29950 + 1000: eb000000 bl 1008 <__bar_from_arm>
29951 + 1004: 00000000 andeq r0, r0, r0
29952
29953 -00001010 <_start>:
29954 - 1010: ebfffffa bl 1000 <__bar_from_arm>
29955 +00001008 <__bar_from_arm>:
29956 + 1008: e59fc004 ldr ip, \[pc, #4\] ; 1014 <__bar_from_arm\+0xc>
29957 + 100c: e08fc00c add ip, pc, ip
29958 + 1010: e12fff1c bx ip
29959 + 1014: 02000001 .word 0x02000001
29960 Disassembly of section .foo:
29961
29962 02001014 <bar>:
29963 --- a/ld/testsuite/ld-arm/farcall-arm-thumb-blx.d
29964 +++ b/ld/testsuite/ld-arm/farcall-arm-thumb-blx.d
29965 @@ -2,12 +2,13 @@
29966
29967 Disassembly of section .text:
29968
29969 -00001000 <__bar_from_arm>:
29970 - 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <__bar_from_arm\+0x4>
29971 - 1004: 02001015 .word 0x02001015
29972 +00001000 <_start>:
29973 + 1000: eb000000 bl 1008 <__bar_from_arm>
29974 + 1004: 00000000 andeq r0, r0, r0
29975
29976 -00001008 <_start>:
29977 - 1008: ebfffffc bl 1000 <__bar_from_arm>
29978 +00001008 <__bar_from_arm>:
29979 + 1008: e51ff004 ldr pc, \[pc, #-4\] ; 100c <__bar_from_arm\+0x4>
29980 + 100c: 02001015 .word 0x02001015
29981 Disassembly of section .foo:
29982
29983 02001014 <bar>:
29984 --- a/ld/testsuite/ld-arm/farcall-arm-thumb-pic-veneer.d
29985 +++ b/ld/testsuite/ld-arm/farcall-arm-thumb-pic-veneer.d
29986 @@ -2,14 +2,15 @@
29987
29988 Disassembly of section .text:
29989
29990 -00001000 <__bar_from_arm>:
29991 - 1000: e59fc000 ldr ip, \[pc, #0\] ; 1008 <__bar_from_arm\+0x8>
29992 - 1004: e08ff00c add pc, pc, ip
29993 - 1008: 0200000d .word 0x0200000d
29994 - 100c: 00000000 .word 0x00000000
29995 +00001000 <_start>:
29996 + 1000: eb000000 bl 1008 <__bar_from_arm>
29997 + 1004: 00000000 andeq r0, r0, r0
29998
29999 -00001010 <_start>:
30000 - 1010: ebfffffa bl 1000 <__bar_from_arm>
30001 +00001008 <__bar_from_arm>:
30002 + 1008: e59fc004 ldr ip, \[pc, #4\] ; 1014 <__bar_from_arm\+0xc>
30003 + 100c: e08fc00c add ip, pc, ip
30004 + 1010: e12fff1c bx ip
30005 + 1014: 02000001 .word 0x02000001
30006 Disassembly of section .foo:
30007
30008 02001014 <bar>:
30009 --- a/ld/testsuite/ld-arm/farcall-arm-thumb.d
30010 +++ b/ld/testsuite/ld-arm/farcall-arm-thumb.d
30011 @@ -2,14 +2,15 @@
30012
30013 Disassembly of section .text:
30014
30015 -00001000 <__bar_from_arm>:
30016 - 1000: e59fc000 ldr ip, \[pc, #0\] ; 1008 <__bar_from_arm\+0x8>
30017 - 1004: e12fff1c bx ip
30018 - 1008: 02001015 .word 0x02001015
30019 - 100c: 00000000 .word 0x00000000
30020 +00001000 <_start>:
30021 + 1000: eb000000 bl 1008 <__bar_from_arm>
30022 + 1004: 00000000 andeq r0, r0, r0
30023
30024 -00001010 <_start>:
30025 - 1010: ebfffffa bl 1000 <__bar_from_arm>
30026 +00001008 <__bar_from_arm>:
30027 + 1008: e59fc000 ldr ip, \[pc, #0\] ; 1010 <__bar_from_arm\+0x8>
30028 + 100c: e12fff1c bx ip
30029 + 1010: 02001015 .word 0x02001015
30030 + 1014: 00000000 .word 0x00000000
30031 Disassembly of section .foo:
30032
30033 02001014 <bar>:
30034 --- a/ld/testsuite/ld-arm/farcall-group-size2.d
30035 +++ b/ld/testsuite/ld-arm/farcall-group-size2.d
30036 @@ -3,35 +3,35 @@
30037
30038 Disassembly of section .text:
30039
30040 -00001000 <__bar2_veneer>:
30041 - 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <__bar2_veneer\+0x4>
30042 - 1004: 02003024 .word 0x02003024
30043 +00001000 <_start>:
30044 + 1000: eb000000 bl 1008 <__bar_from_arm>
30045 + 1004: eb000002 bl 1014 <__bar2_veneer>
30046 00001008 <__bar_from_arm>:
30047 1008: e59fc000 ldr ip, \[pc, #0\] ; 1010 <__bar_from_arm\+0x8>
30048 100c: e12fff1c bx ip
30049 1010: 02003021 .word 0x02003021
30050 - 1014: 00000000 .word 0x00000000
30051 -
30052 -00001018 <_start>:
30053 - 1018: ebfffffa bl 1008 <__bar_from_arm>
30054 - 101c: ebfffff7 bl 1000 <__bar2_veneer>
30055 -00001020 <__bar3_veneer>:
30056 - 1020: e51ff004 ldr pc, \[pc, #-4\] ; 1024 <__bar3_veneer\+0x4>
30057 - 1024: 02003028 .word 0x02003028
30058 -00001028 <__bar5_from_arm>:
30059 - 1028: e59fc000 ldr ip, \[pc, #0\] ; 1030 <__bar5_from_arm\+0x8>
30060 - 102c: e12fff1c bx ip
30061 - 1030: 0200302f .word 0x0200302f
30062 -00001034 <__bar4_from_arm>:
30063 - 1034: e59fc000 ldr ip, \[pc, #0\] ; 103c <__bar4_from_arm\+0x8>
30064 - 1038: e12fff1c bx ip
30065 - 103c: 0200302d .word 0x0200302d
30066 +00001014 <__bar2_veneer>:
30067 + 1014: e51ff004 ldr pc, \[pc, #-4\] ; 1018 <__bar2_veneer\+0x4>
30068 + 1018: 02003024 .word 0x02003024
30069 + 101c: 00000000 .word 0x00000000
30070 +00001020 <myfunc>:
30071 + 1020: eb000008 bl 1048 <__bar3_veneer>
30072 + 1024: eb000004 bl 103c <__bar4_from_arm>
30073 + 1028: eb000000 bl 1030 <__bar5_from_arm>
30074 + 102c: 00000000 andeq r0, r0, r0
30075 +00001030 <__bar5_from_arm>:
30076 + 1030: e59fc000 ldr ip, \[pc, #0\] ; 1038 <__bar5_from_arm\+0x8>
30077 + 1034: e12fff1c bx ip
30078 + 1038: 0200302f .word 0x0200302f
30079 +0000103c <__bar4_from_arm>:
30080 + 103c: e59fc000 ldr ip, \[pc, #0\] ; 1044 <__bar4_from_arm\+0x8>
30081 + 1040: e12fff1c bx ip
30082 + 1044: 0200302d .word 0x0200302d
30083 +00001048 <__bar3_veneer>:
30084 + 1048: e51ff004 ldr pc, \[pc, #-4\] ; 104c <__bar3_veneer\+0x4>
30085 + 104c: 02003028 .word 0x02003028
30086 ...
30087
30088 -00001048 <myfunc>:
30089 - 1048: ebfffff4 bl 1020 <__bar3_veneer>
30090 - 104c: ebfffff8 bl 1034 <__bar4_from_arm>
30091 - 1050: ebfffff4 bl 1028 <__bar5_from_arm>
30092 Disassembly of section .foo:
30093
30094 02003020 <bar>:
30095 --- a/ld/testsuite/ld-arm/farcall-group.d
30096 +++ b/ld/testsuite/ld-arm/farcall-group.d
30097 @@ -3,34 +3,35 @@
30098
30099 Disassembly of section .text:
30100
30101 -00001000 <__bar2_veneer>:
30102 - 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <__bar2_veneer\+0x4>
30103 - 1004: 02003024 .word 0x02003024
30104 -00001008 <__bar_from_arm>:
30105 - 1008: e59fc000 ldr ip, \[pc, #0\] ; 1010 <__bar_from_arm\+0x8>
30106 - 100c: e12fff1c bx ip
30107 - 1010: 02003021 .word 0x02003021
30108 -00001014 <__bar3_veneer>:
30109 - 1014: e51ff004 ldr pc, \[pc, #-4\] ; 1018 <__bar3_veneer\+0x4>
30110 - 1018: 02003028 .word 0x02003028
30111 -0000101c <__bar4_from_arm>:
30112 - 101c: e59fc000 ldr ip, \[pc, #0\] ; 1024 <__bar4_from_arm\+0x8>
30113 - 1020: e12fff1c bx ip
30114 - 1024: 0200302d .word 0x0200302d
30115 -00001028 <__bar5_from_arm>:
30116 - 1028: e59fc000 ldr ip, \[pc, #0\] ; 1030 <__bar5_from_arm\+0x8>
30117 - 102c: e12fff1c bx ip
30118 - 1030: 0200302f .word 0x0200302f
30119 +00001000 <_start>:
30120 + 1000: eb00000c bl 1038 <__bar_from_arm>
30121 + 1004: eb00000e bl 1044 <__bar2_veneer>
30122 +
30123 +00001008 <myfunc>:
30124 + 1008: eb000008 bl 1030 <__bar3_veneer>
30125 + 100c: eb000004 bl 1024 <__bar4_from_arm>
30126 + 1010: eb000000 bl 1018 <__bar5_from_arm>
30127 + 1014: 00000000 andeq r0, r0, r0
30128 +
30129 +00001018 <__bar5_from_arm>:
30130 + 1018: e59fc000 ldr ip, \[pc, #0\] ; 1020 <__bar5_from_arm\+0x8>
30131 + 101c: e12fff1c bx ip
30132 + 1020: 0200302f .word 0x0200302f
30133 +00001024 <__bar4_from_arm>:
30134 + 1024: e59fc000 ldr ip, \[pc, #0\] ; 102c <__bar4_from_arm\+0x8>
30135 + 1028: e12fff1c bx ip
30136 + 102c: 0200302d .word 0x0200302d
30137 +00001030 <__bar3_veneer>:
30138 + 1030: e51ff004 ldr pc, \[pc, #-4\] ; 1034 <__bar3_veneer\+0x4>
30139 + 1034: 02003028 .word 0x02003028
30140 +00001038 <__bar_from_arm>:
30141 + 1038: e59fc000 ldr ip, \[pc, #0\] ; 1040 <__bar_from_arm\+0x8>
30142 + 103c: e12fff1c bx ip
30143 + 1040: 02003021 .word 0x02003021
30144 +00001044 <__bar2_veneer>:
30145 + 1044: e51ff004 ldr pc, \[pc, #-4\] ; 1048 <__bar2_veneer\+0x4>
30146 + 1048: 02003024 .word 0x02003024
30147 ...
30148 -
30149 -00001040 <_start>:
30150 - 1040: ebfffff0 bl 1008 <__bar_from_arm>
30151 - 1044: ebffffed bl 1000 <__bar2_veneer>
30152 -
30153 -00001048 <myfunc>:
30154 - 1048: ebfffff1 bl 1014 <__bar3_veneer>
30155 - 104c: ebfffff2 bl 101c <__bar4_from_arm>
30156 - 1050: ebfffff4 bl 1028 <__bar5_from_arm>
30157 Disassembly of section .foo:
30158
30159 02003020 <bar>:
30160 --- a/ld/testsuite/ld-arm/farcall-mix.d
30161 +++ b/ld/testsuite/ld-arm/farcall-mix.d
30162 @@ -3,32 +3,33 @@
30163
30164 Disassembly of section .text:
30165
30166 -00001000 <__bar2_veneer>:
30167 - 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <__bar2_veneer\+0x4>
30168 - 1004: 02002024 .word 0x02002024
30169 -00001008 <__bar_from_arm>:
30170 - 1008: e59fc000 ldr ip, \[pc, #0\] ; 1010 <__bar_from_arm\+0x8>
30171 - 100c: e12fff1c bx ip
30172 - 1010: 02002021 .word 0x02002021
30173 -00001014 <__bar3_veneer>:
30174 - 1014: e51ff004 ldr pc, \[pc, #-4\] ; 1018 <__bar3_veneer\+0x4>
30175 - 1018: 02002028 .word 0x02002028
30176 -0000101c <__bar4_from_arm>:
30177 - 101c: e59fc000 ldr ip, \[pc, #0\] ; 1024 <__bar4_from_arm\+0x8>
30178 - 1020: e12fff1c bx ip
30179 - 1024: 0200202d .word 0x0200202d
30180 -00001028 <__bar5_from_arm>:
30181 - 1028: e59fc000 ldr ip, \[pc, #0\] ; 1030 <__bar5_from_arm\+0x8>
30182 - 102c: e12fff1c bx ip
30183 - 1030: 0200202f .word 0x0200202f
30184 +00001000 <_start>:
30185 + 1000: eb000009 bl 102c <__bar_from_arm>
30186 + 1004: eb00000b bl 1038 <__bar2_veneer>
30187 + 1008: eb000005 bl 1024 <__bar3_veneer>
30188 + 100c: eb00000b bl 1040 <__bar4_from_arm>
30189 + 1010: eb000000 bl 1018 <__bar5_from_arm>
30190 + 1014: 00000000 andeq r0, r0, r0
30191 +
30192 +00001018 <__bar5_from_arm>:
30193 + 1018: e59fc000 ldr ip, \[pc, #0\] ; 1020 <__bar5_from_arm\+0x8>
30194 + 101c: e12fff1c bx ip
30195 + 1020: 0200202f .word 0x0200202f
30196 +00001024 <__bar3_veneer>:
30197 + 1024: e51ff004 ldr pc, \[pc, #-4\] ; 1028 <__bar3_veneer\+0x4>
30198 + 1028: 02002028 .word 0x02002028
30199 +0000102c <__bar_from_arm>:
30200 + 102c: e59fc000 ldr ip, \[pc, #0\] ; 1034 <__bar_from_arm\+0x8>
30201 + 1030: e12fff1c bx ip
30202 + 1034: 02002021 .word 0x02002021
30203 +00001038 <__bar2_veneer>:
30204 + 1038: e51ff004 ldr pc, \[pc, #-4\] ; 103c <__bar2_veneer\+0x4>
30205 + 103c: 02002024 .word 0x02002024
30206 +00001040 <__bar4_from_arm>:
30207 + 1040: e59fc000 ldr ip, \[pc, #0\] ; 1048 <__bar4_from_arm\+0x8>
30208 + 1044: e12fff1c bx ip
30209 + 1048: 0200202d .word 0x0200202d
30210 ...
30211 -
30212 -00001040 <_start>:
30213 - 1040: ebfffff0 bl 1008 <__bar_from_arm>
30214 - 1044: ebffffed bl 1000 <__bar2_veneer>
30215 - 1048: ebfffff1 bl 1014 <__bar3_veneer>
30216 - 104c: ebfffff2 bl 101c <__bar4_from_arm>
30217 - 1050: ebfffff4 bl 1028 <__bar5_from_arm>
30218 Disassembly of section .foo:
30219
30220 02002020 <bar>:
30221 --- a/ld/testsuite/ld-arm/farcall-mix2.d
30222 +++ b/ld/testsuite/ld-arm/farcall-mix2.d
30223 @@ -3,35 +3,37 @@
30224
30225 Disassembly of section .text:
30226
30227 -00001000 <__bar2_veneer>:
30228 - 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <__bar2_veneer\+0x4>
30229 - 1004: 02003024 .word 0x02003024
30230 +00001000 <_start>:
30231 + 1000: eb000000 bl 1008 <__bar_from_arm>
30232 + 1004: eb000002 bl 1014 <__bar2_veneer>
30233 +
30234 00001008 <__bar_from_arm>:
30235 1008: e59fc000 ldr ip, \[pc, #0\] ; 1010 <__bar_from_arm\+0x8>
30236 100c: e12fff1c bx ip
30237 1010: 02003021 .word 0x02003021
30238 - 1014: 00000000 .word 0x00000000
30239 -
30240 -00001018 <_start>:
30241 - 1018: ebfffffa bl 1008 <__bar_from_arm>
30242 - 101c: ebfffff7 bl 1000 <__bar2_veneer>
30243 +00001014 <__bar2_veneer>:
30244 + 1014: e51ff004 ldr pc, \[pc, #-4\] ; 1018 <__bar2_veneer\+0x4>
30245 + 1018: 02003024 .word 0x02003024
30246 + 101c: 00000000 .word 0x00000000
30247 Disassembly of section .mytext:
30248
30249 -00002000 <__bar5_from_arm>:
30250 - 2000: e59fc000 ldr ip, \[pc, #0\] ; 2008 <__bar5_from_arm\+0x8>
30251 - 2004: e12fff1c bx ip
30252 - 2008: 0200302f .word 0x0200302f
30253 -0000200c <__bar3_veneer>:
30254 - 200c: e51ff004 ldr pc, \[pc, #-4\] ; 2010 <__bar3_veneer\+0x4>
30255 - 2010: 02003028 .word 0x02003028
30256 -00002014 <__bar4_from_arm>:
30257 - 2014: e59fc000 ldr ip, \[pc, #0\] ; 201c <__bar4_from_arm\+0x8>
30258 - 2018: e12fff1c bx ip
30259 - 201c: 0200302d .word 0x0200302d
30260 +00002000 <__bar5_from_arm-0x10>:
30261 + 2000: eb000008 bl 2028 <__bar3_veneer>
30262 + 2004: eb000004 bl 201c <__bar4_from_arm>
30263 + 2008: eb000000 bl 2010 <__bar5_from_arm>
30264 + 200c: 00000000 andeq r0, r0, r0
30265 +00002010 <__bar5_from_arm>:
30266 + 2010: e59fc000 ldr ip, \[pc, #0\] ; 2018 <__bar5_from_arm\+0x8>
30267 + 2014: e12fff1c bx ip
30268 + 2018: 0200302f .word 0x0200302f
30269 +0000201c <__bar4_from_arm>:
30270 + 201c: e59fc000 ldr ip, \[pc, #0\] ; 2024 <__bar4_from_arm\+0x8>
30271 + 2020: e12fff1c bx ip
30272 + 2024: 0200302d .word 0x0200302d
30273 +00002028 <__bar3_veneer>:
30274 + 2028: e51ff004 ldr pc, \[pc, #-4\] ; 202c <__bar3_veneer\+0x4>
30275 + 202c: 02003028 .word 0x02003028
30276 ...
30277 - 2028: ebfffff7 bl 200c <__bar3_veneer>
30278 - 202c: ebfffff8 bl 2014 <__bar4_from_arm>
30279 - 2030: ebfffff2 bl 2000 <__bar5_from_arm>
30280 Disassembly of section .foo:
30281
30282 02003020 <bar>:
30283 --- /dev/null
30284 +++ b/ld/testsuite/ld-arm/farcall-thumb-arm-be8.d
30285 @@ -0,0 +1,19 @@
30286 +.*: file format .*
30287 +
30288 +Disassembly of section .text:
30289 +
30290 +00001000 <_start>:
30291 + 1000: 00f0 02f8 bl 1008 <__bar_from_thumb>
30292 + 1004: 0000 lsls r0, r0, #0
30293 + \.\.\.
30294 +
30295 +00001008 <__bar_from_thumb>:
30296 + 1008: 7847 bx pc
30297 + 100a: c046 nop.*
30298 + 100c: 04f01fe5 ldr pc, \[pc, #-4\] ; 1010 <__bar_from_thumb\+0x8>
30299 + 1010: 02001014 .word 0x02001014
30300 + 1014: 00000000 .word 0x00000000
30301 +Disassembly of section .foo:
30302 +
30303 +02001014 <bar>:
30304 + 2001014: 1eff2fe1 bx lr
30305 --- a/ld/testsuite/ld-arm/farcall-thumb-arm-blx-pic-veneer.d
30306 +++ b/ld/testsuite/ld-arm/farcall-thumb-arm-blx-pic-veneer.d
30307 @@ -2,14 +2,16 @@
30308
30309 Disassembly of section .text:
30310
30311 -00001000 <__bar_from_thumb>:
30312 - 1000: e59fc000 ldr ip, \[pc, #0\] ; 1008 <__bar_from_thumb\+0x8>
30313 - 1004: e08ff00c add pc, pc, ip
30314 - 1008: 0200000c .word 0x0200000c
30315 - 100c: 00000000 .word 0x00000000
30316 +00001000 <_start>:
30317 + 1000: f000 e802 blx 1008 <__bar_from_thumb>
30318 + 1004: 0000 lsls r0, r0, #0
30319 + \.\.\.
30320
30321 -00001010 <_start>:
30322 - 1010: f7ff eff6 blx 1000 <__bar_from_thumb>
30323 +00001008 <__bar_from_thumb>:
30324 + 1008: e59fc000 ldr ip, \[pc, #0\] ; 1010 <__bar_from_thumb\+0x8>
30325 + 100c: e08ff00c add pc, pc, ip
30326 + 1010: 02000000 .word 0x02000000
30327 + 1014: 00000000 .word 0x00000000
30328 Disassembly of section .foo:
30329
30330 02001014 <bar>:
30331 --- a/ld/testsuite/ld-arm/farcall-thumb-arm-blx.d
30332 +++ b/ld/testsuite/ld-arm/farcall-thumb-arm-blx.d
30333 @@ -2,12 +2,14 @@
30334
30335 Disassembly of section .text:
30336
30337 -00001000 <__bar_from_thumb>:
30338 - 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <__bar_from_thumb\+0x4>
30339 - 1004: 02001014 .word 0x02001014
30340 +00001000 <_start>:
30341 + 1000: f000 e802 blx 1008 <__bar_from_thumb>
30342 + 1004: 0000 lsls r0, r0, #0
30343 + \.\.\.
30344
30345 -00001008 <_start>:
30346 - 1008: f7ff effa blx 1000 <__bar_from_thumb>
30347 +00001008 <__bar_from_thumb>:
30348 + 1008: e51ff004 ldr pc, \[pc, #-4\] ; 100c <__bar_from_thumb\+0x4>
30349 + 100c: 02001014 .word 0x02001014
30350 Disassembly of section .foo:
30351
30352 02001014 <bar>:
30353 --- a/ld/testsuite/ld-arm/farcall-thumb-arm-pic-veneer.d
30354 +++ b/ld/testsuite/ld-arm/farcall-thumb-arm-pic-veneer.d
30355 @@ -1,5 +1,5 @@
30356 -#name: Thumb-Thumb farcall without BLX
30357 -#source: farcall-thumb-thumb.s
30358 -#as: -march=armv4t
30359 -#ld: -Ttext 0x1000 --section-start .foo=0x2001014
30360 +#name: Thumb-ARM farcall without BLX (PIC veneer)
30361 +#source: farcall-thumb-arm.s
30362 +#as: -march=armv4t -W
30363 +#ld: -Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer
30364 #error: .*\(.text\+0x0\): relocation truncated to fit: R_ARM_THM_CALL against `bar'
30365 --- a/ld/testsuite/ld-arm/farcall-thumb-arm-short.d
30366 +++ b/ld/testsuite/ld-arm/farcall-thumb-arm-short.d
30367 @@ -2,12 +2,15 @@
30368
30369 Disassembly of section .text:
30370
30371 -00001000 <__bar_from_thumb>:
30372 - 1000: 4778 bx pc
30373 - 1002: 46c0 nop \(mov r8, r8\)
30374 - 1004: ea000402 b 2014 <bar>
30375 -00001008 <_start>:
30376 - 1008: f7ff fffa bl 1000 <__bar_from_thumb>
30377 +00001000 <_start>:
30378 + 1000: f000 f802 bl 1008 <__bar_from_thumb>
30379 + 1004: 0000 lsls r0, r0, #0
30380 + \.\.\.
30381 +
30382 +00001008 <__bar_from_thumb>:
30383 + 1008: 4778 bx pc
30384 + 100a: 46c0 nop \(mov r8, r8\)
30385 + 100c: ea000400 b 2014 <bar>
30386 Disassembly of section .foo:
30387
30388 00002014 <bar>:
30389 --- a/ld/testsuite/ld-arm/farcall-thumb-arm.d
30390 +++ b/ld/testsuite/ld-arm/farcall-thumb-arm.d
30391 @@ -2,18 +2,17 @@
30392
30393 Disassembly of section .text:
30394
30395 -00001000 <__bar_from_thumb>:
30396 - 1000: b540 push {r6, lr}
30397 - 1002: 4e03 ldr r6, \[pc, #12\] \(1010 <__bar_from_thumb\+0x10>\)
30398 - 1004: 46fe mov lr, pc
30399 - 1006: 4730 bx r6
30400 - 1008: e8bd4040 pop {r6, lr}
30401 - 100c: e12fff1e bx lr
30402 +00001000 <_start>:
30403 + 1000: f000 f802 bl 1008 <__bar_from_thumb>
30404 + 1004: 0000 lsls r0, r0, #0
30405 + \.\.\.
30406 +
30407 +00001008 <__bar_from_thumb>:
30408 + 1008: 4778 bx pc
30409 + 100a: 46c0 nop \(mov r8, r8\)
30410 + 100c: e51ff004 ldr pc, \[pc, #-4\] ; 1010 <__bar_from_thumb\+0x8>
30411 1010: 02001014 .word 0x02001014
30412 1014: 00000000 .word 0x00000000
30413 -
30414 -00001018 <_start>:
30415 - 1018: f7ff fff2 bl 1000 <__bar_from_thumb>
30416 Disassembly of section .foo:
30417
30418 02001014 <bar>:
30419 --- a/ld/testsuite/ld-arm/farcall-thumb-thumb-blx-pic-veneer.d
30420 +++ b/ld/testsuite/ld-arm/farcall-thumb-thumb-blx-pic-veneer.d
30421 @@ -2,14 +2,16 @@
30422
30423 Disassembly of section .text:
30424
30425 -00001000 <__bar_veneer>:
30426 - 1000: e59fc000 ldr ip, \[pc, #0\] ; 1008 <__bar_veneer\+0x8>
30427 - 1004: e08ff00c add pc, pc, ip
30428 - 1008: 0200000d .word 0x0200000d
30429 - 100c: 00000000 .word 0x00000000
30430 +00001000 <_start>:
30431 + 1000: f000 e802 blx 1008 <__bar_veneer>
30432 + 1004: 0000 lsls r0, r0, #0
30433 + \.\.\.
30434
30435 -00001010 <_start>:
30436 - 1010: f7ff eff6 blx 1000 <__bar_veneer>
30437 +00001008 <__bar_veneer>:
30438 + 1008: e59fc004 ldr ip, \[pc, #4\] ; 1014 <__bar_veneer\+0xc>
30439 + 100c: e08fc00c add ip, pc, ip
30440 + 1010: e12fff1c bx ip
30441 + 1014: 02000001 .word 0x02000001
30442 Disassembly of section .foo:
30443
30444 02001014 <bar>:
30445 --- a/ld/testsuite/ld-arm/farcall-thumb-thumb-blx.d
30446 +++ b/ld/testsuite/ld-arm/farcall-thumb-thumb-blx.d
30447 @@ -2,12 +2,14 @@
30448
30449 Disassembly of section .text:
30450
30451 -00001000 <__bar_veneer>:
30452 - 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <__bar_veneer\+0x4>
30453 - 1004: 02001015 .word 0x02001015
30454 +00001000 <_start>:
30455 + 1000: f000 e802 blx 1008 <__bar_veneer>
30456 + 1004: 0000 lsls r0, r0, #0
30457 + \.\.\.
30458
30459 -00001008 <_start>:
30460 - 1008: f7ff effa blx 1000 <__bar_veneer>
30461 +00001008 <__bar_veneer>:
30462 + 1008: e51ff004 ldr pc, \[pc, #-4\] ; 100c <__bar_veneer\+0x4>
30463 + 100c: 02001015 .word 0x02001015
30464 Disassembly of section .foo:
30465
30466 02001014 <bar>:
30467 --- a/ld/testsuite/ld-arm/farcall-thumb-thumb-m-pic-veneer.d
30468 +++ b/ld/testsuite/ld-arm/farcall-thumb-thumb-m-pic-veneer.d
30469 @@ -1,5 +1,5 @@
30470 -#name: Thumb-Thumb farcall without BLX
30471 +#name: Thumb-Thumb farcall M profile (PIC veneer)
30472 #source: farcall-thumb-thumb.s
30473 #as: -march=armv4t
30474 -#ld: -Ttext 0x1000 --section-start .foo=0x2001014
30475 +#ld: -Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer
30476 #error: .*\(.text\+0x0\): relocation truncated to fit: R_ARM_THM_CALL against `bar'
30477 --- a/ld/testsuite/ld-arm/farcall-thumb-thumb-m.d
30478 +++ b/ld/testsuite/ld-arm/farcall-thumb-thumb-m.d
30479 @@ -2,17 +2,19 @@
30480
30481 Disassembly of section .text:
30482
30483 -00001000 <__bar_veneer>:
30484 - 1000: b540 push {r6, lr}
30485 - 1002: 4e02 ldr r6, \[pc, #8\] \(100c <__bar_veneer\+0xc>\)
30486 - 1004: 46fe mov lr, pc
30487 - 1006: 4730 bx r6
30488 - 1008: bd40 pop {r6, pc}
30489 - 100a: bf00 nop
30490 - 100c: 02001015 .word 0x02001015
30491 +00001000 <_start>:
30492 + 1000: f000 f802 bl 1008 <__bar_veneer>
30493 + 1004: 0000 lsls r0, r0, #0
30494 + \.\.\.
30495
30496 -00001010 <_start>:
30497 - 1010: f7ff fff6 bl 1000 <__bar_veneer>
30498 +00001008 <__bar_veneer>:
30499 + 1008: b401 push {r0}
30500 + 100a: 4802 ldr r0, \[pc, #8\] \(1014 <__bar_veneer\+0xc>\)
30501 + 100c: 4684 mov ip, r0
30502 + 100e: bc01 pop {r0}
30503 + 1010: 4760 bx ip
30504 + 1012: bf00 nop
30505 + 1014: 02001015 .word 0x02001015
30506 Disassembly of section .foo:
30507
30508 02001014 <bar>:
30509 --- a/ld/testsuite/ld-arm/farcall-thumb-thumb-pic-veneer.d
30510 +++ b/ld/testsuite/ld-arm/farcall-thumb-thumb-pic-veneer.d
30511 @@ -1,5 +1,5 @@
30512 -#name: Thumb-Thumb farcall without BLX
30513 +#name: Thumb-Thumb farcall without BLX (PIC veneer)
30514 #source: farcall-thumb-thumb.s
30515 #as: -march=armv4t
30516 -#ld: -Ttext 0x1000 --section-start .foo=0x2001014
30517 +#ld: -Ttext 0x1000 --section-start .foo=0x2001014 --pic-veneer
30518 #error: .*\(.text\+0x0\): relocation truncated to fit: R_ARM_THM_CALL against `bar'
30519 --- a/ld/testsuite/ld-arm/farcall-thumb-thumb.d
30520 +++ b/ld/testsuite/ld-arm/farcall-thumb-thumb.d
30521 @@ -1,5 +1,21 @@
30522 -#name: Thumb-Thumb farcall without BLX
30523 -#source: farcall-thumb-thumb.s
30524 -#as: -march=armv4t
30525 -#ld: -Ttext 0x1000 --section-start .foo=0x2001014
30526 -#error: .*\(.text\+0x0\): relocation truncated to fit: R_ARM_THM_CALL against `bar'
30527 +.*: file format .*
30528 +
30529 +Disassembly of section .text:
30530 +
30531 +00001000 <_start>:
30532 + 1000: f000 f802 bl 1008 <__bar_veneer>
30533 + 1004: 0000 lsls r0, r0, #0
30534 + \.\.\.
30535 +
30536 +00001008 <__bar_veneer>:
30537 + 1008: b401 push {r0}
30538 + 100a: 4802 ldr r0, \[pc, #8\] \(1014 <__bar_veneer\+0xc>\)
30539 + 100c: 4684 mov ip, r0
30540 + 100e: bc01 pop {r0}
30541 + 1010: 4760 bx ip
30542 + 1012: bf00 nop
30543 + 1014: 02001015 .word 0x02001015
30544 +Disassembly of section .foo:
30545 +
30546 +02001014 <bar>:
30547 + 2001014: 4770 bx lr
30548 --- /dev/null
30549 +++ b/ld/testsuite/ld-arm/script-type.ld
30550 @@ -0,0 +1,7 @@
30551 +SECTIONS {
30552 + foo_a = bar_a;
30553 + foo_t = bar_t;
30554 + foo_o = bar_o;
30555 + .text : { *(.text) }
30556 + .ARM.attribues 0 : { *(.ARM.attributes) }
30557 +}
30558 --- /dev/null
30559 +++ b/ld/testsuite/ld-arm/script-type.s
30560 @@ -0,0 +1,20 @@
30561 +.syntax unified
30562 +.text
30563 +.global bar_a
30564 +.type bar_a %function
30565 +bar_a:
30566 +bx lr
30567 +
30568 +.p2align 4
30569 +.global bar_o
30570 +.type bar_o %object
30571 +bar_o:
30572 +.word 0
30573 +
30574 +.p2align 4
30575 +.thumb
30576 +.global bar_t
30577 +.type bar_t %function
30578 +bar_t:
30579 +bx lr
30580 +
30581 --- /dev/null
30582 +++ b/ld/testsuite/ld-arm/script-type.sym
30583 @@ -0,0 +1,16 @@
30584 +
30585 +Symbol table '.symtab' contains 13 entries:
30586 + Num: Value Size Type Bind Vis Ndx Name
30587 + 0: 00000000 0 NOTYPE LOCAL DEFAULT UND
30588 + 1: 00000000 0 SECTION LOCAL DEFAULT 1
30589 + 2: 00000000 0 SECTION LOCAL DEFAULT 2
30590 + 3: 00000000 0 NOTYPE LOCAL DEFAULT 1 \$a
30591 + 4: 00000010 0 NOTYPE LOCAL DEFAULT 1 \$d
30592 + 5: 00000014 0 NOTYPE LOCAL DEFAULT 1 \$a
30593 + 6: 00000020 0 NOTYPE LOCAL DEFAULT 1 \$t
30594 + 7: 00000010 0 OBJECT GLOBAL DEFAULT 1 bar_o
30595 + 8: 00000021 0 FUNC GLOBAL DEFAULT 1 bar_t
30596 + 9: 00000000 0 FUNC GLOBAL DEFAULT 1 foo_a
30597 + 10: 00000021 0 FUNC GLOBAL DEFAULT 1 foo_t
30598 + 11: 00000010 0 OBJECT GLOBAL DEFAULT 1 foo_o
30599 + 12: 00000000 0 FUNC GLOBAL DEFAULT 1 bar_a
30600 --- a/ld/testsuite/ld-arm/thumb2-bl-as-thumb1-bad-noeabi.d
30601 +++ b/ld/testsuite/ld-arm/thumb2-bl-as-thumb1-bad-noeabi.d
30602 @@ -1,4 +1,19 @@
30603 -#name: Thumb-2-as-Thumb-1 BL failure test
30604 -#source: thumb2-bl-as-thumb1-bad.s
30605 -#ld: -Ttext 0x1000 --section-start .foo=0x401004
30606 -#error: .*\(.text\+0x0\): relocation truncated to fit: R_ARM_THM_CALL against `bar'
30607 +.*: file format .*
30608 +
30609 +Disassembly of section .text:
30610 +
30611 +00001000 <__bar_veneer>:
30612 + 1000: b401 push {r0}
30613 + 1002: 4802 ldr r0, \[pc, #8\] \(100c <__bar_veneer\+0xc>\)
30614 + 1004: 4684 mov ip, r0
30615 + 1006: bc01 pop {r0}
30616 + 1008: 4760 bx ip
30617 + 100a: bf00 nop
30618 + 100c: 0100100d .word 0x0100100d
30619 +
30620 +00001010 <_start>:
30621 + 1010: f7ff fff6 bl 1000 <__bar_veneer>
30622 +Disassembly of section .foo:
30623 +
30624 +0100100c <bar>:
30625 + 100100c: 4770 bx lr
30626 --- a/ld/testsuite/ld-arm/thumb2-bl-as-thumb1-bad.d
30627 +++ b/ld/testsuite/ld-arm/thumb2-bl-as-thumb1-bad.d
30628 @@ -2,13 +2,16 @@
30629
30630 Disassembly of section .text:
30631
30632 -00001000 <__bar_veneer>:
30633 - 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <__bar_veneer\+0x4>
30634 - 1004: 0040100d .word 0x0040100d
30635 +00001000 <_start>:
30636 + 1000: f000 e802 blx 1008 <__bar_veneer>
30637 + 1004: 0000 lsls r0, r0, #0
30638 + \.\.\.
30639 +
30640 +00001008 <__bar_veneer>:
30641 + 1008: e51ff004 ldr pc, \[pc, #-4\] ; 100c <__bar_veneer\+0x4>
30642 + 100c: 0100100d .word 0x0100100d
30643
30644 -00001008 <_start>:
30645 - 1008: f7ff effa blx 1000 <__bar_veneer>
30646 Disassembly of section .foo:
30647
30648 -0040100c <bar>:
30649 - 40100c: 4770 bx lr
30650 +0100100c <bar>:
30651 + 100100c: 4770 bx lr
30652 --- a/ld/testsuite/ld-arm/thumb2-bl-as-thumb1-bad.s
30653 +++ b/ld/testsuite/ld-arm/thumb2-bl-as-thumb1-bad.s
30654 @@ -12,7 +12,7 @@
30655 _start:
30656 bl bar
30657
30658 -@ We will place the section .foo at 0x40100c.
30659 +@ We will place the section .foo at 0x100100c.
30660
30661 .section .foo, "xa"
30662 .thumb_func
30663 --- a/ld/testsuite/ld-arm/thumb2-bl-bad-noeabi.d
30664 +++ b/ld/testsuite/ld-arm/thumb2-bl-bad-noeabi.d
30665 @@ -1,4 +1,19 @@
30666 -#name: Thumb-2 BL failure test
30667 -#source: thumb2-bl-bad.s
30668 -#ld: -Ttext 0x1000 --section-start .foo=0x1001004
30669 -#error: .*\(.text\+0x0\): relocation truncated to fit: R_ARM_THM_CALL against `bar'
30670 +.*: file format .*
30671 +
30672 +Disassembly of section .text:
30673 +
30674 +00001000 <__bar_veneer>:
30675 + 1000: b401 push {r0}
30676 + 1002: 4802 ldr r0, \[pc, #8\] \(100c <__bar_veneer\+0xc>\)
30677 + 1004: 4684 mov ip, r0
30678 + 1006: bc01 pop {r0}
30679 + 1008: 4760 bx ip
30680 + 100a: bf00 nop
30681 + 100c: 0100100d .word 0x0100100d
30682 +
30683 +00001010 <_start>:
30684 + 1010: f7ff fff6 bl 1000 <__bar_veneer>
30685 +Disassembly of section .foo:
30686 +
30687 +0100100c <bar>:
30688 + 100100c: 4770 bx lr
30689 --- a/ld/testsuite/ld-arm/thumb2-bl-bad.d
30690 +++ b/ld/testsuite/ld-arm/thumb2-bl-bad.d
30691 @@ -2,12 +2,14 @@
30692
30693 Disassembly of section .text:
30694
30695 -00001000 <__bar_veneer>:
30696 - 1000: e51ff004 ldr pc, \[pc, #-4\] ; 1004 <__bar_veneer\+0x4>
30697 - 1004: 0100100d .word 0x0100100d
30698 +00001000 <_start>:
30699 + 1000: f000 e802 blx 1008 <__bar_veneer>
30700 + 1004: 0000 lsls r0, r0, #0
30701 + \.\.\.
30702
30703 -00001008 <_start>:
30704 - 1008: f7ff effa blx 1000 <__bar_veneer>
30705 +00001008 <__bar_veneer>:
30706 + 1008: e51ff004 ldr pc, \[pc, #-4\] ; 100c <__bar_veneer\+0x4>
30707 + 100c: 0100100d .word 0x0100100d
30708 Disassembly of section .foo:
30709
30710 0100100c <bar>:
30711 --- /dev/null
30712 +++ b/ld/testsuite/ld-arm/thumb2-bl-blx-interwork.d
30713 @@ -0,0 +1,93 @@
30714 +
30715 +.*: file format .*
30716 +
30717 +
30718 +Disassembly of section \.text:
30719 +
30720 +00008000 <_start>:
30721 + 8000: .*
30722 + 8004: .*
30723 + 8008: bf00 nop
30724 + 800a: .*
30725 + 800e: .*
30726 + 8012: bf00 nop
30727 + 8014: f000 e81c blx 8050 <arm0>
30728 + 8018: f000 e820 blx 805c <arm4>
30729 + 801c: bf00 nop
30730 + 801e: f000 e818 blx 8050 <arm0>
30731 + 8022: f000 e81c blx 805c <arm4>
30732 + 8026: bf00 nop
30733 + 8028: f000 f81e bl 8068 <thumb0>
30734 + 802c: f000 f821 bl 8072 <thumb2>
30735 + 8030: f000 f824 bl 807c <thumb4>
30736 + 8034: f000 f827 bl 8086 <thumb6>
30737 + 8038: bf00 nop
30738 + 803a: f000 f815 bl 8068 <thumb0>
30739 + 803e: f000 f818 bl 8072 <thumb2>
30740 + 8042: f000 f81b bl 807c <thumb4>
30741 + 8046: f000 f81e bl 8086 <thumb6>
30742 + 804a: bf00 nop
30743 + 804c: e320f000 nop \{0\}
30744 +
30745 +00008050 <arm0>:
30746 + 8050: e12fff1e bx lr
30747 +
30748 +00008054 <\.real_start_ofarm0>:
30749 + 8054: 4770 bx lr
30750 + 8056: 0000 .short 0x0000
30751 + 8058: e320f000 nop \{0\}
30752 +
30753 +0000805c <arm4>:
30754 + 805c: e12fff1e bx lr
30755 +
30756 +00008060 <\.real_start_ofarm4>:
30757 + 8060: 4770 bx lr
30758 + 8062: 0000 .short 0x0000
30759 + 8064: f3af 8000 nop\.w
30760 +
30761 +00008068 <thumb0>:
30762 + 8068: 4770 bx lr
30763 + 806a: bf00 nop
30764 + 806c: f3af 8000 nop\.w
30765 + 8070: bf00 nop
30766 +
30767 +00008072 <thumb2>:
30768 + 8072: 4770 bx lr
30769 + 8074: f3af 8000 nop\.w
30770 + 8078: bf00 nop
30771 + 807a: bf00 nop
30772 +
30773 +0000807c <thumb4>:
30774 + 807c: 4770 bx lr
30775 + 807e: bf00 nop
30776 + 8080: bf00 nop
30777 + 8082: bf00 nop
30778 + 8084: bf00 nop
30779 +
30780 +00008086 <thumb6>:
30781 + 8086: 4770 bx lr
30782 +
30783 +00008088 <backwards>:
30784 + 8088: f7ff ffe4 bl 8054 <\.real_start_ofarm0>
30785 + 808c: f7ff ffe8 bl 8060 <\.real_start_ofarm4>
30786 + 8090: bf00 nop
30787 + 8092: f7ff ffdf bl 8054 <\.real_start_ofarm0>
30788 + 8096: f7ff ffe3 bl 8060 <\.real_start_ofarm4>
30789 + 809a: bf00 nop
30790 + 809c: f7ff efd8 blx 8050 <arm0>
30791 + 80a0: f7ff efdc blx 805c <arm4>
30792 + 80a4: bf00 nop
30793 + 80a6: f7ff efd4 blx 8050 <arm0>
30794 + 80aa: f7ff efd8 blx 805c <arm4>
30795 + 80ae: bf00 nop
30796 + 80b0: f7ff ffda bl 8068 <thumb0>
30797 + 80b4: f7ff ffdd bl 8072 <thumb2>
30798 + 80b8: f7ff ffe0 bl 807c <thumb4>
30799 + 80bc: f7ff ffe3 bl 8086 <thumb6>
30800 + 80c0: bf00 nop
30801 + 80c2: f7ff ffd1 bl 8068 <thumb0>
30802 + 80c6: f7ff ffd4 bl 8072 <thumb2>
30803 + 80ca: f7ff ffd7 bl 807c <thumb4>
30804 + 80ce: f7ff ffda bl 8086 <thumb6>
30805 + 80d2: bf00 nop
30806 + 80d4: f3af 8000 nop\.w
30807 --- /dev/null
30808 +++ b/ld/testsuite/ld-arm/thumb2-bl-blx-interwork.s
30809 @@ -0,0 +1,99 @@
30810 + .arch armv7-a
30811 + .global _start
30812 + .syntax unified
30813 + .text
30814 + .thumb
30815 +
30816 + .macro do_calls
30817 + @ These four instructions interwork (by calling a ".real_start_of"
30818 + @ Thumb entry point for a function), but only for backward references.
30819 + bl.w arm0
30820 + bl.w arm4
30821 + nop
30822 + bl.w arm0
30823 + bl.w arm4
30824 + nop
30825 + blx.w arm0
30826 + blx.w arm4
30827 + nop
30828 + blx.w arm0
30829 + blx.w arm4
30830 + nop
30831 + bl.w thumb0
30832 + bl.w thumb2
30833 + bl.w thumb4
30834 + bl.w thumb6
30835 + nop
30836 + bl.w thumb0
30837 + bl.w thumb2
30838 + bl.w thumb4
30839 + bl.w thumb6
30840 + nop
30841 + @ These eight are all accepted with current gas, but generate bad code.
30842 + @blx.w thumb0
30843 + @blx.w thumb2
30844 + @blx.w thumb4
30845 + @blx.w thumb6
30846 + @nop
30847 + @blx.w thumb0
30848 + @blx.w thumb2
30849 + @blx.w thumb4
30850 + @blx.w thumb6
30851 + .endm
30852 +
30853 + .thumb_func
30854 + .align 3
30855 +_start:
30856 + do_calls
30857 +
30858 + .arm
30859 + .global offset0
30860 + .align 3
30861 +arm0:
30862 + bx lr
30863 +
30864 + .thumb
30865 +.real_start_ofarm0:
30866 + bx lr
30867 + .arm
30868 +
30869 + .global offset4
30870 + .align 3
30871 + nop
30872 +arm4:
30873 + bx lr
30874 +
30875 + .thumb
30876 +.real_start_ofarm4:
30877 + bx lr
30878 + .arm
30879 +
30880 + .thumb
30881 + .thumb_func
30882 + .align 3
30883 +thumb0:
30884 + bx lr
30885 +
30886 + .thumb_func
30887 + .align 3
30888 + nop
30889 +thumb2:
30890 + bx lr
30891 +
30892 + .thumb_func
30893 + .align 3
30894 + nop
30895 + nop
30896 +thumb4:
30897 + bx lr
30898 +
30899 + .thumb_func
30900 + .align 3
30901 + nop
30902 + nop
30903 + nop
30904 +thumb6:
30905 + bx lr
30906 +
30907 +backwards:
30908 + do_calls
30909 --- /dev/null
30910 +++ b/ld/testsuite/ld-arm/unwind-1.d
30911 @@ -0,0 +1,10 @@
30912 +#ld: -T arm.ld
30913 +#objdump: -s
30914 +
30915 +.*: file format.*
30916 +
30917 +#...
30918 +Contents of section .ARM.exidx:
30919 + 8008 (f8ffff7f b0b0a880 f4ffff7f 01000000|7ffffff8 80a8b0b0 7ffffff4 00000001) .*
30920 +Contents of section .far:
30921 +#...
30922 --- /dev/null
30923 +++ b/ld/testsuite/ld-arm/unwind-1.s
30924 @@ -0,0 +1,19 @@
30925 + .syntax unified
30926 + .text
30927 + .global _start
30928 + .type _start, %function
30929 +_start:
30930 + .fnstart
30931 + .save {r4, lr}
30932 + bx lr
30933 + .fnend
30934 +
30935 + @ Section with no unwinding information. Linker should insert a cantunwind entry.
30936 + .section .after, "xa"
30937 + .global __aeabi_unwind_cpp_pr0
30938 + .type __aeabi_unwind_cpp_pr0, %function
30939 +__aeabi_unwind_cpp_pr0:
30940 + bx lr
30941 +
30942 + .section .far
30943 + .word 0
30944 --- /dev/null
30945 +++ b/ld/testsuite/ld-arm/unwind-2.d
30946 @@ -0,0 +1,10 @@
30947 +#ld: -T arm.ld
30948 +#objdump: -s
30949 +
30950 +.*: file format.*
30951 +
30952 +#...
30953 +Contents of section .ARM.exidx:
30954 + 8004 (fcffff7f b0b0a880 f8ffff7f 01000000|7ffffffc 80a8b0b0 7ffffff8 00000001) .*
30955 +Contents of section .far:
30956 +#...
30957 --- /dev/null
30958 +++ b/ld/testsuite/ld-arm/unwind-2.s
30959 @@ -0,0 +1,19 @@
30960 + .syntax unified
30961 + .text
30962 +
30963 + .global __aeabi_unwind_cpp_pr0
30964 + .type __aeabi_unwind_cpp_pr0, %function
30965 +__aeabi_unwind_cpp_pr0:
30966 + .global _start
30967 + .type _start, %function
30968 +_start:
30969 + .fnstart
30970 + .save {r4, lr}
30971 + bx lr
30972 + .fnend
30973 +
30974 + @ last text section has unwind information. Linker should append a
30975 + @ terminating cantunwind entry.
30976 +
30977 + .section .far
30978 + .word 0
30979 --- /dev/null
30980 +++ b/ld/testsuite/ld-arm/unwind-3.d
30981 @@ -0,0 +1,11 @@
30982 +#ld: -T arm.ld
30983 +#objdump: -s
30984 +
30985 +.*: file format.*
30986 +
30987 +#...
30988 +Contents of section .ARM.exidx:
30989 + 800c (f4ffff7f b0b0a880 f0ffff7f 01000000|7ffffff4 80a8b0b0 7ffffff0 00000001) .*
30990 + 801c (ecffff7f b0b0a880 e8ffff7f 01000000|7fffffec 80a8b0b0 7fffffe8 00000001) .*
30991 +Contents of section .far:
30992 +#...
30993 --- /dev/null
30994 +++ b/ld/testsuite/ld-arm/unwind-3.s
30995 @@ -0,0 +1,29 @@
30996 + .syntax unified
30997 + .text
30998 + @ section without unwind info
30999 + .global _start
31000 + .type _start, %function
31001 +_start:
31002 + bl _before
31003 +
31004 + @ Section that will be placed first
31005 + .section .before, "xa"
31006 + .type _before, %function
31007 +_before:
31008 + .fnstart
31009 + .save {r4, lr}
31010 + bx lr
31011 + .fnend
31012 +
31013 + @ section that will be placed last
31014 + .section .after, "xa"
31015 + .global __aeabi_unwind_cpp_pr0
31016 + .type __aeabi_unwind_cpp_pr0, %function
31017 +__aeabi_unwind_cpp_pr0:
31018 + .fnstart
31019 + .save {r4, lr}
31020 + bx lr
31021 + .fnend
31022 +
31023 + .section .far
31024 + .word 0
31025 --- /dev/null
31026 +++ b/ld/testsuite/ld-arm/unwind-4.d
31027 @@ -0,0 +1,11 @@
31028 +#ld: -T arm.ld
31029 +#objdump: -s
31030 +
31031 +.*: file format.*
31032 +
31033 +#...
31034 +Contents of section .ARM.exidx:
31035 + 8020 (e0ffff7f b0b0a880 dcffff7f e8ffff7f|7fffffe0 80a8b0b0 7fffffdc 7fffffe8) .*
31036 + 8030 (d8ffff7f b0b0a880 d8ffff7f 01000000|7fffffd8 80a8b0b0 7fffffd8 00000001) .*
31037 +Contents of section .far:
31038 +#...
31039 --- /dev/null
31040 +++ b/ld/testsuite/ld-arm/unwind-4.s
31041 @@ -0,0 +1,49 @@
31042 + .syntax unified
31043 + .text
31044 + @ out of line table entry
31045 + .global _start
31046 + .type _start, %function
31047 +_start:
31048 + .fnstart
31049 + .save {r4, lr}
31050 + .vsave {d0}
31051 + .vsave {d4}
31052 + bl _before
31053 + .fnend
31054 +
31055 + @ entry that can be merged
31056 + .fnstart
31057 + .save {r4, lr}
31058 + bx lr
31059 + .fnend
31060 +
31061 + @ Section that will be placed first
31062 + .section .before, "xa"
31063 + .type _before, %function
31064 +_before:
31065 + .fnstart
31066 + .save {r4, lr}
31067 + bx lr
31068 + .fnend
31069 +
31070 + @ section that will be placed last
31071 + .section .after, "xa"
31072 + .global __aeabi_unwind_cpp_pr0
31073 + .type __aeabi_unwind_cpp_pr0, %function
31074 +__aeabi_unwind_cpp_pr0:
31075 + .fnstart
31076 + .save {r4, lr}
31077 + bx lr
31078 + .fnend
31079 + @ final function is cantunwind, so output table size is smaller
31080 + @ than sum of input sections
31081 + .global __aeabi_unwind_cpp_pr1
31082 + .type __aeabi_unwind_cpp_pr1, %function
31083 +__aeabi_unwind_cpp_pr1:
31084 + .fnstart
31085 + .cantunwind
31086 + bx lr
31087 + .fnend
31088 +
31089 + .section .far
31090 + .word 0
31091 --- a/ld/testsuite/ld-elf/eh5.d
31092 +++ b/ld/testsuite/ld-elf/eh5.d
31093 @@ -14,7 +14,7 @@ Contents of the .eh_frame section:
31094 Code alignment factor: .*
31095 Data alignment factor: .*
31096 Return address column: .*
31097 - Augmentation data: 1b
31098 + Augmentation data: (0|1)b
31099
31100 DW_CFA_nop
31101 DW_CFA_nop
31102 @@ -33,7 +33,7 @@ Contents of the .eh_frame section:
31103 Code alignment factor: .*
31104 Data alignment factor: .*
31105 Return address column: .*
31106 - Augmentation data: 03 .. .. .. .. 1b
31107 + Augmentation data: 03 .. .. .. .. (0|1)b
31108
31109 DW_CFA_nop
31110
31111 @@ -57,7 +57,7 @@ Contents of the .eh_frame section:
31112 Code alignment factor: .*
31113 Data alignment factor: .*
31114 Return address column: .*
31115 - Augmentation data: 03 .. .. .. .. 0c 1b
31116 + Augmentation data: 03 .. .. .. .. 0c (0|1)b
31117
31118 DW_CFA_nop
31119 DW_CFA_nop
31120 @@ -78,7 +78,7 @@ Contents of the .eh_frame section:
31121 Code alignment factor: .*
31122 Data alignment factor: .*
31123 Return address column: .*
31124 - Augmentation data: 1b
31125 + Augmentation data: (0|1)b
31126
31127 DW_CFA_def_cfa: r0( \([er]ax\)|) ofs 16
31128 #...
31129 @@ -93,7 +93,7 @@ Contents of the .eh_frame section:
31130 Code alignment factor: .*
31131 Data alignment factor: .*
31132 Return address column: .*
31133 - Augmentation data: 03 .. .. .. .. 1b
31134 + Augmentation data: 03 .. .. .. .. (0|1)b
31135
31136 DW_CFA_nop
31137
31138 @@ -115,7 +115,7 @@ Contents of the .eh_frame section:
31139 Code alignment factor: .*
31140 Data alignment factor: .*
31141 Return address column: .*
31142 - Augmentation data: 03 .. .. .. .. 0c 1b
31143 + Augmentation data: 03 .. .. .. .. 0c (0|1)b
31144
31145 DW_CFA_nop
31146 DW_CFA_nop
31147 --- a/ld/testsuite/ld-elfcomm/elfcomm.exp
31148 +++ b/ld/testsuite/ld-elfcomm/elfcomm.exp
31149 @@ -175,9 +175,10 @@ proc assembler_generates_commons {} {
31150 return 1
31151 }
31152
31153 -
31154 -if { ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/common1a.c tmpdir/common1a.o]
31155 - || ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/common1b.c tmpdir/common1b.o] } {
31156 +# Explicitly use "-fcommon" so that even if $CFLAGS includes
31157 +# "-fno-common", these tests are compiled as expected.
31158 +if { ![ld_compile "$CC $CFLAGS -fcommon" $srcdir/$subdir/common1a.c tmpdir/common1a.o]
31159 + || ![ld_compile "$CC $CFLAGS -fcommon" $srcdir/$subdir/common1b.c tmpdir/common1b.o] } {
31160 unresolved $test1
31161 return
31162 }
31163 --- /dev/null
31164 +++ b/ld/testsuite/ld-scripts/rgn-at.exp
31165 @@ -0,0 +1,33 @@
31166 +# Test for proper diagnosis of overflowed memory regions.
31167 +# Copyright 2009 Free Software Foundation, Inc.
31168 +#
31169 +# This file is part of the GNU Binutils.
31170 +#
31171 +# This program is free software; you can redistribute it and/or modify
31172 +# it under the terms of the GNU General Public License as published by
31173 +# the Free Software Foundation; either version 3 of the License, or
31174 +# (at your option) any later version.
31175 +#
31176 +# This program is distributed in the hope that it will be useful,
31177 +# but WITHOUT ANY WARRANTY; without even the implied warranty of
31178 +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31179 +# GNU General Public License for more details.
31180 +#
31181 +# You should have received a copy of the GNU General Public License
31182 +# along with this program; if not, write to the Free Software
31183 +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
31184 +# MA 02110-1301, USA.
31185 +
31186 +if ![is_elf_format] {
31187 + return
31188 +}
31189 +
31190 +load_lib ld-lib.exp
31191 +
31192 +set test_list [lsort [glob -nocomplain $srcdir/$subdir/rgn-at*.d]]
31193 +foreach test_file $test_list {
31194 + set test_name [file rootname $test_file]
31195 + set map_file "tmpdir/[file tail $test_name].map"
31196 + verbose $test_name
31197 + run_dump_test $test_name
31198 +}
31199 --- /dev/null
31200 +++ b/ld/testsuite/ld-scripts/rgn-at.s
31201 @@ -0,0 +1,6 @@
31202 + .section .text
31203 + .long 0x12345678
31204 + .section .data
31205 + .long 0x9abcdef0
31206 + .section .bss
31207 + .long 0
31208 --- /dev/null
31209 +++ b/ld/testsuite/ld-scripts/rgn-at1.d
31210 @@ -0,0 +1,12 @@
31211 +# name: rgn-at1
31212 +# source: rgn-at.s
31213 +# ld: -T rgn-at1.t
31214 +# objdump: -w -h
31215 +
31216 +.*: file format .*
31217 +
31218 +Sections:
31219 +Idx +Name +Size +VMA +LMA +File off +Algn +Flags
31220 + 0 .text +0+[0-9a-f][0-9a-f] +0+0010000 +0+0020000 +.*
31221 + 1 .data +0+[0-9a-f][0-9a-f] +0+00100[0-9a-f]+ +0+00200[0-9a-f]+ +.*
31222 + 2 .bss +0+[0-9a-f][0-9a-f] +0+00100[0-9a-f]+ +0+00200[0-9a-f]+ +.*
31223 --- /dev/null
31224 +++ b/ld/testsuite/ld-scripts/rgn-at1.t
31225 @@ -0,0 +1,13 @@
31226 +/* Memory region at test, >AT should propagate by default */
31227 +
31228 +MEMORY {
31229 + ram : ORIGIN = 0x10000, LENGTH = 0x100
31230 + rom : ORIGIN = 0x20000, LENGTH = 0x200
31231 +}
31232 +_start = 0x1000;
31233 +SECTIONS {
31234 + .text : { *(.text) } >ram AT>rom
31235 + .data : { *(.data) } >ram /* default AT>rom */
31236 + .bss : { *(.bss) } >ram
31237 + /DISCARD/ : { *(*) }
31238 +}
31239 --- /dev/null
31240 +++ b/ld/testsuite/ld-scripts/rgn-at2.d
31241 @@ -0,0 +1,12 @@
31242 +# name: rgn-at2
31243 +# source: rgn-at.s
31244 +# ld: -T rgn-at2.t
31245 +# objdump: -w -h
31246 +
31247 +.*: file format .*
31248 +
31249 +Sections:
31250 +Idx +Name +Size +VMA +LMA +File off +Algn +Flags
31251 + 0 .text +0+[0-9a-f][0-9a-f] +0+0010000 +0+0020000 +.*
31252 + 1 .data +0+[0-9a-f][0-9a-f] +0+0030000 +0+0030000 +.*
31253 + 2 .bss +0+[0-9a-f][0-9a-f] +0+00300[0-9a-f]+ +0+00300[0-9a-f]+ +.*
31254 --- /dev/null
31255 +++ b/ld/testsuite/ld-scripts/rgn-at2.t
31256 @@ -0,0 +1,14 @@
31257 +/* Memory region at test, >AT should propagate by default */
31258 +
31259 +MEMORY {
31260 + ram : ORIGIN = 0x10000, LENGTH = 0x100
31261 + rom : ORIGIN = 0x20000, LENGTH = 0x200
31262 + other : ORIGIN = 0x30000, LENGTH = 0x200
31263 +}
31264 +_start = 0x1000;
31265 +SECTIONS {
31266 + .text : { *(.text) } >ram AT>rom
31267 + .data : { *(.data) } >other /* No default AT>rom */
31268 + .bss : { *(.bss) } >other
31269 + /DISCARD/ : { *(*) }
31270 +}
31271 --- /dev/null
31272 +++ b/ld/testsuite/ld-scripts/rgn-at3.d
31273 @@ -0,0 +1,12 @@
31274 +# name: rgn-at3
31275 +# source: rgn-at.s
31276 +# ld: -T rgn-at3.t
31277 +# objdump: -w -h
31278 +
31279 +.*: file format .*
31280 +
31281 +Sections:
31282 +Idx +Name +Size +VMA +LMA +File off +Algn +Flags
31283 + 0 .text +0+[0-9a-f][0-9a-f] +0+0010000 +0+0020000 +.*
31284 + 1 .data +0+[0-9a-f][0-9a-f] +0+00100[0-9a-f]+ +0+0030000 +.*
31285 + 2 .bss +0+[0-9a-f][0-9a-f] +0+00100[0-9a-f]+ +0+00300[0-9a-f]+ +.*
31286 --- /dev/null
31287 +++ b/ld/testsuite/ld-scripts/rgn-at3.t
31288 @@ -0,0 +1,13 @@
31289 +/* Memory region at test, >AT should propagate by default */
31290 +
31291 +MEMORY {
31292 + ram : ORIGIN = 0x10000, LENGTH = 0x100
31293 + rom : ORIGIN = 0x20000, LENGTH = 0x200
31294 +}
31295 +_start = 0x1000;
31296 +SECTIONS {
31297 + .text : { *(.text) } >ram AT>rom
31298 + .data : AT (0x30000) { *(.data) } >ram /* NO default AT>rom */
31299 + .bss : { *(.bss) } >ram /* NO default AT>rom */
31300 + /DISCARD/ : { *(*) }
31301 +}
31302 --- a/ld/testsuite/lib/ld-lib.exp
31303 +++ b/ld/testsuite/lib/ld-lib.exp
31304 @@ -1592,7 +1592,8 @@ proc check_gc_sections_available { } {
31305 # advertised by ld's options.
31306 if { [istarget alpha*-*-*]
31307 || [istarget mep-*-*]
31308 - || [istarget ia64-*-*] } {
31309 + || [istarget ia64-*-*]
31310 + || [istarget *-*-mingw*] } {
31311 set gc_sections_available_saved 0
31312 return 0
31313 }
31314 --- a/libiberty/Makefile.in
31315 +++ b/libiberty/Makefile.in
31316 @@ -124,7 +124,7 @@ COMPILE.c = $(CC) -c @DEFS@ $(CFLAGS) $(
31317 CFILES = alloca.c argv.c asprintf.c atexit.c \
31318 basename.c bcmp.c bcopy.c bsearch.c bzero.c \
31319 calloc.c choose-temp.c clock.c concat.c cp-demangle.c \
31320 - cp-demint.c cplus-dem.c \
31321 + cp-demint.c cplus-dem.c cygpath.c \
31322 dyn-string.c \
31323 fdmatch.c ffs.c fibheap.c filename_cmp.c floatformat.c \
31324 fnmatch.c fopen_unlocked.c \
31325 @@ -182,7 +182,7 @@ REQUIRED_OFILES = \
31326 # maint-missing" and "make check".
31327 CONFIGURED_OFILES = ./asprintf.o ./atexit.o \
31328 ./basename.o ./bcmp.o ./bcopy.o ./bsearch.o ./bzero.o \
31329 - ./calloc.o ./clock.o ./copysign.o \
31330 + ./calloc.o ./clock.o ./copysign.o ./cygpath.o \
31331 ./_doprnt.o \
31332 ./ffs.o \
31333 ./getcwd.o ./getpagesize.o ./gettimeofday.o \
31334 @@ -619,6 +619,12 @@ $(CONFIGURED_OFILES): stamp-picdir
31335 else true; fi
31336 $(COMPILE.c) $(srcdir)/cplus-dem.c $(OUTPUT_OPTION)
31337
31338 +./cygpath.o: $(srcdir)/cygpath.c $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
31339 + if [ x"$(PICFLAG)" != x ]; then \
31340 + $(COMPILE.c) $(PICFLAG) $(srcdir)/cygpath.c -o pic/$@; \
31341 + else true; fi
31342 + $(COMPILE.c) $(srcdir)/cygpath.c $(OUTPUT_OPTION)
31343 +
31344 ./dyn-string.o: $(srcdir)/dyn-string.c config.h $(INCDIR)/ansidecl.h \
31345 $(INCDIR)/dyn-string.h $(INCDIR)/libiberty.h
31346 if [ x"$(PICFLAG)" != x ]; then \
31347 --- a/libiberty/configure
31348 +++ b/libiberty/configure
31349 @@ -8891,6 +8891,20 @@ case "${host}" in
31350 esac
31351
31352
31353 +# On MinGW, add support for Cygwin paths.
31354 +case "${host}" in
31355 + *-*-mingw*)
31356 + case $LIBOBJS in
31357 + "cygpath.$ac_objext" | \
31358 + *" cygpath.$ac_objext" | \
31359 + "cygpath.$ac_objext "* | \
31360 + *" cygpath.$ac_objext "* ) ;;
31361 + *) LIBOBJS="$LIBOBJS cygpath.$ac_objext" ;;
31362 +esac
31363 +
31364 + ;;
31365 +esac
31366 +
31367 if test x$gcc_no_link = xyes; then
31368 if test "x${ac_cv_func_mmap_fixed_mapped+set}" != xset; then
31369 ac_cv_func_mmap_fixed_mapped=no
31370 --- a/libiberty/configure.ac
31371 +++ b/libiberty/configure.ac
31372 @@ -663,6 +663,13 @@ case "${host}" in
31373 esac
31374 AC_SUBST(pexecute)
31375
31376 +# On MinGW, add support for Cygwin paths.
31377 +case "${host}" in
31378 + *-*-mingw*)
31379 + AC_LIBOBJ([cygpath])
31380 + ;;
31381 +esac
31382 +
31383 libiberty_AC_FUNC_STRNCMP
31384
31385 # Install a library built with a cross compiler in $(tooldir) rather
31386 --- /dev/null
31387 +++ b/libiberty/cygpath.c
31388 @@ -0,0 +1,591 @@
31389 +/* Support Cygwin paths under MinGW.
31390 + Copyright (C) 2006 Free Software Foundation, Inc.
31391 + Written by CodeSourcery.
31392 +
31393 +This file is part of the libiberty library.
31394 +Libiberty is free software; you can redistribute it and/or modify it
31395 +under the terms of the GNU Library General Public License as published
31396 +by the Free Software Foundation; either version 2 of the License, or
31397 +(at your option) any later version.
31398 +
31399 +Libiberty is distributed in the hope that it will be useful,
31400 +but WITHOUT ANY WARRANTY; without even the implied warranty of
31401 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
31402 +Library General Public License for more details.
31403 +
31404 +You should have received a copy of the GNU Library General Public
31405 +License along with libiberty; see the file COPYING.LIB. If not, write
31406 +to the Free Software Foundation, Inc., 51 Franklin Street - Fifth
31407 +Floor, Boston, MA 02110-1301, USA. */
31408 +
31409 +#include <windows.h>
31410 +#include <errno.h>
31411 +#include <fcntl.h>
31412 +#include <sys/stat.h>
31413 +#include <sys/types.h>
31414 +#include <io.h>
31415 +#include <process.h>
31416 +#include <stdbool.h>
31417 +#include <stdio.h>
31418 +#include <stdlib.h>
31419 +#include "libiberty.h"
31420 +
31421 +/* If non-zero, we have attempted to use cygpath. CYGPATH_PEX may
31422 + still be NULL, if cygpath is unavailable. */
31423 +static int cygpath_initialized;
31424 +
31425 +/* If non-NULL, an instance of cygpath connected via a pipe. */
31426 +static struct pex_obj *cygpath_pex;
31427 +
31428 +/* The input to cygpath. */
31429 +static FILE *cygpath_in;
31430 +
31431 +/* The output from cygpath. */
31432 +static FILE *cygpath_out;
31433 +
31434 +/* If non-NULL, a file to which path translations are logged. */
31435 +static FILE *cygpath_log;
31436 +
31437 +/* Record MESSAGE in the CYGPATH_LOG. MESSAGE is a format string,
31438 + which is expected to have a single "%s" field, to be replaced by
31439 + ARG. */
31440 +static void
31441 +cygpath_log_msg_arg (const char *message, const char *arg)
31442 +{
31443 + if (!cygpath_log)
31444 + return;
31445 + fprintf (cygpath_log, "[%d] cygpath: ", _getpid ());
31446 + fprintf (cygpath_log, message, arg);
31447 + fprintf (cygpath_log, "\n");
31448 + fflush (cygpath_log);
31449 +}
31450 +
31451 +/* Record MESSAGE in the CYGPATH_LOG. */
31452 +static void
31453 +cygpath_log_msg (const char *message)
31454 +{
31455 + cygpath_log_msg_arg ("%s", message);
31456 +}
31457 +
31458 +/* An error has occured. Add the MESSAGE to the CYGPATH_LOG, noting
31459 + the cause of the error based on errno. */
31460 +static void
31461 +cygpath_perror (const char *message)
31462 +{
31463 + if (!cygpath_log)
31464 + return;
31465 + fprintf (cygpath_log, "[%d] cygpath: error: %s: %s\n",
31466 + _getpid(), message, strerror (errno));
31467 + fflush (cygpath_log);
31468 +}
31469 +
31470 +/* Closes CYGPATH_PEX and frees all associated
31471 + resoures. */
31472 +static void
31473 +cygpath_close (void)
31474 +{
31475 + /* Free resources. */
31476 + if (cygpath_out)
31477 + {
31478 + fclose (cygpath_out);
31479 + cygpath_out = NULL;
31480 + }
31481 + if (cygpath_in)
31482 + {
31483 + fclose (cygpath_in);
31484 + cygpath_in = NULL;
31485 + }
31486 + if (cygpath_pex)
31487 + {
31488 + pex_free (cygpath_pex);
31489 + cygpath_pex = NULL;
31490 + }
31491 + if (cygpath_log)
31492 + {
31493 + cygpath_log_msg ("end");
31494 + cygpath_log = NULL;
31495 + }
31496 +}
31497 +
31498 +/* CYG_PATH is a pointer to a Cygwin path. This function converts the
31499 + Cygwin path to a Windows path, storing the result in
31500 + WIN32_PATH. Returns true if the conversion was successful; false
31501 + otherwise. */
31502 +int
31503 +cygpath (const char *cyg_path, char win32_path[MAX_PATH + 1])
31504 +{
31505 + bool ok;
31506 + bool retrying;
31507 +
31508 + /* Special-case the empty path. cygpath cannot handle the empty
31509 + path correctly. It ignores the empty line, waiting for a
31510 + non-empty line, which in turn causes an application using this
31511 + function to appear stuck. */
31512 + if (cyg_path[0] == '\0')
31513 + {
31514 + win32_path[0] = '\0';
31515 + return true;
31516 + }
31517 +
31518 + retrying = false;
31519 +
31520 + retry:
31521 + if (!cygpath_initialized)
31522 + {
31523 + const char *argv[] = { "cygpath", "-w", "-f", "-", NULL };
31524 + const char *cygpath_path;
31525 + const char *log;
31526 + int err;
31527 +
31528 + /* If we are unable to invoke cygpath, we do not want to try
31529 + again. So, we set the initialized flag at this point; if
31530 + errors occur during the invocation, it will remain set. */
31531 + cygpath_initialized = 1;
31532 + /* Check to see if the user wants cygpath support. */
31533 + cygpath_path = getenv ("CYGPATH");
31534 + if (!cygpath_path)
31535 + /* The user doesn't need to support Cygwin paths. */
31536 + goto error;
31537 + /* If debugging, open the log file. */
31538 + log = getenv ("CSL_DEBUG_CYGPATH");
31539 + if (log && log[0])
31540 + {
31541 + /* The log file is opened for "append" so that multiple
31542 + processes (perhaps invoked from "make") can share it. */
31543 + cygpath_log = fopen (log, "a");
31544 + if (cygpath_log)
31545 + cygpath_log_msg ("begin");
31546 + }
31547 + /* If the environment variable is set to a non-empty string, use
31548 + that string as the path to cygpath. */
31549 + if (cygpath_path[0] != '\0')
31550 + argv[0] = cygpath_path;
31551 + /* Create the pex object. */
31552 + cygpath_pex = pex_init (PEX_SEARCH | PEX_USE_PIPES,
31553 + "cygpath", NULL);
31554 + if (!cygpath_pex)
31555 + goto error;
31556 + /* Get the FILE we will use to write to the child. */
31557 + cygpath_in = pex_input_pipe (cygpath_pex, /*binary=*/0);
31558 + if (!cygpath_in)
31559 + goto error;
31560 + /* Start the child process. */
31561 + if (pex_run (cygpath_pex, PEX_SEARCH | PEX_USE_PIPES,
31562 + argv[0], (char**) argv,
31563 + NULL, NULL,
31564 + &err) != NULL)
31565 + goto error;
31566 + /* Get the FILE we will use to read from the child. */
31567 + cygpath_out = pex_read_output (cygpath_pex, /*binary=*/1);
31568 + if (!cygpath_out)
31569 + goto error;
31570 + }
31571 + else if (!cygpath_pex)
31572 + /* We previously tried to use cygpath, but something went wrong. */
31573 + return false;
31574 +
31575 + /* Write CYG_PATH to the child, on a line by itself. */
31576 + cygpath_log_msg_arg ("-> %s", cyg_path);
31577 + if (fprintf (cygpath_in, "%s\n", cyg_path) < 0)
31578 + {
31579 + cygpath_perror ("write failed");
31580 + goto error;
31581 + }
31582 + /* Flush the output. (We cannot set the stream into line-buffered
31583 + mode with setvbuf because Windows treats _IOLBF as a synonym for
31584 + _IOFBF.) */
31585 + if (fflush (cygpath_in))
31586 + cygpath_perror ("flush failed");
31587 + /* Read the output. */
31588 + ok = true;
31589 + while (1)
31590 + {
31591 + size_t pathlen;
31592 + if (!fgets (win32_path, MAX_PATH, cygpath_out))
31593 + {
31594 + if (ferror (cygpath_out))
31595 + cygpath_perror ("read failed");
31596 + else
31597 + {
31598 + cygpath_log_msg ("error: EOF");
31599 + /* Unfortunately, cygpath sometimes crashes for no
31600 + apparent reason. We give it two chances... */
31601 + if (!retrying)
31602 + {
31603 + retrying = true;
31604 + cygpath_log_msg ("retrying");
31605 + cygpath_close ();
31606 + cygpath_initialized = 0;
31607 + goto retry;
31608 + }
31609 + }
31610 + goto error;
31611 + }
31612 + pathlen = strlen (win32_path);
31613 + if (pathlen == 0 && ok)
31614 + /* This isn't a well-formed response from cygpath. */
31615 + goto error;
31616 + if (win32_path[pathlen - 1] == '\n')
31617 + {
31618 + win32_path[pathlen - 1] = '\0';
31619 + cygpath_log_msg_arg ("<- %s", win32_path);
31620 + break;
31621 + }
31622 + /* We didn't reach the end of the line. There's no point in
31623 + trying to use this output, since we know the length of
31624 + paths are limited to MAX_PATH characters, but we read the
31625 + entire line so that we are still in sync with
31626 + cygpath. */
31627 + ok = false;
31628 + if (cygpath_log)
31629 + cygpath_log_msg_arg ("error: invalid response: %s",
31630 + win32_path);
31631 + }
31632 +
31633 + return ok;
31634 +
31635 + error:
31636 + cygpath_close();
31637 + return false;
31638 +}
31639 +
31640 +/* Returns the handle for the MVCRT DLL, or NULL if it is not
31641 + available. */
31642 +static HMODULE
31643 +msvcrt_dll (void)
31644 +{
31645 + static HMODULE dll = (HMODULE)(-1);
31646 +
31647 + /* After we call LoadLibrary, DLL will be either a valid handle or
31648 + NULL, so this check ensures that we only try to load the library
31649 + once. */
31650 + if (dll == (HMODULE)(-1))
31651 + dll = LoadLibrary ("msvcrt.dll");
31652 +
31653 + return dll;
31654 +}
31655 +
31656 +/* Call the underlying MSVCRT fopen with PATH and MODE, and return
31657 + what it returns. */
31658 +static FILE *
31659 +msvcrt_fopen (const char *path, const char *mode)
31660 +{
31661 + typedef FILE *(fopen_type)(const char *path,
31662 + const char *mode);
31663 +
31664 + static fopen_type *f = NULL;
31665 +
31666 + /* Get the address of "fopen". */
31667 + if (!f)
31668 + {
31669 + HMODULE dll = msvcrt_dll ();
31670 + if (!dll)
31671 + {
31672 + errno = ENOSYS;
31673 + return NULL;
31674 + }
31675 + f = (fopen_type *) GetProcAddress (dll, "fopen");
31676 + if (!f)
31677 + {
31678 + errno = ENOSYS;
31679 + return NULL;
31680 + }
31681 + }
31682 +
31683 + /* Call fopen. */
31684 + return (*f)(path, mode);
31685 +}
31686 +
31687 +FILE *
31688 +fopen (const char *path, const char *mode)
31689 +{
31690 + FILE *f;
31691 + char win32_path[MAX_PATH + 1];
31692 +
31693 + /* Assume PATH is a Windows path. */
31694 + f = msvcrt_fopen (path, mode);
31695 + if (f || errno != ENOENT)
31696 + return f;
31697 + /* Perhaps it is a Cygwin path? */
31698 + if (cygpath (path, win32_path))
31699 + f = msvcrt_fopen (win32_path, mode);
31700 + return f;
31701 +}
31702 +
31703 +int
31704 +open (const char *path, int oflag, ...)
31705 +{
31706 + int fd;
31707 + char win32_path[MAX_PATH + 1];
31708 + int pmode = 0;
31709 +
31710 + if ((oflag & _O_CREAT))
31711 + {
31712 + va_list ap;
31713 + va_start (ap, oflag);
31714 + pmode = va_arg (ap, int);
31715 + va_end (ap);
31716 + }
31717 +
31718 + /* Assume PATH is a Windows path. */
31719 + fd = _open (path, oflag, pmode);
31720 + if (fd != -1 || errno != ENOENT)
31721 + return fd;
31722 + /* Perhaps it is a Cygwin path? */
31723 + if (cygpath (path, win32_path))
31724 + fd = _open (win32_path, oflag, pmode);
31725 + return fd;
31726 +}
31727 +
31728 +int
31729 +stat (const char *path, struct stat *buffer)
31730 +{
31731 + int r;
31732 + char win32_path[MAX_PATH + 1];
31733 +
31734 + /* Assume PATH is a Windows path. */
31735 + r = _stat (path, (struct _stat *) buffer);
31736 + if (r != -1 || errno != ENOENT)
31737 + return r;
31738 + /* Perhaps it is a Cygwin path? */
31739 + if (cygpath (path, win32_path))
31740 + r = _stat (win32_path, (struct _stat *) buffer);
31741 + return r;
31742 +}
31743 +
31744 +int
31745 +access (const char *path, int mode)
31746 +{
31747 + int r;
31748 + char win32_path[MAX_PATH + 1];
31749 +
31750 +#ifdef _WIN32
31751 + /* Some GNU tools mistakenly defined X_OK to 1 on Windows. */
31752 + mode = mode & ~1;
31753 +#endif
31754 + /* Assume PATH is a Windows path. */
31755 + r = _access (path, mode);
31756 + if (r != -1 || errno != ENOENT)
31757 + return r;
31758 + /* Perhaps it is a Cygwin path? */
31759 + if (cygpath (path, win32_path))
31760 + r = _access (win32_path, mode);
31761 + return r;
31762 +}
31763 +
31764 +/* Given the WINDOWS_CODE (typically the result of GetLastError), set
31765 + ERRNO to the corresponding error code. If there is no obvious
31766 + correspondence, ERRNO will be set to EACCES. */
31767 +static void
31768 +set_errno_from_windows_code (DWORD windows_code)
31769 +{
31770 + int mapping[][2] = {
31771 + {ERROR_ACCESS_DENIED, EACCES},
31772 + {ERROR_ACCOUNT_DISABLED, EACCES},
31773 + {ERROR_ACCOUNT_RESTRICTION, EACCES},
31774 + {ERROR_ALREADY_ASSIGNED, EBUSY},
31775 + {ERROR_ALREADY_EXISTS, EEXIST},
31776 + {ERROR_ARITHMETIC_OVERFLOW, ERANGE},
31777 + {ERROR_BAD_COMMAND, EIO},
31778 + {ERROR_BAD_DEVICE, ENODEV},
31779 + {ERROR_BAD_DRIVER_LEVEL, ENXIO},
31780 + {ERROR_BAD_EXE_FORMAT, ENOEXEC},
31781 + {ERROR_BAD_FORMAT, ENOEXEC},
31782 + {ERROR_BAD_LENGTH, EINVAL},
31783 + {ERROR_BAD_PATHNAME, ENOENT},
31784 + {ERROR_BAD_PIPE, EPIPE},
31785 + {ERROR_BAD_UNIT, ENODEV},
31786 + {ERROR_BAD_USERNAME, EINVAL},
31787 + {ERROR_BROKEN_PIPE, EPIPE},
31788 + {ERROR_BUFFER_OVERFLOW, ENOMEM},
31789 + {ERROR_BUSY, EBUSY},
31790 + {ERROR_BUSY_DRIVE, EBUSY},
31791 + {ERROR_CALL_NOT_IMPLEMENTED, ENOSYS},
31792 + {ERROR_CRC, EIO},
31793 + {ERROR_CURRENT_DIRECTORY, EINVAL},
31794 + {ERROR_DEVICE_IN_USE, EBUSY},
31795 + {ERROR_DIR_NOT_EMPTY, EEXIST},
31796 + {ERROR_DIRECTORY, ENOENT},
31797 + {ERROR_DISK_CHANGE, EIO},
31798 + {ERROR_DISK_FULL, ENOSPC},
31799 + {ERROR_DRIVE_LOCKED, EBUSY},
31800 + {ERROR_ENVVAR_NOT_FOUND, EINVAL},
31801 + {ERROR_EXE_MARKED_INVALID, ENOEXEC},
31802 + {ERROR_FILE_EXISTS, EEXIST},
31803 + {ERROR_FILE_INVALID, ENODEV},
31804 + {ERROR_FILE_NOT_FOUND, ENOENT},
31805 + {ERROR_FILENAME_EXCED_RANGE, ENAMETOOLONG},
31806 + {ERROR_GEN_FAILURE, EIO},
31807 + {ERROR_HANDLE_DISK_FULL, ENOSPC},
31808 + {ERROR_INSUFFICIENT_BUFFER, ENOMEM},
31809 + {ERROR_INVALID_ACCESS, EINVAL},
31810 + {ERROR_INVALID_ADDRESS, EFAULT},
31811 + {ERROR_INVALID_BLOCK, EFAULT},
31812 + {ERROR_INVALID_DATA, EINVAL},
31813 + {ERROR_INVALID_DRIVE, ENODEV},
31814 + {ERROR_INVALID_EXE_SIGNATURE, ENOEXEC},
31815 + {ERROR_INVALID_FLAGS, EINVAL},
31816 + {ERROR_INVALID_FUNCTION, ENOSYS},
31817 + {ERROR_INVALID_HANDLE, EBADF},
31818 + {ERROR_INVALID_LOGON_HOURS, EACCES},
31819 + {ERROR_INVALID_NAME, ENOENT},
31820 + {ERROR_INVALID_OWNER, EINVAL},
31821 + {ERROR_INVALID_PARAMETER, EINVAL},
31822 + {ERROR_INVALID_PASSWORD, EPERM},
31823 + {ERROR_INVALID_PRIMARY_GROUP, EINVAL},
31824 + {ERROR_INVALID_SIGNAL_NUMBER, EINVAL},
31825 + {ERROR_INVALID_TARGET_HANDLE, EIO},
31826 + {ERROR_INVALID_WORKSTATION, EACCES},
31827 + {ERROR_IO_DEVICE, EIO},
31828 + {ERROR_IO_INCOMPLETE, EINTR},
31829 + {ERROR_LOCKED, EBUSY},
31830 + {ERROR_LOGON_FAILURE, EACCES},
31831 + {ERROR_MAPPED_ALIGNMENT, EINVAL},
31832 + {ERROR_META_EXPANSION_TOO_LONG, E2BIG},
31833 + {ERROR_MORE_DATA, EPIPE},
31834 + {ERROR_NEGATIVE_SEEK, ESPIPE},
31835 + {ERROR_NO_DATA, EPIPE},
31836 + {ERROR_NO_MORE_SEARCH_HANDLES, EIO},
31837 + {ERROR_NO_PROC_SLOTS, EAGAIN},
31838 + {ERROR_NO_SUCH_PRIVILEGE, EACCES},
31839 + {ERROR_NOACCESS, EFAULT},
31840 + {ERROR_NONE_MAPPED, EINVAL},
31841 + {ERROR_NOT_ENOUGH_MEMORY, ENOMEM},
31842 + {ERROR_NOT_READY, ENODEV},
31843 + {ERROR_NOT_SAME_DEVICE, EXDEV},
31844 + {ERROR_OPEN_FAILED, EIO},
31845 + {ERROR_OPERATION_ABORTED, EINTR},
31846 + {ERROR_OUTOFMEMORY, ENOMEM},
31847 + {ERROR_PASSWORD_EXPIRED, EACCES},
31848 + {ERROR_PATH_BUSY, EBUSY},
31849 + {ERROR_PATH_NOT_FOUND, ENOTDIR},
31850 + {ERROR_PIPE_BUSY, EBUSY},
31851 + {ERROR_PIPE_CONNECTED, EPIPE},
31852 + {ERROR_PIPE_LISTENING, EPIPE},
31853 + {ERROR_PIPE_NOT_CONNECTED, EPIPE},
31854 + {ERROR_PRIVILEGE_NOT_HELD, EACCES},
31855 + {ERROR_READ_FAULT, EIO},
31856 + {ERROR_SEEK, ESPIPE},
31857 + {ERROR_SEEK_ON_DEVICE, ESPIPE},
31858 + {ERROR_SHARING_BUFFER_EXCEEDED, ENFILE},
31859 + {ERROR_STACK_OVERFLOW, ENOMEM},
31860 + {ERROR_SWAPERROR, ENOENT},
31861 + {ERROR_TOO_MANY_MODULES, EMFILE},
31862 + {ERROR_TOO_MANY_OPEN_FILES, EMFILE},
31863 + {ERROR_UNRECOGNIZED_MEDIA, ENXIO},
31864 + {ERROR_UNRECOGNIZED_VOLUME, ENODEV},
31865 + {ERROR_WAIT_NO_CHILDREN, ECHILD},
31866 + {ERROR_WRITE_FAULT, EIO},
31867 + {ERROR_WRITE_PROTECT, EROFS}
31868 +/* MinGW does not define ETXTBSY as yet.
31869 + {ERROR_LOCK_VIOLATION, ETXTBSY},
31870 + {ERROR_SHARING_VIOLATION, ETXTBSY},
31871 +*/
31872 + };
31873 +
31874 + size_t i;
31875 +
31876 + for (i = 0; i < sizeof (mapping)/sizeof (mapping[0]); ++i)
31877 + if (mapping[i][0] == windows_code)
31878 + {
31879 + errno = mapping[i][1];
31880 + return;
31881 + }
31882 +
31883 + /* Unrecognized error. Use EACCESS to have some error code,
31884 + not misleading "No error" thing. */
31885 + errno = EACCES;
31886 +}
31887 +
31888 +int rename (const char *oldpath, const char *newpath)
31889 +{
31890 + BOOL r;
31891 + int oldpath_converted = 0;
31892 + char win32_oldpath[MAX_PATH + 1];
31893 + char win32_newpath[MAX_PATH + 1];
31894 +
31895 + /* Older versions of the cygpath program called FindFirstFile, but
31896 + not FindClose. As a result, a long-running cygpath program ends
31897 + up leaking these handles, and, as a result, the Windows kernel
31898 + will not let us remove or rename things in directories. Therefore,
31899 + we kill the child cygpath program now.
31900 +
31901 + The defect in cygpath was corrected by this patch:
31902 +
31903 + http://cygwin.com/ml/cygwin-patches/2007-q1/msg00033.html
31904 +
31905 + but older versions of cygpath will be in use for the forseeable
31906 + future. */
31907 +
31908 + cygpath_close ();
31909 + cygpath_initialized = 0;
31910 +
31911 + /* Assume all paths are Windows paths. */
31912 + r = MoveFileEx (oldpath, newpath, MOVEFILE_REPLACE_EXISTING);
31913 + if (r)
31914 + return 0;
31915 + else if (GetLastError () != ERROR_PATH_NOT_FOUND)
31916 + goto error;
31917 +
31918 + /* Perhaps the old path is a cygwin path? */
31919 + if (cygpath (oldpath, win32_oldpath))
31920 + {
31921 + oldpath_converted = 1;
31922 + r = MoveFileEx (win32_oldpath, newpath, MOVEFILE_REPLACE_EXISTING);
31923 + if (r)
31924 + return 0;
31925 + else if (GetLastError () != ERROR_PATH_NOT_FOUND)
31926 + goto error;
31927 + }
31928 +
31929 + /* Perhaps the new path is a cygwin path? */
31930 + if (cygpath (newpath, win32_newpath))
31931 + {
31932 + r = MoveFileEx (oldpath_converted ? win32_oldpath : oldpath,
31933 + win32_newpath, MOVEFILE_REPLACE_EXISTING);
31934 + if (r == TRUE)
31935 + return 0;
31936 + }
31937 +error:
31938 + set_errno_from_windows_code (GetLastError ());
31939 + return -1;
31940 +}
31941 +
31942 +int remove (const char *pathname)
31943 +{
31944 + int r;
31945 + char win32_path[MAX_PATH + 1];
31946 +
31947 + cygpath_close ();
31948 + cygpath_initialized = 0;
31949 +
31950 + /* Assume PATH is a Windows path. */
31951 + r = _unlink (pathname);
31952 + if (r != -1 || errno != ENOENT)
31953 + return r;
31954 + /* Perhaps it is a Cygwin path? */
31955 + if (cygpath (pathname, win32_path))
31956 + r = _unlink (win32_path);
31957 + return r;
31958 +}
31959 +
31960 +int unlink(const char *pathname)
31961 +{
31962 + return remove (pathname);
31963 +}
31964 +
31965 +int
31966 +chdir (const char *path)
31967 +{
31968 + int ret;
31969 + char win32_path[MAX_PATH + 1];
31970 +
31971 + /* Assume PATH is a Windows path. */
31972 + ret = _chdir (path);
31973 + if (ret != -1 || errno != ENOENT)
31974 + return ret;
31975 + /* Perhaps it is a Cygwin path? */
31976 + if (cygpath (path, win32_path))
31977 + ret = _chdir (win32_path);
31978 + return ret;
31979 +}
31980 --- a/libiberty/make-temp-file.c
31981 +++ b/libiberty/make-temp-file.c
31982 @@ -36,6 +36,9 @@ Boston, MA 02110-1301, USA. */
31983 #ifdef HAVE_SYS_FILE_H
31984 #include <sys/file.h> /* May get R_OK, etc. on some systems. */
31985 #endif
31986 +#if defined(_WIN32) && !defined(__CYGWIN__)
31987 +#include <windows.h>
31988 +#endif
31989
31990 #ifndef R_OK
31991 #define R_OK 4
31992 @@ -56,6 +59,8 @@ extern int mkstemps (char *, int);
31993 #define TEMP_FILE "ccXXXXXX"
31994 #define TEMP_FILE_LEN (sizeof(TEMP_FILE) - 1)
31995
31996 +#if !defined(_WIN32) || defined(__CYGWIN__)
31997 +
31998 /* Subroutine of choose_tmpdir.
31999 If BASE is non-NULL, return it.
32000 Otherwise it checks if DIR is a usable directory.
32001 @@ -81,6 +86,8 @@ static const char usrtmp[] =
32002 static const char vartmp[] =
32003 { DIR_SEPARATOR, 'v', 'a', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 };
32004
32005 +#endif
32006 +
32007 static char *memoized_tmpdir;
32008
32009 /*
32010 @@ -97,40 +104,58 @@ files in.
32011 char *
32012 choose_tmpdir (void)
32013 {
32014 - const char *base = 0;
32015 - char *tmpdir;
32016 - unsigned int len;
32017 -
32018 - if (memoized_tmpdir)
32019 - return memoized_tmpdir;
32020 -
32021 - base = try_dir (getenv ("TMPDIR"), base);
32022 - base = try_dir (getenv ("TMP"), base);
32023 - base = try_dir (getenv ("TEMP"), base);
32024 -
32025 + if (!memoized_tmpdir)
32026 + {
32027 +#if !defined(_WIN32) || defined(__CYGWIN__)
32028 + const char *base = 0;
32029 + char *tmpdir;
32030 + unsigned int len;
32031 +
32032 + base = try_dir (getenv ("TMPDIR"), base);
32033 + base = try_dir (getenv ("TMP"), base);
32034 + base = try_dir (getenv ("TEMP"), base);
32035 +
32036 #ifdef P_tmpdir
32037 - base = try_dir (P_tmpdir, base);
32038 + base = try_dir (P_tmpdir, base);
32039 #endif
32040
32041 - /* Try /var/tmp, /usr/tmp, then /tmp. */
32042 - base = try_dir (vartmp, base);
32043 - base = try_dir (usrtmp, base);
32044 - base = try_dir (tmp, base);
32045 -
32046 - /* If all else fails, use the current directory! */
32047 - if (base == 0)
32048 - base = ".";
32049 -
32050 - /* Append DIR_SEPARATOR to the directory we've chosen
32051 - and return it. */
32052 - len = strlen (base);
32053 - tmpdir = XNEWVEC (char, len + 2);
32054 - strcpy (tmpdir, base);
32055 - tmpdir[len] = DIR_SEPARATOR;
32056 - tmpdir[len+1] = '\0';
32057 + /* Try /var/tmp, /usr/tmp, then /tmp. */
32058 + base = try_dir (vartmp, base);
32059 + base = try_dir (usrtmp, base);
32060 + base = try_dir (tmp, base);
32061 +
32062 + /* If all else fails, use the current directory! */
32063 + if (base == 0)
32064 + base = ".";
32065 + /* Append DIR_SEPARATOR to the directory we've chosen
32066 + and return it. */
32067 + len = strlen (base);
32068 + tmpdir = XNEWVEC (char, len + 2);
32069 + strcpy (tmpdir, base);
32070 + tmpdir[len] = DIR_SEPARATOR;
32071 + tmpdir[len+1] = '\0';
32072 + memoized_tmpdir = tmpdir;
32073 +#else /* defined(_WIN32) && !defined(__CYGWIN__) */
32074 + DWORD len;
32075 +
32076 + /* Figure out how much space we need. */
32077 + len = GetTempPath(0, NULL);
32078 + if (len)
32079 + {
32080 + memoized_tmpdir = XNEWVEC (char, len);
32081 + if (!GetTempPath(len, memoized_tmpdir))
32082 + {
32083 + XDELETEVEC (memoized_tmpdir);
32084 + memoized_tmpdir = NULL;
32085 + }
32086 + }
32087 + if (!memoized_tmpdir)
32088 + /* If all else fails, use the current directory. */
32089 + memoized_tmpdir = xstrdup (".\\");
32090 +#endif /* defined(_WIN32) && !defined(__CYGWIN__) */
32091 + }
32092
32093 - memoized_tmpdir = tmpdir;
32094 - return tmpdir;
32095 + return memoized_tmpdir;
32096 }
32097
32098 /*
32099 --- a/libiberty/pex-win32.c
32100 +++ b/libiberty/pex-win32.c
32101 @@ -119,7 +119,7 @@ static int
32102 pex_win32_open_read (struct pex_obj *obj ATTRIBUTE_UNUSED, const char *name,
32103 int binary)
32104 {
32105 - return _open (name, _O_RDONLY | (binary ? _O_BINARY : _O_TEXT));
32106 + return open (name, _O_RDONLY | (binary ? _O_BINARY : _O_TEXT));
32107 }
32108
32109 /* Open a file for writing. */
32110 @@ -130,10 +130,10 @@ pex_win32_open_write (struct pex_obj *ob
32111 {
32112 /* Note that we can't use O_EXCL here because gcc may have already
32113 created the temporary file via make_temp_file. */
32114 - return _open (name,
32115 - (_O_WRONLY | _O_CREAT | _O_TRUNC
32116 - | (binary ? _O_BINARY : _O_TEXT)),
32117 - _S_IREAD | _S_IWRITE);
32118 + return open (name,
32119 + (_O_WRONLY | _O_CREAT | _O_TRUNC
32120 + | (binary ? _O_BINARY : _O_TEXT)),
32121 + _S_IREAD | _S_IWRITE);
32122 }
32123
32124 /* Close a file. */
32125 --- a/opcodes/arm-dis.c
32126 +++ b/opcodes/arm-dis.c
32127 @@ -4041,7 +4041,9 @@ print_insn (bfd_vma pc, struct disassemb
32128 for a preceeding one. */
32129 for (; n >= 0; n--)
32130 {
32131 - if (get_sym_code_type (info, n, &type))
32132 + if ((info->section == NULL
32133 + || info->section == info->symtab[n]->section)
32134 + && get_sym_code_type (info, n, &type))
32135 {
32136 last_sym = n;
32137 found = TRUE;
32138 --- a/opcodes/m68k-opc.c
32139 +++ b/opcodes/m68k-opc.c
32140 @@ -2025,7 +2025,9 @@ const struct m68k_opcode m68k_opcodes[]
32141
32142 {"sbcd", 2, one(0100400), one(0170770), "DsDd", m68000up },
32143 {"sbcd", 2, one(0100410), one(0170770), "-s-d", m68000up },
32144 -
32145 +
32146 +{"stldsr", 6, two(0x40e7, 0x46fc), two(0xffff, 0xffff), "#w", mcfisa_c },
32147 +
32148 /* Traps have to come before conditional sets, as they have a more
32149 specific opcode. */
32150 {"trapcc", 2, one(0052374), one(0177777), "", m68020up | cpu32 | fido_a },
32151 --- a/opcodes/mips-dis.c
32152 +++ b/opcodes/mips-dis.c
32153 @@ -38,6 +38,9 @@
32154 #include "elf/mips.h"
32155 #endif
32156
32157 +/* Generate Octeon unaligned load and store instructions. */
32158 +int octeon_use_unalign = 1;
32159 +
32160 /* Mips instructions are at maximum this many bytes long. */
32161 #define INSNLEN 4
32162
32163 @@ -319,6 +322,36 @@ static const struct mips_cp0sel_name mip
32164 { 29, 3, "c0_datahi_d" },
32165 };
32166
32167 +static const char * const mips_cp0_names_octeon[32] = {
32168 + "c0_index", "c0_random", "c0_entrylo0", "c0_entrylo1",
32169 + "c0_context", "c0_pagemask", "c0_wired", "c0_hwrena",
32170 + "c0_badvaddr", "c0_count", "c0_entryhi", "c0_compare",
32171 + "c0_status", "c0_cause", "c0_epc", "c0_prid",
32172 + "c0_config", "$17", "c0_watchlo", "c0_watchhi",
32173 + "c0_xcontext", "$21", "c0_mdebug", "c0_debug",
32174 + "c0_depc", "c0_perfcnt", "$26", "c0_cacheerr",
32175 + "c0_taglo", "c0_taghi", "c0_errorepc", "c0_desave",
32176 +};
32177 +
32178 +static const struct mips_cp0sel_name mips_cp0sel_names_octeon[] = {
32179 + { 5, 1, "c0_pagegrain" },
32180 + { 9, 6, "c0_cvmcount" },
32181 + { 9, 7, "c0_cvmctl" },
32182 + { 11, 7, "c0_cvmmemctl" },
32183 + { 12, 1, "c0_intctl" },
32184 + { 12, 2, "c0_srsctl" },
32185 + { 15, 1, "c0_ebase" },
32186 + { 16, 1, "c0_config1", },
32187 + { 16, 2, "c0_config2", },
32188 + { 16, 3, "c0_config3", },
32189 + { 18, 1, "c0_watchlo,1" },
32190 + { 19, 1, "c0_watchhi,1" },
32191 + { 25, 2, "c0_perfcnt,2" },
32192 + { 27, 1, "c0_cacheerr,1" },
32193 + { 28, 3, "c0_datalo" },
32194 + { 29, 3, "c0_datahi" },
32195 +};
32196 +
32197 /* Xlr cop0 register names. */
32198 static const char * const mips_cp0_names_xlr[32] = {
32199 "c0_index", "c0_random", "c0_entrylo0", "c0_entrylo1",
32200 @@ -513,8 +546,9 @@ const struct mips_arch_choice mips_arch_
32201 NULL, 0, mips_hwr_names_numeric },
32202
32203 { "octeon", 1, bfd_mach_mips_octeon, CPU_OCTEON,
32204 - ISA_MIPS64R2 | INSN_OCTEON, mips_cp0_names_numeric, NULL, 0,
32205 - mips_hwr_names_numeric },
32206 + ISA_MIPS64R2 | INSN_OCTEON, mips_cp0_names_octeon,
32207 + mips_cp0sel_names_octeon, ARRAY_SIZE (mips_cp0sel_names_octeon),
32208 + mips_hwr_names_numeric },
32209
32210 { "xlr", 1, bfd_mach_mips_xlr, CPU_XLR,
32211 ISA_MIPS64 | INSN_XLR,
32212 @@ -676,7 +710,17 @@ parse_mips_dis_option (const char *optio
32213 no_aliases = 1;
32214 return;
32215 }
32216 -
32217 + if (strcmp ("octeon-useun", option) == 0)
32218 + {
32219 + octeon_use_unalign = 1;
32220 + return;
32221 + }
32222 + if (strcmp ("no-octeon-useun", option) == 0)
32223 + {
32224 + octeon_use_unalign = 0;
32225 + return;
32226 + }
32227 +
32228 /* Look for the = that delimits the end of the option name. */
32229 for (i = 0; i < len; i++)
32230 if (option[i] == '=')
32231 @@ -1401,6 +1445,27 @@ print_insn_mips (bfd_vma memaddr,
32232 && strcmp (op->name, "jalx"))
32233 continue;
32234
32235 + if (info->mach == CPU_OCTEON && octeon_use_unalign)
32236 + {
32237 + if (strcmp (op->name, "lwl") == 0
32238 + || strcmp (op->name, "ldl") == 0
32239 + || strcmp (op->name, "swl") == 0
32240 + || strcmp (op->name, "sdl") == 0
32241 + || strcmp (op->name, "lcache") == 0
32242 + || strcmp (op->name, "scache") == 0
32243 + || strcmp (op->name, "flush") == 0)
32244 + continue;
32245 +
32246 + if (strcmp (op->name, "ldr") == 0
32247 + || strcmp (op->name, "lwr") == 0
32248 + || strcmp (op->name, "swr") == 0
32249 + || strcmp (op->name, "sdr") == 0)
32250 + {
32251 + (*info->fprintf_func) (info->stream, "nop");
32252 + return INSNLEN;
32253 + }
32254 + }
32255 +
32256 /* Figure out instruction type and branch delay information. */
32257 if ((op->pinfo & INSN_UNCOND_BRANCH_DELAY) != 0)
32258 {
32259 @@ -2175,6 +2240,12 @@ The following MIPS specific disassembler
32260 with the -M switch (multiple options should be separated by commas):\n"));
32261
32262 fprintf (stream, _("\n\
32263 + octeon-useun Disassemble Octeon unaligned load/store instructions.\n"));
32264 +
32265 + fprintf (stream, _("\n\
32266 + no-octeon-useun Disassemble mips unaligned load/store instructions.\n"));
32267 +
32268 + fprintf (stream, _("\n\
32269 gpr-names=ABI Print GPR names according to specified ABI.\n\
32270 Default: based on binary being disassembled.\n"));
32271
32272 --- a/opcodes/mips-opc.c
32273 +++ b/opcodes/mips-opc.c
32274 @@ -188,8 +188,8 @@ const struct mips_opcode mips_builtin_op
32275 {"pref", "k,o(b)", 0xcc000000, 0xfc000000, RD_b, 0, I4_32|G3 },
32276 {"prefx", "h,t(b)", 0x4c00000f, 0xfc0007ff, RD_b|RD_t|FP_S, 0, I4_33 },
32277 {"nop", "", 0x00000000, 0xffffffff, 0, INSN2_ALIAS, I1 }, /* sll */
32278 -{"ssnop", "", 0x00000040, 0xffffffff, 0, INSN2_ALIAS, I32|N55 }, /* sll */
32279 -{"ehb", "", 0x000000c0, 0xffffffff, 0, INSN2_ALIAS, I33 }, /* sll */
32280 +{"ssnop", "", 0x00000040, 0xffffffff, 0, INSN2_ALIAS, I1 }, /* sll */
32281 +{"ehb", "", 0x000000c0, 0xffffffff, 0, INSN2_ALIAS, I32 }, /* sll */
32282 {"li", "t,j", 0x24000000, 0xffe00000, WR_t, INSN2_ALIAS, I1 }, /* addiu */
32283 {"li", "t,i", 0x34000000, 0xffe00000, WR_t, INSN2_ALIAS, I1 }, /* ori */
32284 {"li", "t,I", 0, (int) M_LI, INSN_MACRO, 0, I1 },
32285 @@ -739,7 +739,7 @@ const struct mips_opcode mips_builtin_op
32286 assembler, but will never match user input (because the line above
32287 will match first). */
32288 {"jal", "a", 0x0c000000, 0xfc000000, UBD|WR_31, 0, I1 },
32289 -{"jalx", "a", 0x74000000, 0xfc000000, UBD|WR_31, 0, I16 },
32290 +{"jalx", "a", 0x74000000, 0xfc000000, UBD|WR_31, 0, I1 },
32291 {"la", "t,A(b)", 0, (int) M_LA_AB, INSN_MACRO, 0, I1 },
32292 {"lb", "t,o(b)", 0x80000000, 0xfc000000, LDD|RD_b|WR_t, 0, I1 },
32293 {"lb", "t,A(b)", 0, (int) M_LB_AB, INSN_MACRO, 0, I1 },
32294 @@ -1170,6 +1170,11 @@ const struct mips_opcode mips_builtin_op
32295 {"rzu.ob", "X,Q", 0x78000020, 0xfc20f83f, WR_D|RD_T|FP_D, RD_MACC, MX|SB1 },
32296 {"rzu.ob", "D,k", 0x4bc00020, 0xffe0f83f, WR_D|RD_S|RD_T, 0, N54 },
32297 {"rzu.qh", "X,Q", 0x78200020, 0xfc20f83f, WR_D|RD_T|FP_D, RD_MACC, MX },
32298 +/* 58xx specific instructions. */
32299 +{"saa", "t,(b)", 0x70000018, 0xfc00ffff, SM|RD_t|RD_b, 0, IOCT },
32300 +{"saa", "t,A(b)", 0, (int) M_SAA_AB, INSN_MACRO, 0, IOCT },
32301 +{"saad", "t,(b)", 0x70000019, 0xfc00ffff, SM|RD_t|RD_b, 0, IOCT },
32302 +{"saad", "t,A(b)", 0, (int) M_SAAD_AB, INSN_MACRO, 0, IOCT },
32303 {"sb", "t,o(b)", 0xa0000000, 0xfc000000, SM|RD_t|RD_b, 0, I1 },
32304 {"sb", "t,A(b)", 0, (int) M_SB_AB, INSN_MACRO, 0, I1 },
32305 {"sc", "t,o(b)", 0xe0000000, 0xfc000000, SM|RD_t|WR_t|RD_b, 0, I2 },
32306 @@ -1334,7 +1339,9 @@ const struct mips_opcode mips_builtin_op
32307 {"invalidate", "t,o(b)",0xb8000000, 0xfc000000, RD_t|RD_b, 0, I2 }, /* same */
32308 {"invalidate", "t,A(b)",0, (int) M_SWR_AB, INSN_MACRO, 0, I2 }, /* as swr */
32309 {"swxc1", "S,t(b)", 0x4c000008, 0xfc0007ff, SM|RD_S|RD_t|RD_b|FP_S, 0, I4_33 },
32310 +{"syncio", "", 0x0000004f, 0xffffffff, INSN_SYNC, 0, IOCT },
32311 {"synciobdma", "", 0x0000008f, 0xffffffff, INSN_SYNC, 0, IOCT },
32312 +{"syncioall", "", 0x000000cf, 0xffffffff, INSN_SYNC, 0, IOCT },
32313 {"syncs", "", 0x0000018f, 0xffffffff, INSN_SYNC, 0, IOCT },
32314 {"syncw", "", 0x0000010f, 0xffffffff, INSN_SYNC, 0, IOCT },
32315 {"syncws", "", 0x0000014f, 0xffffffff, INSN_SYNC, 0, IOCT },
32316 @@ -1387,18 +1394,22 @@ const struct mips_opcode mips_builtin_op
32317 {"trunc.w.s", "D,S", 0x4600000d, 0xffff003f, WR_D|RD_S|FP_S, 0, I2 },
32318 {"trunc.w.s", "D,S,x", 0x4600000d, 0xffff003f, WR_D|RD_S|FP_S, 0, I2 },
32319 {"trunc.w.s", "D,S,t", 0, (int) M_TRUNCWS, INSN_MACRO, INSN2_M_FP_S, I1 },
32320 +{"uld", "t,o(b)", 0x68000000, 0xfc000000, LDD|WR_t|RD_b, 0, IOCT },
32321 {"uld", "t,o(b)", 0, (int) M_ULD, INSN_MACRO, 0, I3 },
32322 {"uld", "t,A(b)", 0, (int) M_ULD_A, INSN_MACRO, 0, I3 },
32323 {"ulh", "t,o(b)", 0, (int) M_ULH, INSN_MACRO, 0, I1 },
32324 {"ulh", "t,A(b)", 0, (int) M_ULH_A, INSN_MACRO, 0, I1 },
32325 {"ulhu", "t,o(b)", 0, (int) M_ULHU, INSN_MACRO, 0, I1 },
32326 {"ulhu", "t,A(b)", 0, (int) M_ULHU_A, INSN_MACRO, 0, I1 },
32327 +{"ulw", "t,o(b)", 0x88000000, 0xfc000000, LDD|RD_b|WR_t, 0, IOCT },
32328 {"ulw", "t,o(b)", 0, (int) M_ULW, INSN_MACRO, 0, I1 },
32329 {"ulw", "t,A(b)", 0, (int) M_ULW_A, INSN_MACRO, 0, I1 },
32330 +{"usd", "t,o(b)", 0xb0000000, 0xfc000000, SM|RD_t|RD_b, 0, IOCT },
32331 {"usd", "t,o(b)", 0, (int) M_USD, INSN_MACRO, 0, I3 },
32332 {"usd", "t,A(b)", 0, (int) M_USD_A, INSN_MACRO, 0, I3 },
32333 {"ush", "t,o(b)", 0, (int) M_USH, INSN_MACRO, 0, I1 },
32334 {"ush", "t,A(b)", 0, (int) M_USH_A, INSN_MACRO, 0, I1 },
32335 +{"usw", "t,o(b)", 0xa8000000, 0xfc000000, SM|RD_t|RD_b, 0, IOCT },
32336 {"usw", "t,o(b)", 0, (int) M_USW, INSN_MACRO, 0, I1 },
32337 {"usw", "t,A(b)", 0, (int) M_USW_A, INSN_MACRO, 0, I1 },
32338 {"v3mulu", "d,v,t", 0x70000011, 0xfc0007ff, WR_d|RD_s|RD_t, 0, IOCT },
32339 --- a/opcodes/ppc-opc.c
32340 +++ b/opcodes/ppc-opc.c
32341 @@ -3377,6 +3377,11 @@ const struct powerpc_opcode powerpc_opco
32342
32343 {"isellt", X(31,15), X_MASK, PPCISEL, PPCNONE, {RT, RA, RB}},
32344
32345 +{"tlbilxlpid", XTO(31,18,0), XTO_MASK, E500MC, PPCNONE, {0}},
32346 +{"tlbilxpid", XTO(31,18,1), XTO_MASK, E500MC, PPCNONE, {0}},
32347 +{"tlbilxva", XTO(31,18,3), XTO_MASK, E500MC, PPCNONE, {RA0, RB}},
32348 +{"tlbilx", X(31,18), X_MASK, E500MC, PPCNONE, {T, RA0, RB}},
32349 +
32350 {"mfcr", XFXM(31,19,0,0), XRARB_MASK, COM, POWER4, {RT}},
32351 {"mfcr", XFXM(31,19,0,0), XFXFXM_MASK, POWER4, PPCNONE, {RT, FXM4}},
32352 {"mfocrf", XFXM(31,19,0,1), XFXFXM_MASK, COM, PPCNONE, {RT, FXM}},
32353 @@ -4416,10 +4421,6 @@ const struct powerpc_opcode powerpc_opco
32354 {"caxo.", XO(31,266,1,1), XO_MASK, PWRCOM, PPCNONE, {RT, RA, RB}},
32355
32356 {"tlbivax", X(31,786), XRT_MASK, BOOKE, PPCNONE, {RA, RB}},
32357 -{"tlbilx", X(31,787), X_MASK, E500MC, PPCNONE, {T, RA0, RB}},
32358 -{"tlbilxlpid", XTO(31,787,0), XTO_MASK, E500MC, PPCNONE, {0}},
32359 -{"tlbilxpid", XTO(31,787,1), XTO_MASK, E500MC, PPCNONE, {0}},
32360 -{"tlbilxva", XTO(31,787,3), XTO_MASK, E500MC, PPCNONE, {RA0, RB}},
32361
32362 {"lwzcix", X(31,789), X_MASK, POWER6, PPCNONE, {RT, RA0, RB}},
32363