PR 3532
[external/binutils.git] / bfd / ChangeLog
1 2006-11-20  Alan Modra  <amodra@bigpond.net.au>
2
3         PR 3532
4         * bfd-in.h (struct bfd_hash_table): Reorganize.  Add "frozen".
5         * hash.c (bfd_hash_table_init_n): Init frozen.
6         (bfd_hash_lookup): Don't grow if frozen.
7         (bfd_hash_traverse): Freeze hash table during traversal.
8         * bfd-in2.h: Regenerate.
9
10 2006-11-18  Alan Modra  <amodra@bigpond.net.au>
11
12         * elflink.c (_bfd_elf_check_kept_section): Test for kept group
13         section.  Save result of checks in kept_section.
14         (_bfd_elf_section_already_linked): Tidy.  Correct comments.
15         Ignore all group member sections.  Handle special matching of
16         single-member groups against linkonce sections via their group
17         section.  When such a match is found, set kept_section to the
18         group member section rather than to the group.
19
20 2006-11-14  Phil Lello  <phil.lello@homecall.co.uk>
21
22         * peXXigen.c: Updates for PE/COFF V8.0, and clarification
23         (dir_names): Added CLR Runtime Header to dir_names[].
24         (_bfd_XX_print_private_bfd_data_common): Added EFI_ROM and XBOX
25         subsystem names
26         (_bfd_XXi_swap_aouthdr_in, _bfd_XXi_swap_aouthdr_out)
27         (pe_print_idata, pe_print_edata)
28         (_bfd_XX_bfd_copy_private_bfd_data_common)
29         (_bfd_XXi_final_link_postscript): Use #DEFINEs for index into
30         DataDirectory.
31
32 2006-11-13  Daniel Jacobowitz  <dan@codesourcery.com>
33
34         * bfd-in.h (bfd_elf32_arm_process_before_allocation): Update
35         prototype.
36         (bfd_elf32_arm_set_byteswap_code): New prototype.
37         * bfd-in2.h: Regenerate.
38         * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Don't take
39         byteswap_code as an argument.  Revert 2006-11-01 change.
40         (bfd_elf32_arm_set_byteswap_code): New.
41         (elf32_arm_size_dynamic_sections): Call
42         bfd_elf32_arm_process_before_allocation.
43
44 2006-11-10  Thiemo Seufer  <ths@mips.com>
45
46         * config.bfd (mips*el-sde-elf*, mips*-sde-elf*): Drop ECOFF support
47         for SDE configs.
48
49 2006-11-10  Nick Clifton  <nickc@redhat.com>
50
51         * config.bfd: Move previously obsoleted targets to the REMOVED
52         list.
53         Add maxq-*-coff to the obsolete list.
54
55 2006-11-10  Pedro Alves  <pedro_alves@portugalmail.pt>
56
57         * pe-arm-wince.c (LOCAL_LABEL_PREFIX): Define as ".".
58         * pei-arm-wince.c (LOCAL_LABEL_PREFIX): Likewise.
59         * coff-arm.c (LOCAL_LABEL_PREFIX): Only define if not defined before.
60
61 2006-11-07  Daniel Jacobowitz  <dan@codesourcery.com>
62
63         * elf32-arm.c (find_thumb_glue): Add ERROR_MESSAGE argument; set it
64         on error.
65         (find_arm_glue): Likewise.
66         (elf32_thumb_to_arm_stub, elf32_arm_create_thumb_stub)
67         (elf32_arm_to_thumb_stub, elf32_arm_final_link_relocate): Add
68         ERROR_MESSAGE argument and pass it through.
69         (elf32_arm_to_thumb_export_stub): Update.
70         (elf32_arm_relocate_section): Use ERROR_MESSAGE and reloc_dangerous.
71
72 2006-11-07  Alan Modra  <amodra@bigpond.net.au>
73
74         * elf64-ppc.c (enum _ppc64_sec_type): New.
75         (struct _ppc64_elf_section_data): Move "t_symndx" into opd union,
76         and rename fields.  Add sec_type and has_14bit_branch.
77         (struct ppc_link_hash_table): Remove has_14bit_branch.
78         (get_opd_info, get_tls_mask, ppc64_elf_edit_opd): Adjust.
79         (ppc64_elf_relocate_section): Likewise.
80         (ppc64_elf_check_relocs): Likewise.  Set per-section has_14bit_branch.
81         (ppc64_elf_size_stubs): Don't set default group size here.
82         (group_sections): Instead do so here, and group sections using
83         their individual requirements.
84
85 2006-11-07  Alan Modra  <amodra@bigpond.net.au>
86
87         * elf64-ppc.c (struct ppc64_elf_obj_tdata): Remove "has_dotsym"
88         and union.
89         (struct ppc_link_hash_entry): Add "next_dot_sym".
90         (struct ppc_link_hash_table): Add "dot_syms".
91         (link_hash_newfunc): Make list of syms starting with a dot.
92         (ppc_get_stub_entry, adjust_opd_syms): Adjust.
93         (ppc64_elf_add_symbol_hook): Don't set has_dotsym.
94         (struct add_symbol_adjust_data): Delete.
95         (add_symbol_adjust): Simplify params and return.
96         (ppc64_elf_check_directives): Just process the "dot_syms" lists,
97         not all syms.
98
99 2006-11-02  Daniel Jacobowitz  <dan@codesourcery.com>
100
101         * libbfd-in.h (_bfd_clear_contents): New prototype.
102         * reloc.c (_bfd_clear_contents): New.
103         * libbfd.h: Regenerated.
104
105         * elf32-arm.c (elf32_arm_final_link_relocate): Use
106         _bfd_clear_contents.
107         * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
108         * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
109         * elf32-i386.c (elf_i386_relocate_section): Likewise.
110         * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
111         * elf32-s390.c (elf_s390_relocate_section): Likewise.
112         * elf32-sh.c (sh_elf_relocate_section): Likewise.
113         * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
114         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
115         * elf64-s390.c (elf_s390_relocate_section): Likewise.
116         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
117         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
118
119         * elfxx-ia64.c (elfNN_ia64_relocate_section): Set value to
120         zero for discarded symbols.
121         * elfxx-mips.c (mips_elf_calculate_relocation): Likewise.
122
123 2006-11-01  Thiemo Seufer  <ths@mips.com>
124             David Ung  <davidu@mips.com>
125
126         * elf-bfd.h (local_call_stubs): New member.
127         * elfxx-mips.c (FN_STUB_P, CALL_STUB_P, CALL_FP_STUB_P): New macros.
128         (mips_elf_calculate_relocation): Handle local mips16 call stubs.
129         (mips16_stub_section_p): Rename from mips_elf_stub_section_p, use
130         the new stub macros.
131         (_bfd_mips_elf_check_relocs): Handle call stubs for code which
132         mixes mips16 and mips32 functions. Use mips16_stub_section_p. Mark
133         used stubs with SEC_KEEP. Use the new stub macros.
134
135 2006-11-01  Alan Modra  <amodra@bigpond.net.au>
136
137         * elf32-arm.c (bfd_elf32_arm_process_before_allocation): Correct
138         check for PLT usage.
139
140 2006-11-01  Daniel Jacobowitz  <dan@codesourcery.com>
141
142         * elfxx-mips.c (mips_elf_merge_gots): Always use maxcnt.
143
144 2006-10-31  Alan Modra  <amodra@bigpond.net.au>
145
146         * elf.c (elfcore_write_note): Pad note descriptor to 4-byte
147         boundary.  Tidy.  Comment.
148
149 2006-10-30  H.J. Lu  <hongjiu.lu@intel.com>
150
151         PR ld/3111
152         * elf-bfd.h (elf_obj_tdata): Add symbuf.
153         (_bfd_elf_section_already_linked): Add struct bfd_link_info *.
154         (_bfd_elf_check_kept_section): Likewise.
155         (bfd_elf_match_symbols_in_sections): Likewise.
156
157         * elf.c (assign_section_numbers): Updated to add
158         struct bfd_link_info *.
159         (bfd_elf_match_symbols_in_sections): Updated. Cache symbol
160         buffer if info->reduce_memory_overheads is false.
161
162         * elflink.c (match_group_member): Updated to add
163         struct bfd_link_info *.
164         (_bfd_elf_check_kept_section): Likewise.
165         (elf_link_input_bfd): Likewise.
166         (_bfd_elf_section_already_linked): Likewise.
167         (bfd_elf_final_link): Free symbol buffer if
168         info->reduce_memory_overheads is false.
169
170         * libbfd-in.h (_bfd_nolink_section_already_linked): Add
171         struct bfd_link_info *.
172         (_bfd_generic_section_already_linked): Likewise.
173         * libbfd.h: Regenerated.
174
175         * linker.c (bfd_section_already_linked): Add
176         struct bfd_link_info *.
177         (_bfd_generic_section_already_linked): Likewise.
178         * targets.c (bfd_target): Add struct bfd_link_info * to
179         _section_already_linked.
180         * bfd-in2.h: Regenerated.
181
182 2006-10-30  Alan Modra  <amodra@bigpond.net.au>
183
184         * bfd.c (bfd_error_type): Add bfd_error_on_input.
185         (input_bfd, input_error): New static vars.
186         (bfd_set_error): Handle bfd_error_on_input.
187         (bfd_errmsg): Likewise.
188         (bfd_perror): Simplify.
189         * archive.c (_bfd_write_archive_contents): Report errors on input.
190         * bfd-in2.h: Regenerate.
191
192 2006-10-30  Alan Modra  <amodra@bigpond.net.au>
193
194         * elf.c (elfcore_write_note): Pad to 4-byte boundary.
195
196 2006-10-28  Richard Sandiford  <richard@codesourcery.com>
197
198         * elf32-mips.c (elf_mips_howto_table_rel): Add R_MIPS_GLOB_DAT.
199         * elfn32-mips.c (elf_mips_howto_table_rel): Likewise.
200         (elf_mips_howto_table_rela): Likewise.
201         * elf64-mips.c (mips_elf64_howto_table_rel): Likewise.
202         (mips_elf64_howto_table_rela): Likewise.
203
204 2006-10-26  H.J. Lu  <hongjiu.lu@intel.com>
205
206         * elf.c (_bfd_elf_init_private_section_data): Assert output
207         section ELF type instead of check if it is SHT_NULL.  Copy
208         OS/PROC specific flags from input section to output section.
209
210 2006-10-27  Alan Modra  <amodra@bigpond.net.au>
211
212         * section.c (SEC_KEEP): Update comment.
213         * bfd-in2.h: Regenerate.
214         * elflink.c (bfd_elf_gc_sections): Ignore SEC_EXCLUDE sections.
215         * merge.c (_bfd_merge_sections): Set SEC_KEEP on excluded sections.
216         * stabs.c (_bfd_discard_section_stabs): Likewise.
217         (_bfd_link_section_stabs): Likewise.  Simplify abs_section check.
218
219 2006-10-26  Ben Elliston  <bje@au.ibm.com>
220
221         * reloc.c (_bfd_relocate_contents): Remove explicit case 0.
222
223         * elf.c (bfd_section_from_shdr): Remove extraneous breaks.
224         * targets.c (find_target): Remove extraneous break.
225
226 2006-10-26  Ben Elliston  <bje@au.ibm.com>
227
228         * coff-maxq.c (coff_maxq20_reloc): Remove unused variable `howto'.
229         (struct maxq_reloc_map): Unused; remove.
230         (maxq_reloc_map): Likewise.
231         (maxq_reloc_type_lookup): Remove loop over maxq_reloc_map.
232
233 2006-10-26  Ben Elliston  <bje@au.ibm.com>
234
235         * elf.c (bfd_elf_set_dyn_lib_class): Change second argument type
236         from int to enum dynamic_lib_link_class lib_class.
237         * bfd-in.h (bfd_elf_set_dyn_lib_class): Likewise.
238         * bfd-in2.h: Regenerate.
239
240 2006-10-25  Alan Modra  <amodra@bigpond.net.au>
241             Trevor Smigiel  <Trevor_Smigiel@playstation.sony.com>
242             Yukishige Shibata  <shibata@rd.scei.sony.co.jp>
243             Nobuhisa Fujinami  <fnami@rd.scei.sony.co.jp>
244             Takeaki Fukuoka  <fukuoka@rd.scei.sony.co.jp>
245
246         * cpu-spu.c: New file.
247         * elf32-spu.c: New file.
248         * elf32-spu.h: New file.
249         * archures.c: Add SPU support.
250         * config.bfd: Likewise.
251         * configure.in: Likewise.
252         * reloc.c: Likewise.
253         * targets.c: Likewise.
254         * Makefile.am: Likewise.  Run "make dep-am".
255         * libbfd.h: Regenerate.
256         * bfd-in2.h: Regenerate.
257         * Makefile.in: Regenerate.
258         * configure: Regenerate.
259         * po/SRC-POTFILES.in: Regenerate.
260
261 2006-10-23  Alan Modra  <amodra@bigpond.net.au>
262
263         * elf64-ppc.c (ppc64_elf_edit_opd): Clarify comment.
264
265 2006-10-23  Alan Modra  <amodra@bigpond.net.au>
266
267         * elf32-score.c: Formatting.
268         (elf_backend_omit_section_dynsym): Define.
269         (score_elf_create_dynamic_relocation): Remove code copied from mips.
270         Don't use section syms in dynamic relocs.  Remove unused param.
271         (score_elf_final_link_relocate): Remove unused param.
272
273 2006-10-23  Alan Modra  <amodra@bigpond.net.au>
274
275         * linker.c (fix_syms): Choose best of previous and next
276         section based on section flags and vma.
277
278 2006-10-21  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
279
280         * elf32-sh64.c (sh64_elf_merge_symbol_attribute): Do merging
281         only when the non visibility part of st_other is non-zero.
282         * elf64-sh64.c (sh64_elf64_merge_symbol_attribute): Likewise.
283
284 2006-10-20  Richard Sandiford  <richard@codesourcery.com>
285
286         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Don't extend
287         PT_DYNAMIC on GNU/Linux targets.
288
289 2006-10-20  Richard Sandiford  <richard@codesourcery.com>
290
291         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Make the
292         size of .rel.dyn reflect the value of DT_RELSZ.
293
294 2006-10-20  Richard Sandiford  <richard@codesourcery.com>
295
296         * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Allocate
297         a PT_NULL header for dynamic objects.
298         (_bfd_mips_elf_modify_segment_map): Add it.
299
300 2006-10-19  Mei Ligang  <ligang@sunnorth.com.cn>
301
302         * elf32-score.c (score_elf_rel_dyn_section): Replace
303         bfd_make_section with bfd_make_section_with_flags.
304         (_bfd_score_elf_create_dynamic_sections): Ditto.
305         (score_elf_create_got_section): Ditto.
306         (score_elf_final_link_relocate): Delete referrence to
307         EF_SCORE_HASENTRY.
308
309 2006-10-19  Richard Sandiford  <richard@codesourcery.com>
310
311         * elfxx-mips.c (sort_dynamic_relocs): Sort relocations against the
312         same symbol by increasing r_offset.
313         (sort_dynamic_relocs_64): Likewise.  Fix comparisons between very
314         large and very small symbol indexes.
315
316 2006-10-19  Richard Sandiford  <richard@codesourcery.com>
317
318         * elfxx-mips.c (_bfd_mips_elf_size_dynamic_sections): Add DT_DEBUG
319         and DT_MIPS_RLD_MAP tags for position-independent executables.
320         Do not add DT_DEBUG to shared libraries for any MIPS target.
321
322 2006-10-18  H.J. Lu  <hongjiu.lu@intel.com>
323
324         PR ld/3290
325         * elflink.c (elf_link_add_object_symbols): Hide definitions in
326         debug sections.
327
328 2006-10-19  Alan Modra  <amodra@bigpond.net.au>
329
330         * elf32-arm.c (bfd_elf32_arm_allocate_interworking_sect): Check,
331         don't set, glue section size.
332         (record_arm_to_thumb_glue): Set glue section size here.
333         (record_thumb_to_arm_glue): Likewise.
334         (bfd_elf32_arm_add_glue_sections_to_bfd): Formatting.
335         (bfd_elf32_arm_process_before_allocation): Ignore exluded sections.
336
337 2006-10-18  Roy Marples  <uberlord@gentoo.org>
338
339         * elf64-sparc.c: Add FreeBSD support.
340         (elf64_sparc_fbsd_post_process_headers): New function.
341         * targets.c (_bfd_target_vector): Add bfd_elf64_sparc_freebsd_vec.
342         * config.bfd (sparc64-*-freebsd*): Set targ_defvec to bfd_elf64_sparc_freebsd_vec.
343         * configure.in: Add entry for bfd_elf64_sparc_freebsd_vec.
344         * configure: Regenerate.
345
346 2006-10-17  Mark Shinwell  <shinwell@codesourcery.com>
347
348         * elf32-arm.c (elf32_arm_final_link_relocate): Add support for
349         R_ARM_MOVW_BREL_NC, R_ARM_MOVW_BREL, R_ARM_MOVT_BREL,
350         R_ARM_THM_MOVW_BREL_NC, R_ARM_THM_MOVW_BREL and
351         R_ARM_THM_MOVT_BREL relocations.
352
353 2006-10-17  Mark Shinwell  <shinwell@codesourcery.com>
354
355         * elf32-arm.c (elf32_arm_howto_table_1): Change offset for
356         R_THM_CALL to 25 and remove FIXME comment.
357         (using_thumb2): New function.
358         (elf32_arm_final_link_relocate): Cope with Thumb-2 BL encoding.
359
360 2006-10-17  Mark Shinwell  <shinwell@codesourcery.com>
361
362         * elf32-arm.c (elf32_arm_final_link_relocate): Add cases
363         for R_ARM_ABS32_NOI and R_ARM_REL32_NOI.
364         (elf32_arm_gc_sweep_hook): Likewise.
365         (elf32_arm_check_relocs): Likewise.
366         (allocate_dynrelocs): Likewise.
367
368 2006-10-17  Alan Modra  <amodra@bigpond.net.au>
369
370         * elf-bfd.h (struct elf_link_hash_table): Reorder.  Add
371         text_index_section and data_index_section.
372         (struct elf_backend_data): Add elf_backend_init_index_section.
373         (_bfd_elf_init_1_index_section): Declare.
374         (_bfd_elf_init_2_index_sections): Declare.
375         * elfxx-target.h (elf_backend_init_index_section): Define.
376         (elfNN_bed): Init new field.
377         * elflink.c (_bfd_elf_link_omit_section_dynsym): Keep first tls
378         section and text_index_section plus data_index_section.
379         (_bfd_elf_link_renumber_dynsyms): Clear dynindx on omitted sections.
380         (_bfd_elf_init_1_index_section): New function.
381         (_bfd_elf_init_2_index_sections): New function.
382         (bfd_elf_size_dynsym_hash_dynstr): Call elf_backend_init_index_section.
383         (elf_link_input_bfd): When emitting relocs, use text_index_section
384         and data_index_section for removed sections.
385         * elf-m10300.c (elf_backend_omit_section_dynsym): Define.
386         * elf32-i386.c: Likewise.
387         * elf32-m32r.c: Likewise.
388         * elf32-sh.c: Likewise.
389         * elf32-xstormy16.c: Likewise.
390         * elf32-xtensa.c: Likewise.
391         * elf64-alpha.c: Likewise.
392         * elf64-hppa.c: Likewise.
393         * elf64-mmix.c: Likewise.
394         * elf64-sh64.c: Likewise.
395         * elfxx-ia64.c: Likewise.
396         * elf32-arm.c (elf32_arm_final_link_relocate): Use text_index_section
397         and data_index_section sym for relocs against sections with no dynamic
398         section sym.
399         (elf_backend_init_index_section): Define.
400         * elf32-cris.c: Similarly.
401         * elf32-hppa.c: Similarly.
402         * elf32-i370.c: Similarly.
403         * elf32-m68k.c: Similarly.
404         * elf32-mips.c: Similarly.
405         * elf32-ppc.c: Similarly.
406         * elf32-s390.c: Similarly.
407         * elf32-sparc.c: Similarly.
408         * elf32-vax.c: Similarly.
409         * elf64-mips.c: Similarly.
410         * elf64-ppc.c: Similarly.
411         * elf64-s390.c: Similarly.
412         * elf64-sparc.c: Similarly.
413         * elf64-x86-64.c: Similarly.
414         * elfn32-mips.c: Similarly.
415         * elfxx-mips.c: Similarly.
416         * elfxx-sparc.c: Similarly.
417         * linker.c (fix_syms): Base symbols in removed sections on
418         previous section in preference to using absolute section.
419
420 2006-10-16  Andreas Schwab  <schwab@suse.de>
421
422         * elfxx-ia64.c (addend_compare): Properly compute return value.
423
424 2006-10-15  H.J. Lu  <hongjiu.lu@intel.com>
425
426         PR ld/3314
427         * elf.c (assign_file_positions_for_non_load_sections): Don't
428         page align empty SHF_ALLOC sections.
429
430 2006-10-13  Jakub Jelinek  <jakub@redhat.com>
431
432         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_sections): Set
433         .plt sh_entsize to 0 if plt header size isn't multiple of
434         plt entry size or for 32-bit which adds a nop insn at the
435         end of the .plt section.
436
437 2006-10-12  Bob Wilson  <bob.wilson@acm.org>
438
439         * elf32-xtensa.c (elf_xtensa_action_discarded): New.
440         (elf_backend_action_discarded): Define.
441
442 2006-10-11  Bob Wilson  <bob.wilson@acm.org>
443
444         * elf32-xtensa.c (elf_xtensa_relocate_section): Return after
445         unresolvable relocation error.
446         (elf_xtensa_finish_dynamic_symbol): Set value of undefined, weak
447         symbols to zero.
448
449 2006-10-10  Bob Wilson  <bob.wilson@acm.org>
450
451         * elf32-xtensa.c (elf_xtensa_size_dynamic_sections): Add DT_DEBUG
452         for PIE executables.
453
454 2006-10-03  Jakub Jelinek  <jakub@redhat.com>
455
456         * elf-bfd.h (struct eh_cie_fde): Add set_loc pointer.
457         * elf-eh-frame.c (skip_cfa_op): Fix handling of DW_CFA_advance_loc.
458         Handle DW_CFA_{remember,restore}_state, DW_CFA_GNU_window_save,
459         DW_CFA_val_{offset{,_sf},expression}.
460         (skip_non_nops): Record number of DW_CFA_set_loc ops.
461         (_bfd_elf_discard_section_eh_frame): Require skip_non_nops recognizes
462         all ops.  If there are any DW_CFA_set_loc ops and they are pcrel
463         or going to be pcrel, compute set_loc array.
464         (_bfd_elf_eh_frame_section_offset): If make_relative, kill relocations
465         against DW_CFA_set_loc operands.
466         (_bfd_elf_write_section_eh_frame): Handle DW_CFA_set_loc adjusting.
467
468 2006-10-02  Daniel Jacobowitz  <dan@codesourcery.com>
469
470         * elflink.c (_bfd_elf_merge_symbol): Discard references to TLS
471         symbols from the --just-syms file.
472
473 2006-10-01  Alan Modra  <amodra@bigpond.net.au>
474
475         * elf64-ppc.c (ppc64_elf_build_stubs): Test glink size for
476         existence of PLT.
477
478 2006-09-29  H.J. Lu  <hongjiu.lu@intel.com>
479
480         PR ld/3283
481         * elf64-x86-64.c (elf64_x86_64_relocate_section): Don't ignore
482         relocation overflow on branches to undefweaks.
483
484 2006-09-29  Alan Modra  <amodra@bigpond.net.au>
485
486         * po/BLD-POTFILES.in: Regenerate.
487         * po/SRC-POTFILES.in: Regenerate.
488
489 2006-09-29  Danny Smith  <dannysmith@users.sourceforge.net>
490
491         PR 3276
492         * pei-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Enable 16 byte
493         alignment for .data$, .rdata$ and .text$ sections so that sse
494         and sse2 code will work for linkonce sections too.
495         * pe-i386.c (COFF_SECTION_ALIGNMENT_ENTRIES): Likewise.
496
497 2006-09-28  Alan Modra  <amodra@bigpond.net.au>
498
499         * elflink.c (_bfd_elf_gc_mark_hook): New function.
500         * elf-bfd.h (_bfd_elf_gc_mark_hook): Declare.
501         * elfxx-target.h (elf_backend_gc_mark_hook): Default to above.
502         * elf-m10300.c (mn10300_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
503         * elf32-arm.c (elf32_arm_gc_mark_hook): Likewise.
504         * elf32-cris.c (cris_elf_gc_mark_hook): Likewise.
505         * elf32-hppa.c (elf32_hppa_gc_mark_hook): Likewise.
506         * elf32-i386.c (elf_i386_gc_mark_hook): Likewise.
507         * elf32-m32r.c (m32r_elf_gc_mark_hook): Likewise.
508         * elf32-m68k.c (elf_m68k_gc_mark_hook): Likewise.
509         * elf32-mcore.c (mcore_elf_gc_mark_hook): Likewise.
510         * elf32-ppc.c (ppc_elf_gc_mark_hook): Likewise.
511         * elf32-s390.c (elf_s390_gc_mark_hook): Likewise.
512         * elf32-score.c (_bfd_score_elf_gc_mark_hook): Likewise.
513         * elf32-sh.c (sh_elf_gc_mark_hook): Likewise.
514         * elf32-vax.c (elf_vax_gc_mark_hook): Likewise.
515         * elf32-xtensa.c (elf_xtensa_gc_mark_hook): Likewise.
516         * elf64-mmix.c (mmix_elf_gc_mark_hook): Likewise.
517         * elf64-s390.c (elf_s390_gc_mark_hook): Likewise.
518         * elf64-x86-64.c (elf64_x86_64_gc_mark_hook): Likewise.
519         * elfxx-mips.c (_bfd_mips_elf_gc_mark_hook): Likewise.
520         * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Likewise.
521         * elf32-bfin.c (bfin_gc_mark_hook): Likewise.
522         (bfinfdpic_gc_sweep_hook): Delete.
523         (elf_backend_gc_sweep_hook): Don't define for elf32-bfinfdpic.
524         * elf32-d10v.c (elf32_d10v_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
525         (elf32_d10v_gc_sweep_hook): Delete.
526         (elf_backend_gc_sweep_hook): Don't define.
527         * elf32-fr30.c (fr30_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
528         (fr30_elf_gc_sweep_hook): Delete.
529         (elf_backend_gc_sweep_hook): Don't define.
530         * elf32-frv.c (elf32_frv_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
531         (elf32_frv_gc_sweep_hook): Delete.
532         (elf_backend_gc_sweep_hook): Don't define.
533         * elf32-iq2000.c (iq2000_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
534         (iq2000_elf_gc_sweep_hook): Delete.
535         (elf_backend_gc_sweep_hook): Don't define.
536         * elf32-openrisc.c (openrisc_elf_gc_mark_hook): Use
537         _bfd_elf_gc_mark_hook.
538         (openrisc_elf_gc_sweep_hook): Delete.
539         (elf_backend_gc_sweep_hook): Don't define.
540         * elf32-v850.c (v850_elf_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
541         (v850_elf_gc_sweep_hook): Delete.
542         (elf_backend_gc_sweep_hook): Don't define.
543         * elf32-xstormy16.c (xstormy16_elf_gc_mark_hook): Use
544         _bfd_elf_gc_mark_hook.
545         (xstormy16_elf_gc_sweep_hook): Delete.
546         (elf_backend_gc_sweep_hook): Don't define.
547         * elf64-sh64.c (sh_elf64_gc_mark_hook): Use _bfd_elf_gc_mark_hook.
548         (sh_elf64_gc_sweep_hook): Delete.
549         (elf_backend_gc_sweep_hook): Don't define.
550         * elf32-avr.c (elf32_avr_gc_mark_hook): Delete.
551         (elf32_avr_gc_sweep_hook): Delete.
552         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
553         * elf32-cr16c.c (elf32_cr16c_gc_mark_hook): Delete.
554         (elf32_cr16c_gc_sweep_hook): Delete.
555         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
556         * elf32-crx.c (elf32_crx_gc_mark_hook): Delete.
557         (elf32_crx_gc_sweep_hook): Delete.
558         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
559         * elf32-h8300.c (elf32_h8_gc_mark_hook): Delete.
560         (elf32_h8_gc_sweep_hook): Delete.
561         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
562         * elf32-ip2k.c (ip2k_elf_gc_mark_hook): Delete.
563         (ip2k_elf_gc_sweep_hook): Delete.
564         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
565         * elf32-m32c.c (m32c_elf_gc_mark_hook, m32c_elf_gc_sweep_hook): Delete.
566         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
567         * elf32-m68hc11.c (elf_backend_gc_mark_hook): Don't define.
568         (elf_backend_gc_sweep_hook): Don't define.
569         * elf32-m68hc12.c (elf_backend_gc_mark_hook): Don't define.
570         (elf_backend_gc_sweep_hook): Don't define.
571         * elf32-m68hc1x.c (elf32_m68hc11_gc_mark_hook): Delete.
572         (elf32_m68hc11_gc_sweep_hook): Delete.
573         * elf32-m68hc1x.h (elf32_m68hc11_gc_mark_hook): Delete.
574         (elf32_m68hc11_gc_sweep_hook): Delete.
575         * elf32-msp430.c (elf32_msp430_gc_mark_hook): Delete.
576         (elf32_msp430_gc_sweep_hook): Delete.
577         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
578         * elf32-mt.c (mt_elf_gc_mark_hook, mt_elf_gc_sweep_hook): Delete.
579         (elf_backend_gc_mark_hook, elf_backend_gc_mark_hook): Don't define.
580
581 2006-09-25 Pedro Alves <pedro_alves@portugalmail.pt>
582
583         * bfd-in.h (CONST_STRNCPY) : Delete.
584         (LITSTRCPY) : New.
585         (LITMEMCPY) : New.
586         * bfd-in2.h : Regenerate.
587         * elflink.c  (bfd_elf_gc_sections) : Use LITMEMCPY. Don't manually
588         calculate string lengths.
589         * nlmcode.h (nlm_swap_auxiliary_headers_in) : Use LITMEMCPY.
590
591 2006-09-26  H.J. Lu  <hongjiu.lu@intel.com>
592
593         PR ld/3223
594         PR ld/3267
595         * elf.c (assign_file_positions_for_non_load_sections): Don't
596         warn zero size allocated sections.
597
598 2006-09-27  Alan Modra  <amodra@bigpond.net.au>
599
600         * elf32-score.c (_bfd_score_elf_relocate_section): Move assignment
601         to "name" so that compiler realizes it is never uninitialized.
602         Use bfd_elf_sym_name.
603
604 2006-09-26  H.J. Lu  <hongjiu.lu@intel.com>
605
606         PR binutils/3262
607         * elf.c (rewrite_elf_program_header): Use bfd_zalloc instead of
608         bfd_alloc to allocate segment map.
609         (copy_elf_program_header): Likewise.
610
611 2006-09-26  Mark Shinwell  <shinwell@codesourcery.com>
612             Joseph Myers  <joseph@codesourcery.com>
613             Ian Lance Taylor  <ian@wasabisystems.com>
614             Ben Elliston  <bje@wasabisystems.com>
615
616         * archures.c: Add definition for bfd_mach_arm_iWMMXt2.
617         * cpu-arm.c (processors): Add bfd_mach_arm_iWMMXt2.
618         (arch_info_struct, bfd_arm_update_notes): Likewise.
619         (architectures): Likewise.
620         (bfd_arm_merge_machines): Check for iWMMXt2.
621         * bfd-in2.h: Rebuild.
622
623 2006-09-24  H.J. Lu  <hongjiu.lu@intel.com>
624
625         * configure: Regenerated.
626
627 2006-09-22  Alan Modra  <amodra@bigpond.net.au>
628
629         * elfcode.h (elf_swap_symbol_in): Return bfd_boolean.  Don't abort
630         on error.
631         * elf-bfd.h (elf_size_info <swap_symbol_in>): Adjust decl.
632         (bfd_elf32_swap_symbol_in, bfd_elf64_swap_symbol_in): Likewise.
633         * elf.c (bfd_elf_get_elf_syms): Test return of swap_symbol_in,
634         and report error.
635         * elf32-arm.c (elf32_arm_swap_symbol_in): Return bfd_boolean.
636
637 2006-09-20  Martin Schwidefsky  <schwidefsky@de.ibm.com>
638
639         * elf32-s390.c (elf_s390_relocate_section): Remove check for code
640         section in LD to LE linker relaxation for R_390_TLS_LDO32.
641         * elf64-s390.c (elf_s390_relocate_section): Likewise for
642         R_390_TLS_LDO64.
643
644 2006-09-20  Kai Tietz  <Kai.Tietz@onevision.com>
645
646         * configure.in: Added new target-vectors x86_64coff_vec,
647         x86_64pe_vec, and x86_64pei_vec.
648         * configure: Regenerate.
649         * config.bfd: Adjusted x86_64 target architecture detection.
650         * bfd.c: Add for new target "coff-x86-64"
651         (bfd_get_sign_extend): Add target vector idents for pe-x86-64. and pei-x86-64.
652         * coff-x86_64.c: Add new file for x86_64 (AMD64) coff support.
653         * libpei.h: Adjustments for COFF_WITH_pex64.
654         * coffcode.h: Add for new target machine, architecture, signature, and internal
655         signature handler.
656         * Makefile.am: Add new files to target-all and define make-rule for pex64igen.c
657         * Makefile.in: Regenerate.
658         * pe-x86_64.c: Add for new target "pe-x86-64".
659         * pei-x86_64.c: Add for new target "pei-x86-64".
660         * peicode.h: Adjusts for new targets.
661         (coff_swap_filehdr_out): Set for this target to
662         _bfd_pex64_only_swap_filehdr_out.
663         (SIZEOF_IDATA4): Define it as 8 byte size for this target.
664         (SIZEOF_IDATA5): Define it as 8 byte size for this target.
665         (jump_table jtab): Add for AMD64MAGIC.
666         (pe_ILF_build_a_bfd): Adjusts for new size of SIZEOF_IDATA4 and SIZE_IDATA5.
667         (pe_ILF_object_p): Add coff image-file signature to internal
668         signature translation.
669         * peXXigen.c: Adjust proper include of target coff-header and
670         introduced target specific code
671         (COFF_WITH_pex64): New macro for this target.
672         (pe_print_idata): New dumping method for import section of PE+ files.
673         * targets.c: Add new target vectors declarations for x86_64 coff targets.
674         * coffcode.h: Support code to support the x86_64 PE magic number.
675         * coff-x86_64.c: New file.
676
677 2006-09-17  Hans-Peter Nilsson  <hp@axis.com>
678
679         * elf.c (special_sections_s): Revert last STRING_COMMA_LEN change
680         for .stabstr entry, explain why.
681
682 2006-09-17  Anton Blanchard  <anton@samba.org>
683             Alan Modra  <amodra@bigpond.net.au>
684
685         * dwarf2.c (concat_filename): Apply DW_AT_comp_dir if dir table
686         entry isn't absolute.
687
688 2006-09-17  Mei Ligang  <ligang@sunnorth.com.cn>
689
690         * cpu-score.c: New file.
691         * elf32-score.c: New file.
692         * config.bfd: Add Score target.
693         * Makefile.am: Add Score files.
694         * Makefile.in: Regenerate.
695         * archures.c: Add Score architecture.
696         * reloc.c: Add Score relocs.
697         * targets.c: Add Score target vectors.
698         * bfd-in2.h: Regenerate.
699         * libbfd.h: Regenerate.
700         * configure.in: Add Score target.
701         * configure: Regenerate.
702
703 2006-09-16  Nick Clifton  <nickc@redhat.com>
704             Pedro Alves  <pedro_alves@portugalmail.pt>
705
706         * bfd-in.h (STRING_AND_COMMA): New macro.  Takes one constant
707         string as its argument and emits the string followed by a comma
708         and then the length of the string.
709         (CONST_STRNEQ): New macro.  Checks to see if a variable string
710         has a constant string as its initial characters.
711         (CONST_STRNCPY): New macro.  Copies a constant string to the start
712         of a variable string.
713         * bfd-in2.h: Regenerate.
714         * archive.c: Make use of the new macros.
715         * archive64.c: Likewise.
716         * bfd.c: Likewise.
717         * coff-ppc.c: Likewise.
718         * coff-stgo32.c: Likewise.
719         * coffcode.h: Likewise.
720         * cofflink.c: Likewise.
721         * cpu-i960.c: Likewise.
722         * dwarf2.c: Likewise.
723         * ecoff.c: Likewise.
724         * elf-m10300.c: Likewise.
725         * elf.c: Likewise.
726         * elf32-arm.c: Likewise.
727         * elf32-bfin.c: Likewise.
728         * elf32-cris.c: Likewise.
729         * elf32-hppa.c: Likewise.
730         * elf32-i370.c: Likewise.
731         * elf32-i386.c: Likewise.
732         * elf32-iq2000.c: Likewise.
733         * elf32-m32r.c: Likewise.
734         * elf32-m68hc11.c: Likewise.
735         * elf32-m68hc12.c: Likewise.
736         * elf32-m68k.c: Likewise.
737         * elf32-mcore.c: Likewise.
738         * elf32-ppc.c: Likewise.
739         * elf32-s390.c: Likewise.
740         * elf32-sh-symbian.c: Likewise.
741         * elf32-sh.c: Likewise.
742         * elf32-sh64.c: Likewise.
743         * elf32-v850.c: Likewise.
744         * elf32-vax.c: Likewise.
745         * elf32-xtensa.c: Likewise.
746         * elf64-alpha.c: Likewise.
747         * elf64-hppa.c: Likewise.
748         * elf64-mmix.c: Likewise.
749         * elf64-ppc.c: Likewise.
750         * elf64-s390.c: Likewise.
751         * elf64-sh64.c: Likewise.
752         * elf64-x86-64.c: Likewise.
753         * elflink.c: Likewise.
754         * elfxx-ia64.c: Likewise.
755         * elfxx-mips.c: Likewise.
756         * elfxx-sparc.c: Likewise.
757         * hpux-core.c: Likewise.
758         * i386linux.c: Likewise.
759         * ieee.c: Likewise.
760         * libpei.h: Likewise.
761         * linker.c: Likewise.
762         * m68klinux.c: Likewise.
763         * mmo.c: Likewise.
764         * nlmcode.h: Likewise.
765         * osf-core.c: Likewise.
766         * pef.c: Likewise.
767         * som.c: Likewise.
768         * sparclinux.c: Likewise.
769         * vms-hdr.c: Likewise.
770
771 2006-09-14  Alan Modra  <amodra@bigpond.net.au>
772
773         PR 3181
774         * elf.c (_bfd_elf_copy_private_header_data): Fix group members
775         that have had their SHT_GROUP section removed.
776
777 2006-09-12  H.J. Lu  <hongjiu.lu@intel.com>
778
779         PR ld/3197
780         * elflink.c (elf_link_output_extsym): Compute bucket only if
781         needed.
782
783 2006-09-10  H.J. Lu  <hongjiu.lu@intel.com>
784
785         PR binutils/3186
786         * elf.c (_bfd_elf_make_section_from_shdr): Correct length of
787         "gnu.linkonce.wi.".
788
789 2006-09-08  Vladimir Prus  <vladimir@codesourcery.com>
790
791         * elf32-arm.c (elf32_arm_swap_symbol_out): Remove
792         unconditional setting of low bit for Thumb symbol
793         mistakenly left behind after check for external
794         symbols was added.  Fix comment typo.
795
796 2006-09-07  H.J. Lu  <hongjiu.lu@intel.com>
797
798         * elf-bfd.h (elf_link_hash_entry): Add a dynamic field.
799         (bfd_elf_link_mark_dynamic_symbol): New.
800         (SYMBOLIC_BIND): New.
801
802         * elf32-i386.c (elf_i386_check_relocs): Replace info->symbolic
803         with SYMBOLIC_BIND (info, h).
804         (elf_i386_relocate_section): Likewise.
805         * elf64-x86-64.c (elf64_x86_64_check_relocs): Likewise.
806         (elf64_x86_64_relocate_section): Likewise.
807         * elfxx-ia64.c (elfNN_ia64_check_relocs): Likewise.
808
809         * elflink.c (bfd_elf_link_mark_dynamic_symbol): New.
810         (bfd_elf_record_link_assignment): Call
811         bfd_elf_link_mark_dynamic_symbol on new entry.
812         (_bfd_elf_merge_symbol): Likewise.
813         (_bfd_elf_export_symbol): Return if the symbol isn't exported.
814         (_bfd_elf_fix_symbol_flags): Replace info->symbolic with
815         SYMBOLIC_BIND (info, h).
816         (_bfd_elf_dynamic_symbol_p): Likewise.
817         (_bfd_elf_symbol_refs_local_p): Likewise.
818         (bfd_elf_size_dynamic_sections): Updated.
819
820 2006-09-05  Bibo Mao  <bibo.mao@intel.com>
821
822         PR binutils/3171
823         * coffcode.h (coff_write_object_contents): Set the optional
824         header magic number to PE32PMAGIC instead of ZMAGIC for ia64.
825
826 2006-09-04  Mark Shinwell  <shinwell@codesourcery.com>
827
828         * elf32-arm.c (elf32_arm_howto_table_1): Adjust entries for
829         R_ARM_THM_ALU_PREL_11_0 and R_ARM_THM_PC12 relocations.
830         (elf32_arm_final_link_relocate): Handle R_ARM_THM_ALU_PREL_11_0
831         and R_ARM_THM_PC12 relocations.
832
833 2006-08-24  Bob Wilson  <bob.wilson@acm.org>
834
835         * elf32-xtensa.c (xtensa_get_property_section_name): Delete.
836         (xtensa_get_property_section): New.
837         (xtensa_read_table_entries): Use xtensa_get_property_section.
838         (relax_property_section, xtensa_get_property_predef_flags): Handle
839         group name suffixes in property section names.
840         (match_section_group): New.
841
842 2006-08-23  Frediano Ziglio  <Frediano.Ziglio@vodafone.com>
843
844         * archive.c (hpux_uid_gid_encode): Fix thinko decrementing "cnt"
845         variable.
846
847 2006-08-22  Daniel Jacobowitz  <dan@codesourcery.com>
848
849         * elf32-arm.c (elf32_arm_copy_indirect_symbol): Only copy
850         plt_thumb_refcount from indirect symbols.
851
852 2006-08-22  Alan Modra  <amodra@bigpond.net.au>
853
854         * elf32-ppc.c (ppc_elf_relocate_section): Correct GOT and PLT HA
855         reloc handling.
856         * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
857
858 2006-08-21  Mark Shinwell  <shinwell@codesourcery.com>
859
860         * elf32-arm.c (elf32_arm_link_hash_table): Correct typo in
861         comment for target1_is_rel.
862
863 2006-08-21  Pedro Alves  <pedro_alves@portugalmail.pt>
864
865         * Makefile.am: Add rules to build pe-arm-wince.lo
866         and pei-arm-wince.lo objects.
867         * Makefile.in: Regenerate.
868         * pe-arm-wince.c: New file.
869         * pei-arm-wince.c: New file.
870         * pei-arm.c: Remove ARM_WINCE block.
871         * pe-arm.c: Remove ARM_WINCE block. Rename
872         bfd_arm_pe_allocate_interworking_sections,
873         bfd_arm_pe_get_bfd_for_interworking, and
874         bfd_arm_pe_process_before_allocation to
875         bfd_armpe_allocate_interworking_sections,
876         bfd_armpe_get_bfd_for_interworking, and
877         bfd_armpe_process_before_allocation. Move them before
878         including bfd.h.
879         * bfd.c: ARM wince bfd format names were renamed. Adjust.
880         * coff-arm.c [ARM_WINCE]: Adjust so Windows CE doesn't end up
881         with unexpected/conflicting relocs.
882         * targets.c: The arm-wince-pe target got its own new vector.
883         Adjust.
884         * config.bfd: Likewise.
885         * configure.in: Likewise.
886         * configure: Regenerate.
887
888 2006-08-18  Paul Brook  <paul@codesourcery.com>
889
890         * elf32-arm.c (elf32_arm_link_hash_entry): Add export_glue.
891         (elf32_arm_link_hash_newfunc): Initialize export_glue.
892         (record_arm_to_thumb_glue): Return stub symbol.
893         (elf32_arm_create_thumb_stub): New function.
894         (elf32_arm_to_thumb_stub): Use it.
895         (elf32_arm_to_thumb_export_stub): New function.
896         (elf32_arm_begin_write_processing): New function.
897         (allocate_dynrelocs): Allocate Arm stubs.
898         (elf_backend_begin_write_processing): Define.
899         (elf32_arm_symbian_begin_write_processing): Remove ATTRIBUTE_UNUSED.
900         Call elf32_arm_begin_write_processing.
901
902 2006-08-17  Alan Modra  <amodra@bigpond.net.au>
903
904         * elf64-ppc.c (create_linkage_sections): Align .glink to 8 bytes.
905         (ppc64_elf_build_stubs): Use new lazy linking stub.
906
907 2006-08-17  Alan Modra  <amodra@bigpond.net.au>
908
909         * elf64-ppc.c (ppc64_elf_size_stubs): Ignore non-code sections.
910
911 2006-08-16  H.J. Lu  <hongjiu.lu@intel.com>
912
913         PR ld/3015
914         * elf.c (get_program_header_size): Add a PT_GNU_RELRO segment
915         only if there is a PT_DYNAMIC segment.
916         (_bfd_elf_map_sections_to_segments): Likewise.
917         (assign_file_positions_for_load_sections): Set PT_GNU_RELRO
918         segment alignment to 1.
919
920 2006-08-15  Thiemo Seufer  <ths@mips.com>
921             Nigel Stephens  <nigel@mips.com>
922
923         * elf32-mips.c, elf64-mips.c, elfn32-mips.c
924         (elf_backend_merge_symbol_attribute): Define.
925         * elflink.c (elf_link_add_object_symbols): Merge only the ELF
926         visibility flags.
927         * elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): New function.
928
929 2006-08-15  Thiemo Seufer  <ths@mips.com>
930             Nigel Stephens  <nigel@mips.com>
931             David Ung  <davidu@mips.com>
932
933         * config.bfd: Add configurations for mips*el-sde-elf* and
934         mips*-sde-elf*.
935
936 2006-08-14  DJ Delorie  <dj@redhat.com>
937
938         * elf-m10300.c (elf32_mn10300_link_hash_entry): Add value.
939         (elf32_mn10300_count_hash_table_entries): New.
940         (elf32_mn10300_list_hash_table_entries): New.
941         (sort_by_value): New.
942         (mn10300_elf_relax_section): Don't skip data sections; restrict
943         code-specific tests to code-specific areas so that potential
944         indirect calls can be detected.  Check for multiple local symbols
945         at the same address and merge their flags.
946         (elf32_mn10300_link_hash_newfunc): Initialize value.
947
948 2006-08-14  Thiemo Seufer  <ths@mips.com>
949
950         * elfxx-mips.c (_bfd_mips_elf_symbol_processing,
951         _bfd_mips_elf_add_symbol_hook): Don't try to place small common TLS
952         symbols in .scommon.
953
954 2006-08-11  Thiemo Seufer  <ths@mips.com>
955
956         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Set
957         sh_entsize only when sgot was already initialized.
958
959 2006-08-08  DJ Delorie  <dj@redhat.com>
960
961         * elf32-sh.c (sh_elf_relax_section): Allow for branches across
962         non-moving .align directives.  Preserve any DIR32 offset when
963         converting bsr's to jsr's.
964
965 2006-08-08  Alan Modra  <amodra@bigpond.net.au>
966
967         * elf64-ppc.c (ppc64_elf_build_stubs): Clear relbrlt reloc_count
968         after stubs have been built.
969
970 2006-08-07  Nick Clifton  <nickc@redhat.com>
971
972         * elf32-sh.c (vxworks_object_p): Only check for vxworks target
973         vectors if they are going to be created.
974
975 2006-08-07  Nick Clifton  <nickc@redhat.com>
976
977         * configure.in (bfd_elf32_shnbsd_vec): Fix typo.
978         * configure: Regenerate.
979
980 2006-08-07  Nick Clifton  <nickc@redhat.com>
981
982         * coff-arm.c (coff_arm_rtype_to_howto): Only check for ARM_SECREL
983         relocation types if the target is ARM_WINCE.
984
985 2006-08-05  Pedro Alves  <pedro_alves@portugalmail.pt>
986
987         * bfd.c (bfd_get_sign_extend_vma): Add cases for pe-arm-little
988         and pei-arm-little.
989         * coff-arm.c (coff_arm_rtype_to_howto) [COFF_WITH_PE]: Handle
990         ARM_SECREL.
991         (coff_arm_reloc_type_lookup): Map BFD_RELOC_32_SECREL to
992         ARM_SECREL.
993         * pe-arm.c [COFF_SECTION_ALIGNMENT_ENTRIES]: Define.
994         * pei-arm.c [TARGET_UNDERSCORE]: Define for ARM_WINCE like in
995         pe-arm.c.
996         [COFF_SECTION_ALIGNMENT_ENTRIES]: Define.
997
998 2006-08-04  Marcelo Tosatti  <marcelo@kvack.org>
999
1000         * elflink.c (elf_gc_sweep): If info.print_gc_sections is true,
1001         list removed sections to stderr.
1002
1003 2006-08-04  Richard Sandiford  <richard@codesourcery.com>
1004             Kazu Hirata  <kazu@codesourcery.com>
1005             Phil Edwards  <phil@codesourcery.com>
1006             Nathan Sidwell  <nathan@codesourcery.com>
1007
1008         * config.bfd (sh-*-vxworks): Use bfd_elf32_shvxworks_vec and
1009         bfd_elf32_shlvxworks_vec.
1010         * configure.in (bfd_elf32_sh64_vec): Add elf-vxworks.lo.
1011         (bfd_elf32_sh64l_vec, bfd_elf32_sh64lin_vec): Likewise.
1012         (bfd_elf32_sh64blin_vec, bfd_elf32_sh64lnbsd_vec): Likewise.
1013         (bfd_elf32_sh64nbsd_vec, bfd_elf32_sh_vec): Likewise.
1014         (bfd_elf32_shblin_vec, bfd_elf32_shl_vec): Likewise.
1015         (bfd_elf32_shl_symbian_vec, bfd_elf32_shlin_vec): Likewise.
1016         (bfd_elf32_shlnbsd_vec, bfd_elf32_shnbsd_vec): Likewise.
1017         (bfd_elf32_shlvxworks_vec, bfd_elf32_shvxworks_vec): New stanzas.
1018         * configure: Regenerate.
1019         * Makefile.am: Regenerate dependencies.
1020         * Makefile.in: Regenerate.
1021         * elf-vxworks.c (elf_vxworks_gott_symbol_p): New function.
1022         (elf_vxworks_add_symbol_hook): Use it.
1023         (elf_vxworks_link_output_symbol_hook): Likewise.  Use the hash
1024         table entry to check for weak undefined symbols and to obtain
1025         the original bfd.
1026         (elf_vxworks_emit_relocs): Use target_index instead of this_idx.
1027         * elf32-sh-relocs.h: New file, split from elf32-sh.c.
1028         (R_SH_DIR32): Use SH_PARTIAL32 for the partial_inplace field,
1029         SH_SRC_MASK32 for the src_mask field, and SH_ELF_RELOC for the
1030         special_function field.
1031         (R_SH_REL32): Use SH_PARTIAL32 and SH_SRC_MASK32 here too.
1032         (R_SH_REL32, R_SH_TLS_GD_32, R_SH_TLS_LD_32): Likewise.
1033         (R_SH_TLS_LDO_32, R_SH_TLS_IE_32, R_SH_TLS_LE_32): Likewise.
1034         (R_SH_TLS_DTPMOD32, R_SH_TLS_DTPOFF32, R_SH_TLS_TPOFF32): Likewise.
1035         (R_SH_GOT32, R_SH_PLT32, R_SH_COPY, R_SH_GLOB_DAT): Likewise.
1036         (R_SH_JMP_SLOT, R_SH_RELATIVE, R_SH_GOTOFF, R_SH_GOTPC): Likewise.
1037         (SH_PARTIAL32, SH_SRC_MASK32, SH_ELF_RELOC): Undefine at end of file.
1038         * elf32-sh.c: Include elf32-vxworks.h.
1039         (MINUS_ONE): Define.
1040         (sh_elf_howto_table): Include elf32-sh-relocs.h with SH_PARTIAL32
1041         set to TRUE, SH_SRC_MASK32 set to 0xffffffff, and SH_ELF_RELOC set
1042         to sh_elf_reloc.
1043         (sh_vxworks_howto_table): New variable.  Include elf32-sh-relocs.h
1044         with SH_PARTIAL32 set to FALSE, SH_SRC_MASK32 set to 0, and
1045         SH_ELF_RELOC set to bfd_elf_generic_reloc.
1046         (vxworks_object_p, get_howto_table): New functions.
1047         (sh_elf_reloc_type_lookup): Fix typo.  Use get_howto_table.
1048         (sh_elf_info_to_howto): Use get_howto_table.
1049         (sh_elf_relax_section): Honor the partial_inplace field of the
1050         R_SH_DIR32 howto.
1051         (sh_elf_relax_delete_bytes): Likewise.
1052         (elf_sh_plt_info): New structure.
1053         (PLT_ENTRY_SIZE): Replace both definitions with...
1054         (ELF_PLT_ENTRY_SIZE): ...this new macro, with separate definitions for
1055         INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
1056         (elf_sh_plt0_entry_be): Update sizes of both definitions accordingly.
1057         (elf_sh_plt0_entry_le): Likewise.
1058         (elf_sh_plt_entry_be, elf_sh_plt_entry_le): Likewise.
1059         (elf_sh_pic_plt_entry_be, elf_sh_pic_plt_entry_le): Likewise.
1060         (elf_sh_plts): New structure, with separate definitions for
1061         INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
1062         (elf_sh_plt0_entry): Delete both definitions.
1063         (elf_sh_plt_entry, elf_sh_pic_plt_entry): Likewise.
1064         (elf_sh_sizeof_plt, elf_sh_plt_plt0_offset): Likewise.
1065         (elf_sh_plt_temp_offset, elf_sh_plt_symbol_offset): Likewise.
1066         (elf_sh_plt_reloc_offset): Likewise.
1067         (movi_shori_putval): Delete in favor of...
1068         (install_plt_field): ...this new function, with separate definitions
1069         for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
1070         (get_plt_info): New function, with separate definitions
1071         for INCLUDE_SHMEDIA and !INCLUDE_SHMEDIA.
1072         (elf_sh_plt0_linker_offset, elf_sh_plt0_gotid_offset): Delete.
1073         (VXWORKS_PLT_HEADER_SIZE, VXWORKS_PLT_ENTRY_SIZE): New macros.
1074         (vxworks_sh_plt0_entry_be, vxworks_sh_plt0_entry_le): New constants.
1075         (vxworks_sh_plt_entry_be, vxworks_sh_plt_entry_le): Likewise.
1076         (vxworks_sh_pic_plt_entry_be, vxworks_sh_pic_plt_entry_le): Likewise.
1077         (get_plt_index, get_plt_offset): New functions.
1078         (elf_sh_link_hash_table): Add srelplt2, plt_info and vxworks_p fields.
1079         (sh_elf_link_hash_table_create): Initialize them.
1080         (sh_elf_create_dynamic_sections): Call
1081         elf_vxworks_create_dynamic_sections for VxWorks.
1082         (allocate_dynrelocs): Use htab->plt_info to get the size of PLT
1083         entries.  Allocate relocation entries in .rela.plt.unloaded if
1084         generating a VxWorks executable.
1085         (sh_elf_always_size_sections): New function.
1086         (sh_elf_size_dynamic_sections): Extend .rela.plt handling to
1087         .rela.plt.unloaded.
1088         (sh_elf_relocate_section): Use get_howto_table.  Honor
1089         partial_inplace when calculating the addend for dynamic
1090         relocations.  Use get_plt_index.
1091         (sh_elf_finish_dynamic_symbol): Use get_plt_index, install_plt_field
1092         and htab->plt_info.  Fill in the bra .plt offset for VxWorks
1093         executables.  Populate .rela.plt.unloaded.  Do not make
1094         _GLOBAL_OFFSET_TABLE_ absolute on VxWorks.
1095         (sh_elf_finish_dynamic_sections): Use install_plt_field and
1096         htab->plt_info.  Handle cases where there is no special PLT header.
1097         Populate the first relocation in .rela.plt.unloaded and fix up
1098         the remaining entries.
1099         (sh_elf_plt_sym_val): Use get_plt_info.
1100         (elf_backend_always_size_sections): Define.
1101         (TARGET_BIG_SYM, TARGET_BIG_NAME): Override for VxWorks.
1102         (TARGET_LITTLE_SYM, TARGET_BIG_SYM): Likewise.
1103         (elf32_bed, elf_backend_want_plt_sym): Likewise.
1104         (elf_symbol_leading_char, elf_backend_want_got_underscore): Likewise.
1105         (elf_backend_grok_prstatus, elf_backend_grok_psinfo): Likewise.
1106         (elf_backend_add_symbol_hook): Likewise.
1107         (elf_backend_link_output_symbol_hook): Likewise.
1108         (elf_backend_emit_relocs): Likewise.
1109         (elf_backend_final_write_processing): Likewise.
1110         (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): Likewise.
1111         * targets.c (bfd_elf32_shlvxworks_vec): Declare.
1112         (bfd_elf32_shvxworks_vec): Likewise.
1113         (_bfd_target_vector): Include bfd_elf32_shlvxworks_vec and
1114         bfd_elf32_shvxworks_vec.
1115
1116 2006-08-02  Mark Kettenis  <kettenis@gnu.org>
1117
1118         * configure.in (arm-*-openbsd*): Set COREFILE to netbsd-core.lo.
1119         * configure: Regenerate.
1120
1121 2006-08-02  Petr Salinger  <Petr.Salinger@seznam.cz>
1122
1123         PR binutils/2983
1124         * elf64-x86-64.c: Add FreeBSD support.
1125         (elf64_x86_64_fbsd_post_process_headers): New function.
1126         * targets.c (_bfd_target_vector): Add bfd_elf64_x86_64_freebsd_vec.
1127         * config.bfd (x64_64-*-freebsd*): Add bfd_elf64_x86_64_freebsd_vec
1128         to the targ_selvecs.
1129         * configure.in: Add entry for bfd_elf64_x86_64_freebsd_vec.
1130         * configure: Regenerate.
1131
1132 2006-07-26  Andreas Schwab  <schwab@suse.de>
1133
1134         * elfxx-ia64.c (elfNN_ia64_choose_gp): Use rawsize if set.
1135
1136 2006-07-26  Alan Modra  <amodra@bigpond.net.au>
1137
1138         * elf.c (elf_modify_segment_map): Delete empty PT_LOAD segments.
1139         * elf32-xtensa.c (elf_xtensa_modify_segment_map): Delete.
1140         (define elf_backend_modify_segment_map): Don't define.
1141
1142 2006-07-25  Thiemo Seufer  <ths@networkno.de>
1143
1144         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Allow
1145         linking of objects for compatible machine types.
1146
1147 2006-07-25  Thiemo Seufer  <ths@networkno.de>
1148
1149         * elfxx-mips.c (mips_elf_next_relocation): Tighten check to test
1150         also for same symbol.
1151
1152 2006-07-25  Thiemo Seufer  <ths@mips.com>
1153
1154         * elfxx-mips.c (mips_elf_calculate_relocation): Remove magic constant.
1155
1156 2006-07-24  Michael Wetherell  <mike.wetherell@ntlworld.com>
1157
1158         * elf.c (bfd_section_from_shdr): Reject unrecognised OS-specific
1159         sections only if the SHF_OS_NONCONFORMING flag is present.
1160
1161 2006-07-24  Nick Clifton  <nickc@redhat.com>
1162
1163         PR ld/2729
1164         * peXXigen.c (_bfd_XXi_final_link_postscript): Check for the
1165         existance of output sections before putting their entries into the
1166         DataDictionary.
1167
1168 2006-07-20  Thiemo Seufer  <ths@mips.com>
1169
1170         * elf32-mips.c (mips16_jump_reloc): Remove function.
1171         (elf_mips16_howto_table_rel): Use _bfd_mips_elf_generic_reloc
1172         instead of mips16_jump_reloc.
1173         * elf64_mips.c, wlfn32-mips.c (mips16_jump_reloc): Remove function.
1174         (elf_mips16_howto_table_rel, elf_mips16_howto_table_rela): Use
1175         _bfd_mips_elf_generic_reloc instead of mips16_jump_reloc.
1176
1177 2006-07-19  Alan Modra  <amodra@bigpond.net.au>
1178
1179         * bfd-in.h (enum notice_asneeded_action): Define.
1180         * bfd-in2.h: Regenerate.
1181         * elflink.c (elf_link_add_object_symbols): Call linker "notice"
1182         function with NULL name for as-needed handling.
1183
1184 2006-07-18  Paul Brook  <paul@codesourcery.com>
1185
1186         * bfd-in2.h: Regenerate.
1187         * libbfd.h: Regenerate.
1188         * reloc.c: Add BFD_RELOC_ARM_T32_ADD_IMM.
1189
1190 2006-07-18  Nick Clifton  <nickc@redhat.com>
1191
1192         * elfxx-mips.c (_bfd_mips_elf_common_definition): New function.
1193         Consider SHN_MIPS_ACOMMON and SHN_MIPS_SCOMMON as being common
1194         sections.
1195         * elfxx-mips.h  (_bfd_mips_elf_common_definition): Prototype.
1196
1197 2006-07-14  Jakub Jelinek  <jakub@redhat.com>
1198
1199         * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Fix cinfo.shift2 value.
1200
1201 2006-07-14  Mark Kettenis  <kettenis@gnu.org>
1202
1203         * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Move declarations
1204         to the start of a block.
1205
1206 2006-07-13  Nick Clifton  <nickc@redhat.com>
1207
1208         * coff-sh.c (_bfd_sh_align_load_span): Catch sh_insn_info()
1209         returning a NULL value.
1210
1211 2006-07-12  H.J. Lu  <hongjiu.lu@intel.com>
1212
1213         PR ld/2884
1214         * elflink.c (_bfd_elf_merge_symbol): Copy the symbol info from
1215         the old versioned dynamic definition to the new one with
1216         non-default visibility.  Hide the symbol if it is hidden or
1217         internal.
1218
1219 2006-07-12  Matthew R. Dempsky  <mrd@alkemio.org>
1220
1221         * cpu-m68k.c (bfd_m68k_compatible): Handle CPU32.
1222
1223 2006-07-10  Jakub Jelinek  <jakub@redhat.com>
1224
1225         * elf.c (_bfd_elf_print_private_bfd_data): Handle DT_GNU_HASH.
1226         (bfd_section_from_shdr, elf_fake_sections, assign_section_numbers):
1227         Handle SHT_GNU_HASH.
1228         (special_sections_g): Include .gnu.hash section.
1229         (bfd_elf_gnu_hash): New function.
1230         * elf-bfd.h (bfd_elf_gnu_hash, _bfd_elf_hash_symbol): New prototypes.
1231         (struct elf_backend_data): Add elf_hash_symbol method.
1232         * elflink.c (_bfd_elf_link_create_dynamic_sections): Create .hash
1233         only if info->emit_hash, create .gnu.hash section if
1234         info->emit_gnu_hash.
1235         (struct collect_gnu_hash_codes): New type.
1236         (elf_collect_gnu_hash_codes, elf_renumber_gnu_hash_syms,
1237         _bfd_elf_hash_symbol): New functions.
1238         (compute_bucket_count): Don't compute HASHCODES array, instead add
1239         that and NSYMS as arguments.  Use bed->s->sizeof_hash_entry
1240         instead of bed->s->arch_size / 8.  Fix .hash size estimation.
1241         When not optimizing, use the number of hashed symbols rather than
1242         dynsymcount.
1243         (bfd_elf_size_dynamic_sections): Only add DT_HASH if info->emit_hash,
1244         and ADD DT_GNU_HASH if info->emit_gnu_hash.
1245         (bfd_elf_size_dynsym_hash_dynstr): Size .hash only if info->emit_hash,
1246         adjust compute_bucket_count caller.  Create and populate .gnu.hash
1247         section if info->emit_gnu_hash.
1248         (elf_link_output_extsym): Only populate .hash section if
1249         finfo->hash_sec != NULL.
1250         (bfd_elf_final_link): Adjust assertion.  Handle DT_GNU_HASH.
1251         * elfxx-target.h (elf_backend_hash_symbol): Define if not yet defined.
1252         (elfNN_bed): Add elf_backend_hash_symbol.
1253         * elf64-x86-64.c (elf64_x86_64_hash_symbol): New function.
1254         (elf_backend_hash_symbol): Define.
1255         * elf32-i386.c (elf_i386_hash_symbol): New function.
1256         (elf_backend_hash_symbol): Define.
1257
1258 2006-07-05  Nick Clifton  <nickc@redhat.com>
1259
1260         PR ld/2659
1261         * cofflink.c (_bfd_coff_link_input_bfd): Fix selection of aux
1262         entry when multiple definitions of a symbol are encountered.
1263
1264 2006-06-30  H.J. Lu  <hongjiu.lu@intel.com>
1265
1266         * elf32-i386.c (elf_i386_relocate_section): Use xchg %ax,%ax
1267         instead of 2 nops.
1268         * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
1269         (elf64_x86_64_plt0_entry): Use nopl 0(%rax) instead of 4 nops.
1270
1271 2006-06-29  Jakub Jelinek  <jakub@redhat.com>
1272
1273         PR ld/2513
1274         * elf32-i386.c (GOT_TLS_MASK, GOT_TLS_IE_IE, GOT_TLS_IE_GD,
1275         GOT_TLS_IE_MASK, elf_i386_check_relocs, allocate_dynrelocs): Revert
1276         2006-04-08 changes.
1277         (elf_i386_relocate_section): Likewise.  For GD->IE transition
1278         change subl into addl whenever tls_type is GOT_TLS_IE_POS.
1279
1280 2006-06-23  Alan Modra  <amodra@bigpond.net.au>
1281
1282         PR ld/2754
1283         * elf.c (bfd_elf_mkobject): Don't alloc if already done.  Set
1284         program_header_size to -1.
1285         (_bfd_elf_map_sections_to_segments): Adjust program_header_size check.
1286         (assign_file_positions_for_load_sections ): Likewise.
1287         (_bfd_elf_sizeof_headers): Use saved program_header_size if
1288         available.
1289         * elf32-arm.c (elf32_arm_mkobject): Call bfd_elf_mkobject, don't
1290         alloc if already done.
1291         * elf32-i386.c (elf_i386_mkobject): Likewise.
1292         * elf32-ppc.c (ppc_elf_mkobject): Likewise.
1293         * elf32-s390.c (elf_s390_mkobject): Likewise.
1294         * elf32-sh.c (sh_elf_mkobject): Likewise.
1295         * elf64-alpha.c (elf64_alpha_mkobject): Likewise.
1296         * elf64-ppc.c (ppc64_elf_mkobject): Likewise.
1297         * elf64-s390.c (elf_s390_mkobject): Likewise.
1298         * elf64-x86-64.c (elf64_x86_64_mkobject): Likewise.
1299         * elfxx-sparc.c (_bfd_sparc_elf_mkobject): Likewise.
1300
1301 2006-06-20  Jakub Jelinek  <jakub@redhat.com>
1302
1303         * elflink.c (elf_link_add_object_symbols): Don't create .tcommon
1304         section for relocatable link.
1305
1306 2006-06-21  Alan Modra  <amodra@bigpond.net.au>
1307
1308         * elf-bfd.h (struct elf_backend_data): Add
1309         elf_backend_modify_program_headers.
1310         * elfxx-target.h (elf_backend_modify_program_headers): Define.
1311         (elfNN_bed): Init new field.
1312         * elf.c (elf_modify_segment_map): Remove comment.
1313         (assign_file_positions_for_load_sections): Only call
1314         elf_modify_segment_map for objcopy/strip.
1315         (assign_file_positions_except_relocs): Call
1316         elf_backend_modify_program_headers.
1317         * elf32-frv.c (elf32_frvfdpic_always_size_sections): Don't make
1318         .stack section.
1319         (elf32_frvfdpic_modify_segment_map): Delete.
1320         (elf32_frvfdpic_modify_program_headers): New.
1321         (elf_backend_modify_segment_map): Don't define.
1322         (elf_backend_modify_program_headers): Define.
1323         * elf32-bfin.c (elf32_bfinfdpic_always_size_sections): Don't make
1324         .stack section.
1325         (elf32_bfinfdpic_modify_segment_map): Delete.
1326         (elf32_bfinfdpic_modify_program_headers): New.
1327         (elf_backend_modify_segment_map): Don't define.
1328         (elf_backend_modify_program_headers): Define.
1329         * elfxx-ia64.c (elfNN_ia64_modify_program_headers): New function.
1330         Split out from..
1331         (elfNN_ia64_modify_segment_map): ..here.
1332         (elf_backend_modify_program_headers): Define.
1333
1334 2006-06-20  Jakub Jelinek  <jakub@redhat.com>
1335
1336         * bfd.c (bfd_record_phdr): Clear p_align and p_align_valid fields.
1337         * elf.c (_bfd_elf_link_hash_table_init): Clear hplt field.
1338
1339 2006-06-20  Alan Modra  <amodra@bigpond.net.au>
1340
1341         * elf-bfd.h: Formatting.
1342         (_bfd_elf_map_sections_to_segments): Declare.
1343         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame_hdr): Don't
1344         clear program_header_size.
1345         * elf.c (get_program_header_size): Move.  Don't use or set saved
1346         program_header_size here.
1347         (elf_modify_segment_map): New function.  Split out from..
1348         (assign_file_positions_for_load_sections): ..here.  Assert
1349         header size is correct.  Remove dead code.
1350         (_bfd_elf_map_sections_to_segments): Rename from
1351         map_sections_to_segments.  Make global.  Use get_program_header_size
1352         when we need estimate of header size.  Call elf_modify_segment_map.
1353         Set program_header_size.
1354         (print_segment_map): Delete.
1355         (_bfd_elf_sizeof_headers): If segment_map available, get the
1356         actual size.
1357         * elf32-arm.c (elf32_arm_symbian_modify_segment_map): Make safe
1358         for calling more than once.
1359         * elf32-bfin.c (elf32_bfinfdpic_modify_segment_map): Likewise.
1360         * elf32-frv.c (elf32_frvfdpic_modify_segment_map): Likewise.
1361         * elfxx-mips.c (_bfd_mips_elf_modify_segment_map): Likewise.
1362         * elf32-i370.c (elf_backend_add_symbol_hook): Delete.
1363         (elf_backend_additional_program_headers): Delete.
1364         (elf_backend_modify_segment_map): Delete.
1365         * elf64-hppa.c (elf64_hppa_modify_segment_map): Convert to ISO C.
1366         * elfxx-ia64.c (elfNN_ia64_modify_segment_map): Likewise.
1367         * doc/bfdint.texi: Delete SIZEOF_HEADERS difficulties.
1368
1369 2006-06-19  Vladimir Prus  <vladimir@codesourcery.com>
1370
1371         * elf32-arm.c (elf32_arm_swap_symbol_out): Don't set low
1372         bit for undefined symbols.
1373
1374 2006-06-19  Alan Modra  <amodra@bigpond.net.au>
1375
1376         * elf-bfd.h (struct elf_backend_data): Add bfd_link_info pointer
1377         parameter.
1378         (_bfd_elf_sizeof_headers): Replace bfd_boolean param with
1379         bfd_link_info pointer.
1380         * targets.c (struct bfd_target <_bfd_sizeof_headers>): Likewise.
1381         * bfd.c (bfd_sizeof_headers): Tweak param name.
1382         * aout-adobe.c (aout_adobe_sizeof_headers): Adjust.
1383         * aoutx.h (NAME (aout, sizeof_headers)): Adjust.
1384         * binary.c (binary_sizeof_headers): Adjust.
1385         * bout.c (b_out_sizeof_headers): Adjust.
1386         * coff-rs6000.c (_bfd_xcoff_sizeof_headers): Adjust.
1387         * coff64-rs6000.c (xcoff64_sizeof_headers): Adjust.
1388         * coffgen.c (coff_sizeof_headers): Adjust.
1389         * ecoff.c (_bfd_ecoff_sizeof_headers): Adjust.
1390         (ecoff_compute_section_file_positions): Adjust.
1391         (_bfd_ecoff_write_object_contents): Adjust.
1392         * elf.c (get_program_header_size, _bfd_elf_sizeof_headers): Adjust.
1393         * elf32-arm.c (elf32_arm_additional_program_headers): Adjust.
1394         * elf32-i370.c (elf_backend_additional_program_headers): Adjust.
1395         * elf32-ppc.c (ppc_elf_additional_program_headers): Adjust.
1396         * elf64-hppa.c (elf64_hppa_additional_program_headers): Adjust.
1397         * elf64-x86-64.c (elf64_x86_64_additional_program_headers): Adjust.
1398         * elfxx-ia64.c (elfNN_ia64_additional_program_headers): Adjust.
1399         * elfxx-mips.c (_bfd_mips_elf_additional_program_headers): Adjust.
1400         * elfxx-mips.h (_bfd_mips_elf_additional_program_headers): Adjust.
1401         * i386msdos.c: Convert to ISO C.
1402         (msdos_sizeof_headers): Adjust.
1403         * i386os9k.c: Convert to ISO C.
1404         (os9k_sizeof_headers): Adjust.
1405         * ieee.c (ieee_sizeof_headers): Adjust.
1406         * ihex.c (ihex_sizeof_headers): Adjust.
1407         * libaout.h (NAME (aout, sizeof_headers)): Adjust.
1408         * libbfd-in.h (_bfd_nolink_sizeof_headers): Adjust.
1409         * libcoff-in.h (coff_sizeof_headers): Adjust.
1410         * libecoff.h (_bfd_ecoff_sizeof_headers): Adjust.
1411         * mach-o.c (bfd_mach_o_sizeof_headers): Adjust.
1412         * mmo.c (mmo_sizeof_headers): Adjust.
1413         * oasys.c (oasys_sizeof_headers): Adjust.
1414         * pdp11.c (NAME (aout, sizeof_headers)): Adjust.
1415         * pef.c (bfd_pef_sizeof_headers): Adjust.
1416         * ppcboot.c (ppcboot_sizeof_headers): Adjust.
1417         * som.c (som_sizeof_headers): Adjust.
1418         * srec.c (srec_sizeof_headers): Adjust.
1419         * tekhex.c (tekhex_sizeof_headers): Adjust.
1420         * versados.c (versados_sizeof_headers): Adjust.
1421         * vms.c (vms_sizeof_headers): Adjust.
1422         * xcoff-target.h (_bfd_xcoff_sizeof_headers): Adjust.
1423         * xsym.c (bfd_sym_sizeof_headers): Adjust.
1424         * xsym.h (bfd_sym_sizeof_headers): Adjust.
1425         * bfd-in2.h: Regenerate.
1426         * libbfd.h: Regenerate.
1427         * libcoff.h: Regenerate.
1428
1429 2006-06-15  Mark Shinwell  <shinwell@codesourcery.com>
1430
1431         * bfd-in2.h: Regenerate.
1432         * elf32-arm.c (R_ARM_ALU_PC_G0_NC, R_ARM_ALU_PC_G0,
1433         R_ARM_ALU_PC_G1_NC, R_ARM_ALU_PC_G1, R_ARM_ALU_PC_G2,
1434         R_ARM_LDR_PC_G1, R_ARM_LDR_PC_G2, R_ARM_LDRS_PC_G0,
1435         R_ARM_LDRS_PC_G1, R_ARM_LDRS_PC_G2, R_ARM_LDC_PC_G0,
1436         R_ARM_LDC_PC_G1, R_ARM_LDC_PC_G2, R_ARM_ALU_SB_G0_NC,
1437         R_ARM_ALU_SB_G0, R_ARM_ALU_SB_G1_NC, R_ARM_ALU_SB_G1,
1438         R_ARM_ALU_SB_G2, R_ARM_LDR_SB_G0, R_ARM_LDR_SB_G1,
1439         R_ARM_LDR_SB_G2, R_ARM_LDRS_SB_G0, R_ARM_LDRS_SB_G1,
1440         R_ARM_LDRS_SB_G2, R_ARM_LDC_SB_G0, R_ARM_LDC_SB_G1,
1441         R_ARM_LDC_SB_G2): New relocation types.
1442         (R_ARM_PC13): Rename to AAELF name R_ARM_LDR_PC_G0 and
1443         adjust HOWTO entry to be consistent with R_ARM_LDR_PC_G1
1444         and friends.
1445         (elf32_arm_howto_table_3): Delete; contents merged into
1446         elf32_arm_howto_table_2.
1447         (elf32_arm_howto_from_type): Adjust correspondingly.
1448         (elf32_arm_reloc_map): Extend with the above relocations.
1449         (calculate_group_reloc_mask): New function.
1450         (identify_add_or_sub): New function.
1451         (elf32_arm_final_link_relocate): Support for the above
1452         relocations.
1453         * reloc.c: Add enumeration entries for BFD_RELOC_ARM_...
1454         codes to correspond to the above relocations.
1455
1456 2006-06-14  Richard Sandiford  <richard@codesourcery.com>
1457
1458         * elf32-m68k.c (elf_m68k_plt_info): New structure.
1459         (elf_m68k_plt0_entry): Add R_68K_PC32-style in-place addends.
1460         (elf_m68k_plt_entry): Likewise.
1461         (elf_m68k_plt_info): New table.
1462         (CFV4E_PLT_ENTRY_SIZE): Rename to...
1463         (ISAB_PLT_ENTRY_SIZE): ...this.
1464         (CFV4E_FLAG): Delete.
1465         (elf_cfv4e_plt0_entry): Rename to...
1466         (elf_isab_plt0_entry): ...this.  Adjust comments.  Use (-6,%pc,%d0)
1467         for the second instruction too.
1468         (elf_cfv4e_plt_entry): Rename to...
1469         (elf_isab_plt_entry): ...this.  Adjust comments and use (-6,%pc,%d0).
1470         (elf_isab_plt_info): New table.
1471         (CPU32_FLAG): Delete.
1472         (PLT_CPU32_ENTRY_SIZE): Rename to...
1473         (CPU32_PLT_ENTRY_SIZE): ...this.
1474         (elf_cpu32_plt0_entry): Update bounds accordingly.  Add R_68K_PC32-
1475         style in-place addends.
1476         (elf_cpu32_plt_entry): Likewise.
1477         (elf_cpu32_plt_info): New table.
1478         (elf_m68k_link_hash_table): Add a plt_info field.
1479         (elf_m68k_link_hash_table_create): Initialize it.
1480         (elf_m68k_get_plt_info): New function.
1481         (elf_m68k_always_size_sections): Likewise.
1482         (elf_m68k_adjust_dynamic_symbol): Use the plt_info hash table field.
1483         (elf_m68k_install_pc32): New function.
1484         (elf_m68k_finish_dynamic_symbol): Factor code using plt_info and
1485         elf_m68k_install_pc32.
1486         (elf_m68k_finish_dynamic_sections): Likewise.
1487         (elf_m68k_plt_sym_val): Use elf_m68k_get_plt_info.
1488         (elf_backend_always_size_sections): Define.
1489
1490 2006-06-14  Alan Modra  <amodra@bigpond.net.au>
1491
1492         * elflink.c (elf_link_add_object_symbols): Save and restore
1493         struct bfd_hash_table table, size and count fields for
1494         as-needed libs.
1495
1496 2006-06-12  Thiemo Seufer  <ths@mips.com>
1497
1498         * elf32-mips.c: Expand comment about ABI-mandated pagesize values.
1499         (ELF_MAXPAGESIZE, ELF_COMMONPAGESIZE): define in a more obvious way.
1500         * elf64-mips.c, elfn32-mips.c (ELF_MAXPAGESIZE): Fix value for IRIX6.
1501         Delete old comments.
1502         (ELF_COMMONPAGESIZE): Define in a more obvious way.
1503
1504 2006-06-12  Nick Clifton  <nickc@redhat.com>
1505
1506         PR binutils/2735
1507         * elflink.c (elf_link_add_object_symbols): Fix the warning message
1508         about mismatched alignments to allow for the case where the common
1509         alignment has been deduced from the section alignment.
1510         * bfd.c (_bfd_default_error_handler): Update comment to explain
1511         why bfd and asection varargs are out of order.  Explicitly catch
1512         and abort on NULL bfd and asection arguments.
1513
1514 2006-06-11  Richard Sandiford  <richard@codesourcery.com>
1515             Thiemo Seufer  <ths@mips.com>
1516
1517         * elfxx-mips.c (mips_elf_link_hash_table): Add function_stub_size.
1518         (STUB_ORI): New macro.
1519         (STUB_LI16U): Fix formatting.
1520         (MIPS_FUNCTION_STUB_SIZE): Delete.
1521         (MIPS_FUNCTION_STUB_MAX_SIZE): Likewise.
1522         (MIPS_FUNCTION_STUB_NORMAL_SIZE): New macro.
1523         (MIPS_FUNCTION_STUB_BIG_SIZE): Likewise.
1524         (_bfd_mips_elf_adjust_dynamic_symbol): Use htab->function_stub_size
1525         instead of MIPS_FUNCTION_STUB_SIZE.
1526         (count_section_dynsyms): New function, split out from
1527         _bfd_mips_elf_final_link.
1528         (_bfd_mips_elf_always_size_sections): Get a worst-case estimate
1529         of the number of dynamic symbols needed and use it to set up
1530         function_stub_size.  Use function_stub_size rather than
1531         MIPS_FUNCTION_STUB_SIZE to determine the size of the stub section.
1532         Use 16-byte stubs for 0x10000 dynamic symbols.
1533         (_bfd_mips_elf_size_dynamic_sections): Use htab->function_stub_size
1534         instead of MIPS_FUNCTION_STUB_SIZE.  Fix formatting.
1535         (_bfd_mips_elf_finish_dynamic_symbol): Likewise.  Change the
1536         size of the stub buffer from MIPS_FUNCTION_STUB_MAX_SIZE to
1537         MIPS_FUNCTION_STUB_BIG_SIZE.  Tweak the check for unhandled dynindxes.
1538         Use MIPS_FUNCTION_STUB_BIG_SIZE rather than a hard-coded 20.
1539         Use STUB_ORI rather than STUB_LI16U for big stubs.
1540         (_bfd_mips_elf_link_hash_table_create): Initialize function_stub_size.
1541         (_bfd_mips_elf_final_link): Use count_section_dynsyms.
1542
1543 2006-06-09  David Ung  <davidu@mips.com>
1544
1545         * bfd/elfxx-mips.c (mips_elf_calculate_relocation): Fix mode for stub
1546         calling relocations.
1547
1548 2006-06-08  David Daney  <ddaney@avtrex.com>
1549
1550         * elfxx-mips.c (STUB_LI16): Removed.
1551         (STUB_LUI): New macro.
1552         (STUB_LI16U): Ditto.
1553         (STUB_LI16S): Ditto.
1554         (MIPS_FUNCTION_STUB_SIZE): Rewrote to take info parameter.
1555         (_bfd_mips_elf_adjust_dynamic_symbol): Pass info parameter to
1556         MIPS_FUNCTION_STUB_SIZE.
1557         (_bfd_mips_elf_always_size_sections): Ditto.
1558         (_bfd_mips_elf_size_dynamic_sections): Ditto.
1559         (_bfd_mips_elf_finish_dynamic_sections): Ditto.
1560         (_bfd_mips_elf_finish_dynamic_symbol): Rewrote stub generation
1561         to allow larger symbol table indexes.
1562
1563 2006-06-07  Joseph S. Myers  <joseph@codesourcery.com>
1564
1565         * po/Make-in (pdf, ps): New dummy targets.
1566
1567 2006-06-06  Alan Modra  <amodra@bigpond.net.au>
1568
1569         * hash.c (bfd_hash_lookup): Correct stray line.
1570
1571         * elf.c (_bfd_elf_init_private_section_data): Comment typo.
1572         (elfcore_grok_nto_status): Use long instead of pid_t.
1573         (elfcore_grok_nto_regs, elfcore_grok_nto_note): Likewise.
1574
1575 2006-06-05  Daniel Jacobowitz  <dan@codesourcery.com>
1576
1577         * po/Make-in (top_builddir): Define.
1578
1579 2006-06-05  Alan Modra  <amodra@bigpond.net.au>
1580
1581         * Makefile.am: Run "make dep-am".
1582         * Makefile.in: Regenerate.
1583         * config.in: Regenerate.
1584
1585 2006-06-02  Alan Modra  <amodra@bigpond.net.au>
1586             H.J. Lu  <hongjiu.lu@intel.com>
1587
1588         PR ld/2723
1589         * elflink.c (bfd_elf_final_link): Don't output section symbols
1590         for special ELF sections.
1591
1592 2006-06-01  Alan Modra  <amodra@bigpond.net.au>
1593
1594         * stabs.c (_bfd_link_section_stabs): Use bfd_make_section*_with_flags
1595         instead of bfd_make_section*.
1596         * aix386-core.c: Likewise.
1597         * aix5ppc-core.c: Likewise.
1598         * aout-adobe.c: Likewise.
1599         * aoutf1.h: Likewise.
1600         * binary.c: Likewise.
1601         * cisco-core.c: Likewise.
1602         * coff-arm.c: Likewise.
1603         * coff-h8300.c: Likewise.
1604         * elf.c: Likewise.
1605         * elf32-bfin.c: Likewise.
1606         * elf32-m32c.c: Likewise.
1607         * hppabsd-core.c: Likewise.
1608         * hpux-core.c: Likewise.
1609         * i386linux.c: Likewise.
1610         * ieee.c: Likewise.
1611         * ihex.c: Likewise.
1612         * irix-core.c: Likewise.
1613         * lynx-core.c: Likewise.
1614         * m68klinux.c: Likewise.
1615         * mach-o.c: Likewise.
1616         * netbsd-core.c: Likewise.
1617         * nlmcode.h: Likewise.
1618         * opncls.c: Likewise.
1619         * osf-core.c: Likewise.
1620         * peXXigen.c: Likewise.
1621         * ppcboot.c: Likewise.
1622         * ptrace-core.c: Likewise.
1623         * rs6000-core.c: Likewise.
1624         * sco5-core.c: Likewise.
1625         * sparclinux.c: Likewise.
1626         * srec.c: Likewise.
1627         * sunos.c: Likewise.
1628         * trad-core.c: Likewise.
1629         * xcofflink.c: Likewise.
1630         * xsym.c: Likewise.
1631
1632 2006-05-31  Daniel Jacobowitz  <dan@codesourcery.com>
1633
1634         * Makefile.am (INCLUDES): Use @INCINTL@.
1635         * acinclude.m4: Include new gettext macros.
1636         * configure.in: Use ZW_GNU_GETTEXT_SISTER_DIR and AM_PO_SUBDIRS.
1637         Manually substitute POFILES and GMOFILES.
1638         * Makefile.in, aclocal.m4, configure, doc/Makefile.in: Regenerated.
1639
1640 2006-05-30  H.J. Lu  <hongjiu.lu@intel.com>
1641
1642         * bfd.c (bfd_emul_get_maxpagesize): New.
1643         (bfd_elf_set_pagesize): Likewise.
1644         (bfd_emul_set_maxpagesize): Likewise.
1645         (bfd_emul_get_commonpagesize): Likewise.
1646         (bfd_emul_set_commonpagesize): Likewise.
1647         * bfd-in2.h: Regenerated.
1648
1649         * elf-bfd.h (elf_backend_data): Add commonpagesize.
1650         (xvec_get_elf_backend_data): New.
1651         (get_elf_backend_data): Use xvec_get_elf_backend_data.
1652
1653         * elf32-arm.c (elf32_arm_vxworks_bed): Remove const.
1654         * elfxx-target.h (elfNN_bed): Likewise.
1655
1656         * elf32-arm.c (ELF_COMMONPAGESIZE): Defined.
1657         * elf32-mips.c (ELF_COMMONPAGESIZE): Likewise.
1658         * elf32-ppc.c (ELF_COMMONPAGESIZE): Likewise.
1659         * elf32-sh.c (ELF_COMMONPAGESIZE): Likewise.
1660         * elf32-sh64.c (ELF_COMMONPAGESIZE): Likewise.
1661         * elf32-sparc.c (ELF_COMMONPAGESIZE): Likewise.
1662         * elf64-alpha.c (ELF_COMMONPAGESIZE): Likewise.
1663         * elf64-ppc.c (ELF_COMMONPAGESIZE): Likewise.
1664         * elf64-sparc.c (ELF_COMMONPAGESIZE): Likewise.
1665         * elf64-x86-64.c (ELF_COMMONPAGESIZE): Likewise.
1666         * elfn32-mips.c (ELF_COMMONPAGESIZE): Likewise.
1667         * elfxx-ia64.c (ELF_COMMONPAGESIZE): Likewise.
1668
1669         * elfxx-target.h (ELF_COMMONPAGESIZE): Define if not defined.
1670         (elfNN_bed): Initialize commonpagesize with ELF_COMMONPAGESIZE.
1671
1672         * targets.c (bfd_find_target): Support NULL abfd.
1673
1674 2006-05-30  Nick Clifton  <nickc@redhat.com>
1675
1676         * po/es.po: Updated Spanish translation.
1677
1678 2006-05-27  Alan Modra  <amodra@bigpond.net.au>
1679             H.J. Lu  <hongjiu.lu@intel.com>
1680
1681         * elf.c (assign_file_positions_for_load_sections): Retrieve
1682         maxpagesize from m->p_align if it is valid.  Set p_vaddr,
1683         p_paddr and p_align earlier.  Revert 2006-05-19 change to p_align.
1684         (copy_elf_program_header): Copy p_align.  Set p_align_valid.
1685
1686 2006-05-26  H.J. Lu  <hongjiu.lu@intel.com>
1687
1688         * elf64-x86-64.c (ELF_MINPAGESIZE): Changed to 0x1000.
1689
1690 2006-05-25  H.J. Lu  <hongjiu.lu@intel.com>
1691
1692         * elf64-x86-64.c (ELF_MINPAGESIZE): Set to 0x100000.
1693
1694 2006-05-25  H.J. Lu  <hongjiu.lu@intel.com>
1695
1696         * elf64-x86-64.c (ELF_MAXPAGESIZE): Updated to 0x200000.
1697
1698 2006-05-26  Alan Modra  <amodra@bigpond.net.au>
1699
1700         * elf.c (sym_is_global): Return a bfd_boolean.
1701         (ignore_section_sym): New function.
1702         (elf_map_symbols): Use ignore_section_sym to discard some syms.
1703         (_bfd_elf_symbol_from_bfd_symbol): Ensure section belongs to
1704         bfd before using elf_section_syms.
1705
1706 2006-05-25  H.J. Lu  <hongjiu.lu@intel.com>
1707
1708         * config.bfd: (sh-*-linux*): Treat as 64bit target.
1709         (sh*l*-*-netbsdelf*): Likewise.
1710         (sh-*-netbsdelf*): Likewise.
1711         (shl*-*-elf*): Likewise.
1712         (sh[1234]l*-*-elf*): Likewise.
1713         (sh3el*-*-elf*): Likewise.
1714         (shl*-*-kaos*): Likewise.
1715         (sh-*-elf*): Likewise.
1716         (sh[1234]*-elf*): Likewise.
1717         (sh-*-rtems*): Likewise.
1718         (sh-*-kaos*): Likewise.
1719
1720 2006-05-24  H.J. Lu  <hongjiu.lu@intel.com>
1721
1722         PR ld/1485
1723         * config.bfd: Set want64 to true if 64bit bfd is used.
1724         (sh-*-linux*): Use targ64_selvecs for 64bit targets.
1725         (sh*l*-*-netbsdelf*): Likewise.
1726         (sh-*-netbsdelf*): Likewise.
1727         (shl*-*-elf*): Likewise.
1728         (sh[1234]l*-*-elf*): Likewise.
1729         (sh3el*-*-elf*): Likewise.
1730         (shl*-*-kaos*): Likewise.
1731         (sh-*-elf*): Likewise.
1732         (sh[1234]*-elf*): Likewise.
1733         (sh-*-rtems*): Likewise.
1734         (sh-*-kaos*): Likewise.
1735
1736 2006-05-24  Paul Brook  <paul@codesourcery.com>
1737
1738         * elf-bfd.h (elf_backend_data): Add elf_backend_output_arch_local_syms
1739         * elf32-arm.c (output_arch_syminfo): Define.
1740         (elf32_arm_ouput_plt_map_sym, elf32_arm_output_plt_map,
1741         elf32_arm_output_arch_local_syms): New functions.
1742         (elf_backend_output_arch_local_syms): Define.
1743         * elflink.c (bfd_elf_final_link): Call
1744         elf_backend_output_arch_local_syms.
1745         * elfxx-target.h (elf_backend_output_arch_local_syms): Provide default
1746         definition.
1747         (elfNN_bed): Add elf_backend_output_arch_local_syms.
1748
1749 2006-05-24  Paul Brook  <paul@codesourcery.com>
1750
1751         * elf32-arm.c (put_arm_insn, put_thumb_insn): New functions.
1752         (elf32_thumb_to_arm_stub, elf32_arm_to_thumb_stub,
1753         elf32_arm_finish_dynamic_symbol): Use them.
1754
1755 2006-05-24  Carlos O'Donell  <carlos@systemhalted.org>
1756             Randolph Chung  <tausq@debian.org>
1757
1758         * elf-hppa.h (reloc_hppa_howto_table): Check bitfield for
1759         TPREL21L/TPREL14R relocations. Handle LTOFF_TP14R relocations.
1760         Add handling for TLS relocations.
1761         (elf_hpp_reloc_final_type): Handle TLS relocs.
1762         * elf32-hppa.c: Add authors for cleanup and TLS support.
1763         (hppa_elf_local_got_tls_type, hh_name, eh_name): Define.
1764         (elf32_hppa_link_hash_entry): Add tls_type.
1765         (elf32_hppa_link_hash_table): Add tld_ldm_got.
1766         (hppa_link_has_newfunc): Set tls_type.
1767         (elf32_hppa_link_hash_table_create): Set tls_ldm_got refcount.
1768         (hppa_stub_name): Use hh_name macro.
1769         (elf32_hppa_copy_indirect_symbol): Copy TLS information.
1770         (elf32_hppa_check_relocs): Call elf32_hppa_optimized_tls_reloc.
1771         Handle TLS relocs.
1772         (elf32_hppa_gc_sweep_hook): Likewise.
1773         (allocate_dynrelocs): Handle TLS relocs.
1774         (elf32_hppa_size_dynamic_sections): Count space required by TLS
1775         relocs. Use hh_name macro.
1776         (dtpoff_base): New function.
1777         (tpoff): Likewise.
1778         (elf32_hppa_optimized_tls_reloc): Likewise.
1779         (final_link_relocate): Handle TLS relocs.
1780         (elf32_hppa_relocate_section): Handle TLS relocs. Use eh_name
1781         and hh_name macros.
1782         (elf32_hppa_finish_dynamic_symbol): Setup TLS got entries. Use
1783         hh_name and eh_name macros.
1784         (elf32_hppa_reloc_type_clas): Handle TLS relocs.
1785
1786 2006-05-24  Bjoern Haase  <bjoern.m.haase@web.de>
1787
1788         * archures.c: Add bfd_mach_avr6.
1789         * cpu-avr.c: Likewise.
1790         * reloc.c (BFD_RELOC_AVR_LO8_LDI_GS, BFD_RELOC_AVR_HI8_LDI_GS):
1791         New relocations.
1792         * libbfd.h: Regenerate.
1793         * bfd-in2.h:Regenerate.
1794         * elf32-avr.h: New file.  Protoypes for functions accessed from ld.
1795         * elf32-avr.c: Add elf32-avr.h to include list.
1796         (elf32_avr_stub_hash_entry): New function.
1797         (elf32_avr_link_hash_table): New struct.
1798         (avr_link_hash_table): Likewise.
1799         (avr_stub_hash_entry): Likewise.
1800         (avr_stub_hash_lookup): New function.
1801         (stub_hash_newfunc): New function.
1802         (elf32_avr_link_hash_table_create): New function.
1803         (elf32_avr_link_hash_table_free): New function.
1804         (avr_get_stub_addr): New function.
1805         (debug_relax, debug_stubs): Add new global variables controlling
1806         debugging printout to stdout.
1807         (avr_pc_wrap_around): Change the type to bfd_vma.
1808         (avr_replace_call_ret_sequences): Add a new variable controling
1809         linkrelax optimizations.
1810         (avr_stub_is_required_for_16_bit_reloc): New function.
1811         (avr_final_link_relocate):
1812         Add linker hash table to parameter list. Use stub addr. if necessary.
1813         (elf32_avr_relocate_section):
1814         Add linker hashtable to parameter list of avr_final_link_relocate.
1815         (bfd_elf_avr_final_write_processing): Add support for bfd_mach_avr6.
1816         (elf32_avr_object_p): Add support for E_AVR_MACH_AVR6.
1817         (elf32_avr_relax_delete_bytes):
1818         Iterate over all sections of a bfd when adjusting relocs addends.
1819         (elf32_avr_relax_section):
1820         Evaluate avr_replace_call_ret_sequences and recalculate the size of
1821         stub section.
1822         (avr_stub_name): New function.
1823         (avr_get_stub_entry): New function.
1824         (avr_add_stub): New function.
1825         (avr_build_one_stub): New function.
1826         (avr_size_one_stub): New function.
1827         (elf32_avr_setup_params): New function.
1828         (elf32_avr_setup_section_lists): New function.
1829         (get_local_syms): New function.
1830         (elf32_avr_size_stubs): New function.
1831         (bfd_elf32_bfd_link_hash_table_create): New function.
1832         (bfd_elf32_bfd_link_hash_table_free): New function.
1833
1834 2006-05-23  H.J. Lu  <hongjiu.lu@intel.com>
1835
1836         PR ld/2655
1837         PR ld/2657
1838         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame): Properly
1839         update CIE/FDE length.  Don't pad to the section alignment.
1840
1841 2006-05-23  Jie Zhang  <jie.zhang@analog.com>
1842
1843         * elf32-bfin.c (bfinfdpic_relocate_section): Clear reloc for
1844         deteted entries in .eh_frame section.
1845
1846 2006-05-23  Jie Zhang  <jie.zhang@analog.com>
1847
1848         * elf32-bfin.c (bfin_check_relocs): Use __GLOBAL_OFFSET_TABLE_
1849         instead of _GLOBAL_OFFSET_TABLE_.
1850         (bfin_relocate_section): Ditto.
1851         (_bfin_create_got_section): Ditto.
1852         (elf32_bfinfdpic_create_dynamic_sections): Use
1853         __PROCEDURE_LINKAGE_TABLE_ instead of _PROCEDURE_LINKAGE_TABLE_.
1854         (bfin_finish_dynamic_symbol): Use __DYNAMIC instead of _DYNAMIC.
1855
1856 2006-05-23  Alan Modra  <amodra@bigpond.net.au>
1857
1858         * elf64-ppc.c (compare_symbols): Prefer strong dynamic global
1859         function syms over other syms.
1860
1861 2006-05-22  Daniel Jacobowitz  <dan@codesourcery.com>
1862
1863         * elflink.c (_bfd_elf_add_dynamic_entry): Remove DT_TEXTREL
1864         check.
1865         (bfd_elf_final_link): Add a late DT_TEXTREL check.
1866         * elfxx-mips.c (MIPS_ELF_READONLY_SECTION): Define.
1867         (mips_elf_create_dynamic_relocation): Set DF_TEXTREL.
1868         (_bfd_mips_elf_check_relocs): Delete MIPS_READONLY_SECTION.
1869         Use MIPS_ELF_READONLY_SECTION.
1870         (_bfd_mips_elf_size_dynamic_sections): Clear DF_TEXTREL after
1871         creating DT_TEXTREL.
1872         (_bfd_mips_elf_finish_dynamic_sections): Clear textrel markers
1873         if no text relocations were generated.
1874
1875 2006-05-19  H.J. Lu  <hongjiu.lu@intel.com>
1876
1877         * elfxx-ia64.c (ELF_MAXPAGESIZE): Fix a typo in comment.
1878
1879 2006-05-19  Alan Modra  <amodra@bigpond.net.au>
1880
1881         * elf.c (elf_fake_sections): Formatting.
1882         (assign_file_positions_for_load_sections): Only add SEC_ALLOC
1883         sections to p_memsz.  Remove hack for PT_NOTE sections.  Allow
1884         section alignment to increase p_align for PT_LOAD.
1885         (assign_file_positions_for_non_load_sections): Remove ARM BPABI
1886         hack for PT_DYNAMIC.  Instead, set p_filesz for all segments
1887         other than PT_LOAD, and PT_NOTE in core.
1888
1889 2006-05-17  Alan Modra  <amodra@bigpond.net.au>
1890
1891         * elf.c (assign_file_positions_for_segments): Split into..
1892         (assign_file_positions_for_load_sections): ..this, and..
1893         (assign_file_positions_for_non_load_sections): ..this new function,..
1894         (assign_file_positions_except_relocs): ..writing program headers here.
1895
1896 2006-05-17  Alan Modra  <amodra@bigpond.net.au>
1897
1898         * elflink.c (elf_gc_sweep): Don't specially keep non-alloc,
1899         non-load sections if they have relocs.
1900
1901 2006-05-15  Paul Brook  <paul@codesourcery.com>
1902
1903         * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Rename ...
1904         (bfd_is_arm_special_symbol_name): ... to this.  Add type argument.
1905         Check symbol name is of specified type.
1906         * elf32-arm.c (elf32_arm_is_target_special_symbol,
1907         arm_elf_find_function, elf32_arm_output_symbol_hook): Use
1908         bfd_is_arm_special_symbol_name.
1909         * bfd-in.h (BFD_ARM_SPECIAL_SYM_TYPE_MAP,
1910         BFD_ARM_SPECIAL_SYM_TYPE_TAG, BFD_ARM_SPECIAL_SYM_TYPE_OTHER,
1911         BFD_ARM_SPECIAL_SYM_TYPE_ANY): Define.
1912         (bfd_is_arm_mapping_symbol_name): Remove prototype.
1913         (bfd_is_arm_special_symbol_name): Add prototype.
1914         * bfd-in2.h: Regenerate.
1915
1916 2006-05-15  David Heine  <dlheine@tensilica.com>
1917             Bob Wilson  <bob.wilson@acm.org>
1918
1919         * elf32-xtensa.c (check_loop_aligned): Fix reversed check for
1920         undefined opcode.  Clean up assertions.
1921         (narrow_instruction, widen_instruction): Remove "do_it" parameters.
1922         Factor most of the code into separate functions....
1923         (can_narrow_instruction, can_widen_instruction): New.
1924         (prev_instr_is_a_loop): New.
1925         (compute_ebb_proposed_actions): Combine error handling code for
1926         decode errors.  Replace call to insn_decode_len with inline code.
1927         Use can_narrow_instruction and can_widen_instruction.  Handle errors
1928         from call to xtensa_opcode_is_loop.
1929         (relax_section): Adjust calls to narrow_instruction and
1930         widen_instruction.
1931
1932 2006-05-15  Alan Modra  <amodra@bigpond.net.au>
1933
1934         PR 2658
1935         * elf32-ppc.c (ppc_elf_relax_section): Don't segfault on non-pic
1936         -shared link.
1937
1938 2006-05-11  Michael Matz  <matz@suse.de>
1939
1940         * elflink.c (match_group_member): Correctly iterate group
1941         members.
1942
1943 2006-05-11  Paul Brook  <paul@codesourcery.com>
1944
1945         * elf32-arm.c (elf32_arm_reloc_map): Add MOVW and MOVT relocs.
1946         (elf32_arm_final_link_relocate): Handle MOVW and MOVT relocs.
1947         (elf32_arm_gc_sweep_hook, elf32_arm_check_relocs): Ditto.
1948         * reloc.c: Ditto.
1949         * bfd-in2.h: Regenerate.
1950         * libbfd.h: Regenerate.
1951         * libcoff.h: Regenerate.
1952
1953 2006-05-11  Mike Bland  <mbland@google.com>
1954
1955         * elf.c (_bfd_elf_init_private_section_data): Don't change
1956         section type if already set.
1957
1958 2006-05-10  Nick Clifton  <nickc@redhat.com>
1959
1960         PR ld/2607
1961         * elfcode.h (valid_section_index_p): New function: Checks for a
1962         valid section index.  Allows indicies in the range SHN_LOPROC to
1963         SHN_HIOS.
1964         (elf_object_p): Use valid_section_index_p.
1965
1966 2006-05-11  Pedro Alves  <pedro_alves@portugalmail.pt>
1967
1968         * coff-arm.c (ARM_26D, ARM_32, ARM_RVA_32, ARM_SECTION,
1969         ARM_SECREL): Mark WinCE versions of these relocs as partial
1970         inplace.
1971         (coff_arm_relocate_section): Adjust addend for WinCE.
1972
1973 2006-05-10  Alan Modra  <amodra@bigpond.net.au>
1974
1975         PR 2342
1976         * elflink.c (_bfd_elf_default_action_discarded): Revert 2006-02-16.
1977
1978 2006-05-09  Nick Clifton  <nickc@redhat.com>
1979
1980         * coffcode.h (coff_write_relocs): Produce an error message if a an
1981         out-of-range symbol index is detected in a reloc.
1982
1983 2006-05-09  Ben Elliston  <bje@au.ibm.com>
1984
1985         * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Remove unused
1986         local variable `dynobj'.
1987
1988 2006-05-05  Bjoern Haase  <bjoern.m.haase@web.de>
1989
1990         * elf32-avr.c (elf32_avr_relax_delete_bytes): Iterate over all
1991         of the bfd's sections for the reloc-addend adjustments.
1992
1993 2006-05-05  Martin Schwidefsky  <schwidefsky@de.ibm.com>
1994
1995         * elf32-s390.c (invalid_tls_insn): Call bfd_set_error.
1996         (elf_s390_relocate_section): Add code to do the GD->LE and
1997         LD->LE TLS linker optimizations if a brasl instruction is used
1998         for the __tls_get_offset function call.
1999         * elf64-s390.c (invalid_tls_insn): Call bfd_set_error.
2000
2001 2006-05-05  Alan Modra  <amodra@bigpond.net.au>
2002
2003         * elf64-ppc.c (ppc64_elf_tls_optimize): Only optimize
2004         R_PPC64_TPREL64 and R_PPC64_DTPMOD64 relocs when they are in
2005         the .toc and referenced by a TLS code sequence.
2006         (ppc64_elf_edit_toc): Cater for the unlikely situation that
2007         .toc is the first section in a file.
2008
2009 2006-05-04  Andreas Schwab  <schwab@suse.de>
2010
2011         * aoutf1.h (struct external_sparc_core): Declare c_regs as struct
2012         regs instead of an array of int.
2013         (struct external_solaris_bcp_core): Likewise.
2014         (swapcore_sun3): Use offsetof instead of computing the offset
2015         manually.
2016         (swapcore_sparc): Likewise.  Simplify reference to c_regs.
2017         (swapcore_solaris_bcp): Likewise.
2018
2019 2006-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
2020
2021         * elfxx-mips.c (_bfd_mips_elf_hide_symbol): Adjust handling
2022         for missing GOTs.
2023
2024 2006-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
2025
2026         * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Accept more
2027         mapping symbols.
2028
2029 2006-05-04  Ben Elliston  <bje@au.ibm.com>
2030
2031         * coff-or32.c (bfd_section_from_shdr): Remove unused local
2032         variable `ptr'.
2033         * cofflink.c (process_embedded_commands): Remove unused local
2034         variables `had_read' and `had_shared'.
2035         * ecofflink.c (bfd_ecoff_debug_accumulate): Remove unused local
2036         variable `fdr_adr'.
2037         * ihex.c (ihex_read_section): Remove unused local variable `addr'.
2038
2039 2006-05-03  Alan Modra  <amodra@bigpond.net.au>
2040
2041         * libbfd-in.h (_bfd_generic_new_section_hook): Declare.
2042         * section.c (bfd_abs_symbol, bfd_com_symbol): Delete.
2043         (bfd_und_symbol, bfd_ind_symbol): Delete.
2044         (BFD_FAKE_SECTION): Remove SYM_PTR param, set symbol_ptr_ptr to
2045         &SEC.symbol.
2046         (STD_SECTION): Adjust.
2047         (_bfd_generic_new_section_hook): New function, extracted from..
2048         (bfd_section_init): ..here.
2049         (bfd_make_section_old_way): Call new_section_hook for abs, com,
2050         und and ind sections.
2051         * elf.c (_bfd_elf_large_com_section): Adjust.
2052         * aoutx.h (new_section_hook): Call _bfd_generic_new_section_hook.
2053         * pdp11.c (new_section_hook): Likewise.
2054         * coffcode.h (coff_new_section_hook): Likewise.
2055         * ecoff.c (_bfd_ecoff_new_section_hook): Likewise.
2056         * elf.c (_bfd_elf_new_section_hook): Likewise.
2057         * vms.c (vms_new_section_hook): Likwise.
2058         * elf32-arm.c (elf32_arm_new_section_hook): Check used_by_bfd isn't
2059         already set.
2060         * elf32-sh64.c (sh64_elf_new_section_hook): Likewise.
2061         * elf32-xtensa.c (elf_xtensa_new_section_hook): Likewise.
2062         * elf64-mmix.c (mmix_elf_new_section_hook): Likewise.
2063         * elf64-ppc.c (ppc64_elf_new_section_hook): Likewise.
2064         * elfxx-mips.c (_bfd_mips_elf_new_section_hook): Likewise.
2065         * elfxx-sparc.c (_bfd_sparc_elf_new_section_hook): Likewise.
2066         * ieee.c (ieee_new_section_hook): Likewise.  Call
2067         _bfd_generic_new_section_hook too.
2068         * mmo.c (mmo_new_section_hook): Likewise.
2069         * oasys.c (oasys_new_section_hook): Likewise.
2070         * som.c (som_new_section_hook): Likewise.
2071         * coff-w65.c (reloc_processing): Don't use bfd_abs_symbol.
2072         * bfd-in2.h: Regenerate.
2073         * libbfd.h: Regenerate.
2074
2075 2006-05-03  Alan Modra  <amodra@bigpond.net.au>
2076
2077         * hash.c (DEFAULT_SIZE): Revert last change.
2078         (higher_prime_number): Correct test for no larger prime.  Don't
2079         abort on error, instead return 0.  Depopulate primes[].
2080         (bfd_hash_lookup): If we overflow size, refuse to grow table.
2081
2082 2006-05-02  Paul Brook  <paul@codesourcery.com>
2083
2084         * elf32-arm.c (elf32_arm_final_link_relocate): Set thumb funciton bit
2085         for R_ARM_REL32.
2086
2087 2006-05-02  Ben Elliston  <bje@au.ibm.com>
2088
2089         * archive.c (bfd_generic_archive_p): Remove unused local variable
2090         `fail'.
2091         * dwarf2.c (decode_line_info): Remove unused local variable
2092         `basic_block'.
2093         * elfcode.h (elf_slurp_reloc_table_from_section): Remove unused
2094         local variable `s'.
2095         * tekhex.c (tekhex_write_object_contents): Remove unused local
2096         variable `bytes_written'.
2097         * aout-ns32k.c (MY_swap_std_reloc_out): Remove unused local
2098         variable `r_addend'.
2099         * elf32-dlx.c (dlx_rtype_to_howto): Remove breaks after returns.
2100         * elfxx-mips.c (_bfd_elf_mips_mach): Remove breaks after returns.
2101         (_bfd_ns32k_relocate_contents): Remove break after return.
2102         * elf.c (bfd_section_from_shdr): Remove breaks after returns.
2103
2104 2006-05-02  Nick Clifton  <nickc@redhat.com>
2105
2106         * elf32-sh-symbian.c: Rename local define DEBUG to SYMBIAN_DEBUG
2107         in order to avoid conflicts with the global DEBUG define.
2108
2109 2006-05-02  Alan Modra  <amodra@bigpond.net.au>
2110
2111         * dwarf2.c: Formatting.
2112         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Simplify
2113         output section check.
2114         * elf32-i370.c: Warning fixes inside #ifdef DEBUG.
2115         * elf32-m32c.c: Similarly.
2116         * elf32-ppc.c: Similarly.
2117         * elf32-v850.c: Similarly.
2118         * nlm32-sparc.c: Similarly.
2119         * elfcode.h: Similarly.
2120         (elf_symbol_flags): Delete.
2121         * elflink.c (elf_link_input_bfd): Comment typo.
2122
2123 2006-05-01  DJ Delorie  <dj@redhat.com>
2124
2125         * bfd-in.h (bfd_hash_table): Add count field.
2126         * bfd-in2.h: Regenerate.
2127         * hash.c (higher_prime_number): New.
2128         (bfd_hash_table_inint_n): Init count field.
2129         (bfd_hash_lookup): Grow table as needed.
2130
2131 2006-04-27  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
2132
2133         PR binutils/2584
2134         * tekhex.c (getvalue): Change return type to bfd_boolean and
2135         add the new parameter.  Return false if the unexpected character
2136         is found.
2137         (getsym): Likewise.
2138         (first_phase): Change return type to bfd_boolean and return
2139         false if the unexpected character is found.  Replace abort
2140         with returning false.
2141         (pass_over): Change return type to bfd_boolean and the type of
2142         the second argument to bfd_boolean (*) (bfd *, int, char *).
2143         Return false if FUNC returns false.
2144         (tekhex_object_p): Return NULL if pass_over fails.
2145
2146 2006-04-27  Alan Modra  <amodra@bigpond.net.au>
2147
2148         * coff-rs6000.c (xcoff_write_archive_contents_old): Warning fix.
2149
2150 2006-04-26  H.J. Lu  <hongjiu.lu@intel.com>
2151
2152         PR binutils/2593
2153         * elf.c (_bfd_elf_new_section_hook): Don't set section ELF type
2154         and flags if its BFD flags have been set.
2155         (_bfd_elf_init_private_section_data): Don't copy the output ELF
2156         section type from input if it has been set to something
2157         different.
2158
2159 2006-04-25  H.J. Lu  <hongjiu.lu@intel.com>
2160
2161         PR binutils/2467
2162         * elf.c (_bfd_elf_close_and_cleanup): Check elf_tdata (abfd)
2163         is NULL first.
2164
2165         * elf32-arm.c (elf32_arm_close_and_cleanup): Check if
2166         abfd->sections is NULL.
2167         (elf32_arm_bfd_free_cached_info): New.
2168         (bfd_elf32_bfd_free_cached_info): Defined.
2169
2170         * elfxx-target.h (bfd_elfNN_bfd_free_cached_info): Default it
2171         to _bfd_free_cached_info.
2172
2173         * libbfd-in.h (_bfd_free_cached_info): New.
2174         * libbfd: Regenerated.
2175
2176         * opncls.c (_bfd_delete_bfd): Check if abfd->memory is NULL.
2177         (_bfd_free_cached_info): New.
2178
2179 2006-04-21  Alan Modra  <amodra@bigpond.net.au>
2180
2181         * elf.c (assign_file_positions_except_relocs): Move code setting
2182         file position of non-loaded sections..
2183         (assign_file_positions_for_segments): ..to here.
2184
2185 2006-04-20  H.J. Lu  <hongjiu.lu@intel.com>
2186
2187         PR ld/2537
2188         * elf.c (bfd_section_from_shdr): Allow sections reserved for
2189         applications. Issue an error on sections we don't know how
2190         to handle.
2191
2192 2006-04-19  Alan Modra  <amodra@bigpond.net.au>
2193
2194         * Makefile.am: Run "make dep-am".
2195         * Makefile.in: Regenerate.
2196
2197 2006-04-19  Alan Modra  <amodra@bigpond.net.au>
2198
2199         * warning.m4 (--enable-werror): Format help message.
2200         (--enable-build-warnings): Likewise.
2201         * configure: Regenerate.
2202
2203 2006-04-18  Nick Clifton  <nickc@redhat.com>
2204
2205         PR 2257
2206         * elfcode.h (elf_object_p): Allow files with corrupt e_shstrndx
2207         fields to still be handled as ELF files.
2208
2209 2006-04-16  Daniel Jacobowitz  <dan@codesourcery.com>
2210
2211         * po/SRC-POTFILES.in: Regenerated.
2212
2213 2006-04-16  Daniel Jacobowitz  <dan@codesourcery.com>
2214
2215         * configure.in: Update version to 2.17.50.
2216         * configure: Regenerated.
2217
2218 2006-04-14  David Heine  <dlheine@tensilica.com>
2219
2220         * elf32-xtensa.c (build_reloc_opcodes): New.
2221         (compute_text_actions): Use it to decode opcodes outside inner loop.
2222         (check_section_ebb_pcrels_fit): Add "reloc_opcodes" argument, and if
2223         it is set, use it to get the opcodes for relocations.
2224         (move_shared_literal): Adjust call to check_section_ebb_pcrels_fit.
2225
2226 2006-04-08  H.J. Lu  <hongjiu.lu@intel.com>
2227
2228         PR ld/2513
2229         * elf32-i386.c (GOT_TLS_MASK): New macro for tls_type.
2230         (GOT_TLS_IE_IE): Likewise.
2231         (GOT_TLS_IE_GD): Likewise.
2232         (GOT_TLS_IE_MASK): Likewise.
2233         (elf_i386_check_relocs): For global symbols, set GOT_TLS_IE_GD
2234         and GOT_TLS_IE_IE for R_386_TLS_GD and R_386_TLS_IE
2235         respectively.
2236         (allocate_dynrelocs): If both GOT_TLS_IE_IE and GOT_TLS_IE_GD
2237         are set, treat tls_type as GOT_TLS_IE_BOTH.
2238         (elf_i386_relocate_section): Likewise.
2239
2240 2006-04-07  Randolph Chung  <tausq@debian.org>
2241
2242         * elf64-hppa.c (elf64_hppa_grok_prstatus): New function.
2243         (elf64_hppa_grok_psinfo): Likewise.
2244         (elf_backend_grok_pstatus, elf_backend_grok_psinfo): Define.
2245
2246 2006-04-06  DJ Delorie  <dj@redhat.com>
2247
2248         * elf32-m32c.c (m32c_elf_relocate_section): Generate a symbol for
2249         each plt entry we create.
2250
2251 2006-04-06  Carlos O'Donell  <carlos@codesourcery.com>
2252
2253         * po/Make-in: Add install-html target.
2254         * Makefile.am: Rename docdir to bfddocdir. Add datarootdir, docdir
2255         htmldir. Add install-html and install-html-recursive targets.
2256         * Makefile.in: Regenerate.
2257         * configure.in: AC_SUBST for datarootdir, docdir and htmldir.
2258         * configure: Regenerate.
2259
2260 2006-04-06  H.J. Lu  <hongjiu.lu@intel.com>
2261
2262         * elfxx-ia64.c (elfNN_ia64_relax_section): Skip unneeded passes
2263         with the skip_relax_pass_0 and skip_relax_pass_1 bits in the
2264         section structure.
2265
2266 2006-04-05  Bernd Schmidt  <bernd.schmidt@analog.com>
2267
2268         * elf32-bfin.c (bfinfdpic_relocs_info_hash): Sprinkle casts to
2269         eliminate warnings.
2270
2271 2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
2272             James E Wilson  <wilson@specifixinc.com>
2273
2274         PR ld/2442
2275         * elfxx-ia64.c (elfNN_ia64_dyn_sym_info): Remove next.
2276         (elfNN_ia64_local_hash_entry): Add count, sorted_count and
2277         size.
2278         (elfNN_ia64_link_hash_entry): Likewise.
2279         (elfNN_ia64_new_elf_hash_entry): Initialize count, sorted_count
2280         and size.
2281         (elfNN_ia64_hash_copy_indirect): Updated elfNN_ia64_dyn_sym_info
2282         processing.
2283         (elfNN_ia64_hash_hide_symbol): Likewise.
2284         (elfNN_ia64_global_dyn_sym_thunk): Likewise.
2285         (elfNN_ia64_local_dyn_sym_thunk): Likewise.
2286         (elfNN_ia64_global_dyn_info_free): New function.
2287         (elfNN_ia64_local_dyn_info_free): Likewise.
2288         (elfNN_ia64_hash_table_free): Free local and global
2289         elfNN_ia64_dyn_sym_info.
2290         (addend_compare): New function.
2291         (sort_dyn_sym_info): Likewise.
2292         (get_dyn_sym_info): Updated to use binary search for addend.
2293         (elfNN_ia64_check_relocs): Scan relocations to create dynamic
2294         relocation arrays first.
2295
2296 2006-04-05  Bernd Schmidt  <bernd.schmidt@analog.com>
2297
2298         * elf32-bfin.c (_bfin_create_got_section): Don't generate a _gp
2299         symbol.
2300
2301 2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
2302
2303         PR ld/2411
2304         * elflink.c (check_dynsym): New.
2305         (elf_link_output_extsym): Use it.
2306         (bfd_elf_final_link): Likewise.
2307
2308 2006-04-05  H.J. Lu  <hongjiu.lu@intel.com>
2309
2310         PR ld/2404
2311         * elflink.c (_bfd_elf_merge_symbol): Skip the default indirect
2312         symbol from the dynamic definition with the default version if
2313         its type and the type of existing regular definition mismatch.
2314
2315 2006-04-05  Richard Sandiford  <richard@codesourcery.com>
2316             Daniel Jacobowitz  <dan@codesourcery.com>
2317
2318         * config.bfd (sparc-*-vxworks*): New stanza.
2319         * configure.in (bfd_elf32_sparc_vxworks_vec): New stanza.
2320         (bfd_elf32_sparc_vec, bfd_elf64_sparc_vec): Add elf-vxworks.lo.
2321         * configure: Regenerate.
2322         * elf32-sparc.c: Include elf-vxworks.h.
2323         (elf32_sparc_vxworks_link_hash_table_create: New.
2324         (elf32_sparc_vxworks_final_write_processing): New.
2325         (TARGET_BIG_SYM): Override for VxWorks.
2326         (TARGET_BIG_NAME, ELF_MINPAGESIZE): Likewise.
2327         (bfd_elf32_bfd_link_hash_table_create): Likewise.
2328         (elf_backend_want_got_plt, elf_backend_plt_readonly): Likewise.
2329         (elf_backend_got_header_size, elf_backend_add_symbol_hook): Likewise.
2330         (elf_backend_link_output_symbol_hook): Likewise.
2331         (elf_backend_emit_relocs): Likewise.
2332         (elf_backend_final_write_processing, elf32_bed): Likewise.
2333         * elfxx-sparc.c: Include libiberty.h and elf-vxworks.h.
2334         (sparc_vxworks_exec_plt0_entry, sparc_vxworks_exec_plt_entry): New.
2335         (sparc_vxworks_shared_plt0_entry, sparc_vxworks_shared_plt_entry): New.
2336         (_bfd_sparc_elf_link_hash_table_create): Don't initialize
2337         build_plt_entry here.
2338         (create_got_section): Initialize sgotplt for VxWorks.
2339         (_bfd_sparc_elf_create_dynamic_sections): Initialize build_plt_entry,
2340         plt_header_size and plt_entry_size, with new VxWorks-specific settings.
2341         Call elf_vxworks_create_dynamic_sections for VxWorks.
2342         (allocate_dynrelocs): Use plt_header_size and plt_entry_size.
2343         Allocate room for .got.plt and .rela.plt.unloaded entries on VxWorks.
2344         (_bfd_sparc_elf_size_dynamic_sections): Don't allocate a nop in .plt
2345         for VxWorks.  Check for the .got.plt section.
2346         (sparc_vxworks_build_plt_entry): New function.
2347         (_bfd_sparc_elf_finish_dynamic_symbol): Add handling of VxWorks PLTs.
2348         Don't make _GLOBAL_OFFSET_TABLE_ and _PROCEDURE_LINKAGE_TABLE_
2349         absolute on VxWorks.
2350         (sparc32_finish_dyn): Add special handling for DT_RELASZ
2351         and DT_PLTGOT on VxWorks.
2352         (sparc_vxworks_finish_exec_plt): New.
2353         (sparc_vxworks_finish_shared_plt): New.
2354         (_bfd_sparc_elf_finish_dynamic_sections): Call them.
2355         Use plt_header_size and plt_entry_size.
2356         * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add is_vxworks,
2357         srelplt2, sgotplt, plt_header_size and plt_entry_size fields.
2358         * Makefile.am (elfxx-sparc.lo): Depend on elf-vxworks.h.
2359         (elf32-sparc.lo): Likewise.
2360         * Makefile.in: Regenerate.
2361         * targets.c (bfd_elf32_sparc_vxworks_vec): Declare.
2362         (_bfd_target_vector): Add a pointer to it.
2363
2364 2006-03-30  Ben Elliston  <bje@au.ibm.com>
2365
2366         PR ld/2267
2367         * elflink.c (elf_fixup_link_order): Ensure `elfsec' is not a
2368         special section number that exceeds the number of ELF sections
2369         (eg. SHN_MIPS_SCOMMON).
2370
2371 2006-03-27  Richard Sandiford  <richard@codesourcery.com>
2372
2373         * elfxx-mips.c (mips_got_entry): Add more commentary.
2374         (mips_elf_local_got_index): Use the hash table entry to record
2375         the GOT index of forced-local symbols.
2376         (mips_elf_initialize_tls_index): Rearrange code.  Store the index
2377         in either the hash table entry or the mips_got_entry, not both.
2378         Add more commentary.
2379         (mips_elf_multi_got): Make sure the g->next is nonnull when calling
2380         mips_elf_initialize_tls_index.
2381
2382 2006-03-25  Bernd Schmidt  <bernd.schmidt@analog.com>
2383
2384         * elf32-bfin.c (bfd_const_reloc, bfd_oper_reloc, bfin_push_reloc,
2385         RELOC_STACK_SIZE, reloc_stack, reloc_stack_tos, is_reloc_stack_empty,
2386         reloc_stack_push, reloc_stack_pop, reloc_stack_operate,
2387         bfin_areloc_howto_table): Delete.  All
2388         uses deleted as well.
2389         (bfin_reloc_map): Delete all stack relocs.
2390         (bfin_info_to_howto, bfin_bfd_reloc_type_lookup,
2391         bfin_reloc_type_lookup): Don't support them.
2392         (bfin_relocate_section): Don't try to handle them.
2393
2394         * config.bfd (bfin-*-*): Add bfd_elf32_bfinfdpic_vec.
2395         * configure.in: Likewise.
2396         * configure: Regenerate.
2397         * elf32-bfin.c: Include "elf/dwarf2.h" and "hashtab.h".
2398         (BFIN_RELOC_MAX): Now 0x21.
2399         (bfin_howto_table, bfin_reloc_map): Add FD-PIC relocs.
2400         (bfd_elf32_bfinfdpic_vec): Declare.
2401         (IS_FDPIC): New macro.
2402         (struct bfinfdpic_elf_link_hash_table): New struct.
2403         (bfinfdpic_hash_table, bfinfdpic_got_section,
2404         bfinfdpic_gotrel_section, bfinfdpic_gotfixup_section,
2405         bfinfdpic_plt_setion, bfinfdpic_pltrel_section,
2406         bfinfdpic_relocs_info, bfinfdpic_got_initial_offset,
2407         bfinfdpic_plt_initial_offset): Accessor macros for it.
2408         (BFINFDPIC_SYM_LOCAL, BFINFDPIC_FUNCDESC_LOCAL): New macros.
2409         (struct bfinfdpic_relocs_info): New struct.
2410         (LZPLT_RESOLVER_EXTRA, LZPLT_NORMAL_SIZE, LZPLT_ENTRIES,
2411         BFINFDPIC_LZPLT_BLOCK_SIZE, BFINFDPIC_LZPLT_RESOLV_LOC,
2412         DEFAULT_STACK_SIZE): New macros.
2413         (bfinfdpic_elf_link_hash_table_create, bfinfdpic_relocs_info_hash,
2414         bfinfdpic_relocs_info_eq, bfinfdpics_relocs_info_find,
2415         bfinfdpic_relocs_info_for_global, bfinfdpic_relocs_info_for_local,
2416         bfinfdpic_pic_merge_early_relocs_info, _bfinfdpic_add_dyn_reloc,
2417         _bfinfdpic_add_rofixup, _bfinfdpic_osec_to_segment,
2418         _bfinfdpic_osec_readonly_p, bfinfdpic_relocate_section,
2419         bfinfdpic_check_relocs, bfinfdpic_gc_sweep_hook,
2420         _bfinfdpic_link_omit_section_dynsym, _bfin_create_got_section,
2421         elf32_bfinfdpic_create_dynamic_sections, _bfinfdpic_get_fd_entry,
2422         _bfinfdpic_compute_got_alloc_data, _bfinfdpic_get_got_entry,
2423         _bfinfdpic_assign_got_entries, _bfinfdpic_assign_plt_entries,
2424         _bfinfdpic_resolve_final_relocs_info,
2425         elf32_bfinfdpic_size_dynamic_sections,
2426         elf32_bfinfdpic_always_size_sections,
2427         elf32_bfinfdpic_modify_segment_map,
2428         _bfinfdpic_count_got_plt_entries,
2429         elf32_bfinfdpic_finish_dynamic_sections,
2430         elf32_bfinfdpic_adjust_dynamic_symbol,
2431         elf32_bfinfdpic_finish_dynamic_symbol,
2432         elf32_bfinfdpic_elf_use_relative_eh_frame,
2433         elf32_bfinfdpic_elf_encode_eh_address,
2434         elf32_bfin_object_p, bfin_elf_copy_private_bfd_data,
2435         elf32_bfinfdpic_copy_private_bfd_data,
2436         (struct _bfinfdpic_dynamic_got_info,
2437         struct _bfinfdpic_dynamic_got_plt_info): New structs.
2438         (elf32_bfin_print_private_bfd_data): Print PIC flags.
2439         (elf32_bfin_merge_private_bfd_data): Extend to support FD-PIC.
2440         (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, elf32_bed,
2441         elf_backend_got_header_size, bfd_elf32_bfd_link_hash_table_create,
2442         elf_backend_always_size_sectinos, elf_backend_modify_segment_map,
2443         bfd_elf32_bfd_copy_private_bfd_data,
2444         elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol,
2445         elf_backend_size_dynamic_sections, elf_backend_finish_dynamic_symbol,
2446         elf_backend_finish_dynamic_sections, elf_backend_relocate_section,
2447         elf_backend_can_make_relative_eh_frame, elf_backend_check_relocs,
2448         elf_backend_can_make_ldsa_relative_eh_frame, elf_backend_may_use_rel_p,
2449         elf_backend_may_use_rela_p, elf_backend_default_use_rela_p,
2450         elf_backend_omit_section_dynsym): Redefine these macros and include
2451         "elf32-target.h" again to create the elf32-bfinfdpic target.
2452         * reloc.c (BFD_RELOC_BFIN_GOT17M4, BFD_RELOC_BFIN_GOTHI,
2453         BFD_RELOC_BFIN_GOTLO, BFD_RELOC_BFIN_FUNCDESC,
2454         BFD_RELOC_BFIN_FUNCDESC_GOT17M4, BFD_RELOC_BFIN_FUNCDESC_GOTHI,
2455         BFD_RELOC_BFIN_FUNCDESC_GOTLO, BFD_RELOC_BFIN_FUNCDESC_VALUE,
2456         BFD_RELOC_BFIN_FUNCDESC_GOTOFF17M4, BFD_RELOC_BFIN_FUNCDESC_GOTOFFHI,
2457         BFD_RELOC_BFIN_FUNCDESC_GOTOFFLO, BFD_RELOC_BFIN_GOTOFFHI,
2458         BFD_RELOC_BFIN_GOTOFFLO): New.
2459         * targets.c (bfd_elf32_bfinfdpic_vec): New bfd_target.
2460         (_bfd_target_vector): Add it.
2461         * bfd-in2.h: Regenerate.
2462         * libbfd.h: Regenerate.
2463
2464 2006-03-25  Richard Sandiford  <richard@codesourcery.com>
2465
2466         * cpu-m68k.c (bfd_m68k_compatible): Treat ISA A+ and ISA B code as
2467         incompatible.  Likewise MAC and EMAC code.
2468         * elf32-m68k.c (elf32_m68k_merge_private_bfd_data): Use
2469         bfd_get_compatible to set the new bfd architecture.  Rely on it
2470         to detect incompatibilities.
2471
2472 2006-03-23  Michael Matz  <matz@suse.de>
2473
2474         * reloc.c: Add BFD_RELOC_X86_64_GOT64, BFD_RELOC_X86_64_GOTPCREL64,
2475         BFD_RELOC_X86_64_GOTPC64, BFD_RELOC_X86_64_GOTPLT64,
2476         BFD_RELOC_X86_64_PLTOFF64.
2477         * bfd-in2.h: Regenerated.
2478         * libbfd.h: Regenerated.
2479         * elf64-x86-64.c (x86_64_elf_howto_table): Correct comment.
2480         Add howtos for above relocs.
2481         (x86_64_reloc_map): Add mappings for new relocs.
2482         (elf64_x86_64_check_relocs): R_X86_64_GOT64, R_X86_64_GOTPCREL64,
2483         R_X86_64_GOTPLT64 need a got entry.  R_X86_64_GOTPLT64 also a PLT
2484         entry.  R_X86_64_GOTPC64 needs a .got section.  R_X86_64_PLTOFF64
2485         needs a PLT entry.
2486         (elf64_x86_64_gc_sweep_hook): Reflect changes from
2487         elf64_x86_64_check_relocs for the new relocs.
2488         (elf64_x86_64_relocate_section): Handle new relocs.
2489
2490 2006-03-22  Bob Wilson  <bob.wilson@acm.org>
2491
2492         * elf32-xtensa.c (xtensa_read_table_entries): Remove assertion that
2493         rel->r_addend is zero.
2494
2495 2006-03-22  Richard Sandiford  <richard@codesourcery.com>
2496
2497         * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Fix type
2498         of "loc".
2499
2500 2006-03-22  Richard Sandiford  <richard@codesourcery.com>
2501             Daniel Jacobowitz  <dan@codesourcery.com>
2502             Phil Edwards  <phil@codesourcery.com>
2503             Zack Weinberg  <zack@codesourcery.com>
2504             Mark Mitchell  <mark@codesourcery.com>
2505             Nathan Sidwell  <nathan@codesourcery.com>
2506
2507         * bfd-in2.h: Regenerate.
2508         * config.bfd (mips*-*-vxworks*, mips*el-*-vxworks*): New stanzas.
2509         * configure.in (bfd_elf32_bigmips_vxworks_vec): New stanza.
2510         (bfd_elf32_littlemips_vxworks_vec): Likewise.
2511         (bfd_elf32_bigmips_vec): Add elf-vxworks.lo.
2512         (bfd_elf32_littlemips_vec): Likewise.
2513         (bfd_elf32_nbigmips_vec): Likewise.
2514         (bfd_elf32_nlittlemips_vec): Likewise.
2515         (bfd_elf32_ntradbigmips_vec): Likewise.
2516         (bfd_elf32_ntradlittlemips_vec): Likewise.
2517         (bfd_elf32_tradbigmips_vec): Likewise.
2518         (bfd_elf32_tradlittlemips_vec): Likewise.
2519         (bfd_elf64_bigmips_vec): Likewise.
2520         (bfd_elf64_littlemips_vec): Likewise.
2521         (bfd_elf64_tradbigmips_vec): Likewise.
2522         (bfd_elf64_tradlittlemips_vec): Likewise.
2523         * elf32-mips.c: Include elf-vxworks.h.
2524         (mips_info_to_howto_rel): Use elf_backend_mips_rtype_to_howto
2525         instead of calling mips_elf32_rtype_to_howto directly.
2526         (mips_vxworks_copy_howto_rela): New reloc howto.
2527         (mips_vxworks_jump_slot_howto_rela): Likewise.
2528         (mips_vxworks_bfd_reloc_type_lookup): New function.
2529         (mips_vxworks_rtype_to_howto): Likewise.
2530         (mips_vxworks_final_write_processing): Likewise.
2531         (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME): Override for VxWorks.
2532         (TARGET_BIG_SYM, TARGET_BIG_NAME, elf_bed, ELF_MAXPAGESIZE): Likewise.
2533         (elf_backend_want_got_plt): Likewise.
2534         (elf_backend_want_plt_sym): Likewise.
2535         (elf_backend_got_symbol_offset): Likewise.
2536         (elf_backend_want_dynbss): Likewise.
2537         (elf_backend_may_use_rel_p): Likewise.
2538         (elf_backend_may_use_rela_p): Likewise.
2539         (elf_backend_default_use_rela_p): Likewise.
2540         (elf_backend_got_header_size: Likewise.
2541         (elf_backend_plt_readonly): Likewise.
2542         (bfd_elf32_bfd_reloc_type_lookup): Likewise.
2543         (elf_backend_mips_rtype_to_howto): Likewise.
2544         (elf_backend_adjust_dynamic_symbol): Likewise.
2545         (elf_backend_finish_dynamic_symbol): Likewise.
2546         (bfd_elf32_bfd_link_hash_table_create): Likewise.
2547         (elf_backend_add_symbol_hook): Likewise.
2548         (elf_backend_link_output_symbol_hook): Likewise.
2549         (elf_backend_emit_relocs): Likewise.
2550         (elf_backend_final_write_processing: Likewise.
2551         (elf_backend_additional_program_headers): Likewise.
2552         (elf_backend_modify_segment_map): Likewise.
2553         (elf_backend_symbol_processing): Likewise.
2554         * elfxx-mips.c: Include elf-vxworks.h.
2555         (mips_elf_link_hash_entry): Add is_relocation_target and
2556         is_branch_target fields.
2557         (mips_elf_link_hash_table): Add is_vxworks, srelbss, sdynbss, srelplt,
2558         srelplt2, sgotplt, splt, plt_header_size and plt_entry_size fields.
2559         (MIPS_ELF_RELA_SIZE, MIPS_ELF_REL_DYN_NAME): New macros.
2560         (MIPS_RESERVED_GOTNO): Take a mips_elf_link_hash_table argument.
2561         Return 3 for VxWorks.
2562         (ELF_MIPS_GP_OFFSET): Change the argument from a bfd to a
2563         mips_elf_link_hash_table.  Return 0 for VxWorks.
2564         (MIPS_ELF_GOT_MAX_SIZE): Change the argument from a bfd to a
2565         mips_elf_link_hash_table.  Update the call to ELF_MIPS_GP_OFFSET.
2566         (mips_vxworks_exec_plt0_entry): New variable.
2567         (mips_vxworks_exec_plt_entry): Likewise.
2568         (mips_vxworks_shared_plt0_entry): Likewise.
2569         (mips_vxworks_shared_plt_entry): Likewise.
2570         (mips_elf_link_hash_newfunc): Initialize the new hash_entry fields.
2571         (mips_elf_rel_dyn_section): Change the bfd argument to a
2572         mips_elf_link_hash_table.  Use MIPS_ELF_REL_DYN_NAME to get
2573         the name of the section.
2574         (mips_elf_initialize_tls_slots): Update the call to
2575         mips_elf_rel_dyn_section.
2576         (mips_elf_gotplt_index): New function.
2577         (mips_elf_local_got_index): Add an input_section argument.
2578         Update the call to mips_elf_create_local_got_entry.
2579         (mips_elf_got_page): Likewise.
2580         (mips_elf_got16_entry): Likewise.
2581         (mips_elf_create_local_got_entry): Add bfd_link_info and input_section
2582         arguments.  Create dynamic relocations for each entry on VxWorks.
2583         (mips_elf_merge_gots): Update the use of MIPS_ELF_GOT_MAX_SIZE.
2584         (mips_elf_multi_got): Update the uses of MIPS_ELF_GOT_MAX_SIZE
2585         and MIPS_RESERVED_GOTNO.
2586         (mips_elf_create_got_section): Update the uses of
2587         MIPS_ELF_GOT_MAX_SIZE.  Create .got.plt on VxWorks.
2588         (is_gott_symbol): New function.
2589         (mips_elf_calculate_relocation): Use a dynobj local variable.
2590         Update the calls to mips_elf_local_got_index, mips_elf_got16_entry and
2591         mips_elf_got_page_entry.  Set G to the .got.plt entry when calculating
2592         VxWorks R_MIPS_CALL* relocations.  Calculate and use G for all GOT
2593         relocations on VxWorks.  Add dynamic relocations for references
2594         to the VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols.  Don't
2595         create dynamic relocations for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64
2596         in VxWorks executables.
2597         (mips_elf_allocate_dynamic_relocations): Add a bfd_link_info argument.
2598         Use MIPS_ELF_RELA_SIZE to calculate the size of a VxWorks entry.
2599         Don't allocate a null entry on VxWorks.
2600         (mips_elf_create_dynamic_relocation): Update the call to
2601         mips_elf_rel_dyn_section.  Use absolute rather than relative
2602         relocations for VxWorks, and make them RELA rather than REL.
2603         (_bfd_mips_elf_create_dynamic_sections): Don't make .dynamic
2604         read-only on VxWorks.  Update the call to mips_elf_rel_dyn_section.
2605         Create the .plt, .rela.plt, .dynbss and .rela.bss sections on
2606         VxWorks.  Likewise create the _PROCEDURE_LINKAGE_TABLE symbol.
2607         Call elf_vxworks_create_dynamic_sections for VxWorks and
2608         initialize the plt_header_size and plt_entry_size fields.
2609         (_bfd_mips_elf_check_relocs): Don't allow GOT relocations to be
2610         used in VxWorks executables.  Don't allocate dynamic relocations
2611         for R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 in VxWorks executables.
2612         Set is_relocation_target for each symbol referenced by a relocation.
2613         Allocate .rela.dyn entries for relocations against the special
2614         VxWorks __GOTT_BASE__ and __GOTT_INDEX__ symbols.  Create GOT
2615         entries for all VxWorks R_MIPS_GOT16 relocations.  Don't allocate
2616         a global GOT entry for symbols mentioned in VxWorks R_MIPS_CALL*,
2617         R_MIPS_32, R_MIPS_REL32 or R_MIPS_64 relocations.  Update the calls
2618         to mips_elf_rel_dyn_section and mips_elf_allocate_dynamic_relocations.
2619         Set is_branch_target for symbols mentioned in R_MIPS_PC16 or R_MIPS_26
2620         relocations.  Don't set no_fn_stub on VxWorks.
2621         (_bfd_mips_elf_adjust_dynamic_symbol): Update the call to
2622         mips_elf_allocate_dynamic_relocations.
2623         (_bfd_mips_vxworks_adjust_dynamic_symbol): New function.
2624         (_bfd_mips_elf_always_size_sections): Do not allocate GOT page
2625         entries for VxWorks, and do not create multiple GOTs.
2626         (_bfd_mips_elf_size_dynamic_sections): Use MIPS_ELF_REL_DYN_NAME.
2627         Handle .got specially for VxWorks.  Update the uses of
2628         MIPS_RESERVED_GOTNO and mips_elf_allocate_dynamic_relocations.
2629         Check for sgotplt and splt.  Allocate the .rel(a).dyn contents last,
2630         once its final size is known.  Set DF_TEXTREL for VxWorks.  Add
2631         DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL, DT_PLTRELSZ and DT_JMPREL
2632         tags on VxWorks.  Do not add the MIPS-specific tags for VxWorks.
2633         (_bfd_mips_vxworks_finish_dynamic_symbol): New function.
2634         (mips_vxworks_finish_exec_plt): Likewise.
2635         (mips_vxworks_finish_shared_plt): Likewise.
2636         (_bfd_mips_elf_finish_dynamic_sections): Remove an unncessary call
2637         to mips_elf_rel_dyn_section.  Use a VxWorks-specific value of
2638         DT_PLTGOT.  Handle DT_RELA, DT_RELASZ, DT_RELAENT, DT_PLTREL,
2639         DT_PLTRELSZ and DT_JMPREL.  Update the uses of MIPS_RESERVED_GOTNO
2640         and mips_elf_rel_dyn_section.  Use a different GOT header for
2641         VxWorks.  Don't sort .rela.dyn on VxWorks.  Finish the PLT on VxWorks.
2642         (_bfd_mips_elf_link_hash_table_create): Initialize the new
2643         mips_elf_link_hash_table fields.
2644         (_bfd_mips_vxworks_link_hash_table_create): New function.
2645         (_bfd_mips_elf_final_link): Set the GP value to _GLOBAL_OFFSET_TABLE_
2646         on VxWorks.  Update the call to ELF_MIPS_GP_OFFSET.
2647         * elfxx-mips.h (_bfd_mips_vxworks_adjust_dynamic_symbol): Declare.
2648         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
2649         (_bfd_mips_vxworks_link_hash_table_create): Likewise.
2650         * libbfd.h: Regenerate.
2651         * Makefile.am (elfxx-mips.lo): Depend on elf-vxworks.h.
2652         (elf32-mips.lo): Likewise.
2653         * Makefile.in: Regenerate.
2654         * reloc.c (BFD_RELOC_MIPS_COPY, BFD_RELOC_MIPS_JUMP_SLOT): Declare.
2655         * targets.c (bfd_elf32_bigmips_vxworks_vec): Declare.
2656         (bfd_elf32_littlemips_vxworks_vec): Likewise.
2657         (_bfd_target_vector): Add entries for them.
2658
2659 2006-03-19  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2660
2661         * elf64-hppa.c (elf64_hppa_special_sections): Change flags for .tbss
2662         section from SHF_PARISC_WEAKORDER to SHF_HP_TLS.
2663         (elf_backend_special_sections): Remove #undef.
2664
2665 2006-03-18  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2666
2667         * elf64-hppa.c (allocate_global_data_opd): Don't create an OPD entry
2668         for undefined weak symbols.
2669
2670 2006-03-17  Daniel Jacobowitz  <dan@codesourcery.com>
2671
2672         PR ld/2462
2673         * elflink.c (bfd_elf_final_link): Remove
2674         bed->elf_backend_emit_relocs from emit_relocs.
2675
2676 2006-03-17  Alexandre Oliva  <aoliva@redhat.com>
2677
2678         * elf32-ppc.c (ppc_elf_relocate_section): Copy addend from
2679         first relocation to the second when relaxing TLS GD to LE;
2680         zero it out when relaxing to IE.
2681
2682 2006-03-17  Alan Modra  <amodra@bigpond.net.au>
2683
2684         PR 2434
2685         * elflink.c (elf_link_add_object_symbols): Save and restore
2686         warning sym's linked sym.
2687
2688 2006-03-16  Alan Modra  <amodra@bigpond.net.au>
2689
2690         PR 2434
2691         * elflink.c (struct elf_smash_syms_data, elf_smash_syms): Delete.
2692         (elf_link_add_object_symbols): Delete unnecessary locals.  Rename
2693         hash_table -> htab.  Formatting.  Save entire symbol table
2694         before loading as-needed syms, and restore afterwards if lib not
2695         needed.  Use bfd_hash_allocate rather than bfd_alloc for sym
2696         name.  Free some buffers earlier.
2697         * bfd-in.h (struct bfd_hash_table): Add entsize.
2698         (bfd_hash_table_init, bfd_hash_table_init_n): Adjust prototype.
2699         * elf-bfd.h (_bfd_elf_link_hash_table_init): Likewise
2700         * hash.c (bfd_hash_table_init_n): Add entsize param, save to
2701         hash table.
2702         (bfd_hash_table_init): Add param, adjust calls.
2703         * aoutx.h: Adjust all hash_table_init functions and calls.
2704         * bfd.c: Likewise.
2705         * coff-arm.c: Likewise.
2706         * coff-h8300.c: Likewise.
2707         * coff-ppc.c: Likewise.
2708         * cofflink.c: Likewise.
2709         * ecoff.c: Likewise.
2710         * ecofflink.c: Likewise.
2711         * elf-m10300.c: Likewise.
2712         * elf-strtab.c: Likewise.
2713         * elf.c: Likewise.
2714         * elf32-arm.c: Likewise.
2715         * elf32-bfin.c: Likewise.
2716         * elf32-cris.c: Likewise.
2717         * elf32-frv.c: Likewise.
2718         * elf32-hppa.c: Likewise.
2719         * elf32-i386.c: Likewise.
2720         * elf32-m32r.c: Likewise.
2721         * elf32-m68hc1x.c: Likewise.
2722         * elf32-m68k.c: Likewise.
2723         * elf32-ppc.c: Likewise.
2724         * elf32-s390.c: Likewise.
2725         * elf32-sh.c: Likewise.
2726         * elf32-vax.c: Likewise.
2727         * elf64-alpha.c: Likewise.
2728         * elf64-hppa.c: Likewise.
2729         * elf64-ppc.c: Likewise.
2730         * elf64-s390.c: Likewise.
2731         * elf64-sh64.c: Likewise.
2732         * elf64-x86-64.c: Likewise.
2733         * elfxx-ia64.c: Likewise.
2734         * elfxx-mips.c: Likewise.
2735         * elfxx-sparc.c: Likewise.
2736         * i386linux.c: Likewise.
2737         * libaout.h: Likewise.
2738         * libbfd-in.h: Likewise.
2739         * libcoff-in.h: Likewise.
2740         * linker.c: Likewise.
2741         * m68klinux.c: Likewise.
2742         * merge.c: Likewise.
2743         * opncls.c: Likewise.
2744         * pdp11.c: Likewise.
2745         * sparclinux.c: Likewise.
2746         * stabs.c: Likewise.
2747         * sunos.c: Likewise.
2748         * vms.c: Likewise.
2749         * xcofflink.c: Likewise.
2750         * section.c (struct section_hash_entry): Move to..
2751         * libbfd-in.h: ..here.
2752         * Makefile.am: Run "make dep-am"
2753         * Makefile.in: Regenerate.
2754         * bfd-in2.h: Regenerate.
2755         * libbfd.h: Regenerate.
2756         * libcoff.h: Regenerate.
2757
2758 2006-03-16  Alan Modra  <amodra@bigpond.net.au>
2759
2760         * elf32-ppc.c (ppc_elf_check_relocs): REL24 and REL14 relocs
2761         against __GLOBAL_OFFSET_TABLE__ need never be dynamic.  Tweak
2762         last change to REL32 relocs so that they are counted as
2763         possibly dynamic as per REL24 and REL14.
2764
2765 2006-03-16  Alan Modra  <amodra@bigpond.net.au>
2766
2767         * elf32-ppc.c (ppc_elf_check_relocs): Don't fall into REL24
2768         checks from REL32.
2769
2770 2006-03-15  Ben Elliston  <bje@au.ibm.com>
2771
2772         * elf32-arm.c (elf32_arm_merge_eabi_attributes): Iterate over all
2773         in_list elements, not just the first.
2774
2775 2006-03-14  Richard Sandiford  <richard@codesourcery.com>
2776
2777         * elf32-mips.c (mips_elf_adjust_addend): New function, mostly split
2778         out from...
2779         (_bfd_mips_elf_relocate_section): ...here.  Use it to adjust r_addend
2780         for final links too.
2781
2782 2006-03-13  Richard Sandiford  <richard@codesourcery.com>
2783
2784         * elfxx-mips.c (mips_elf_create_got_section): Initialize hgot.
2785
2786 2006-03-11  H.J. Lu  <hongjiu.lu@intel.com>
2787
2788         PR ld/2443
2789         * dwarf2.c (concat_filename): Don't issue an error if file is 0.
2790
2791 2006-03-10  Paul Brook  <paul@codesourcery.com>
2792
2793         * elf32-arm.c (INTERWORK_FLAG): Handle EABIv5.
2794         (elf32_arm_print_private_bfd_data): Ditto.
2795
2796 2006-03-09  Paul Brook  <paul@codesourcery.com>
2797
2798         * cpu-arm.c (bfd_is_arm_mapping_symbol_name): Recognise additional
2799         mapping symbols.
2800
2801 2006-03-09  Khem Raj  <khem@mvista.com>
2802
2803         * elf32-arm.c(elf32_arm_finish_dynamic_sections): Use unsigned
2804         char type.
2805
2806 2006-03-08  H.J. Lu  <hongjiu.lu@intel.com>
2807
2808         * elfxx-ia64.c (elfNN_ia64_choose_gp): Properly choose gp.
2809
2810 2006-03-07  Richard Sandiford  <richard@codesourcery.com>
2811             Daniel Jacobowitz  <dan@codesourcery.com>
2812             Zack Weinberg  <zack@codesourcery.com>
2813             Nathan Sidwell  <nathan@codesourcery.com>
2814             Paul Brook  <paul@codesourcery.com>
2815             Ricardo Anguiano  <anguiano@codesourcery.com>
2816             Phil Edwards  <phil@codesourcery.com>
2817
2818         * configure.in (bfd_elf32_bigarm_vec): Include elf-vxworks.lo.
2819         (bfd_elf32_bigarm_symbian_vec): Likewise.
2820         (bfd_elf32_bigarm_vxworks_vec): Likewise.
2821         (bfd_elf32_littlearm_vec): Likewise.
2822         (bfd_elf32_littlearm_symbian_vec): Likewise.
2823         (bfd_elf32_littlearm_vxworks_vec): Likewise.
2824         * configure: Regenerate.
2825         * elf32-arm.c: Include libiberty.h and elf-vxworks.h.
2826         (RELOC_SECTION, RELOC_SIZE, SWAP_RELOC_IN, SWAP_RELOC_OUT): New macros.
2827         (elf32_arm_vxworks_bed): Add forward declaration.
2828         (elf32_arm_howto_table_1): Fix the masks for R_ASM_ABS12.
2829         (elf32_arm_vxworks_exec_plt0_entry): New table.
2830         (elf32_arm_vxworks_exec_plt_entry): Likewise.
2831         (elf32_arm_vxworks_shared_plt_entry): Likewise.
2832         (elf32_arm_link_hash_table): Add vxworks_p and srelplt2 fields.
2833         (reloc_section_p): New function.
2834         (create_got_section): Use RELOC_SECTION.
2835         (elf32_arm_create_dynamic_sections): Likewise.  Call
2836         elf_vxworks_create_dynamic_sections for VxWorks targets.
2837         Choose between the two possible values of plt_header_size
2838         and plt_entry_size.
2839         (elf32_arm_link_hash_table_create): Initialize vxworks_p and srelplt2.
2840         (elf32_arm_abs12_reloc): New function.
2841         (elf32_arm_final_link_relocate): Call it.  Allow the creation of
2842         dynamic R_ARM_ABS12 relocs on VxWorks.  Use reloc_section_p,
2843         RELOC_SIZE, SWAP_RELOC_OUT and RELOC_SECTION.  Initialize the
2844         r_addend fields of relocs.  On rela targets, skip any code that
2845         adjusts in-place addends.  When using _bfd_link_final_relocate
2846         to perform a final relocation, pass rel->r_addend as the addend
2847         argument.
2848         (elf32_arm_merge_private_bfd_data): If one of the bfds is a VxWorks
2849         object, ignore flags that are not standard on VxWorks.
2850         (elf32_arm_check_relocs): Allow the creation of dynamic R_ARM_ABS12
2851         relocs on VxWorks.  Use reloc_section_p.
2852         (elf32_arm_adjust_dynamic_symbol): Use RELOC_SECTION and RELOC_SIZE.
2853         (allocate_dynrelocs): Use RELOC_SIZE.  Account for the size of
2854         .rela.plt.unloaded relocs on VxWorks targets.
2855         (elf32_arm_size_dynamic_sections): Use RELOC_SIZE.  Check for
2856         .rela.plt.unloaded as well as .rel(a).plt.  Add DT_RELA* tags
2857         instead of DT_REL* tags on RELA targets.
2858         (elf32_arm_finish_dynamic_symbol): Use RELOC_SECTION, RELOC_SIZE
2859         and SWAP_RELOC_OUT.  Initialize r_addend fields.  Handle VxWorks
2860         PLT entries.  Do not make _GLOBAL_OFFSET_TABLE_ absolute on VxWorks.
2861         (elf32_arm_finish_dynamic_sections): Use RELOC_SECTION, RELOC_SIZE
2862         and SWAP_RELOC_OUT.  Initialize r_addend fields.  Handle DT_RELASZ
2863         like DT_RELSZ.  Handle the VxWorks form of initial PLT entry.
2864         Correct the .rela.plt.unreloaded symbol indexes.
2865         (elf32_arm_output_symbol_hook): Call the VxWorks version of this
2866         hook on VxWorks targets.
2867         (elf32_arm_vxworks_link_hash_table_create): Set vxworks_p to true.
2868         Minor formatting tweak.
2869         (elf32_arm_vxworks_final_write_processing): New function.
2870         (elf_backend_add_symbol_hook): Override for VxWorks and reset
2871         for Symbian.
2872         (elf_backend_final_write_processing): Likewise.
2873         (elf_backend_emit_relocs): Likewise.
2874         (elf_backend_want_plt_sym): Likewise.
2875         (ELF_MAXPAGESIZE): Likewise.
2876         (elf_backend_may_use_rel_p): Minor formatting tweak.
2877         (elf_backend_may_use_rela_p): Likewise.
2878         (elf_backend_default_use_rela_p): Likewise.
2879         (elf_backend_rela_normal): Likewise.
2880         * Makefile.in (elf32-arm.lo): Depend on elf-vxworks.h.
2881
2882 2006-03-06  Nathan Sidwell  <nathan@codesourcery.com>
2883
2884         * archures.c (bfd_mach_mcf_isa_a_nodiv, bfd_mach_mcf_isa_b_nousp):
2885         New.  Adjust other variants.
2886         (bfd_default_scan): Update.
2887         * bfd-in2.h: Rebuilt.
2888         * cpu-m68k.c: Adjust.
2889         (bfd_m68k_compatible): New. Use it for architectures.
2890         * elf32-m68k.c (elf32_m68k_object_p): Adjust.
2891         (elf32_m68k_merge_private_bfd_data): Adjust.  Correct isa-a/b
2892         mismatch.
2893         (elf32_m68k_print_private_bfd_data): Adjust.
2894         * ieee.c (ieee_write_processor): Adjust.
2895
2896 2006-03-06  Alan Modra  <amodra@bigpond.net.au>
2897
2898         * dwarf2.c: Formatting.
2899         (add_line_info): Remove outer loop.
2900
2901 2006-03-05  H.J. Lu  <hongjiu.lu@intel.com>
2902             Alan Modra  <amodra@bigpond.net.au>
2903
2904         PR binutils/2338
2905         * dwarf2.c (loadable_section): New struct.
2906         (dwarf2_debug): Add loadable_section_count and
2907         loadable_sections.
2908         (new_line_sorts_after): New.
2909         (add_line_info): Use new_line_sorts_after to compare line
2910         addresses.
2911         (check_function_name): Removed.
2912         (unset_sections): New.
2913         (place_sections): New.
2914         (_bfd_dwarf2_find_nearest_line): Updated. Call place_sections
2915         and unset_sections on relocatable files.
2916         (_bfd_dwarf2_find_line): Likewise.
2917
2918 2006-03-03  Nick Clifton  <nickc@redhat.com>
2919
2920         * cpu-avr.c: Update to ISO-C90 formatting.
2921         * elf32-avr.c: Likewise.
2922
2923 2006-03-03  Bjoern Haase  <bjoern.m.haase@web.de>
2924
2925         * elf32-avr.c (avr_reloc_map): Insert BFD_RELOC_AVR_MS8_LDI
2926         and R_AVR_MS8_LDI
2927         (bfd_elf_avr_final_write_processing): Set
2928         EF_AVR_LINKRELAX_PREPARED in e_flags field.
2929         (elf32_avr_relax_section): New function.
2930         (elf32_avr_relax_delete_bytes): New function.
2931         (elf32_avr_get_relocated_section_contents): New function.
2932         (avr_pc_wrap_around): New function.
2933         (avr_relative_distance_considering_wrap_around): New function.
2934         (avr_final_link_relocate): Handle negative int8t_t immediate for R_AVR_LDI.
2935         * reloc.c: Add BFD_RELOC_AVR_MS8_LDI and BFD_RELOC_AVR_LDI_NEG
2936         * libbfd.h: Regenerate.
2937         * bfd-in2.h: Regenerate.
2938
2939 2006-03-02  DJ Delorie  <dj@redhat.com>
2940
2941         * elf32-m32c.c (m32c_offset_for_reloc): Fix local symbol
2942         calculations.
2943
2944 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
2945
2946         * elf32-ppc.c (is_ppc_elf_target): Return true if the target is
2947         bfd_elf32_powerpc_vxworks_vec.
2948
2949 2006-03-02  Nick Clifton  <nickc@redhat.com>
2950
2951         * elf32-m32c.c (m32c_elf_relax_section): Initialise 'gap'.
2952
2953 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
2954
2955         * elf32-i386.c (elf_i386_create_dynamic_sections): Use
2956         elf_vxworks_create_dynamic_sections.
2957         (elf_i386_size_dynamic_sections): Remove VxWorks GOT and PLT
2958         symbol handling.
2959         * elf32-ppc.c (ppc_elf_create_dynamic_sections): Use
2960         elf_vxworks_create_dynamic_sections.
2961         (ppc_elf_size_dynamic_sections): Remove VxWorks GOT and PLT
2962         symbol handling.
2963         * elf-vxworks.c (elf_vxworks_create_dynamic_sections): New function.
2964         * elf-vxworks.h (elf_vxworks_create_dynamic_sections): Declare.
2965
2966 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
2967
2968         * elf32-i386.c (elf_i386_vxworks_link_output_symbol_hook): Delete.
2969         (elf_backend_link_output_symbol_hook): Use
2970         elf_vxworks_link_output_symbol_hook instead.
2971         * elf32-ppc.c (elf_i386_vxworks_link_output_symbol_hook): Delete.
2972         (elf_backend_link_output_symbol_hook): Use
2973         elf_vxworks_link_output_symbol_hook instead.
2974         * elf-vxworks.c (elf_vxworks_link_output_symbol_hook): Provide the
2975         same interface as elf_backend_link_output_symbol_hook.
2976         * elf-vxworks.h (elf_vxworks_link_output_symbol_hook): Update
2977         prototype accordingly.
2978
2979 2006-03-02  Richard Sandiford  <richard@codesourcery.com>
2980
2981         * elf32-ppc.c (ppc_elf_plt_type): New enumeration.
2982         (ppc_elf_link_hash_table): Replace old_got and new_got with
2983         plt_type and can_use_new_plt.
2984         (ppc_elf_create_dynamic_sections): Add SEC_HAS_CONTENTS,
2985         SEC_LOAD and SEC_READONLY to the VxWorks .plt flags.
2986         (ppc_elf_check_relocs): Set can_use_new_plt instead of new_plt.
2987         Move from plt_type == PLT_UNSET to PLT_OLD instead of setting old_plt.
2988         (ppc_elf_select_plt_layout): Move from plt_type == PLT_UNSET to
2989         either plt_type == PLT_OLD or plt_type == PLT_NEW.  Assert that
2990         this function should not be called for VxWorks targets.
2991         (ppc_elf_tls_setup): Use plt_type instead of old_got.
2992         (allocate_got): Likewise.  Rearrange so that max_before_header
2993         is only used for PLT_OLD and PLT_NEW.
2994         (allocate_dynrelocs): Use plt_type instead of old_got and is_vxworks.
2995         (ppc_elf_size_dynamic_sections): Likewise.
2996         (ppc_elf_relax_section): Likewise.
2997         (ppc_elf_relocate_section): Likewise.
2998         (ppc_elf_finish_dynamic_symbol): Likewise.
2999         (ppc_elf_vxworks_link_hash_table_create): Initialize plt_type.
3000
3001 2006-02-28  Richard Sandiford  <richard@codesourcery.com>
3002
3003         * elf32-i386.c (elf_i386_link_hash_table): Add next_tls_desc_index.
3004         (elf_i386_link_hash_table_create): Initialize it.
3005         (elf_i386_compute_jump_table_size): Use it instead of
3006         srelplt->reloc_count.
3007         (allocate_dynrelocs): Likewise.
3008         (elf_i386_size_dynamic_sections): Likewise.
3009         (elf_i386_relocate_section): Likewise.
3010
3011 2006-02-27  Jakub Jelinek  <jakub@redhat.com>
3012
3013         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Handle S flag.
3014         (_bfd_elf_write_section_eh_frame): Likewise.
3015
3016 2006-02-27  Carlos O'Donell  <carlos@codesourcery.com>
3017
3018         * po/Make-in: Add html target.
3019
3020 2006-02-27  Richard Sandiford  <richard@codesourcery.com>
3021
3022         * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_symbol): Use the
3023         cached hgot entry to check for _GLOBAL_OFFSET_TABLE_.
3024         * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Likewise.
3025         * elf32-bfin.c (bfin_finish_dynamic_symbol): Likewise.
3026         * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
3027         * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
3028         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
3029         * elf32-m32r.c (m32r_elf_finish_dynamic_symbol): Likewise.
3030         * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): Likewise.
3031         * elf32-sh.c (sh_elf_finish_dynamic_symbol): Likewise.
3032         * elf32-vax.c (elf_vax_finish_dynamic_symbol): Likewise.
3033         * elf32-xtensa.c (elf_xtensa_finish_dynamic_symbol): Likewise.
3034         * elf64-sh64.c (sh64_elf64_finish_dynamic_symbol): Likewise.
3035         * elf64-x86-64.c (elf64_x86_64_finish_dynamic_symbol): Likewise.
3036         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Likewise.
3037         * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.  Also use
3038         the cached hplt entry to check for _PROCEDURE_LINKAGE_TABLE_.
3039         * elf64-alpha.c (elf64_alpha_finish_dynamic_symbol): Likewise.
3040         * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3041         * elfxx-ia64.c (elfNN_ia64_finish_dynamic_symbol): Likewise.
3042         * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
3043
3044 2006-02-25  Richard Sandiford  <richard@codesourcery.com>
3045
3046         * elf-bfd.h (elf_link_hash_table): Add hplt field.
3047         * elflink.c (_bfd_elf_create_dynamic_sections): Initialize it.
3048         * elf-m10300.c (_bfd_mn10300_elf_create_got_section): Likewise.
3049         * elf32-frv.c (_frv_create_got_section): Likewise.
3050         * elf32-m32r.c (m32r_elf_create_dynamic_sections): Likewise.
3051         * elf32-sh.c (sh_elf_create_dynamic_sections): Likewise.
3052         * elf64-alpha.c (elf64_alpha_create_dynamic_sections): Likewise.
3053         * elf64-sh64.c (sh64_elf64_create_dynamic_sections): Likewise.
3054         * elf32-i386.c (elf_i386_link_hash_table): Remove hgot and hplt.
3055         (elf_i386_link_hash_table_create): Don't initialize them.
3056         (elf_i386_size_dynamic_sections): Use the generic ELF hplt and
3057         hgot fields.
3058         (elf_i386_finish_dynamic_symbol): Likewise.
3059         * elf32-ppc.c (ppc_elf_link_hash_table): Remove hplt.
3060         (ppc_elf_size_dynamic_sections): Use the generic ELF hplt fields.
3061         (ppc_elf_finish_dynamic_symbol): Likewise.
3062
3063 2006-02-24  DJ Delorie  <dj@redhat.com>
3064
3065         * elf32-m32c.c (m32c_elf_howto_table): Add relaxation relocs.
3066         (m32c_elf_relocate_section): Don't relocate them.
3067         (compare_reloc): New.
3068         (relax_reloc): Remove.
3069         (m32c_offset_for_reloc): New.
3070         (m16c_addr_encodings): New.
3071         (m16c_jmpaddr_encodings): New.
3072         (m32c_addr_encodings): New.
3073         (m32c_elf_relax_section): Relax jumps and address displacements.
3074         (m32c_elf_relax_delete_bytes): Adjust for internal syms.  Fix up
3075         short jumps.
3076
3077         * reloc.c: Add m32c relax relocs.
3078         * libbfd.h: Regenerate.
3079         * bfd-in2.h: Regenerate.
3080
3081 2006-02-24  H.J. Lu  <hongjiu.lu@intel.com>
3082
3083         PR ld/2218
3084         * elf-bfd.h (elf_backend_data): Add elf_backend_fixup_symbol.
3085         (_bfd_elf_link_hash_fixup_symbol): New.
3086
3087         * elflink.c (_bfd_elf_link_hash_fixup_symbol): New.
3088         (_bfd_elf_fix_symbol_flags): Call elf_backend_fixup_symbol if
3089         it isn't NULL.
3090
3091         * elfxx-ia64.c (elf_backend_fixup_symbol): Defined.
3092
3093         * elfxx-target.h (elf_backend_fixup_symbol): New.
3094         (elfNN_bed): Initialize elf_backend_fixup_symbol.
3095
3096 2006-02-23  H.J. Lu  <hongjiu.lu@intel.com>
3097
3098         * cpu-ia64-opc.c (ins_immu5b): New.
3099         (ext_immu5b): Likewise.
3100         (elf64_ia64_operands): Add IMMU5b.
3101
3102 2006-02-21  Alan Modra  <amodra@bigpond.net.au>
3103
3104         PR ld/2218
3105         * elf32-arm.c (allocate_dynrelocs): Ensure undef weak sym in pie
3106         is dynamic.
3107         * elf32-hppa.c (allocate_dynrelocs): Likewise.
3108         * elf32-i386.c (allocate_dynrelocs): Likewise.
3109         * elf32-s390.c (allocate_dynrelocs): Likewise.
3110         * elf32-sh.c (allocate_dynrelocs): Likewise.
3111         * elf64-s390.c (allocate_dynrelocs): Likewise.
3112         * elf64-x86-64.c (allocate_dynrelocs): Likewise.
3113         * elf32-m32r.c (allocate_dynrelocs): Likewise.  Discard relocs
3114         on undef weak with non-default visibility too.
3115         * elfxx-sparc.c (allocate_dynrelocs): Ditto.
3116
3117 2006-02-21  Alan Modra  <amodra@bigpond.net.au>
3118
3119         * bfd.c: (_bfd_default_error_handler): Don't call abort on
3120         error, instead call _exit.
3121         (_bfd_abort): Call _exit not xexit.
3122
3123 2006-02-17  Kevin Buettner  <kevinb@redhat.com>
3124
3125         * elf32-frv.c (elf32_frv_grok_prstatus, elf32_frv_grok_psinfo):
3126         New functions.
3127         * elf_backend_grok_prstatus, elf_backend_grok_psinfo): Define.
3128
3129 2006-02-17  Shrirang Khisti  <shrirangk@kpitcummins.com>
3130             Anil Paranjape  <anilp1@kpitcummins.com>
3131             Shilin Shakti  <shilins@kpitcummins.com>
3132
3133         * Makefile.am: Add xc16x related entry
3134         * Makefile.in: Regenerate
3135         * archures.c: Add bfd_xc16x_arch
3136         * bfd-in2.h: Regenerate
3137         * config.bfd: Add xc16x-*-elf
3138         * configure.in: Add bfd_elf32_xc16x_vec
3139         * configure: Regenerate.
3140         * targets.c: Added xc16x related information
3141         * cpu-xc16x.c: New file
3142         * reloc.c: Add new relocations specific to xc16x:
3143         BFD_RELOC_XC16X_PAG, BFD_RELOC_XC16X_POF, BFD_RELOC_XC16X_SEG,
3144         BFD_RELOC_XC16X_SOF
3145         * elf32-xc16x.c: New file.
3146
3147 2006-02-17  Alan Modra  <amodra@bigpond.net.au>
3148
3149         * elf32-ppc.c (allocate_dynrelocs): Tweak undef weak handling.
3150         * elf64-ppc.c (allocate_dynrelocs): Likewise.
3151
3152 2006-02-17  Alan Modra  <amodra@bigpond.net.au>
3153
3154         PR ld/2218
3155         * elf64-ppc.c (allocate_dynrelocs): Ensure undef weak sym is
3156         dynamic.
3157         (ppc64_elf_relocate_section): Check output reloc section size.
3158         * elf32-ppc.c (allocate_dynrelocs): Simplify undef weak test.
3159
3160 2006-02-16  H.J. Lu  <hongjiu.lu@intel.com>
3161
3162         PR ld/2322
3163         * elf.c (get_segment_type): New function.
3164         (_bfd_elf_print_private_bfd_data): Use it.
3165         (print_segment_map): New function.
3166         (assign_file_positions_for_segments): Call print_segment_map
3167         when there are not enough room for program headers.
3168
3169 2006-02-16  Nick Hudson  <nick.hudson@dsl.pipex.com>
3170
3171         * config.bfd (mips*el-*-netbsd*, mips*-*-netbsd*): Use
3172         traditional MIPS ELF targets.
3173
3174 2006-02-15  H.J. Lu  <hongjiu.lu@intel.com>
3175
3176         PR binutils/2338
3177         * dwarf2.c (check_function_name): New function.
3178         (_bfd_dwarf2_find_nearest_line): Use check_function_name to
3179         check if function is correct.
3180
3181 2006-02-16  Alan Modra  <amodra@bigpond.net.au>
3182
3183         * elflink.c (_bfd_elf_default_action_discarded): Return 0 for
3184         debug sections.
3185         (elf_link_input_bfd): Adjust comments.
3186
3187 2006-02-10  H.J. Lu  <hongjiu.lu@intel.com>
3188
3189         * elf.c (copy_private_bfd_data): Minor update.
3190
3191 2006-02-10  H.J. Lu  <hongjiu.lu@intel.com>
3192
3193         PR binutils/2258
3194         * elf.c (copy_private_bfd_data): Renamed to ...
3195         (rewrite_elf_program_header): This.
3196         (copy_elf_program_header): New function.
3197         (copy_private_bfd_data): Likewise.
3198
3199 2006-02-07  Nathan Sidwell  <nathan@codesourcery.com>
3200
3201         * archures.c (bfd_mach_mcf5200, bfd_mach_mcf5206e,
3202         bfd_mach_mcf5307, bfd_mach_mcf5407, bfd_mach_mcf528x,
3203         bfd_mach_mcfv4e, bfd_mach_mcf521x, bfd_mach_mcf5249,
3204         bfd_mach_mcf547x, bfd_mach_mcf548x): Remove.
3205         (bfd_mach_mcf_isa_a, bfd_mach_mcf_isa_a_div,
3206         bfd_mach_mcf_isa_a_div_mac, bfd_mach_mcf_isa_a_div_emac,
3207         bfd_mach_mcf_isa_aplus, bfd_mach_mcf_isa_aplus_mac,
3208         bfd_mach_mcf_isa_aplus_emac, bfd_mach_mcf_isa_aplus_usp,
3209         bfd_mach_mcf_isa_aplus_usp_mac, bfd_mach_mcf_isa_aplus_usp_emac,
3210         bfd_mach_mcf_isa_b, bfd_mach_mcf_isa_b_mac, bfd_mach_mcf_isa_b_emac,
3211         bfd_mach_mcf_isa_b_usp_float, bfd_mach_mcf_isa_b_usp_float_mac,
3212         bfd_mach_mcf_isa_b_usp_float_emac): New.
3213         (bfd_default_scan): Update coldfire mapping.
3214         * bfd-in.h (bfd_m68k_mach_to_features,
3215         bfd_m68k_features_to_mach): Declare.
3216         * bfd-in2.h: Rebuilt.
3217         * cpu-m68k.c (arch_info_struct): Add new coldfire machines,
3218         adjust legacy names.
3219         (m68k_arch_features): New.
3220         (bfd_m68k_mach_to_features,
3221         bfd_m68k_features_to_mach): Define.
3222         * elf32-m68k.c (elf32_m68k_object_p): New.
3223         (elf32_m68k_merge_private_bfd_data): Merge the CF EF flags.
3224         (elf32_m68k_print_private_bfd_data): Print the CF EF flags.
3225         (elf_backend_object_p): Define.
3226         * ieee.c (ieee_write_processor): Update coldfire machines.
3227         * libbfd.h: Rebuilt.
3228
3229 2006-02-06  Steve Ellcey  <sje@cup.hp.com>
3230
3231         * elfxx-ia64.c (elfNN_ia64_fake_sections): Set SHF_IA_64_HP_TLS
3232         if SHF_TLS is set.
3233
3234 2006-02-05  Arnold Metselaar  <arnold.metselaar@planet.nl>
3235
3236         * coff-z80.c (r_imm24): New howto.
3237         (rtype2howto): New case R_IMM24.
3238         (coff_z80_reloc_type_lookup): New case BFD_RELOC_24.
3239         (extra_case): Use bfd_get_8 for R_IMM8, new case R_IMM24.
3240
3241 2006-02-04  Richard Sandiford  <richard@codesourcery.com>
3242
3243         * elfxx-mips.c (mips_elf_initialize_tls_index): If a TLS symbol
3244         has already been assigned a GOT index, copy that index to the
3245         current hash table entry.
3246
3247 2006-02-01  Eric Botcazou  <ebotcazou@libertysurf.fr>
3248
3249         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass
3250         for call-to-undefweak reloc overflow.
3251
3252 2006-01-31  Eric Botcazou  <ebotcazou@libertysurf.fr>
3253
3254         * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Reinstate bypass
3255         for 32-bit relocs overflow.
3256
3257 2006-01-27  Paul Brook  <paul@codesourcery.com>
3258
3259         * elf32-arm.c (elf32_arm_get_symbol_type): Allow STT_TLS thumb
3260         objects.
3261
3262 2006-01-18  Alexandre Oliva  <aoliva@redhat.com>
3263
3264         Introduce TLS descriptors for i386 and x86_64.
3265         * reloc.c (BFD_RELOC_386_TLS_GOTDESC, BFD_RELOC_386_TLS_DESC,
3266         BFD_RELOC_386_TLS_DESC_CALL, BFD_RELOC_X86_64_GOTPC32_TLSDESC,
3267         BFD_RELOC_X86_64_TLSDESC, BFD_RELOC_X86_64_TLSDESC_CALL): New.
3268         * libbfd.h, bfd-in2.h: Rebuilt.
3269         * elf32-i386.c (elf_howto_table): New relocations.
3270         (R_386_tls): Adjust.
3271         (elf_i386_reloc_type_lookup): Map new relocations.
3272         (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros.
3273         (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros.
3274         (struct elf_i386_link_hash_entry): Add tlsdesc_got field.
3275         (struct elf_i386_obj_tdata): Add local_tlsdesc_gotent field.
3276         (elf_i386_local_tlsdesc_gotent): New macro.
3277         (struct elf_i386_link_hash_table): Add sgotplt_jump_table_size.
3278         (elf_i386_compute_jump_table_size): New macro.
3279         (link_hash_newfunc): Initialize tlsdesc_got.
3280         (elf_i386_link_hash_table_create): Set sgotplt_jump_table_size.
3281         (elf_i386_tls_transition): Handle R_386_TLS_GOTDESC and
3282         R_386_TLS_DESC_CALL.
3283         (elf_i386_check_relocs): Likewise.  Allocate space for
3284         local_tlsdesc_gotent.
3285         (elf_i386_gc_sweep_hook): Handle R_386_TLS_GOTDESC and
3286         R_386_TLS_DESC_CALL.
3287         (allocate_dynrelocs): Count function PLT relocations.  Reserve
3288         space for TLS descriptors and relocations.
3289         (elf_i386_size_dynamic_sections): Reserve space for TLS
3290         descriptors and relocations.  Set up sgotplt_jump_table_size.
3291         Don't zero reloc_count in srelplt.
3292         (elf_i386_always_size_sections): New.  Set up _TLS_MODULE_BASE_.
3293         (elf_i386_relocate_section): Handle R_386_TLS_GOTDESC and
3294         R_386_TLS_DESC_CALL.
3295         (elf_i386_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P.
3296         (elf_backend_always_size_sections): Define.
3297         * elf64-x86-64.c (x86_64_elf_howto): Add R_X86_64_GOTPC32_TLSDESC,
3298         R_X86_64_TLSDESC, R_X86_64_TLSDESC_CALL.
3299         (R_X86_64_standard): Adjust.
3300         (x86_64_reloc_map): Map new relocs.
3301         (elf64_x86_64_rtype_to_howto): New, split out of...
3302         (elf64_x86_64_info_to_howto): ... this function, and...
3303         (elf64_x86_64_reloc_type_lookup): ... use it to map elf_reloc_val.
3304         (GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P): New macros.
3305         (GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): New macros.
3306         (struct elf64_x86_64_link_hash_entry): Add tlsdesc_got field.
3307         (struct elf64_x86_64_obj_tdata): Add local_tlsdesc_gotent field.
3308         (elf64_x86_64_local_tlsdesc_gotent): New macro.
3309         (struct elf64_x86_64_link_hash_table): Add tlsdesc_plt,
3310         tlsdesc_got and sgotplt_jump_table_size fields.
3311         (elf64_x86_64_compute_jump_table_size): New macro.
3312         (link_hash_newfunc): Initialize tlsdesc_got.
3313         (elf64_x86_64_link_hash_table_create): Initialize new fields.
3314         (elf64_x86_64_tls_transition): Handle R_X86_64_GOTPC32_TLSDESC and
3315         R_X86_64_TLSDESC_CALL.
3316         (elf64_x86_64_check_relocs): Likewise.  Allocate space for
3317         local_tlsdesc_gotent.
3318         (elf64_x86_64_gc_sweep_hook): Handle R_X86_64_GOTPC32_TLSDESC and
3319         R_X86_64_TLSDESC_CALL.
3320         (allocate_dynrelocs): Count function PLT relocations.  Reserve
3321         space for TLS descriptors and relocations.
3322         (elf64_x86_64_size_dynamic_sections): Reserve space for TLS
3323         descriptors and relocations.  Set up sgotplt_jump_table_size,
3324         tlsdesc_plt and tlsdesc_got.  Make room for them.  Don't zero
3325         reloc_count in srelplt.  Add dynamic entries for DT_TLSDESC_PLT
3326         and DT_TLSDESC_GOT.
3327         (elf64_x86_64_always_size_sections): New.  Set up
3328         _TLS_MODULE_BASE_.
3329         (elf64_x86_64_relocate_section): Handle R_386_TLS_GOTDESC and
3330         R_386_TLS_DESC_CALL.
3331         (elf64_x86_64_finish_dynamic_symbol): Use GOT_TLS_GD_ANY_P.
3332         (elf64_x86_64_finish_dynamic_sections): Set DT_TLSDESC_PLT and
3333         DT_TLSDESC_GOT.  Set up TLS descriptor lazy resolver PLT entry.
3334         (elf_backend_always_size_sections): Define.
3335
3336 2006-01-17  H.J. Lu  <hongjiu.lu@intel.com>
3337
3338         PR binutils/2096
3339         * dwarf2.c (comp_unit_contains_address): Update comment.
3340         (_bfd_dwarf2_find_nearest_line): Use section's vma, instead of
3341         lma.  Return TRUE only if both comp_unit_contains_address and
3342         comp_unit_find_nearest_line return TRUE.
3343         (_bfd_dwarf2_find_line): Use section's vma, instead of lma.
3344
3345 2006-01-18  Alan Modra  <amodra@bigpond.net.au>
3346
3347         * elf-bfd.h (struct elf_backend_data): Add gc_mark_dynamic_ref.
3348         (bfd_elf_gc_mark_dynamic_ref_symbol): Declare.
3349         * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Rename from
3350         elf_gc_mark_dynamic_ref_symbol.  Make global.
3351         (bfd_elf_gc_sections): Call bed->gc_mark_dynamic_ref.
3352         * elfxx-target.h (elf_backend_gc_mark_dynamic_ref): Define.
3353         (elfNN_bed): Init new field.
3354         * elf64-ppc.c (elf_backend_gc_mark_dynamic_ref): Define.
3355         (ppc64_elf_gc_mark_dynamic_ref): New function.
3356
3357 2006-01-17  Alan Modra  <amodra@bigpond.net.au>
3358
3359         * elf64-ppc.c (ppc64_elf_gc_mark_hook): Don't hang forever in loop.
3360
3361 2006-01-17  Nick Clifton  <nickc@redhat.com>
3362
3363         PR binutils/2159
3364         * elf.c (elfcore_write_pstatus): Add ATTRIBUTE_UNUSED to unused
3365         parameters.
3366
3367 2006-01-11  Nick Clifton  <nickc@redhat.com>
3368
3369         * elf32-arm.c (elf32_arm_output_symbol_hook): Install new entry
3370         into the newly (re)allocated map array.
3371
3372 2006-01-09  Alexis Wilke  <alexis_wilke@yahoo.com>
3373
3374         * peXXigen.c (tbl): Add comma after "HIGH3ADJ".
3375
3376 2006-01-01  Jakub Jelinek  <jakub@redhat.com>
3377
3378         * elf64-ppc.c (ppc64_elf_action_discarded): Return 0
3379         for .toc1 section.
3380
3381 For older changes see ChangeLog-2005
3382 \f
3383 Local Variables:
3384 mode: change-log
3385 left-margin: 8
3386 fill-column: 74
3387 version-control: never
3388 End: