* coffcode.h (sec_to_styp_flags): Handle
[external/binutils.git] / bfd / ChangeLog
1 2011-09-27  Kai Tietz  <ktietz@redhat.com>
2
3         * coffcode.h (sec_to_styp_flags): Handle
4         SEC_LINK_DUPLICATES_SAME_CONTENTS, and
5         SEC_LINK_DUPLICATES_SAME_SIZE.
6
7 2011-09-22  Tristan Gingold  <gingold@adacore.com>
8
9         * configure.in: Bump version to 2.22.51
10         * configure: Regenerate.
11
12 2011-09-21  David S. Miller  <davem@davemloft.net>
13
14         * elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): New.
15         * elfxx-sparc.h: Declare it.
16         * elf32-sparc.c (elf32_sparc_merge_private_bfd_data): Call it.
17         * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
18
19 2011-09-21  Tristan Gingold  <gingold@adacore.com>
20
21         * mach-o.c (bfd_mach_o_convert_section_name_to_bfd): Add comment.
22         Deals with size limited strings.
23         (bfd_mach_o_build_commands): Initialize more fields.
24
25 2011-09-15  H.J. Lu  <hongjiu.lu@intel.com>
26
27         PR ld/13177
28         * elflink.c (elf_gc_sweep_symbol): Also hide symbols without PLT
29         nor GOT references.
30
31 2011-09-15  H.J. Lu  <hongjiu.lu@intel.com>
32
33         PR ld/12975
34         * bfd-in.h (bfd_elf_size_dynamic_sections): Remove pointer
35         to struct bfd_elf_version_tree.
36
37         * elflink.c (elf_info_failed): Remove verdefs.
38         (_bfd_elf_export_symbol): Updated.
39         _bfd_elf_link_assign_sym_version): Likewise.
40         (bfd_elf_size_dynamic_sections): Remove pointer to struct
41         bfd_elf_version_tree.  Updated.
42         (bfd_elf_gc_mark_dynamic_ref_symbol): Check if a symbol is hidden
43         by linker script.
44
45         * linker.c (bfd_hide_sym_by_version): New.
46
47         * bfd-in2.h: Regenerated.
48
49 2011-09-12  H.J. Lu  <hongjiu.lu@intel.com>
50
51         PR ld/13178
52         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Use .got.plt
53         if there are no GOT relocations.
54
55 2011-09-09  Kai Tietz  <ktietz@redhat.com>
56
57         * peicode.h (pe_ILF_build_a_bfd): Don't remove leading underscore
58         for targets without symbol_leading_char.
59
60 2011-09-08  Bernd Jendrissek  <bernd.jendrissek@gmail.com>
61
62         * bfdwin.c (bfd_get_file_window): Fix memory leak.
63
64 2011-09-07  Alan Modra  <amodra@gmail.com>
65
66         PR ld/13131
67         * bfd/elf64-ppc.c (adjust_toc_syms): Ensure ppc64_elf_howto_table
68         is initialized.
69
70 2011-09-06  Alan Modra  <amodra@gmail.com>
71
72         PR ld/13131
73         * elf64-ppc.c (adjust_toc_syms): Delete redundant code.
74         (ppc64_elf_edit_toc): Fix style nit.  Report some details
75         on linker failure due to reference in debug or non-alloc
76         sections to optimized away toc entry, and don't abort.
77
78 2011-09-01  Christophe Lyon  <christophe.lyon@st.com>
79
80         * elf32-arm.c (elf32_arm_output_arch_local_syms): Skip excluded
81         sections.
82
83 2011-08-26  Nick Clifton  <nickc@redhat.com>
84
85         * po/es.po: Updated Spanish translation.
86
87 2011-08-19  Alan Modra  <amodra@gmail.com>
88
89         * elf64-ppc.c (ppc64_elf_edit_toc): Ignore can_optimize bit if
90         we haven't seen expected -mcmodel=medium/large code relocs.
91
92 2011-08-18  Tristan Gingold  <gingold@adacore.com>
93
94         * mach-o.c (bfd_mach_o_read_segment): Initialize list.
95
96 2011-08-17  Tristan Gingold  <gingold@adacore.com>
97
98         * mach-o.c (bfd_mach_o_write_section_32): Fix typo.
99
100 2011-08-17  Alan Modra  <amodra@gmail.com>
101
102         PR ld/12762
103         * bfd-in.h (struct bfd_section_already_linked): Forward declare.
104         (_bfd_handle_already_linked): Declare.
105         * coff-alpha.c (_bfd_ecoff_section_already_linked): Define as
106         _bfd_coff_section_already_linked.
107         * coff-mips.c (_bfd_ecoff_section_already_linked): Likewise.
108         * coffcode.h (coff_section_already_linked): Likewise.
109         * cofflink.c (coff_link_add_symbols): Revert 2011-07-09 changes.
110         * elf-bfd.h: Likewise.
111         * libbfd-in.h: Likewise.
112         * targets.c: Likewise.
113         * linker.c (bfd_section_already_linked): Likewise.
114         (bfd_section_already_linked_table_lookup): Likewise.
115         (bfd_section_already_linked_table_insert): Likewise.
116         (_bfd_generic_section_already_linked): Likewise.  Call
117         _bfd_handle_already_linked.
118         (_bfd_handle_already_linked): New function, split out from..
119         * elflink.c (_bfd_elf_section_already_linked): ..here.  Revert
120         2011-07-09 changes.  Avoid unnecessary strcmp when matching
121         already_linked_list entries.  Match plugin linkonce section.
122         (section_signature): Delete.
123         * coffgen.c (_bfd_coff_section_already_linked): New function.
124         * libcoff-in.h (_bfd_coff_section_already_linked): Declare.
125         * libbfd.h: Regenerate.
126         * libcoff.h: Regenerate.
127         * bfd-in2.h: Regenerate.
128
129 2011-08-14  Alan Modra  <amodra@gmail.com>
130
131         * elf32-ppc.c (ppc_elf_select_plt_layout): Force bss-plt when
132         shared and call to _mcount will go via plt.
133
134 2011-08-14  Alan Modra  <amodra@gmail.com>
135
136         * elf64-ppc.c: Prefix all einfo error strings with "%P: ".
137         * elf32-ppc.c: Likewise.
138         (ppc_elf_select_plt_layout): Use einfo rather than info to report
139         forced bss-plt.
140
141 2011-08-12  H.J. Lu  <hongjiu.lu@intel.com>
142
143         PR ld/13082
144         * elf64-x86-64.c (x86_64_elf_howto_table): Add R_X86_64_RELATIVE64.
145         (elf_x86_64_relocate_section): Treat R_X86_64_64 like R_X86_64_32
146         and zero-extend it to 64bit if addend is zero for x32.  Generate
147         R_X86_64_RELATIVE64 for x32.
148
149 2011-08-09  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
150
151         * bfd-in.h (bfd_elf32_arm_set_target_relocs): Update prototype.
152         * bfd-in2.h (bfd_elf32_arm_set_target_relocs): Likewise.
153         * elf32-arm.c (elf32_arm_link_hash_table): New field.
154         (elf232_arm_link_hash_table_create): Initialise new field.
155         (check_use_blx): Change test depending on fix_arm1176.
156         (bfd_elf32_arm_set_target_relocs): Set fix_arm1176 from
157         command line options.
158
159 2011-08-08  Tristan Gingold  <gingold@adacore.com>
160
161         * mach-o.c (struct mach_o_segment_name_xlat): Add comments.
162         (segsec_names_xlat): Reorder elements.
163         (bfd_mach_o_read_section_32): Fix typo.
164         (bfd_mach_o_read_section_64): Fix typo.
165
166 2011-08-08  Tristan Gingold  <gingold@adacore.com>
167
168         * mach-o.h (BFD_MACH_O_SEGNAME_SIZE): New macro.
169         (BFD_MACH_O_SECTNAME_SIZE): Ditto.
170         (bfd_mach_o_section): Use them.  Add next field.
171         (bfd_mach_o_segment_command): Replace sections array by
172         sect_head and sect_tail.
173         (bfd_mach_o_get_mach_o_section): New macro.
174         (bfd_mach_o_lookup_section): Remove.
175         (bfd_mach_o_new_section_hook): New function.
176         * mach-o.c (bfd_mach_o_normalize_section_name): Use strncmp
177         instead of strcmp.
178         (bfd_mach_o_convert_section_name_to_bfd): Replaces section
179         parameter with segname and sectname parameters.  Adjust.
180         (bfd_mach_o_append_section_to_segment): New function.  Use a
181         linked list for Mach-O sections.
182         (bfd_mach_o_write_segment_32): Adjust.
183         (bfd_mach_o_write_segment_64): Ditto.
184         (bfd_mach_o_build_commands): Fix comment.  Adjust.
185         (bfd_mach_o_flatten_sections): Adjust.
186         (bfd_mach_o_print_section_map): Adjust.
187         (bfd_mach_o_set_section_flags_from_bfd): Ditto.
188         (bfd_mach_o_new_section_hook): New function.
189         (bfd_mach_o_init_section_from_mach_o): Ditto.
190         (bfd_mach_o_read_section_32): Remove section parameter.
191         Return a section instead.
192         (bfd_mach_o_read_section_64): Ditto.
193         (bfd_mach_o_read_section): Ditto.
194         (bfd_mach_o_make_bfd_section): Adjust.
195         (bfd_mach_o_read_segment): Adjust for new profile of
196         bfd_mach_o_read_section.
197         (bfd_mach_o_lookup_section): Remove.
198         * mach-o-target.c (bfd_mach_o_new_section_hook): Remove.
199
200 2011-08-08  Tristan Gingold  <gingold@adacore.com>
201
202         * mach-o.h (bfd_mach_o_version_min_command): New structure.
203         (bfd_mach_o_load_command): Add version_min.
204         (mach_o_data_struct): Fix comment.
205         * mach-o.c (bfd_mach_o_read_version_min): New function.
206         (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_FUNCTION_STARTS,
207         BFD_MACH_O_LC_VERSION_MIN_MACOSX and
208         BFD_MACH_O_LC_VERSION_MIN_IPHONEOS.
209         (bfd_mach_o_get_name_or_null): New function.
210         (bfd_mach_o_get_name): Use the above new one.
211         (bfd_mach_o_load_command_name): Add the above new commands.
212         (bfd_mach_o_bfd_print_private_bfd_data): Display numerically
213         unknown commands.  Handle BFD_MACH_O_LC_FUNCTION_STARTS,
214         BFD_MACH_O_LC_VERSION_MIN_MACOSX and
215         BFD_MACH_O_LC_VERSION_MIN_IPHONEOS.
216
217 2011-08-08  Tristan Gingold  <gingold@adacore.com>
218
219         * mach-o.h: Move size macros to external.h
220         Move reloc macros to reloc.h and x86-64.h.
221         * mach-o-i386.c: Includes mach-o/reloc.h
222         * mach-o-x86-64.c: Ditto and includes mach-o/x86-64.h
223         * mach-o.c: Add includes.
224         (bfd_mach_o_write_header): Use structure from external.h to convert.
225         (bfd_mach_o_write_thread): Ditto.
226         (bfd_mach_o_write_relocs): Ditto.
227         (bfd_mach_o_write_section_32): Ditto.
228         (bfd_mach_o_write_section_64): Ditto.
229         (bfd_mach_o_write_segment_32): Ditto.
230         (bfd_mach_o_write_segment_64): Ditto.
231         (bfd_mach_o_write_symtab): Ditto.
232         (bfd_mach_o_write_contents): Ditto.
233         (bfd_mach_o_read_header): Ditto.
234         (bfd_mach_o_read_section_32): Ditto.
235         (bfd_mach_o_read_section_64): Ditto.
236         (bfd_mach_o_read_symtab_symbol): Ditto.
237         (bfd_mach_o_read_dylinker): Ditto.
238         (bfd_mach_o_read_dylib): Ditto.
239         (bfd_mach_o_read_dysymtab): Ditto.
240         (bfd_mach_o_read_symtab): Ditto.
241         (bfd_mach_o_read_linkedit): Ditto.
242         (bfd_mach_o_read_str): Ditto.
243         (bfd_mach_o_read_dyld_info): Ditto.
244         (bfd_mach_o_read_segment): Ditto.
245         (bfd_mach_o_read_command): Ditto.
246         (bfd_mach_o_archive_p): Ditto.
247         (bfd_mach_o_canonicalize_one_reloc): Ditto. Change the BUF parameter.
248         (bfd_mach_o_canonicalize_relocs): Adjust to call the above function.
249         (bfd_mach_o_read_dysymtab_symbol): Rename BUF variable.
250         (bfd_mach_o_read_uuid): Remove useless cast.  Use a macro instead
251         of an hard-coded value.
252
253 2011-08-08  Tristan Gingold  <gingold@adacore.com>
254
255         * mach-o-x86-64.c (bfd_mach_o_x86_64_mkobject): Fix cut-and-past typos.
256         (bfd_mach_o_x86_64_swap_reloc_out): Handle BFD_RELOC_32_PCREL,
257         BFD_RELOC_MACH_O_X86_64_SUBTRACTOR64 and
258         BFD_RELOC_MACH_O_X86_64_GOT_LOAD.  Share common code.
259
260 2011-08-08  Tristan Gingold  <gingold@adacore.com>
261
262         * mach-o.c (bfd_mach_o_normalize_section_name): New function.
263         (bfd_mach_o_convert_section_name_to_bfd): Use it.
264         (bfd_mach_o_get_section_type_from_name): New function.
265         (bfd_mach_o_get_section_attribute_from_name): Ditto.
266         * mach-o.h (bfd_mach_o_section): Move bfdsection field at the end.
267         Add comments.  Add prototypes for the above new functions.
268
269 2011-08-05  Mark Kettenis  <kettenis@gnu.org>
270
271         * netbsd-core.c (netbsd_core_vec): Init match_priority field.
272
273 2011-08-05  Alan Modra  <amodra@gmail.com>
274
275         * elf64-ppc.c (maybe_strip_output): New function.
276         (ppc64_elf_size_stubs): Use it to strip .branch_lt and .eh_frame.
277
278 2011-08-05  Alan Modra  <amodra@gmail.com>
279
280         PR ld/12762
281         * elflink.c (_bfd_elf_section_already_linked): Return matched
282         status.  Remove COFF comdat section handling.
283         * linker.c (_bfd_generic_section_already_linked): Return matched
284         status.  Don't set SEC_GROUP in l_flags for plugin entries.
285         (bfd_section_already_linked): Update prototype.
286         * targets.c (_section_already_linked): Likewise.
287         * elf-bfd.h (_bfd_elf_section_already_linked): Likewise.
288         * libbfd-in.h (_bfd_generic_section_already_linked): Likewise.
289         (_bfd_nolink_section_already_linked): Update.
290         * libbfd.h: Regenerate.
291         * bfd-in2.h: Regenerate.
292
293 2011-08-05  Alan Modra  <amodra@gmail.com>
294
295         * elf32-ppc.c: Include dwarf2.h.
296         (struct ppc_elf_link_hash_table): Add glink_eh_frame.
297         (ppc_elf_create_glink): Create .eh_frame section.
298         (glink_eh_frame_cie): New array.
299         (ppc_elf_size_dynamic_sections): Size glink_eh_frame.
300         (ppc_elf_finish_dynamic_sections): Write glink_eh_frame.
301
302 2011-08-04  Tristan Gingold  <gingold@adacore.com>
303
304         * vms-alpha.c (_bfd_vms_write_eeom): Round vms_linkage_index.
305         (_bfd_vms_write_etir): Initialize vms_linkage_index to 0.
306
307 2011-08-03  Tristan Gingold  <gingold@adacore.com>
308
309         * mach-o.c (bfd_mach_o_canonicalize_symtab): Handle no symbols case.
310         (bfd_mach_o_read_symtab_symbols): Return if no symbols.
311
312 2011-08-02  Maciej W. Rozycki  <macro@codesourcery.com>
313
314         * elfxx-mips.c (check_4byte_branch): Remove function.
315         (check_relocated_bzc): New function.
316         (_bfd_mips_elf_relax_section): Permit the relaxation of LUI
317         instructions that immediately follow a compact branch
318         instruction.
319
320 2011-08-02  Alan Modra  <amodra@gmail.com>
321
322         * elf64-ppc.c (build_plt_stub): Correct emitted relocs when no
323         plt_static_chain.
324         (ppc_build_one_stub): Adjust get_relocs call to suit..
325         (ppc_size_one_stub): ..and reloc sizing.  Correct plt size corner case.
326
327 2011-08-01  H.J. Lu  <hongjiu.lu@intel.com>
328
329         PR ld/13048
330         * archures.c (bfd_mach_i386_intel_syntax): New.
331         (bfd_mach_i386_i8086): Updated.
332         (bfd_mach_i386_i386): Likewise.
333         (bfd_mach_x86_64): Likewise.
334         (bfd_mach_x64_32): Likewise.
335         (bfd_mach_i386_i386_intel_syntax): Likewise.
336         (bfd_mach_x86_64_intel_syntax): Likewise.
337         (bfd_mach_x64_32_intel_syntax): Likewise.
338         (bfd_mach_l1om): Likewise.
339         (bfd_mach_l1om_intel_syntax): Likewise.
340         (bfd_mach_k1om): Likewise.
341         (bfd_mach_k1om_intel_syntax): Likewise.
342
343         * bfd-in2.h: Regenerated.
344
345         * cpu-i386.c (bfd_i386_compatible): Check mach instead of
346         bits_per_address.
347         (bfd_x64_32_arch_intel_syntax): Set bits_per_address to 64.
348         (bfd_x64_32_arch): Likewise.
349
350         * elf64-x86-64.c: Include "libiberty.h".
351         (x86_64_elf_howto_table): Append x32 R_X86_64_32.
352         (elf_x86_64_rtype_to_howto): Support x32 R_X86_64_32.
353         (elf_x86_64_reloc_type_lookup): Likewise.
354         (elf_x86_64_reloc_name_lookup): Likewise.
355         (elf_x86_64_relocate_section): Likewise.
356         (elf_x86_64_check_relocs): Allow R_X86_64_64 relocations for x32.
357
358 2011-07-29  Maciej W. Rozycki  <macro@codesourcery.com>
359
360         * elfxx-mips.c (check_br32): Fix return type.
361
362 2011-07-29  Maciej W. Rozycki  <macro@codesourcery.com>
363
364         * elfxx-mips.c (bz_insn_16): Correct opcode mask.
365
366 2011-07-29  Maciej W. Rozycki  <macro@codesourcery.com>
367
368         * elfxx-mips.c: Adjust comments throughout.
369         (mips_elf_relax_delete_bytes): Reshape code.
370         (_bfd_mips_elf_relax_section): Remove check for
371         R_MICROMIPS_GPREL16 relocations.  Reshape code.
372
373 2011-07-28  Roland McGrath  <mcgrathr@google.com>
374
375         * elf32-i386.c (NACL_PLT_ENTRY_SIZE, NACLMASK): New macros.
376         (elf_i386_nacl_plt0_entry): New variable.
377         (elf_i386_plt_entry): New variable.
378         (elf_i386_nacl_pic_plt0_entry): New variable.
379         (elf_i386_nacl_pic_plt_entry): New variable.
380         (elf_i386_nacl_plt, elf_i386_nacl_arch_bed): New variables.
381         (elf_backend_arch_data): New macro setting for elf_i386_nacl_vec stanza.
382         (elf_backend_plt_alignment): Likewise.
383
384         * config.bfd: Handle i[3-7]86-*-nacl*.
385         * elf32-i386.c (bfd_elf32_i386_nacl_vec): New backend vector stanza.
386         * targets.c: Support bfd_elf32_i386_nacl_vec.
387         * configure.in: Likewise.
388         * configure: Regenerated.
389
390         * elf32-i386.c (struct elf_i386_plt_layout): New type.
391         (GET_PLT_ENTRY_SIZE): New macro.
392         (elf_i386_plt): New variable.
393         (struct elf_i386_backend_data): New member `plt'.
394         (elf_i386_arch_bed): Add initializer for it.
395         (elf_i386_vxworks_arch_bed): Likewise.
396         (elf_i386_allocate_dynrelocs): Use GET_PLT_ENTRY_SIZE.
397         (elf_i386_plt_sym_val): Likewise.
398         (elf_i386_relocate_section): Likewise.
399         (elf_i386_finish_dynamic_symbol): Likewise.
400         Also use other elf_i386_plt_layout members for PLT details.
401         (elf_i386_finish_dynamic_sections): Likewise.
402
403         * elf32-i386.c (struct elf_i386_backend_data): New type.
404         (get_elf_i386_backend_data): New macro.
405         (elf_i386_arch_bed): New variable.
406         (elf_backend_arch_data): New macro.
407         (struct elf_i386_link_hash_table): Remove plt0_pad_byte and is_vxworks.
408         (elf_i386_link_hash_table_create): Don't initialize them.
409         (elf_i386_create_dynamic_sections): Find is_vxworks flags in
410         elf_i386_backend_data, not elf_i386_link_hash_table.
411         (elf_i386_adjust_dynamic_symbol): Likewise.
412         (elf_i386_allocate_dynrelocs): Likewise.
413         (elf_i386_readonly_dynrelocs): Likewise.
414         (elf_i386_size_dynamic_sections): Likewise.
415         (elf_i386_relocate_section): Likewise.
416         (elf_i386_finish_dynamic_symbol): Likewise.
417         (elf_i386_finish_dynamic_sections): Likewise.  Same for plt0_pad_byte.
418         (elf_i386_vxworks_link_hash_table_create): Function removed.
419         (elf_i386_vxworks_arch_bed): New variable.
420         (elf_backend_arch_data): New macro in elf32-i386-vxworks stanza.
421
422         * elf-bfd.h (elf_backend_data): New member arch_backend_data.
423         * elfxx-target.h (elf_backend_arch_data): New macro.
424         (elfNN_bed): Use it as initializer for the new member.
425
426 2011-07-28  Mikulas Patocka  <mikulas@artax.karlin.mff.cuni.cz>
427
428         * elf64-hppa.c (elf_hppa_final_link_relocate): Fix handling of out
429         of range branches.
430
431 2011-07-26  Jakub Jelinek  <jakub@redhat.com>
432
433         * dwarf2.c (dwarf_debug_sections): Add .debug_macro
434         and .zdebug_macro entry.
435         (dwarf_debug_section_enum): Add debug_macro.
436
437 2011-07-26  Alan Modra  <amodra@gmail.com>
438
439         * elf64-ppc.c: Include dwarf2.h.
440         (struct ppc_link_hash_table): Add glink_eh_frame.
441         (create_linkage_sections): Create .eh_frame section.
442         (ppc64_elf_size_dynamic_sections): Arrange to drop unneeded
443         glink_eh_frame.
444         (glink_eh_frame_cie): New array.
445         (ppc64_elf_size_stubs): Size glink_eh_frame.
446         (ppc64_elf_build_stubs): Init glink_eh_frame contents.
447         (ppc64_elf_finish_dynamic_sections): Write glink_eh_frame.
448
449 2011-07-25  Hans-Peter Nilsson  <hp@bitrange.com>
450
451         PR ld/12815
452         * elf64-mmix.c (struct _mmix_elf_section_data): New members
453         has_warned_bpo and has_warned_pushj.
454         (mmix_final_link_relocate): Remove PARAMS and PTR macros,
455         converting to ISO C.  Add new parameter error_message.  All
456         callers changed.
457         (mmix_elf_perform_relocation): Ditto.
458         <case R_MMIX_PUSHJ_STUBBABLE, case R_MMIX_BASE_PLUS_OFFSET>:
459         Handle the case where mmix_elf_check_common_relocs has not been
460         called, missing preparations for relocs of the respective type.
461
462 2011-07-24  Chao-ying Fu  <fu@mips.com>
463             Ilie Garbacea  <ilie@mips.com>
464             Maciej W. Rozycki  <macro@codesourcery.com>
465             Joseph Myers  <joseph@codesourcery.com>
466             Catherine Moore  <clm@codesourcery.com>
467             Richard Sandiford  <rdsandiford@googlemail.com>
468
469         * archures.c (bfd_mach_mips_micromips): New macro.
470         * cpu-mips.c (I_micromips): New enum value.
471         (arch_info_struct): Add bfd_mach_mips_micromips.
472         * elfxx-mips.h (_bfd_mips_elf_is_target_special_symbol): New
473         prototype.
474         (_bfd_mips_elf_relax_section): Likewise.
475         (_bfd_mips16_elf_reloc_unshuffle): Rename to...
476         (_bfd_mips_elf_reloc_unshuffle): ... this.  Handle microMIPS
477         ASE.
478         (_bfd_mips16_elf_reloc_shuffle): Rename to...
479         (_bfd_mips_elf_reloc_shuffle): ... this.  Handle microMIPS ASE.
480         (gprel16_reloc_p): Handle microMIPS ASE.
481         (literal_reloc_p): New function.
482         * elf32-mips.c (elf_micromips_howto_table_rel): New variable.
483         (_bfd_mips_elf32_gprel16_reloc): Handle microMIPS ASE.
484         (mips16_gprel_reloc): Update for _bfd_mips_elf_reloc_unshuffle
485         and _bfd_mips_elf_reloc_shuffle changes.
486         (mips_elf_gprel32_reloc): Update comment.
487         (micromips_reloc_map): New variable.
488         (bfd_elf32_bfd_reloc_type_lookup): Handle microMIPS ASE.
489         (mips_elf32_rtype_to_howto): Likewise.
490         (mips_info_to_howto_rel): Likewise.
491         (bfd_elf32_bfd_is_target_special_symbol): Define.
492         (bfd_elf32_bfd_relax_section): Likewise.
493         * elf64-mips.c (micromips_elf64_howto_table_rel): New variable.
494         (micromips_elf64_howto_table_rela): Likewise.
495         (mips16_gprel_reloc): Update for _bfd_mips_elf_reloc_unshuffle
496         and _bfd_mips_elf_reloc_shuffle changes.
497         (micromips_reloc_map): Likewise.
498         (bfd_elf64_bfd_reloc_type_lookup): Handle microMIPS ASE.
499         (bfd_elf64_bfd_reloc_name_lookup): Likewise.
500         (mips_elf64_rtype_to_howto): Likewise.
501         (bfd_elf64_bfd_is_target_special_symbol): Define.
502         * elfn32-mips.c (elf_micromips_howto_table_rel): New variable.
503         (elf_micromips_howto_table_rela): Likewise.
504         (mips16_gprel_reloc): Update for _bfd_mips_elf_reloc_unshuffle
505         and _bfd_mips_elf_reloc_shuffle changes.
506         (micromips_reloc_map): Likewise.
507         (bfd_elf32_bfd_reloc_type_lookup): Handle microMIPS ASE.
508         (bfd_elf32_bfd_reloc_name_lookup): Likewise.
509         (mips_elf_n32_rtype_to_howto): Likewise.
510         (bfd_elf32_bfd_is_target_special_symbol): Define.
511         * elfxx-mips.c (LA25_LUI_MICROMIPS_1): New macro.
512         (LA25_LUI_MICROMIPS_2): Likewise.
513         (LA25_J_MICROMIPS_1, LA25_J_MICROMIPS_2): Likewise.
514         (LA25_ADDIU_MICROMIPS_1, LA25_ADDIU_MICROMIPS_2): Likewise.
515         (TLS_RELOC_P): Handle microMIPS ASE.
516         (mips_elf_create_stub_symbol): Adjust value of stub symbol if
517         target is a microMIPS function.
518         (micromips_reloc_p): New function.
519         (micromips_reloc_shuffle_p): Likewise.
520         (got16_reloc_p, call16_reloc_p): Handle microMIPS ASE.
521         (got_disp_reloc_p, got_page_reloc_p): New functions.
522         (got_ofst_reloc_p): Likewise.
523         (got_hi16_reloc_p, got_lo16_reloc_p): Likewise.
524         (call_hi16_reloc_p, call_lo16_reloc_p): Likewise.
525         (hi16_reloc_p, lo16_reloc_p, jal_reloc_p): Handle microMIPS ASE.
526         (micromips_branch_reloc_p): New function.
527         (tls_gd_reloc_p, tls_ldm_reloc_p): Likewise.
528         (tls_gottprel_reloc_p): Likewise.
529         (_bfd_mips16_elf_reloc_unshuffle): Rename to...
530         (_bfd_mips_elf_reloc_unshuffle): ... this.  Handle microMIPS
531         ASE.
532         (_bfd_mips16_elf_reloc_shuffle): Rename to...
533         (_bfd_mips_elf_reloc_shuffle): ... this.  Handle microMIPS ASE.
534         (_bfd_mips_elf_lo16_reloc): Handle microMIPS ASE.
535         (mips_tls_got_index, mips_elf_got_page): Likewise.
536         (mips_elf_create_local_got_entry): Likewise.
537         (mips_elf_relocation_needs_la25_stub): Likewise.
538         (mips_elf_calculate_relocation): Likewise.
539         (mips_elf_perform_relocation): Likewise.
540         (_bfd_mips_elf_symbol_processing): Likewise.
541         (_bfd_mips_elf_add_symbol_hook): Likewise.
542         (_bfd_mips_elf_link_output_symbol_hook): Likewise.
543         (mips_elf_add_lo16_rel_addend): Likewise.
544         (_bfd_mips_elf_check_relocs): Likewise.
545         (mips_elf_adjust_addend): Likewise.
546         (_bfd_mips_elf_relocate_section): Likewise.
547         (mips_elf_create_la25_stub): Likewise.
548         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
549         (_bfd_mips_elf_gc_sweep_hook): Likewise.
550         (_bfd_mips_elf_is_target_special_symbol): New function.
551         (mips_elf_relax_delete_bytes): Likewise.
552         (opcode_descriptor): New structure.
553         (RA): New macro.
554         (OP32_SREG, OP32_TREG, OP16_VALID_REG): Likewise.
555         (b_insns_32, bc_insn_32, bz_insn_32, bzal_insn_32): New variables.
556         (beq_insn_32): Likewise.
557         (b_insn_16, bz_insn_16): New variables.
558         (BZC32_REG_FIELD): New macro.
559         (bz_rs_insns_32, bz_rt_insns_32): New variables.
560         (bzc_insns_32, bz_insns_16):Likewise.
561         (BZ16_REG, BZ16_REG_FIELD): New macros.
562         (jal_insn_32_bd16, jal_insn_32_bd32): New variables.
563         (jal_x_insn_32_bd32): Likewise.
564         (j_insn_32, jalr_insn_32): Likewise.
565         (ds_insns_32_bd16, ds_insns_32_bd32): Likewise.
566         (jalr_insn_16_bd16, jalr_insn_16_bd32, jr_insn_16): Likewise.
567         (JR16_REG): New macro.
568         (ds_insns_16_bd16): New variable.
569         (lui_insn): Likewise.
570         (addiu_insn, addiupc_insn): Likewise.
571         (ADDIUPC_REG_FIELD): New macro.
572         (MOVE32_RD, MOVE32_RS): Likewise.
573         (MOVE16_RD_FIELD, MOVE16_RS_FIELD): Likewise.
574         (move_insns_32, move_insns_16): New variables.
575         (nop_insn_32, nop_insn_16): Likewise.
576         (MATCH): New macro.
577         (find_match): New function.
578         (check_br16_dslot, check_br32_dslot): Likewise.
579         (check_br16, check_br32): Likewise.
580         (IS_BITSIZE): New macro.
581         (check_4byte_branch): New function.
582         (_bfd_mips_elf_relax_section): Likewise.
583         (_bfd_mips_elf_merge_private_bfd_data): Disallow linking MIPS16
584         and microMIPS modules together.
585         (_bfd_mips_elf_print_private_bfd_data): Handle microMIPS ASE.
586         * reloc.c (BFD_RELOC_MICROMIPS_7_PCREL_S1): New relocation.
587         (BFD_RELOC_MICROMIPS_10_PCREL_S1): Likewise.
588         (BFD_RELOC_MICROMIPS_16_PCREL_S1): Likewise.
589         (BFD_RELOC_MICROMIPS_GPREL16): Likewise.
590         (BFD_RELOC_MICROMIPS_JMP, BFD_RELOC_MICROMIPS_HI16): Likewise.
591         (BFD_RELOC_MICROMIPS_HI16_S): Likewise.
592         (BFD_RELOC_MICROMIPS_LO16): Likewise.
593         (BFD_RELOC_MICROMIPS_LITERAL): Likewise.
594         (BFD_RELOC_MICROMIPS_GOT16): Likewise.
595         (BFD_RELOC_MICROMIPS_CALL16): Likewise.
596         (BFD_RELOC_MICROMIPS_GOT_HI16): Likewise.
597         (BFD_RELOC_MICROMIPS_GOT_LO16): Likewise.
598         (BFD_RELOC_MICROMIPS_CALL_HI16): Likewise.
599         (BFD_RELOC_MICROMIPS_CALL_LO16): Likewise.
600         (BFD_RELOC_MICROMIPS_SUB): Likewise.
601         (BFD_RELOC_MICROMIPS_GOT_PAGE): Likewise.
602         (BFD_RELOC_MICROMIPS_GOT_OFST): Likewise.
603         (BFD_RELOC_MICROMIPS_GOT_DISP): Likewise.
604         (BFD_RELOC_MICROMIPS_HIGHEST): Likewise.
605         (BFD_RELOC_MICROMIPS_HIGHER): Likewise.
606         (BFD_RELOC_MICROMIPS_SCN_DISP): Likewise.
607         (BFD_RELOC_MICROMIPS_JALR): Likewise.
608         (BFD_RELOC_MICROMIPS_TLS_GD): Likewise.
609         (BFD_RELOC_MICROMIPS_TLS_LDM): Likewise.
610         (BFD_RELOC_MICROMIPS_TLS_DTPREL_HI16): Likewise.
611         (BFD_RELOC_MICROMIPS_TLS_DTPREL_LO16): Likewise.
612         (BFD_RELOC_MICROMIPS_TLS_GOTTPREL): Likewise.
613         (BFD_RELOC_MICROMIPS_TLS_TPREL_HI16): Likewise.
614         (BFD_RELOC_MICROMIPS_TLS_TPREL_LO16): Likewise.
615         * bfd-in2.h: Regenerate.
616         * libbfd.h: Regenerate.
617
618 2011-07-22  H.J. Lu  <hongjiu.lu@intel.com>
619
620         * Makefile.am (ALL_MACHINES): Add cpu-k1om.lo.
621         (ALL_MACHINES_CFILES): Add cpu-k1om.c.
622         * Makefile.in: Regenerated.
623
624         * archures.c (bfd_architecture): Add bfd_arch_k1om.
625         (bfd_k1om_arch): New.
626         (bfd_archures_list): Add &bfd_k1om_arch.
627         * bfd-in2.h: Regenerated.
628
629         * config.bfd (targ64_selvecs): Add bfd_elf64_k1om_vec if
630         bfd_elf64_x86_64_vec is supported.  Add bfd_elf64_k1om_freebsd_vec
631         if bfd_elf64_x86_64_freebsd_vec is supported.
632         (targ_selvecs): Likewise.
633
634         * configure.in: Support bfd_elf64_k1om_vec and
635         bfd_elf64_k1om_freebsd_vec.
636         * configure: Regenerated.
637
638         * cpu-k1om.c: New.
639
640         * elf64-x86-64.c (elf64_k1om_elf_object_p): New.
641         (bfd_elf64_k1om_vec): Likewise.
642         (bfd_elf64_k1om_freebsd_vec): Likewise.
643
644         * targets.c (bfd_elf64_k1om_vec): New.
645         (bfd_elf64_k1om_freebsd_vec): Likewise.
646         (_bfd_target_vector): Add bfd_elf64_k1om_vec and
647         bfd_elf64_k1om_freebsd_vec.
648
649 2011-07-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
650
651         Fix false coff-go32-exe matches.
652         * coff-i386.c (TARGET_SYM) <_bfd_check_format>: Conditionally use
653         COFF_CHECK_FORMAT.
654         * coff-stgo32.c (go32_check_format): New forward declaration.
655         (COFF_CHECK_FORMAT): New defintion.
656         (go32_check_format): New function.
657
658 2011-07-15  Alan Modra  <amodra@gmail.com>
659
660         * configure.in: Bump version.
661         * configure: Regenerate.
662
663 2011-07-14  Alan Modra  <amodra@gmail.com>
664
665         * linker.c (_bfd_generic_section_already_linked): Set l_flags.
666         * elf-bfd.h (struct already_linked): Forward declare.
667
668 2011-07-14  Alan Modra  <amodra@gmail.com>
669
670         * elflink.c (_bfd_elf_fix_symbol_flags): Loop on indirect syms.
671         (_bfd_elf_adjust_dynamic_symbol): Remove FIXME.
672
673 2011-07-14  Alan Modra  <amodra@gmail.com>
674
675         * elf64-ppc.c (struct ppc_link_hash_table): Add plt_static_chain.
676         (build_plt_stub): Add plt_static_chain param, don't load r11 if false.
677         (build_tls_get_addr_stub): Likewise.
678         (ppc_build_one_stub): Update calls to above.
679         (ppc_size_one_stub): Adjust stub size.
680         (ppc64_elf_size_stubs): Add plt_static_chain param, save to htab.
681         * elf64-ppc.h (ppc64_elf_size_stubs): Update prototype.
682
683 2011-07-12  Nick Clifton  <nickc@redhat.com>
684
685         * elf32-arm.c (elf32_arm_section_flags): Delete.
686         (elf_backend_section_flags): Remove.
687
688 2011-07-11  H.J. Lu  <hongjiu.lu@intel.com>
689
690         PR ld/12982
691         * elflink.c (bfd_elf_size_dynamic_sections): Also skip BFD_PLUGIN
692         when setting stack_flags.
693
694 2011-07-11  Catherine Moore  <clm@codesourcery.com>
695
696         * aout-adobe.c (aout_32_bfd_lookup_section_flags): New definition.
697         * aout-target.h (MY_bfd_lookup_section_flags): New definition.
698         * aout-tic30.c (MY_bfd_lookup_section_flags): New definition.
699         * bfd-in2.h: Regenerated.
700         * bfd.c (bfd_lookup_section_flags): New definition.
701         * binary.c (binary_bfd_lookup_section_flags): New definition.
702         * bout.c (b_out_bfd_lookup_section_flags): New definition.
703         * coff-alpha.c (_bfd_ecoff_bfd_lookup_section_flags): New definition.
704         * coff-mips.c (_bfd_ecoff_bfd_lookup_section_flags): New definition.
705         * coff-rs6000.c (rs6000coff_vec): Include
706         bfd_generic_lookup_section_flags.
707         (pmac_xcoff_vec): Likewise.
708         * coffcode.h (coff_bfd_lookup_section_flags): New definition.
709         * coff64-rs6000.c (rs6000coff64_vec): Include
710         bfd_generic_lookup_section_flags.
711         (aix5coff64_vec): Likewise.
712         * ecoff.c (bfd_debug_section): Initialize flag_info field.
713         * elf-bfd.h (elf_backend_lookup_section_flags_hook): Declare.
714         (bfd_elf_lookup_section_flags): Declare.
715         * elflink.c (bfd_elf_lookup_section_flags): New function.
716         * elfxx-target.h (bfd_elfNN_bfd_lookup_section_flags): Define.
717         (elf_backend_lookup_section_flags_hook): Define.
718         (elf_backend_data): Add elf_backend_lookup_section_flags_hook.
719         * i386msdos.c (msdos_bfd_lookup_section_flags): New define.
720         * i386os9k.c (os9k_bfd_lookup_section_flags): New define.
721         * ieee.c (ieee_bfd_lookup_section_flags): New define.
722         * ihex.c (ihex_bfd_lookup_section_flags): New define.
723         * libbfd-in.h (_bfd_nolink_bfd_lookup_section_flags): Declare.
724         (bfd_generic_lookup_section_flags): Declare.
725         * libbfd.h: Regenerated.
726         * mach-o-target.c (bfd_mach_o_bfd_lookup_section_flags): New.
727         * mmo.c (mmo_bfd_lookup_section_flags): New definition.
728         * nlm-target.h (nlm_bfd_lookup_section_flags): New definition.
729         * oasys.c (oasys_bfd_lookup_section_flags): New definition.
730         * pef.c (bfd_pef_bfd_lookup_section_flags): New definition.
731         * plugin.c (bfd_plugin_bfd_lookup_section_flags): New definition.
732         * ppcboot.c (ppcboot_bfd_lookup_section_flags): New definition.
733         * reloc.c (bfd_generic_lookup_section_flags): New function.
734         * som.c (som_bfd_lookup_section_flags): New definition.
735         * srec.c (srec_bfd_lookup_section_flags): New definition.
736         * targets.c (flag_info): Declare.
737         (NAME##_bfd_lookup_section_flags): Add to LINK jump table.
738         (_bfd_lookup_section_flags): New.
739         * tekhex.c (tekhex_bfd_lookup_section_flags): New definition.
740         * versados.c (versados_bfd_lookup_section_flags): New definition.
741         * vms-alpha.c (alpha_vms_bfd_lookup_section_flag): New definition.
742         * xsym.c (bfd_sym_bfd_lookup_section_flags): New definition.
743
744 2011-07-11  H.J. Lu  <hongjiu.lu@intel.com>
745
746         PR ld/12978
747         * elfnn-ia64.c (count_dyn_reloc): Fix a typo.
748
749 2011-07-09  Alan Modra  <amodra@gmail.com>
750
751         PR ld/12942
752         * elflink.c (elf_link_add_object_symbols): Use elf_discarded_section
753         rather than kept_section to determine whether a symbol is from
754         a discarded section.
755         * cofflink.c (coff_link_add_symbols): Make symbols from discarded
756         sections appear undefined.
757
758 2011-07-09  H.J. Lu  <hongjiu.lu@intel.com>
759
760         PR ld/12942
761         * elf-bfd.h (_bfd_elf_section_already_linked): Replace
762         "asection *" with "struct already_linked *".
763         * libbfd-in.h (_bfd_nolink_section_already_linked): Likewise.
764         (_bfd_generic_section_already_linked): Likewise.
765         (bfd_section_already_linked_table_insert): Likewise.
766         (struct already_linked): New.
767         (struct bfd_section_already_linked): Use it.
768         * elflink.c (_bfd_elf_section_already_linked): Replace.
769         "asection *" with "struct already_linked *".  Replace the plugin
770         dummy with the LTO output.
771         * linker.c (_bfd_generic_section_already_linked): Likewise.
772         * targets.c (struct already_linked): Add forward declaration.
773         (bfd_target): Replace "struct bfd_section *" with
774         "struct already_linked *" in _section_already_linked.
775         * bfd-in2.h: Regenerate.
776         * libbfd.h: Regenerate.
777
778 2011-07-06  Tristan Gingold  <gingold@adacore.com>
779
780         * mach-o.h: Move loader related definitions to
781         include/mach-o/loader.h.  Include it.
782
783 2011-07-05  H.J. Lu  <hongjiu.lu@intel.com>
784
785         * elf64-x86-64.c (elf_backend_post_process_headers): Always
786         define to _bfd_elf_set_osabi.
787
788 2011-07-03  Samuel Thibault  <samuel.thibault@gnu.org>
789             Thomas Schwinge  <thomas@schwinge.name>
790
791         PR binutils/12913
792         * elf.c (_bfd_elf_set_osabi): Use ELFOSABI_GNU name instead of
793         ELFOSABI_LINUX alias.
794         * elf32-hppa.c: Likewise.
795         * elf32-i370.c: Likewise.
796         * elf64-hppa.c: Likewise.
797
798 2011-07-01  Ian Lance Taylor  <iant@google.com>
799
800         * elf32-i386.c (elf_i386_eh_frame_plt): Correct expression: change
801         DW_OP_lit3 to DW_OP_lit2.
802
803 2011-07-01  Alan Modra  <amodra@gmail.com>
804
805         * elf32-ppc.c (ppc_elf_copy_indirect_symbol): Don't look at
806         dyn relocs when called to copy flags for a weak sym.
807         * elf64-ppc.c (ppc64_elf_copy_indirect_symbol): Likewise.
808         (ppc64_elf_merge_private_bfd_data): Delete.
809         (bfd_elf64_bfd_merge_private_bfd_data): Define as
810         _bfd_generic_verify_endian_match.
811
812 2011-06-30  Bernd Schmidt  <bernds@codesourcery.com>
813
814         * bfd/elf32-tic6x.c (elf32_tic6x_set_osabi): Also set it if
815         link_info is NULL.
816
817 2011-06-28  Tristan Gingold  <gingold@adacore.com>
818
819         * vms-alpha.c (vms_private_data_struct): Make vms_linkage_index
820         unsigned int.
821         (_bfd_vms_write_etir): Write linkage index from reloc.
822
823 2011-06-28  Fawzi Mohamed <fawzi.mohamed@nokia.com>
824
825         * mach-o.c (bfd_mach_o_read_command): Also ignore
826         BFD_MACH_O_LC_ROUTINES_64.
827
828 2011-06-27  Tristan Gingold  <gingold@adacore.com>
829
830         * vms-alpha.c (_bfd_vms_write_etir): Use 'section' to get current
831         section target index.
832
833 2011-06-27  Nick Clifton  <nickc@redhat.com>
834
835         * cisco-core.c (cisco_core_little_vec): Add initialization of
836         match_priority field.
837
838 2011-06-27  Tristan Gingold  <gingold@adacore.com>
839
840         * cache.c: Include bfd_stdint.h.
841         (cache_bmmap): Change profile.  Return region start and size.
842         * bfdio.c (struct bfd_iovec): Change bmmap profile.
843         (bfd_mmap): Change profile and adjust.   Update comment.
844         (memory_bmmap): Change profile.
845         * opncls.c (opncls_bmmap): Change profile.
846         * vms-lib.c (vms_lib_bmmap): Likewise.
847         * libbfd.h: Regenerate.
848         * bfd-in2.h: Regenerate.
849
850 2011-06-27  Tristan Gingold  <gingold@adacore.com>
851
852         * vms-misc.c (vms_time_to_time_t): Adjust overflow detection.
853         Add comment.
854
855 2011-06-25  H.J. Lu  <hongjiu.lu@intel.com>
856
857         * elf64-x86-64.c (elf_backend_post_process_headers): Don't
858         define for FreeBSD/x86-64 nor FreeBSD/L1OM.  Define for L1OM.
859
860 2011-06-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
861
862         * elf64-x86-64.c (elf_x86_64_link_hash_table_create): Initialize
863         PLT_EH_FRAME.
864         * elf32-i386.c (elf_i386_link_hash_table): Likewise.
865
866 2011-06-24  Richard Henderson  <rth@redhat.com>
867
868         PR ld/12928
869         * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Recover the
870         tlsgd insn before swapping adjacent insns.
871
872 2011-06-24  Tristan Gingold  <gingold@adacore.com>
873
874         * vms-alpha.c (alpha_vms_slurp_relocs): Add a guard for relocs in the
875         absolute section.
876
877 2011-06-24  Alan Modra  <amodra@gmail.com>
878
879         PR ld/12921
880         * elf.c (assign_file_positions_for_load_sections): Don't align
881         sh_offset for all SHT_NOBITS sections here, just .tbss sections
882         that don't get a PT_LOAD.
883
884 2011-06-22  Kaz Kojima  <kkojima@rr.iij4u.or.jp>
885
886         * elf32-sh.c (sh_elf_relocate_section): Allow R_SH_TLS_LE_32 for PIE.
887         (sh_elf_check_relocs): Likewise.
888
889 2011-06-22  Richard Henderson  <rth@redhat.com>
890
891         * elf64-alpha.c (elf64_alpha_check_relocs): No dynamic reloc for
892         TPREL in a PIE image.
893         (alpha_dynamic_entries_for_reloc): Likewise.
894         (elf64_alpha_relocate_section): Allow TPREL in PIE images.
895         (elf64_alpha_relax_got_load): Likewise.
896
897 2011-06-22  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>
898
899         * elf32-arm.c (elf32_arm_final_link_relocate): Allow R_ARM_TLS_LE32
900         for PIE.
901
902 2011-06-22  Alan Modra  <amodra@gmail.com>
903
904         * elflink.c (_bfd_elf_merge_symbol): Allow type changes for
905         plugin symbols.  Fix segfault on linker scrip defined syms.
906
907 2011-06-20  Jakub Jelinek  <jakub@redhat.com>
908
909         PR ld/12570
910         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Allow no relocations
911         at all for linker created .eh_frame sections.
912         (_bfd_elf_discard_section_eh_frame): Handle linker created
913         .eh_frame sections with no relocations.
914         * elf64-x86-64.c: Include dwarf2.h.
915         (elf_x86_64_eh_frame_plt): New variable.
916         (PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET,
917         PLT_FDE_LEN_OFFSET): Define.
918         (struct elf_x86_64_link_hash_table): Add plt_eh_frame field.
919         (elf_x86_64_create_dynamic_sections): Create and fill in
920         .eh_frame section for .plt section.
921         (elf_x86_64_size_dynamic_sections): Write .plt section size
922         into .eh_frame FDE covering .plt section.
923         (elf_x86_64_finish_dynamic_sections): Write .plt section
924         start into .eh_frame FDE covering .plt section.  Call
925         _bfd_elf_write_section_eh_frame on htab->plt_eh_frame section.
926         (elf_backend_plt_alignment): Define to 4.
927         * elf32-i386.c: Include dwarf2.h.
928         (elf_i386_eh_frame_plt): New variable.
929         (PLT_CIE_LENGTH, PLT_FDE_LENGTH, PLT_FDE_START_OFFSET,
930         PLT_FDE_LEN_OFFSET): Define.
931         (struct elf_i386_link_hash_table): Add plt_eh_frame field.
932         (elf_i386_create_dynamic_sections): Create and fill in
933         .eh_frame section for .plt section.
934         (elf_i386_size_dynamic_sections): Write .plt section size
935         into .eh_frame FDE covering .plt section.
936         (elf_i386_finish_dynamic_sections): Write .plt section
937         start into .eh_frame FDE covering .plt section.  Call
938         _bfd_elf_write_section_eh_frame on htab->plt_eh_frame section.
939         (elf_backend_plt_alignment): Define to 4.
940
941 2011-06-19  H.J. Lu  <hongjiu.lu@intel.com>
942
943         * elf64-x86-64.c (elf_backend_post_process_headers): Defined
944         for x32.
945
946 2011-06-16  H.J. Lu  <hongjiu.lu@intel.com>
947
948         * elf64-x86-64.c: Include <stdarg.h> and CORE_HEADER if
949         CORE_HEADER is defined.
950         (elf_x86_64_write_core_note): New.
951         (elf_backend_write_core_note): Likewise.
952
953         * hosts/x86-64linux.h (uint64_t): New.
954         (user_regsx32_struct): Likewise.
955         (elf_gregx32_t): Likewise.
956         (ELF_NGREGX32): Likewise.
957         (elf_gregsetx32_t): Likewise.
958         (elf_prstatusx32): Likewise.
959         (prstatusx32_t): Likewise.
960         (user_fpregs32_struct): Removed.
961         (user_fpxregs32_struct): Likewise.
962         (user32): Likewise.
963         (elf_fpregset32_t): Likewise.
964         (elf_fpxregset32_t): Likewise.
965         (prgregset32_t): Likewise.
966         (prfpregset32_t): Likewise.
967
968 2011-06-16  H.J. Lu  <hongjiu.lu@intel.com>
969
970         * elf64-x86-64.c (elf_x86_64_grok_prstatus): Support x32.
971         (elf_x86_64_grok_psinfo): Likewise.
972
973 2011-06-16  Nick Clifton  <nickc@redhat.com>
974
975         * elf.c (elf_find_function): Fail if not provided with a symbol
976         table.
977
978 2011-06-15  Ulrich Weigand  <ulrich.weigand@linaro.org>
979
980         * elf-bfd.h (elfcore_write_arm_vfp): Add prototype.
981         * elf.c (elfcore_grok_arm_vfp): New function.
982         (elfcore_grok_note): Call it to handle NT_ARM_VFP notes.
983         (elfcore_write_arm_vfp): New function.
984         (elfcore_write_register_note): Call it to handle .reg-arm-vfp.
985
986 2011-06-14  Richard Henderson  <rth@redhat.com>
987
988         * elf64-alpha.c (elf64_alpha_copy_indirect_symbol): Rename from
989         elf64_alpha_merge_ind_symbols; adjust for the generic interface.
990         (elf64_alpha_always_size_sections): Don't call
991         elf64_alpha_merge_ind_symbols.
992         (elf_backend_copy_indirect_symbol): New.
993
994 2011-06-14  Alan Modra  <amodra@gmail.com>
995
996         PR ld/12887
997         * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Check sec_info_type
998         before doing anything.
999         (_bfd_elf_discard_section_eh_frame): Likewise.
1000
1001 2011-06-14  Alan Modra  <amodra@gmail.com>
1002
1003         * Makefile.am: Formatting.
1004         * Makefile.in: Regenerate.
1005         * configure.in (bfd_elf64_tilegx_vec): Add elfxx-tilegx.lo.
1006         * po/SRC-POTFILES.in: Regnerate.
1007
1008 2011-06-14  Alan Modra  <amodra@gmail.com>
1009
1010         * elf32-tilepro.c (tilepro_elf_size_dynamic_sections): Don't use PTR.
1011         (allocate_dynrelocs, readonly_dynrelocs): Replace PTR with void *.
1012         Don't handle warning symbols here.
1013         * elfxx-tilegx.c (tilegx_elf_size_dynamic_sections): As above.
1014         (allocate_dynrelocs, readonly_dynrelocs): As above.
1015
1016 2011-06-14  Alan Modra  <amodra@gmail.com>
1017
1018         PR ld/12851
1019         * elflink.c (_bfd_elf_gc_mark_extra_sections): New function.
1020         (elf_gc_sweep): Don't treat debug and sections like .comment
1021         specially here.
1022         (bfd_elf_gc_sections): Treat note sections as gc roots only when
1023         not part of a group.  Always call gc_mark_extra_sections.
1024         * elf-bfd.h (_bfd_elf_gc_mark_extra_sections): Declare.
1025         * elfxx-target.h (elf_backend_gc_mark_extra_sections): Default to
1026         _bfd_elf_gc_mark_extra_sections.
1027         * elf32-arm.c (elf32_arm_gc_mark_extra_sections): Call
1028         _bfd_elf_gc_mark_extra_sections.
1029         * elf32-tic6x.c (elf32_tic6x_gc_mark_extra_sections): Likewise.
1030
1031 2011-06-13  Nick Clifton  <nickc@redhat.com>
1032
1033         * elf32-tilepro.c (tilepro_elf_check_relocs): Delete unused local
1034         variable 'local_got_offsets'.
1035         * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1036         (tilegx_finish_dyn): Delete unused local variable 'abi_64_p'.
1037
1038 2011-06-13  Walter Lee  <walt@tilera.com>
1039
1040         * Makefile.am (ALL_MACHINES): Add cpu-tilegx.lo and cpu-tilepro.lo.
1041         (ALL_MACHINE_CFILES): Add cpu-tilegx.c and cpu-tilepro.c.
1042         (BFD32_BACKENDS): Add elf32-tilegx.lo, elf32-tilepro.lo,
1043         and elfxx-tilegx.lo.
1044         (BFD32_BACKENDS_CFILES): Add elf32-tilegx.c elf32-tilepro.c, and
1045         elfxx-tilegx.c.
1046         (BFD64_BACKENDS): Add elf64-tilegx.lo.
1047         (BFD64_BACKENDS_CFILES): Add elf64-tilegx.c.
1048         * Makefile.in: Regenerate.
1049         * arctures.c (bfd_architecture): Define bfd_arch_tilepro,
1050         bfd_arch_tilegx, bfd_mach_tilepro, bfd_mach_tilegx.
1051         (bfd_arch_info): Add bfd_tilegx_arch, bfd_tilepro_arch.
1052         (bfd_archures_list): Add bfd_tilegx_arch, bfd_tilepro_arch.
1053         bfd-in2.h: Regenerate.
1054         * config.bfd: Handle tilegx-*-* and tilepro-*-*.
1055         * configure.in: Handle bfd_elf32_tilegx_vec, bfd_elf32_tilepro_vec,
1056         and bfd_elf64_tilegx_vec.
1057         * configure: Regenerate.
1058         * elf-bfd.h (enum elf_target_id): Define TILEGX_ELF_DATA and
1059         TILEPRO_ELF_DATA.
1060         * libbfd.h: Regenerate.
1061         * reloc.c: Add BFD_RELOC_TILEPRO_{COPY, GLOB_DAT, JMP_SLOT,
1062         RELATIVE, BROFF_X1, JOFFLONG_X1, JOFFLONG_X1_PLT, IMM8_X0,
1063         IMM8_Y0, IMM8_X1, IMM8_Y1, DEST_IMM8_X1, MT_IMM15_X1, MF_IMM15_X1,
1064         IMM16_X0, IMM16_X1, IMM16_X0_LO, IMM16_X1_LO, IMM16_X0_HI,
1065         IMM16_X1_HI, IMM16_X0_HA, IMM16_X1_HA, IMM16_X0_PCREL,
1066         IMM16_X1_PCREL, IMM16_X0_LO_PCREL, IMM16_X1_LO_PCREL,
1067         IMM16_X0_HI_PCREL, IMM16_X1_HI_PCREL, IMM16_X0_HA_PCREL,
1068         IMM16_X1_HA_PCREL, IMM16_X0_GOT, IMM16_X1_GOT, IMM16_X0_GOT_LO,
1069         IMM16_X1_GOT_LO, IMM16_X0_GOT_HI, IMM16_X1_GOT_HI,
1070         IMM16_X0_GOT_HA, IMM16_X1_GOT_HA, MMSTART_X0, MMEND_X0,
1071         MMSTART_X1, MMEND_X1, SHAMT_X0, SHAMT_X1, SHAMT_Y0, SHAMT_Y1,
1072         IMM16_X0_TLS_GD, IMM16_X1_TLS_GD, IMM16_X0_TLS_GD_LO,
1073         IMM16_X1_TLS_GD_LO, IMM16_X0_TLS_GD_HI, IMM16_X1_TLS_GD_HI,
1074         IMM16_X0_TLS_GD_HA, IMM16_X1_TLS_GD_HA, IMM16_X0_TLS_IE,
1075         IMM16_X1_TLS_IE, IMM16_X0_TLS_IE_LO, IMM16_X1_TLS_IE_LO,
1076         IMM16_X0_TLS_IE_HI, IMM16_X1_TLS_IE_HI, IMM16_X0_TLS_IE_HA,
1077         IMM16_X1_TLS_IE_HA, TLS_DTPMOD32, TLS_DTPOFF32, TLS_TPOFF32}
1078         Add BFD_RELOC_TILEGX_{HW0, HW1, HW2, HW3, HW0_LAST, HW1_LAST,
1079         HW2_LAST, COPY, GLOB_DAT, JMP_SLOT, RELATIVE, BROFF_X1,
1080         JUMPOFF_X1, JUMPOFF_X1_PLT, IMM8_X0, IMM8_Y0, IMM8_X1, IMM8_Y1,
1081         DEST_IMM8_X1, MT_IMM14_X1, MF_IMM14_X1, MMSTART_X0, MMEND_X0,
1082         SHAMT_X0, SHAMT_X1, SHAMT_Y0, SHAMT_Y1, IMM16_X0_HW0,
1083         IMM16_X1_HW0, IMM16_X0_HW1, IMM16_X1_HW1, IMM16_X0_HW2,
1084         IMM16_X1_HW2, IMM16_X0_HW3, IMM16_X1_HW3, IMM16_X0_HW0_LAST,
1085         IMM16_X1_HW0_LAST, IMM16_X0_HW1_LAST, IMM16_X1_HW1_LAST,
1086         IMM16_X0_HW2_LAST, IMM16_X1_HW2_LAST, IMM16_X0_HW0_PCREL,
1087         IMM16_X1_HW0_PCREL, IMM16_X0_HW1_PCREL, IMM16_X1_HW1_PCREL,
1088         IMM16_X0_HW2_PCREL, IMM16_X1_HW2_PCREL, IMM16_X0_HW3_PCREL,
1089         IMM16_X1_HW3_PCREL, IMM16_X0_HW0_LAST_PCREL,
1090         IMM16_X1_HW0_LAST_PCREL, IMM16_X0_HW1_LAST_PCREL,
1091         IMM16_X1_HW1_LAST_PCREL, IMM16_X0_HW2_LAST_PCREL,
1092         IMM16_X1_HW2_LAST_PCREL, IMM16_X0_HW0_GOT, IMM16_X1_HW0_GOT,
1093         IMM16_X0_HW1_GOT, IMM16_X1_HW1_GOT, IMM16_X0_HW2_GOT,
1094         IMM16_X1_HW2_GOT, IMM16_X0_HW3_GOT, IMM16_X1_HW3_GOT,
1095         IMM16_X0_HW0_LAST_GOT, IMM16_X1_HW0_LAST_GOT,
1096         IMM16_X0_HW1_LAST_GOT, IMM16_X1_HW1_LAST_GOT,
1097         IMM16_X0_HW2_LAST_GOT, IMM16_X1_HW2_LAST_GOT, IMM16_X0_HW0_TLS_GD,
1098         IMM16_X1_HW0_TLS_GD, IMM16_X0_HW1_TLS_GD, IMM16_X1_HW1_TLS_GD,
1099         IMM16_X0_HW2_TLS_GD, IMM16_X1_HW2_TLS_GD, IMM16_X0_HW3_TLS_GD,
1100         IMM16_X1_HW3_TLS_GD, IMM16_X0_HW0_LAST_TLS_GD,
1101         IMM16_X1_HW0_LAST_TLS_GD, IMM16_X0_HW1_LAST_TLS_GD,
1102         IMM16_X1_HW1_LAST_TLS_GD, IMM16_X0_HW2_LAST_TLS_GD,
1103         IMM16_X1_HW2_LAST_TLS_GD, IMM16_X0_HW0_TLS_IE,
1104         IMM16_X1_HW0_TLS_IE, IMM16_X0_HW1_TLS_IE, IMM16_X1_HW1_TLS_IE,
1105         IMM16_X0_HW2_TLS_IE, IMM16_X1_HW2_TLS_IE, IMM16_X0_HW3_TLS_IE,
1106         IMM16_X1_HW3_TLS_IE, IMM16_X0_HW0_LAST_TLS_IE,
1107         IMM16_X1_HW0_LAST_TLS_IE, IMM16_X0_HW1_LAST_TLS_IE,
1108         IMM16_X1_HW1_LAST_TLS_IE, IMM16_X0_HW2_LAST_TLS_IE,
1109         IMM16_X1_HW2_LAST_TLS_IE, TLS_DTPMOD64, TLS_DTPOFF64, TLS_TPOFF64,
1110         TLS_DTPMOD32, TLS_DTPOFF32, TLS_TPOFF32}
1111         * targets.c (bfd_elf32_tilegx_vec): Declare.
1112         (bfd_elf32_tilepro_vec): Declare.
1113         (bfd_elf64_tilegx_vec): Declare.
1114         (bfd_target_vector): Add bfd_elf32_tilegx_vec, bfd_elf32_tilepro_vec,
1115         and bfd_elf64_tilegx_vec.
1116         * cpu-tilegx.c: New file.
1117         * cpu-tilepro.c: New file.
1118         * elf32-tilepro.h: New file.
1119         * elf32-tilepro.c: New file.
1120         * elf32-tilegx.c: New file.
1121         * elf32-tilegx.h: New file.
1122         * elf64-tilegx.c: New file.
1123         * elf64-tilegx.h: New file.
1124         * elfxx-tilegx.c: New file.
1125         * elfxx-tilegx.h: New file.
1126
1127 2011-06-13  Alan Modra  <amodra@gmail.com>
1128
1129         * linker.c (bfd_link_hash_traverse): Follow warning symbol link.
1130         (_bfd_generic_link_write_global_symbol, fix_syms): Don't handle
1131         warning symbols here.
1132         * elf-m10300.c (elf32_mn10300_finish_hash_table_entry): Likewise.
1133         * elf32-arm.c (allocate_dynrelocs_for_symbol,
1134         elf32_arm_readonly_dynrelocs): Likewise.
1135         * elf32-bfin.c (bfin_discard_copies): Likewise.
1136         * elf32-cris.c (elf_cris_adjust_gotplt_to_got,
1137         elf_cris_discard_excess_dso_dynamics,
1138         elf_cris_discard_excess_program_dynamics): Likewise.
1139         * elf32-hppa.c (allocate_plt_static, allocate_dynrelocs,
1140         clobber_millicode_symbols, readonly_dynrelocs): Likewise.
1141         * elf32-i370.c (i370_elf_adjust_dynindx): Likewise.
1142         * elf32-i386.c (elf_i386_allocate_dynrelocs,
1143         elf_i386_readonly_dynrelocs): Likewise.
1144         * elf32-lm32.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
1145         * elf32-m32c.c (m32c_relax_plt_check, m32c_relax_plt_realloc): Likewise.
1146         * elf32-m32r.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
1147         * elf32-m68k.c (elf_m68k_discard_copies): Likewise.
1148         * elf32-microblaze.c (allocate_dynrelocs): Likewise.
1149         * elf32-ppc.c (allocate_dynrelocs, maybe_set_textrel): Likewise.
1150         * elf32-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
1151         * elf32-score.c (score_elf_sort_hash_table_f): Likewise.
1152         * elf32-score7.c (score_elf_sort_hash_table_f): Likewise.
1153         * elf32-sh.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
1154         * elf32-tic6x.c (elf32_tic6x_allocate_dynrelocs,
1155         elf32_tic6x_readonly_dynrelocs): Likewise.
1156         * elf32-vax.c (elf_vax_discard_copies): Likewise.
1157         * elf32-xstormy16.c (xstormy16_relax_plt_check,
1158         xstormy16_relax_plt_realloc): Likewise.
1159         * elf32-xtensa.c (elf_xtensa_allocate_dynrelocs): Likewise.
1160         * elf64-alpha.c (elf64_alpha_output_extsym,
1161         elf64_alpha_calc_got_offsets_for_symbol,
1162         elf64_alpha_calc_dynrel_sizes, elf64_alpha_size_rela_got_1): Likewise.
1163         * elf64-hppa.c (elf64_hppa_mark_exported_functions,
1164         allocate_global_data_opd, elf64_hppa_mark_milli_and_exported_functions,
1165         elf_hppa_unmark_useless_dynamic_symbols,
1166         elf_hppa_remark_useless_dynamic_symbols): Likewise.
1167         * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref, func_desc_adjust,
1168         adjust_opd_syms, adjust_toc_syms, allocate_dynrelocs,
1169         readonly_dynrelocs, merge_global_got, reallocate_got,
1170         undo_symbol_twiddle): Likewise.
1171         * elf64-s390.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
1172         * elf64-sh64.c (sh64_elf64_discard_copies): Likewise.
1173         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs,
1174         elf_x86_64_readonly_dynrelocs): Likewise.
1175         * elflink.c (elf_link_renumber_hash_table_dynsyms,
1176         elf_link_renumber_local_hash_table_dynsyms, _bfd_elf_export_symbol,
1177         _bfd_elf_link_find_version_dependencies,
1178         _bfd_elf_link_assign_sym_version, _bfd_elf_adjust_dynamic_symbol,
1179         _bfd_elf_link_sec_merge_syms, elf_adjust_dynstr_offsets,
1180         elf_collect_hash_codes, elf_collect_gnu_hash_codes,
1181         elf_renumber_gnu_hash_syms, elf_gc_sweep_symbol,
1182         elf_gc_propagate_vtable_entries_used,
1183         elf_gc_smash_unused_vtentry_relocs, bfd_elf_gc_mark_dynamic_ref_symbol,
1184         elf_gc_allocate_got_offsets): Likewise.
1185         * elfnn-ia64.c (elfNN_ia64_global_dyn_info_free,
1186         elfNN_ia64_global_dyn_sym_thunk): Likewise.
1187         * elfxx-mips.c (mips_elf_check_symbols, mips_elf_output_extsym,
1188         mips_elf_sort_hash_table_f, allocate_dynrelocs): Likewise.
1189         * elfxx-sparc.c (allocate_dynrelocs, readonly_dynrelocs): Likewise.
1190         * i386linux.c (linux_tally_symbols): Likewise.
1191         * m68klinux.c (linux_tally_symbols): Likewise.
1192         * sparclinux.c (linux_tally_symbols): Likewise.
1193         * sunos.c (sunos_scan_dynamic_symbol): Likewise.
1194         * xcofflink.c (xcoff_post_gc_symbol): Likewise.
1195
1196         * elflink.c (elf_link_output_extsym): Make it a bfd_hash_traverse
1197         function.  Update all callers.
1198         * aoutx.h (aout_link_write_other_symbol): Likewise.
1199         * pdp11.c (aout_link_write_other_symbol): Likewise.
1200         * cofflink.c (_bfd_coff_write_global_sym): Likewise.
1201         * ecoff.c (ecoff_link_write_external): Likewise.
1202         * xcofflink.c (xcoff_write_global_symbol): Likewise.
1203         * vms-alpha.c (alpha_vms_link_output_symbol): Likewise.  Handle
1204         warning symbols.
1205         * ecoff.c (ecoff_link_hash_traverse): Delete.
1206         * coff-ppc.c (ppc_bfd_coff_final_link): Use bfd_hash_traverse for
1207         _bfd_coff_write_global_sym.
1208         * libcoff-in.h (_bfd_coff_write_global_sym): Update prototype.
1209         * libcoff.h: Regenerate.
1210
1211 2011-06-10  Nick Clifton  <nickc@redhat.com>
1212
1213         * elflink.c (_bfd_elf_link_create_dynamic_sections): If the
1214         backend does not provide a function for creating dynamic sections
1215         then fail.
1216         (bfd_elf_final_link): Issue a warning message if a dynamic section
1217         has the SHT_NOTE type.
1218         (bfd_elf_final_link): Do not look for dynamic strings in a section
1219         that does not have the SHT_STRTAB type or the name .dynstr.
1220         * elf32-arm.c (elf32_arm_finish_dynamic_sections): Fail if the got
1221         section is not in the output binary.
1222         * elf32-hppa.c (elf32_hppa_finish_dynamic_sections): Likewise.
1223
1224 2011-06-09  Tristan Gingold  <gingold@adacore.com>
1225
1226         * elfnn-ia64.c (elfNN_ia64_relax_section, elfNN_ia64_choose_gp)
1227         (elfNN_ia64_relocate_section, elfNN_vms_object_p): Remove trailing
1228         spaces.
1229
1230 2011-06-09  Tristan Gingold  <gingold@adacore.com>
1231
1232         * bfd.c (bfd_get_sign_extend_vma): Handle aixcoff.
1233
1234 2011-06-09  Nick Clifton  <nickc@redhat.com>
1235
1236         PR ld/12845
1237         * elf.c (_bfd_elf_init_private_section_data): Add an assertion
1238         that the output section has an allocated bfd_elf_section_data
1239         structure.
1240         * elfxx-mips.c (mips_elf_check_symbols): Do not create a stub for
1241         symbols in sections that have been removed by garbage collection.
1242
1243 2011-06-08  H.J. Lu  <hongjiu.lu@intel.com>
1244
1245         * elf64-x86-64.c (elf_x86_64_check_relocs): Allow R_X86_64_64
1246         relocations in SEC_DEBUGGING sections when building shared
1247         libraries.
1248
1249 2011-06-08  H.J. Lu  <hongjiu.lu@intel.com>
1250
1251         PR ld/12851
1252         * elflink.c (elf_gc_sweep): Don't check SHT_NOTE sections here.
1253         (bfd_elf_gc_sections): Also check SHT_NOTE sections.
1254
1255 2011-06-08  Tristan Gingold  <gingold@adacore.com>
1256
1257         * makefile.vms (OBJS): Add elfxx-ia64.obj
1258         Remove vax case.
1259
1260 2011-06-08  Alan Modra  <amodra@gmail.com>
1261
1262         * aix386-core.c, * cisco-core.c, * hpux-core.c, * osf-core.c,
1263         * sco5-core.c: Init match_priority field.
1264
1265 2011-06-08  Alan Modra  <amodra@gmail.com>
1266
1267         * elflink.c (_bfd_elf_archive_symbol_lookup): Follow warning and
1268         indirect links here.
1269
1270 2011-06-07  Joel Brobecker  <brobecker@adacore.com>
1271
1272         * irix-core.c (irix_core_vec): Add match_priority field.
1273
1274 2011-06-06  Alan Modra  <amodra@gmail.com>
1275
1276         * targets.c (bfd_target): Make ar_max_namelen an unsigned char.
1277         Add match_priority.
1278         * configure.in: Bump bfd version.
1279         * elfcode.h (elf_object_p): Delete hacks preventing match of
1280         EM_NONE and ELFOSABI_NONE targets when a better match exists.
1281         * elfxx-target.h (elf_match_priority): Define and use.
1282         * format.c (bfd_check_format_matches): Use target match_priority
1283         to choose best of multiple matching targets.  In cases with multiple
1284         matches rerun _bfd_check_format if we don't choose the last match.
1285         * aout-adobe.c, * aout-arm.c, * aout-target.h, * aout-tic30.c,
1286         * binary.c, * bout.c, * coff-alpha.c, * coff-i386.c, * coff-i860.c,
1287         * coff-i960.c, * coff-ia64.c, * coff-mips.c, * coff-or32.c,
1288         * coff-ppc.c, * coff-rs6000.c, * coff-sh.c, * coff-tic30.c,
1289         * coff-tic54x.c, * coff-x86_64.c, * coff64-rs6000.c, * coffcode.h,
1290         * i386msdos.c, * i386os9k.c, * ieee.c, * ihex.c, * mach-o-target.c,
1291         * mipsbsd.c, * mmo.c, * nlm-target.h, * oasys.c, * pdp11.c,
1292         * pe-mips.c, * pef.c, * plugin.c, * ppcboot.c, * som.c, * srec.c,
1293         * tekhex.c, * trad-core.c, * verilog.c, * versados.c, * vms-alpha.c,
1294         * vms-lib.c, * xsym.c: Init match_priority field.
1295         * configure: Regenerate.
1296         * bfd-in2.h: Regenerate.
1297
1298 2011-06-04  H.J. Lu  <hongjiu.lu@intel.com>
1299
1300         PR ld/12842
1301         * elfcode.h (elf_object_p): Revert the last change.
1302
1303 2011-06-04  Alan Modra  <amodra@gmail.com>
1304
1305         * archures.c (bfd_arch_get_compatible): If one arch is unknown,
1306         return the other arch.
1307         * elfcode.h (elf_object_p): Allow explicit match to generic ELF
1308         target.
1309
1310 2011-06-03  Bertram Felgenhauer  <bertram.felgenhauer@gmail.com>
1311
1312         PR ld/12682
1313         * hash.c (higher_primer_number): Add more, small, prime numbers.
1314         (bfd_hash_set_default_size): Likewise.
1315
1316 2011-06-02  Nick Clifton  <nickc@redhat.com>
1317
1318         * coff-mcore.c: Fix spelling typo.
1319         * coff-stgo32.c: Likewise.
1320         * elf32-arm.c: Likewise.
1321         * elf32-avr.c: Likewise.
1322         * elf-m68hc1x.c: Likewise.
1323         * elf32-mcore.c: Likewise.
1324         * elf32-mep.c: Likewise.
1325         * elf32-mt.c: Likewise.
1326         * elf32-ppc.c: Likewise.
1327         * elf32-xtensa.c: Likewise.
1328         * elf64-ppc.c: Likewise.
1329         * elfxx-mips.c: Likewise.
1330         * netbsd.h: Likewise.
1331         * nlmcode.h: Likewise.
1332         * vms-alpha.c: Likewise.
1333         * po/bfd.pot: Regenerate.
1334         * po/SRC-POTFILES.in: Regenerate.
1335
1336 2011-06-01  DJ Delorie  <dj@redhat.com>
1337
1338         * config.bfd: Add bfd_elf32_rx_be_ns_vec.
1339         * target.c: Likewise.
1340         * configure.in: Likewise.
1341         * configure.in: Regenerate.
1342         * elf32-rx.c: Add elf32-rx-be-ns target.
1343         (rx_elf_object_p): Never allow the be-ns target by default,
1344         only allow it if the user requests it.
1345
1346 2011-06-01  H.J. Lu  <hongjiu.lu@intel.com>
1347
1348         * elf32-i386.c (elf_i386_size_dynamic_sections): Properly warn
1349         relocation in readonly section in a shared object.
1350         * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Likewise.
1351
1352 2011-05-31  Nick Clifton  <nickc@redhat.com>
1353
1354         * archive.c (adjust_relative_path): Fix comment to prevent it
1355         corrupting the auto-generated bfd.h.
1356
1357 2011-05-31  Paul Brook  <paul@codesourcery.com>
1358
1359         * elf32-arm.c (elf32_arm_final_link_relocate): Only do bl conversion
1360         for known functions.
1361         (elf32_arm_swap_symbol_in): Only set ST_BRANCH_TO_ARM for function
1362         symbols.
1363
1364 2011-05-31  Paul Brook  <paul@codesourcery.com>
1365
1366         * elf32-arm.c (arm_stub_is_thumb): Add
1367         arm_stub_long_branch_v4t_thumb_tls_pic.
1368         (elf32_arm_final_link_relocate): TLS stubs are always ARM.
1369         Handle Thumb stubs.
1370
1371 2011-05-27  Nick Clifton  <nickc@redhat.com>
1372
1373         PR binutils/12710
1374         * archive.c (_bfd_get_elt_at_filepos): Set correct error value if
1375         unable to read a file pointed to by an entry in a thin archive.
1376         (adjust_relative_path): Use lrealpath to canonicalize paths.
1377         Handle the case where the reference path is above the current
1378         path in the directory tree.
1379
1380 2011-05-26  H.J. Lu  <hongjiu.lu@intel.com>
1381
1382         PR ld/12809
1383         * elf64-x86-64.c (elf_x86_64_relocate_section): Handle
1384         R_X86_64_TPOFF64 in executable.
1385
1386 2011-05-26  Alan Modra  <amodra@gmail.com>
1387
1388         * elf-bfd.h (SYMBOL_REFERENCES_LOCAL): Remove most of comment.
1389         * elflink.c (_bfd_elf_symbol_refs_local_p): Expand
1390         local_protected comment.
1391
1392 2011-05-25  Tristan Gingold  <gingold@adacore.com>
1393
1394         * configure.in (bfd_elf32_ia64_big_vec, bfd_elf32_ia64_hpux_big_vec)
1395         (bfd_elf64_ia64_big_vec, bfd_elf64_ia64_hpux_big_vec)
1396         (bfd_elf64_ia64_little_vec, bfd_elf64_ia64_vms_vec): Add elfxx-ia64.lo
1397         * Makefile.am (BFD64_BACKENDS): Add elfxx-ia64.lo
1398         (BFD64_BACKENDS_CFILES): Add elfxx-ia64.c
1399         (elf32-ia64.c): Created from elfnn-ia64.c
1400         (elf64-ia64.c): Likewise.
1401         * elfxx-ia64.h: New file.
1402         * elfxx-ia64.c: Split with elfnn-ia64.c.  Keep only the following
1403         functions.Includes elfxx-ia64.h.
1404         (elfNN_ia64_reloc): Renames to ia64_elf_reloc.  Adjust error message.
1405         (IA64_HOWTO): Adjust.
1406         (lookup_howto): Renames to ia64_elf_lookup_howto.  Make it public.
1407         (elfNN_ia64_reloc_type_lookup): Renames to
1408         ia64_elf_reloc_type_lookup. Make it public. Adjust calls.
1409         (elfNN_ia64_reloc_name_lookup): Renames to
1410         ia64_elf_reloc_name_lookup. Make it public.
1411         (elfNN_ia64_relax_br): Renames to ia64_elf_relax_br.  Make it public.
1412         (elfNN_ia64_relax_brl): Renames to ia64_elf_relax_brl. Make it
1413         public.
1414         (elfNN_ia64_relax_ldxmov): Renames to ia64_elf_relax_ldxmov.
1415         Move it and make it public.  Move prototype to elfxx-ia64.h
1416         (elfNN_ia64_install_value): Renames to ia64_elf_install_value.
1417         Move prototype to elfxx-ia64.h
1418         * elfnn-ia64.c: New file, split from elfxx-ia64.c.
1419         (elfNN_ia64_info_to_howto): Adjust calls.
1420         (elfNN_ia64_relax_section): Adjust calls.
1421         (count_dyn_reloc): Fix typo.
1422         (elfNN_ia64_relocate_section): Adjust calls.
1423         (elfNN_ia64_finish_dynamic_symbol): Likewise.
1424         (bfd_elfNN_bfd_reloc_type_lookup)
1425         (bfd_elfNN_bfd_reloc_name_lookup): Adjust macros.
1426         * configure: Regenerate.
1427         * Makefile.in: Regenerate.
1428
1429 2011-05-23  DJ Delorie  <dj@redhat.com>
1430
1431         * elf32-rx.c (rx_elf_object_p): When reading an RX object in, undo
1432         the vma/lma swapping done in elf32_rx_modify_program_headers.
1433
1434 2011-05-23  Nick Clifton  <nickc@redhat.com>
1435
1436         * elf-m10300.c (mn10300_elf_mkobject): New function.
1437         (bfd_elf32_mkobject): Define.
1438
1439 2011-05-23  Alan Modra  <amodra@gmail.com>
1440
1441         * elf-bfd.h: Comment typo fix.
1442         * elf32-ppc.c (struct ppc_elf_dyn_relocs): Delete.  Replace with
1443         struct elf_dyn_relocs throughout.
1444         * elf64-ppc.c (struct ppc_dyn_relocs): Likewise.
1445
1446 2011-05-23  Alan Modra  <amodra@gmail.com>
1447
1448         * elf32-frv.c: Use info->callbacks->einfo throughout file in linker
1449         functions rather than warning callback or _bfd_error_handler.
1450         * elf32-ppc.c: Likewise.
1451         * elf64-ppc.c: Likewise.
1452         * elf32-ppc.c (ppc_elf_tls_optimize): Use %H in __tls_get_addr lost
1453         arg error.
1454         * elf64-ppc.c (ppc64_elf_tls_optimize): Likewise.
1455
1456 2011-05-23  Alan Modra  <amodra@gmail.com>
1457
1458         PR 12763
1459         * elf.c (assign_file_positions_for_load_sections): Set sh_offset for
1460         .tbss, and page align same for all SHT_NOBITS sections.
1461
1462 2011-05-21  Alan Modra  <amodra@gmail.com>
1463
1464         PR 12763
1465         * elf.c (_bfd_elf_make_section_from_shdr): Set up TLS section LMAs
1466         from PT_TLS header.
1467         (_bfd_elf_map_sections_to_segments): Don't create a final PT_LOAD
1468         segment if just for .tbss.
1469         (assign_file_positions_for_load_sections): Don't report "can't
1470         allocate in segment" errors for .tbss.
1471         (assign_file_positions_for_non_load_sections): Don't set p_filesz
1472         from SHT_NOBITS section filepos.
1473
1474 2011-05-20  Bernd Schmidt  <bernds@codesourcery.com>
1475
1476         * elf32-tic6x.c (elf32_tic6x_howto_table): Add entries for
1477         R_C6000_PCR_H16 and R_C6000_PCR_L16.
1478         (elf32_tic6x_relocate_section): Handle them.
1479
1480 2011-05-18  Nick Clifton  <nickc@redhat.com>
1481
1482         PR ld/12761
1483         * elflink.c (elf_link_add_object_symbols): Process .gnu.warning
1484         sections when building shared libraries.
1485
1486 2011-05-18  Rafał Krypa  <r.krypa@samsung.com>
1487
1488         PR ld/12778
1489         * elf32-arm.c (elf32_arm_gc_sweep_hook): Use the computed dynamic
1490         reloc pointer.
1491
1492 2011-05-18  Tristan Gingold  <gingold@adacore.com>
1493
1494         * xcofflink.c (xcoff_link_add_symbols): Handle C_DWARF symbols.
1495         (xcoff_sweep): Always keep dwarf sections.
1496         (xcoff_link_input_bfd): Handle dwarf symbols and sections.
1497
1498 2011-05-18  Tristan Gingold  <gingold@adacore.com>
1499
1500         * libxcoff.h (struct xcoff_dwsect_name): New type.
1501         (XCOFF_DWSECT_NBR_NAMES): New macro.
1502         (xcoff_dwsect_names): Declare.
1503         * coffcode.h (sec_to_styp_flags): Handle xcoff dwarf sections.
1504         (styp_to_sec_flags): Ditto.
1505         (coff_new_section_hook): Ditto.
1506         (coff_slurp_symbol_table): Handle C_DWARF and C_INFO.
1507         * coff-rs6000.c (xcoff_dwsect_name): New variable.
1508
1509 2011-05-17  Tomohiro Kashiwada  <kikairoya@gmail.com>
1510
1511         PR ld/12759
1512         * elf32-rx.c (ignore_lma): New variable.
1513         (bfd_elf32_rx_set_target_flags): Add ignore_lma parameter.
1514         (rx_modify_program_headers): Only copy the LMA into the VMA if
1515         ignore_lma is true.
1516
1517 2011-05-17  Alan Modra  <amodra@gmail.com>
1518
1519         PR ld/12760
1520         * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Adjust "notice" call.
1521         * elflink.c (elf_link_add_object_symbols): Likewise.
1522         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
1523
1524 2011-05-16  Alan Modra  <amodra@gmail.com>
1525
1526         * linker.c (_bfd_generic_link_add_one_symbol): Don't init u.undef.weak.
1527
1528 2011-05-15  Richard Sandiford  <rdsandiford@googlemail.com>
1529
1530         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Record both local and
1531         global GOT entries for GOT_PAGE relocations against global symbols.
1532
1533 2011-05-13  Bernd Schmidt  <bernds@codesourcery.com>
1534
1535         * config.bfd (tic6x-*-elf, tic6x-*-uclinux): New.
1536         (tic6x-*-*): Replaced by these.
1537         * elf32-tic6x.c (elf32_tic6x_set_osabi): New static function.
1538         (elf32_tic6x_check_relocs): Create dynamic sections if -shared.
1539         (elf_backend_relocs_compatible, elf_backend_post_process_headers):
1540         Define.
1541         (elf32_bed, TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, TARGET_BIG_SYM,
1542         TARGET_BIG_NAME, ELF_OSABI): Redefine twice, and include
1543         "elf32-target.h" two more times.
1544         * configure.in: Handle bfd_elf32_tic6x_linux_be_vec,
1545         bfd_elf32_tic6x_linux_le_vec, bfd_elf32_tic6x_elf_be_vec and
1546         bfd_elf32_tic6x_elf_le_vec.
1547         * configure: Regenerate.
1548
1549 2011-05-13  Jan Beulich  <jbeulich@novell.com>
1550
1551         * config.bfd: Add targets x86_64-*-pe and x86_64-*-pep.
1552
1553 2011-05-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
1554
1555         * config.in: Regenerated.
1556         * configure: Regenerated.
1557         * configure.in: New tests for HAVE_PRPSINFO_T_PR_PID,
1558         HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID and
1559         HAVE_PSINFO32_T_PR_PID.
1560         * elf.c (elfcore_grok_psinfo): Protect reading psinfo.pr_pid by
1561         HAVE_PRPSINFO_T_PR_PID, HAVE_PRPSINFO32_T_PR_PID, HAVE_PSINFO_T_PR_PID
1562         and HAVE_PSINFO32_T_PR_PID.
1563         * hosts/x86-64linux.h (HAVE_PRPSINFO32_T_PR_PID): New redefinition.
1564
1565 2011-05-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
1566
1567         * elf.c (elfcore_grok_psinfo): Initialize CORE_PID for both native and
1568         32bit psinfo.
1569         * elf32-ppc.c (ppc_elf_grok_psinfo): Initialize core_pid.
1570         * elf64-ppc.c (ppc64_elf_grok_psinfo): Likewise.
1571
1572 2011-05-09  Paul Brook  <paul@codesourcery.com>
1573
1574         * bfd-in.h (elf32_tic6x_fix_exidx_coverage): Add prototype.
1575         * bfd-in2.h: Regenerate.
1576         * elf32-tic6x.c: Include limits.h.
1577         (tic6x_unwind_edit_type, tic6x_unwind_table_edit,
1578         _tic6x_elf_section_data): New.
1579         (elf32_tic6x_section_data): Define.
1580         (elf32_tic6x_new_section_hook): Allocate target specific data.
1581         (elf32_tic6x_add_unwind_table_edit): New function.
1582         (get_tic6x_elf_section_data, elf32_tic6x_adjust_exidx_size,
1583         elf32_tic6x_insert_cantunwind_after, elf32_tic6x_add_low31,
1584         elf32_tic6x_copy_exidx_entry): New functions.
1585         (elf_backend_write_section): Define.
1586
1587 2011-05-09  Paul Brook  <paul@codesourcery.com>
1588
1589         * elf32-tic6x.c (is_tic6x_elf_unwind_section_name,
1590         elf32_tic6x_fake_sections): New functions.
1591         (elf_backend_fake_sections): Define.
1592
1593 2011-05-09  Paul Brook  <paul@codesourcery.com>
1594
1595         * elf32-tic6x.c (elf32_tic6x_gc_mark_extra_sections): New function.
1596         (elf_backend_gc_mark_extra_sections): Define.
1597
1598 2011-05-07  Dave Korn  <dave.korn.cygwin@gmail.com>
1599
1600         PR ld/12365
1601         * cofflink.c (bfd_coff_link_input_bfd): Check for and warn about
1602         references to symbols defined in discarded sections.
1603
1604 2011-05-07  Dave Korn  <dave.korn.cygwin@gmail.com>
1605
1606         PR ld/12365
1607         * coffgen.c (coff_write_symbol): Assume input section is its own
1608         output section if output_section member not set.
1609         (coff_write_alien_symbol): Likewise.
1610
1611 2011-05-07  H.J. Lu  <hongjiu.lu@intel.com>
1612
1613         PR ld/12730
1614         * elf.c (_bfd_elf_section_offset): Check SEC_ELF_REVERSE_COPY.
1615
1616         * elflink.c (elf_link_input_bfd): Reverse copy .ctors/.dtors
1617         sections if needed.
1618
1619         * section.c (SEC_ELF_REVERSE_COPY): New.
1620         * bfd-in2.h: Regenerated.
1621
1622 2011-05-07  Anders Kaseorg  <andersk@ksplice.com>
1623
1624         PR 12739
1625         * libbfd.c (bfd_get_8, bfd_get_signed_8): Use const cast.
1626         * bfd-in2.h: Regenerate.
1627
1628 2011-05-06  Tristan Gingold  <gingold@adacore.com>
1629
1630         * vms-alpha.c (evax_section_flags): Remove SEC_IN_MEMORY.
1631         (_bfd_vms_slurp_egsd): Rename old_flags to vms_flags.  Handle
1632         any code section.  Add comments.
1633         (alpha_vms_object_p): Use void * instead of PTR.
1634         (alpha_vms_create_eisd_for_section): Fix test for setting DZRO.
1635         (build_module_list): Guard against no DST section.  Add comments.
1636         (alpha_vms_link_output_symbol): Discard undefined symbols.
1637         (alpha_vms_get_section_contents): Simply memcpy if the section was
1638         already loaded.  Fix typo.
1639         (vms_new_section_hook): Use void * instead of PTR.
1640         (vms_alpha_vec): Ditto.
1641
1642 2011-05-06  Richard Sandiford  <richard.sandiford@linaro.org>
1643
1644         * elf32-arm.c (cortex_a8_erratum_scan): If the stub is a Thumb
1645         branch to a PLT entry, redirect it to the PLT's Thumb entry point.
1646
1647 2011-05-05  Bernd Schmidt  <bernds@codesourcery.com>
1648
1649         * elf32-tic6x.c (elf32_tic6x_final_link): New function.
1650         (elf32_tic6x_merge_attributes): Do not warn for PID or PIC
1651         mismatch.  Choose the lower of the two values.
1652         (bfd_elf32_bfd_final_link): New macro.
1653
1654 2011-04-28  Tristan Gingold  <gingold@adacore.com>
1655
1656         * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Adjust for x_file.
1657         (bfd_xcoff_swap_aux_out): Ditto.
1658         * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Ditto.
1659         (bfd_xcoff64_swap_aux_out): Ditto.
1660
1661 2011-05-04  Alan Modra  <amodra@gmail.com>
1662
1663         PR ld/12727
1664         * elf64-ppc.c (ppc_build_one_stub <ppc_sub_plt_call>): Clear
1665         was_undefined on dot-symbols.
1666
1667 2011-05-03  Paul Brook  <paul@codesourcery.com>
1668
1669
1670         * elf32-tic6x.c (elf32_tic6x_howto_table,
1671         elf32_tic6x_howto_table_rel, (elf32_tic6x_gc_sweep_hook,
1672         elf32_tic6x_relocate_section, elf32_tic6x_check_relocs):
1673         Add R_C6000_EHTYPE.
1674
1675 2011-05-01  Alan Modra  <amodra@gmail.com>
1676
1677         PR ld/12718
1678         * elf32-i386.c (elf_i386_check_relocs): Ensure dynobj set before
1679         creating ifunc sections.
1680         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1681
1682 2011-04-30  H.J. Lu  <hongjiu.lu@intel.com>
1683
1684         * elf64-x86-64.c (elf_x86_64_merge_symbol): Correct parameter
1685         names.
1686
1687 2011-04-28  Tom Tromey  <tromey@redhat.com>
1688
1689         * bfdio.c (memory_bstat): Pass correct size to memset.
1690
1691 2011-04-28  Mike Frysinger  <vapier@gentoo.org>
1692
1693         * dwarf2.c (dwarf_debug_sections): Mark const.
1694         * elf.c (special_sections): Likewise.
1695         * libbfd-in.h (dwarf_debug_sections): Likewise.
1696         * libbfd.h: Regenerate.
1697
1698 2011-04-26  Kai Tietz  <ktietz@redhat.com>
1699
1700         * coffcode.h (sec_to_styp_flags): Allow linkonce for
1701         debugging sections.
1702
1703 2011-04-26  Tristan Gingold  <gingold@adacore.com>
1704
1705         * coff64-rs6000.c: Convert to ISO-C.  Remove PARAMS and PTR macros.
1706
1707 2011-04-24  Alan Modra  <amodra@gmail.com>
1708
1709         PR ld/12365
1710         PR ld/12696
1711         * coff-aux.c (coff_m68k_aux_link_add_one_symbol): Update "notice" call.
1712         * linker.c (_bfd_link_hash_newfunc): Clear bitfields.
1713         (_bfd_generic_link_add_one_symbol): Update "notice" call.
1714         * elflink.c (_bfd_elf_merge_symbol): Don't skip weak redefs when
1715         it is a redef of an IR symbol in a real BFD.
1716
1717 2011-04-22  H.J. Lu  <hongjiu.lu@intel.com>
1718
1719         * elf32-i386.c (elf_i386_readonly_dynrelocs): Warn relocation
1720         in readonly section in a shared object.
1721         (elf_i386_size_dynamic_sections): Likewise.
1722         * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
1723         (elf_x86_64_size_dynamic_sections): Likewise.
1724
1725 2011-04-21  H.J. Lu  <hongjiu.lu@intel.com>
1726
1727         PR ld/12694
1728         * elf32-i386.c (elf_i386_readonly_dynrelocs): Skip local IFUNC
1729         symbols.
1730         * elf64-x86-64.c (elf_x86_64_readonly_dynrelocs): Likewise.
1731
1732 2011-04-21  H.J. Lu  <hongjiu.lu@intel.com>
1733
1734         * elf32-i386.c (elf_i386_finish_dynamic_symbol): Return false
1735         on dynamic symbol error.
1736         * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
1737
1738 2011-04-20  Tristan Gingold  <gingold@adacore.com>
1739
1740         * config.bfd (alpha*-*-*vms*, ia64*-*-*vms*): Define targ_selvecs.
1741
1742 2011-04-20  Alan Modra  <amodra@gmail.com>
1743
1744         * hash.c (bfd_default_hash_table_size): Make it an unsigned long.
1745         (bfd_hash_table_init_n): Overflow checking.
1746         (bfd_hash_set_default_size): Return current size.  Take unsigned long
1747         arg.  Add 65537 to hash_size primes.
1748         * bfd-in.h (bfd_hash_set_default_size): Update prototype.
1749         * bfd-in2.h: Regenerate.
1750
1751 2011-04-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
1752
1753         * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Fix +1 overrun of
1754         memmove elements.
1755
1756 2011-04-20  Alan Modra  <amodra@gmail.com>
1757
1758         * libbfd.c (bfd_log2): Do return rounded up value.
1759         * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Replace bfd_log2
1760         call with expanded old round down version of the function.
1761
1762         * archive.c (_bfd_get_elt_at_filepos): Don't release n_nfd.
1763         * elflink.c (elf_link_add_object_symbols): Delete redundant code.
1764
1765 2011-04-20  Alan Modra  <amodra@gmail.com>
1766
1767         PR ld/12365
1768         * elfcode.h (elf_slurp_symbol_table): Put common plugin IR symbols
1769         in their own common section.
1770         * elflink.c (elf_link_add_object_symbols): Likewise.
1771         * linker.c (generic_link_check_archive_element): Don't lose flags
1772         if common section is pre-existing.
1773         (_bfd_generic_link_add_one_symbol): Likewise.
1774
1775 2011-04-20  Alan Modra  <amodra@gmail.com>
1776
1777         PR ld/12365
1778         * elflink.c (_bfd_elf_merge_symbol): Update multiple_common calls.
1779         * linker.c (_bfd_generic_link_add_one_symbol): Likewise.  Call
1780         multiple_definition regardless of allow_multiple_definition.
1781         * simple.c (simple_dummy_multiple_definition): Update.
1782         * xcofflink.c (xcoff_link_add_symbols): Update multiple_definition
1783         calls.
1784
1785 2011-04-18  Tristan Gingold  <gingold@adacore.com>
1786
1787         * coff-rs6000.c: Convert to ISO-C.  Remove PARAMS macro.
1788
1789 2011-04-18  Alan Modra  <amodra@gmail.com>
1790
1791         PR ld/12365
1792         PR ld/12672
1793         * bfd.c (BFD_PLUGIN): Define.
1794         (BFD_FLAGS_SAVED, BFD_FLAGS_FOR_BFD_USE_MASK): Add BFD_PLUGIN.
1795         * bfd-in2.h: Regenerate.
1796         * elflink.c (elf_link_output_extsym): Strip undefined plugin syms.
1797         * opncls.c (bfd_make_readable): Don't lose original bfd flags.
1798
1799 2011-04-17  Jan Kratochvil  <jan.kratochvil@redhat.com>
1800
1801         * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Do not check for
1802         SEC_LOAD.
1803
1804 2011-04-15  Sergio Durigan Junior  <sergiodj@redhat.com>
1805
1806         * elf-bfd.h (struct sdt_note): New struct.
1807         (struct elf_obj_tdata) <sdt_note_head>: New field.
1808         * elf.c (elfobj_grok_stapsdt_note_1): New function.
1809         (elfobj_grok_stapsdt_note): Likewise.
1810         (elf_parse_notes): Added code to treat SystemTap note
1811         sections.
1812
1813 2011-04-12  Richard Henderson  <rth@redhat.com>
1814
1815         * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Do not
1816         exclude empty .got sections.
1817
1818 2011-04-11  H.J. Lu  <hongjiu.lu@intel.com>
1819
1820         * elf32-i386.c (elf_i386_reloc_type_lookup): Fix the out of bound
1821         array access for BFD_RELOC_386_IRELATIVE.
1822
1823 2011-04-11  Bernd Schmidt  <bernds@codesourcery.com>
1824
1825         * elf32-tic6x.c (elf32_tic6x_check_relocs): Initialize pc_count field.
1826
1827 2011-04-11  Mark Wielaard  <mjw@redhat.com>
1828
1829         PR 10549
1830         * elf-bfd.h (has_ifunc_symbols): Renamed to has_gnu_symbols.
1831         (has_gnu_symbols): Renamed from has_ifunc_symbols.
1832         * elf.c (_bfd_elf_set_osabi): Use new has_gnu_symbols name.
1833         * elf32-arm.c (elf32_arm_add_symbol_hook): Set has_gnu_symbols
1834         also if STB_GNU_UNIQUE symbol binding was seen.
1835         * elf32-i386.c (elf_i386_add_symbol_hook): Likewise.
1836         * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
1837         * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
1838         * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
1839         * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
1840         * elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise.
1841
1842 2011-04-11  Alan Modra  <amodra@gmail.com>
1843
1844         * bfd-in.h (bfd_get_section_limit): Don't use rawsize with output
1845         sections.
1846         * libbfd.c (_bfd_generic_get_section_contents): Likewise.
1847         (_bfd_generic_get_section_contents_in_window): Likewise.
1848         * section.c (bfd_get_section_contents): Likewise.
1849         * compress.c (bfd_get_full_section_contents): Likewise.
1850         * elf32-rx.c (rx_final_link): Ignore rawsize.
1851         * elf32-microblaze.c (microblaze_elf_relocate_section): Use correct
1852         bfd with bfd_get_section_limit.
1853         * elfxx-ia64.c (elfNN_ia64_choose_gp): Add "final" parameter.  Use
1854         os->size during final link.  Update callers.
1855         * bfd-in2.h: Regenerate.
1856
1857 2011-04-10  Richard Sandiford  <rdsandiford@googlemail.com>
1858
1859         PR ld/12637
1860         * elfxx-mips.c (mips_elf_merge_got_with): Use arg->global_count
1861         as the number of global entries when merging with the primary GOT.
1862
1863 2011-04-09  H.J. Lu  <hongjiu.lu@intel.com>
1864
1865         * elf32-i386.c: Update copyright year.
1866         * elf64-x86-64.c: Likewise.
1867
1868 2011-04-09  Kai Tietz  <ktietz@redhat.com>
1869
1870         * peXXigen.c (_bfd_XXi_final_link_postscripte): Sort pdata in temporary
1871         buffer and use rawsize for sorting.
1872         * coffcode.h (coff_compute_section_file_positions): Set rawsize
1873         before doing alignment.
1874
1875 2011-04-09  H.J. Lu  <hongjiu.lu@intel.com>
1876
1877         * elf32-i386.c (elf_i386_relocate_section): Return relocation
1878         error on unsupported relocation.
1879         * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1880
1881 2011-04-09  H.J. Lu  <hongjiu.lu@intel.com>
1882
1883         PR binutils/12657
1884         * hosts/x86-64linux.h (elf_prstatus32): Replace __pid_t with
1885         pid_t.
1886
1887 2011-04-08  H.J. Lu  <hongjiu.lu@intel.com>
1888
1889         PR ld/12654
1890         * elf32-i386.c (elf_i386_relocate_section): Check !executable
1891         instead of shared for R_386_TLS_LDO_32.
1892
1893 2011-04-08  Tristan Gingold  <gingold@adacore.com>
1894
1895         * Makefile.am (SOURCE_HFILES): Remove xcoff-target.h
1896         * coff-pmac: Remove
1897         * xcoff-target.h: Remove
1898         * Makefile.in: Regenerate.
1899
1900 2011-04-07  Cary Coutant  <ccoutant@google.com>
1901
1902         * dwarf2.c (scan_unit_for_symbols): Check for DW_AT_specification.
1903
1904 2011-04-07  Paul Brook  <paul@codesourcery.com>
1905
1906         * elf32-tic6x.c (elf32_tic6x_howto_table): R_C6000_PREL31 is
1907         pc-relative.
1908         (elf32_tic6x_howto_table_rel): Ditto.
1909         (elf32_tic6x_relocate_section): Implement R_C6000_PREL31.
1910         (elf32_tic6x_check_relocs): Ditto.
1911
1912 2011-04-06  Joseph Myers  <joseph@codesourcery.com>
1913
1914         * config.bfd (thumb-*-oabi): Don't handle in list of obsolete
1915         targets.
1916         (strongarm*, thumb*, xscale*): Remove architectures.
1917         (strongarm-*-kaos*, thumb-*-coff, thumb-*-elf, thumb-epoc-pe*,
1918         thumb-*-pe*, strongarm-*-elf, strongarm-*-coff, xscale-*-elf,
1919         xscale-*-coff): Remove targets.
1920
1921 2011-04-01  Tristan Gingold  <gingold@adacore.com>
1922
1923         * elfxx-ia64.c: include bfd_stdint.h
1924
1925 2011-03-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
1926
1927         * elf32-tic6x.c (elf32_tic6x_relocate_section): Remove unused variable
1928         dynobj and its initialization.
1929
1930 2011-03-31  Tristan Gingold  <gingold@adacore.com>
1931
1932         * makefile.vms (DEFS): Add HAVE_bfd_elf64_ia64_vms_vec.
1933         * configure.com: Set BFD_HOST_64BIT_LONG_LONG and
1934         BFD_HOST_LONG_LONG to 1.
1935
1936 2011-03-31  Tristan Gingold  <gingold@adacore.com>
1937
1938         * vms-alpha.c (vms_get_remaining_object_record): Fix dec-c warning.
1939         (_bfd_vms_write_etir): Ditto.
1940         (_bfd_vms_slurp_etir): Avoid to use intptr_t
1941         * configure.com: Generate bfd_stdint.h
1942
1943 2011-03-31  Bernd Schmidt  <bernds@codesourcery.com>
1944
1945         * elf32-tic6x.h (struct elf32_tic6x_params): New.
1946         (elf32_tic6x_setup): Declare.
1947         * elf32-tic6x.c: Include <limits.h>.
1948         (ELF_DYNAMIC_LINKER, DEFAULT_STACK_SIZE, PLT_ENTRY_SIZE): Define.
1949         (struct elf32_tic6x_link_hash_table, struct elf32_link_hash_entry):
1950         New structures.
1951         (elf32_tic6x_link_hash_table, is_tic6x_elf): New macros.
1952         (tic6x_elf_scom_section, tic6x_elf_scom_symbol,
1953         tic6x_elf_scom_symbol_ptr): New static variables.
1954         (elf32_tic6x_howto_table, elf32_tic6x_howto_table_rel,
1955         elf32_tic6x_reloc_map): Add R_C6000_JUMP_SLOT, R_C6000_EHTYPE,
1956         R_C6000_PCR_H16 and R_C6000_PCR_L16.
1957         (elf32_tic6x_link_hash_newfunc, elf32_tic6x_link_hash_table_create,
1958         elf32_tic6x_link_hash_table_free, elf32_tic6x_setup,
1959         elf32_tic6x_using_dsbt, elf32_tic6x_install_rela,
1960         elf32_tic6x_create_dynamic_sections, elf32_tic6x_make_got_dynreloc,
1961         elf32_tic6x_finish_dynamic_symbol, elf32_tic6x_gc_sweep_hook,
1962         elf32_tic6x_adjust_dynamic_symbol): New static functions.
1963         (elf32_tic6x_relocate_section): For R_C6000_PCR_S21, convert branches
1964         to weak symbols as required by the ABI.
1965         Handle GOT and DSBT_INDEX relocs, and copy relocs to the output file
1966         as needed when generating DSBT output.
1967         (elf32_tic6x_check_relocs, elf32_tic6x_add_symbol_hook,
1968         elf32_tic6x_symbol_processing, elf32_tic6x_section_from_bfd_section,
1969         elf32_tic6x_allocate_dynrelocs, elf32_tic6x_size_dynamic_sections,
1970         elf32_tic6x_always_size_sections, elf32_tic6x_modify_program_headers,
1971         elf32_tic6x_finish_dynamic_sections, elf32_tic6x_plt_sym_val,
1972         elf32_tic6x_copy_private_data, elf32_tic6x_link_omit_section_dynsym):
1973         New static functions.
1974         (ELF_MAXPAGESIZE): Define to 0x1000.
1975         (bfd_elf32_bfd_copy_private_bfd_data,
1976         bfd_elf32_bfd_link_hash_table_create,
1977         bfd_elf32_bfd_link_hash_table_free, elf_backend_can_refcount,
1978         elf_backend_want_got_plt, elf_backend_want_dynbss,
1979         elf_backend_plt_readonly, elf_backend_got_header_size,
1980         elf_backend_gc_sweep_hook, elf_backend_modify_program_headers,
1981         elf_backend_create_dynamic_sections, elf_backend_adjust_dynamic_symbol,
1982         elf_backend_check_relocs, elf_backend_add_symbol_hook,
1983         elf_backend_symbol_processing, elf_backend_link_output_symbol_hook,
1984         elf_backend_section_from_bfd_section,
1985         elf_backend_finish_dynamic_symbol, elf_backend_always_size_sections,
1986         elf32_tic6x_size_dynamic_sections, elf_backend_finish_dynamic_sections,
1987         elf_backend_omit_section_dynsym, elf_backend_plt_sym_val): Define.
1988
1989         * bfd/reloc.c (BFD_RELOC_C6000_JUMP_SLOT, BFD_RELOC_C6000_EHTYPE,
1990         BFD_RELOC_C6000_PCR_H16, BFD_RELOC_C6000_PCR_S16): Add.
1991         * bfd/bfd-in2.h: Regenerate.
1992         * bfd/libbfd.h: Regenerate.
1993         * config.bfd: Accept tic6x-*-* instead of tic6x-*-elf.
1994
1995 2011-03-31  Tristan Gingold  <gingold@adacore.com>
1996
1997         * coffcode.h (coff_slurp_symbol_table): Silently discard C_NULL
1998         entry on xcoff when value is C_NULL_VALUE.
1999
2000 2011-03-31  Tristan Gingold  <gingold@adacore.com>
2001
2002         * libcoff-in.h (exec_hdr): Remove.
2003         * libcoff.h: Regenerate.
2004
2005 2011-03-30  Nick Clifton  <nickc@redhat.com>
2006
2007         * po/da.po: Updated Danish translation.
2008
2009 2011-03-29  Richard Henderson  <rth@redhat.com>
2010
2011         * elf64-alpha.c (elf64_alpha_gc_mark_hook): New.
2012         (elf64_alpha_gc_sweep_hook): New.
2013         (elf_backend_gc_mark_hook, elf_backend_gc_sweep_hook): New.
2014         (elf_backend_can_gc_sections): New.
2015
2016 2011-03-26  John Marino  <binutils@marino.st>
2017
2018         * config.bfd: Add x86_64-*-dragonfly*, fix i386-*-dragonfly*.
2019         * configure.in: Delete unused bfd_elf32_i386_dragonfly_vec.
2020         * configure: Regenerate.
2021
2022 2011-03-25  Michael Snyder  <msnyder@vmware.com>
2023
2024         * coffcode.h (coff_set_alignment_hook): Check return of bfd_seek.
2025
2026 2011-03-25  Tristan Gingold  <gingold@adacore.com>
2027
2028         * vms-alpha.c (_bfd_vms_find_nearest_dst_line): Allow the use
2029         of find_nearest_line on object files.
2030
2031 2011-03-25  Tristan Gingold  <gingold@adacore.com>
2032
2033         * vms-alpha.c (evax_section_flags): Make $CODE$ section read-only.
2034         Minor reordering.
2035         (alpha_vms_create_eisd_for_section): Make code sections read-only.
2036
2037 2011-03-24  Alan Modra  <amodra@gmail.com>
2038
2039         * elf32-ppc.c (ppc_elf_tls_optimize): Catch more cases where
2040         old-style __tls_get_addr calls without marker relocs don't match
2041         their arg setup insn one for one.  If such mismatches are found
2042         report the reloc and don't do any tls optimization.
2043         * elf64-ppc.c (ppc64_elf_tls_optimize): Likewise.
2044
2045 2011-03-22  Eric B. Weddington  <eric.weddington@atmel.com>
2046
2047         * bfd-in2.h: Regenerate.
2048
2049 2011-03-22  Eric B. Weddington  <eric.weddington@atmel.com>
2050
2051         * archures.c: Add AVR XMEGA architecture information.
2052         * cpu-avr.c (arch_info_struct): Likewise.
2053         * elf32-avr.c (bfd_elf_avr_final_write_processing): Likewise.
2054         (elf32_avr_object_p): Likewise.
2055
2056 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
2057
2058         * reloc.c (BFD_RELOC_ARM_IRELATIVE): New relocation.
2059         * bfd-in2.h: Regenerate.
2060         * elf32-arm.c (elf32_arm_howto_table_2): Rename existing definition
2061         to elf32_arm_howto_table_3 and replace with a single R_ARM_IRELATIVE
2062         entry.
2063         (elf32_arm_howto_from_type): Update accordingly.
2064         (elf32_arm_reloc_map): Map BFD_RELOC_ARM_IRELATIVE to R_ARM_IRELATIVE.
2065         (elf32_arm_reloc_name_lookup): Handle elf32_arm_howto_table_3.
2066         (arm_plt_info): New structure, split out from elf32_arm_link_hash_entry
2067         with an extra noncall_refcount field.
2068         (arm_local_iplt_info): New structure.
2069         (elf_arm_obj_tdata): Add local_iplt.
2070         (elf32_arm_local_iplt): New accessor macro.
2071         (elf32_arm_link_hash_entry): Replace plt_thumb_refcount,
2072         plt_maybe_thumb_refcount and plt_got_offset with an arm_plt_info.
2073         Change tls_type to a bitfield and add is_iplt.
2074         (elf32_arm_link_hash_newfunc): Update accordingly.
2075         (elf32_arm_allocate_local_sym_info): New function.
2076         (elf32_arm_create_local_iplt): Likewise.
2077         (elf32_arm_get_plt_info): Likewise.
2078         (elf32_arm_plt_needs_thumb_stub_p): Likewise.
2079         (elf32_arm_get_local_dynreloc_list): Likewise.
2080         (create_ifunc_sections): Likewise.
2081         (elf32_arm_copy_indirect_symbol): Update after the changes to
2082         elf32_arm_link_hash_entry.  Assert the is_iplt has not yet been set.
2083         (arm_type_of_stub): Add an st_type argument.  Use elf32_arm_get_plt_info
2084         to get PLT information.  Assert that all STT_GNU_IFUNC references
2085         are turned into PLT references.
2086         (arm_build_one_stub): Pass the symbol type to
2087         elf32_arm_final_link_relocate.
2088         (elf32_arm_size_stubs): Pass the symbol type to arm_type_of_stub.
2089         (elf32_arm_allocate_irelocs): New function.
2090         (elf32_arm_add_dynreloc): In static objects, use .rel.iplt for
2091         all R_ARM_IRELATIVE.
2092         (elf32_arm_allocate_plt_entry): New function.
2093         (elf32_arm_populate_plt_entry): Likewise.
2094         (elf32_arm_final_link_relocate): Add an st_type parameter.
2095         Set srelgot to null for static objects.  Use separate variables
2096         to record which st_value and st_type should be used when generating
2097         a dynamic relocation.  Use elf32_arm_get_plt_info to find the
2098         symbol's PLT information, setting has_iplt_entry, splt,
2099         plt_offset and gotplt_offset accordingly.  Check whether
2100         STT_GNU_IFUNC symbols should resolve to an .iplt entry, and change
2101         the relocation target accordingly.  Broaden assert to include
2102         .iplts.  Don't set sreloc for static relocations.  Assert that
2103         we only generate dynamic R_ARM_RELATIVE relocations for R_ARM_ABS32
2104         and R_ARM_ABS32_NOI.  Generate R_ARM_IRELATIVE relocations instead
2105         of R_ARM_RELATIVE relocations if the target is an STT_GNU_IFUNC
2106         symbol.  Pass the symbol type to arm_type_of_stub.  Conditionally
2107         resolve GOT references to the .igot.plt entry.
2108         (elf32_arm_relocate_section): Update the call to
2109         elf32_arm_final_link_relocate.
2110         (elf32_arm_gc_sweep_hook): Use elf32_arm_get_plt_info to get PLT
2111         information.  Treat R_ARM_REL32 and R_ARM_REL32_NOI as call
2112         relocations in shared libraries and relocatable executables.
2113         Count non-call PLT references.  Use elf32_arm_get_local_dynreloc_list
2114         to get the list of dynamic relocations for a local symbol.
2115         (elf32_arm_check_relocs): Always create ifunc sections.  Set isym
2116         at the same time as setting h.  Use elf32_arm_allocate_local_sym_info
2117         to allocate local symbol information.  Treat R_ARM_REL32 and
2118         R_ARM_REL32_NOI as call relocations in shared libraries and
2119         relocatable executables.  Record PLT information for local
2120         STT_GNU_IFUNC functions as well as global functions.   Count
2121         non-call PLT references.  Use elf32_arm_get_local_dynreloc_list
2122         to get the list of dynamic relocations for a local symbol.
2123         (elf32_arm_adjust_dynamic_symbol): Handle STT_GNU_IFUNC symbols.
2124         Don't remove STT_GNU_IFUNC PLTs unless all references have been
2125         removed.  Update after the changes to elf32_arm_link_hash_entry.
2126         (allocate_dynrelocs_for_symbol): Decide whether STT_GNU_IFUNC PLT
2127         entries should live in .plt or .iplt.  Check whether the .igot.plt
2128         and .got entries can be combined.  Use elf32_arm_allocate_plt_entry
2129         to allocate .plt and .(i)got.plt entries.  Detect which .got
2130         entries will need R_ARM_IRELATIVE relocations and use
2131         elf32_arm_allocate_irelocs to allocate them.  Likewise other
2132         non-.got dynamic relocations.
2133         (elf32_arm_size_dynamic_sections): Allocate .iplt, .igot.plt
2134         and dynamic relocations for local STT_GNU_IFUNC symbols.
2135         Check whether the .igot.plt and .got entries can be combined.
2136         Detect which .got entries will need R_ARM_IRELATIVE relocations
2137         and use elf32_arm_allocate_irelocs to allocate them.  Use stashed
2138         section pointers intead of strcmp checks.  Handle iplt and igotplt.
2139         (elf32_arm_finish_dynamic_symbol): Use elf32_arm_populate_plt_entry
2140         to fill in .plt, .got.plt and .rel(a).plt entries.  Point
2141         STT_GNU_IFUNC symbols at an .iplt entry if non-call relocations
2142         resolve to it.
2143         (elf32_arm_output_plt_map_1): New function, split out from
2144         elf32_arm_output_plt_map.  Handle .iplt entries.  Use
2145         elf32_arm_plt_needs_thumb_stub_p.
2146         (elf32_arm_output_plt_map): Call it.
2147         (elf32_arm_output_arch_local_syms): Add mapping symbols for
2148         local .iplt entries.
2149         (elf32_arm_swap_symbol_in): Handle Thumb STT_GNU_IFUNC symbols.
2150         (elf32_arm_swap_symbol_out): Likewise.
2151         (elf32_arm_add_symbol_hook): New function.
2152         (elf_backend_add_symbol_hook): Define for all targets.
2153
2154 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
2155
2156         * elf-bfd.h (elf_link_hash_entry): Add target_internal.
2157         * elf.c (swap_out_syms): Set st_target_internal for each
2158         Elf_Internal_Sym.
2159         * elfcode.h (elf_swap_symbol_in): Likewise.
2160         * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise.
2161         * elf32-sh-symbian.c (sh_symbian_relocate_section): Likewise.
2162         * elf64-sparc.c (elf64_sparc_output_arch_syms): Likewise.
2163         * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Likewise.
2164         * elflink.c (elf_link_output_extsym): Likewise.
2165         (bfd_elf_final_link): Likewise.
2166         (elf_link_add_object_symbols): Copy st_target_internal
2167         to the hash table if we see a definition.
2168         (_bfd_elf_copy_link_hash_symbol_type): Copy target_internal.
2169         * elf32-arm.c (elf32_arm_stub_hash_entry): Replace st_type with
2170         a branch_type field.
2171         (a8_erratum_fix, a8_erratum_reloc): Likewise.
2172         (arm_type_of_stub): Replace actual_st_type with an
2173         actual_branch_type parameter.
2174         (arm_build_one_stub): Use branch types rather than st_types to
2175         determine the type of branch.
2176         (cortex_a8_erratum_scan): Likewise.
2177         (elf32_arm_size_stubs): Likewise.
2178         (bfd_elf32_arm_process_before_allocation): Likewise.
2179         (allocate_dynrelocs_for_symbol): Likewise.
2180         (elf32_arm_finish_dynamic_sections): Likewise.
2181         (elf32_arm_final_link_relocate): Replace sym_flags parameter with
2182         a branch_type parameter.
2183         (elf32_arm_relocate_section): Update call accordingly.
2184         (elf32_arm_adjust_dynamic_symbol): Don't check STT_ARM_TFUNC.
2185         (elf32_arm_output_map_sym): Initialize st_target_internal.
2186         (elf32_arm_output_stub_sym): Likewise.
2187         (elf32_arm_symbol_processing): Delete.
2188         (elf32_arm_swap_symbol_in): Convert STT_ARM_TFUNCs into STT_FUNCs.
2189         Use st_target_internal to record the branch type.
2190         (elf32_arm_swap_symbol_out): Use st_target_internal to test for
2191         Thumb functions.
2192         (elf32_arm_is_function_type): Delete.
2193         (elf_backend_symbol_processing): Likewise.
2194         (elf_backend_is_function_type): Likewise.
2195
2196 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
2197
2198         * elf32-arm.c (elf32_arm_check_relocs): Always assign a dynobj.
2199         (elf32_arm_finish_dynamic_sections): Move sgot != NULL assertion
2200         into the PLT block.
2201
2202 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
2203
2204         * elf32-arm.c (elf32_arm_check_relocs): Use call_reloc_p,
2205         may_need_local_target_p and may_become_dynamic_p to classify
2206         the relocation type.  Don't check info->symbolic or h->def_regular
2207         when deciding whether to record a potential dynamic reloc.
2208         Don't treat potential dynamic relocs as PLT references.
2209         (elf32_arm_gc_sweep_hook): Update to match.  Assert that we don't
2210         try to make the PLT reference count go negative.
2211
2212 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
2213
2214         * elf32-arm.c (elf32_arm_final_link_relocate): Always fill in the
2215         GOT entry here, rather than leaving it to finish_dynamic_symbol.
2216         Only create a dynamic relocation for local references if
2217         info->shared.
2218         (allocate_dynrelocs_for_symbol): Update dynamic relocation
2219         allocation accordingly.
2220         (elf32_arm_finish_dynamic_symbol): Don't initialise the GOT entry here.
2221
2222 2011-03-14  Richard Sandiford  <richard.sandiford@linaro.org>
2223
2224         * elf32-arm.c (elf32_arm_allocate_dynrelocs): New function.
2225         (elf32_arm_add_dynreloc): Likewise.
2226         (elf32_arm_adjust_dynamic_symbol): Use elf32_arm_allocate_dynrelocs
2227         to allocate dynamic relocations.
2228         (elf32_arm_size_dynamic_sections): Likewise.
2229         (allocate_dynrelocs): Likewise.  Rename to
2230         allocate_dynrelocs_for_symbol.
2231         (elf32_arm_final_link_relocate): Use elf32_arm_add_dynreloc to
2232         create dynamic relocations.
2233         (elf32_arm_finish_dynamic_symbol): Likewise.
2234
2235 2011-03-12  H.J. Lu  <hongjiu.lu@intel.com>
2236
2237         * elf64-x86-64.c (elf_x86_64_check_tls_transition): Supprt TLS
2238         x32 GD->IE and GD->LE transitions.
2239         (elf_x86_64_relocate_section): Supprt TLS x32 GD->IE, GD->LE
2240         and LD->LE transitions.
2241
2242 2011-03-10  Alan Modra  <amodra@gmail.com>
2243
2244         * elf64-ppc.c (ppc64_elf_relocate_section): Provide section/offset
2245         for LO_DS error message and correct multiple.
2246
2247 2011-03-10  Alan Modra  <amodra@gmail.com>
2248
2249         * elf64-ppc.c (bfd_elf64_bfd_link_just_syms): Define.
2250         (ppc64_elf_link_just_syms): New function.
2251         (opd_entry_value): Don't assume big-endian host.
2252         (get_r2off): New function.
2253         (ppc_build_one_stub, ppc_size_one_stub): Use it here.
2254
2255 2011-03-06  Michael Snyder  <msnyder@vmware.com>
2256
2257         * compress.c (bfd_compress_section_contents): Check for out of mem.
2258
2259         * elf64-x86-64.c (elf_x86_64_relocate_section): Document
2260         that case statement falls through intentionally.
2261
2262         * elf32-i386.c (elf_i386_relocate_section): Document fall through.
2263
2264 2011-03-04  Alan Modra  <amodra@gmail.com>
2265
2266         * archive.c (bsd_write_armap): Don't call stat in deterministic
2267         mode, and don't use st_mtime if stat returns error.
2268
2269 2011-03-03  Michael Snyder  <msnyder@vmware.com>
2270
2271         * elf64-x86-64.c (elf_x86_64_relocate_section): Remove dead code.
2272
2273         * coff-x86_64.c (coff_amd64_rtype_to_howto): Fencepost error.
2274
2275         * aoutx.h (aout_final_link): Use sizeof int not sizeof int*.
2276         (aout_link_write_other_symbol): Missing break statement.
2277
2278         * dwarf2.c (scan_unit_for_symbols): Stop memory leak.
2279
2280         * archive.c (_bfd_slurp_extended_name_table): Fail if bfd_seek fails.
2281
2282 2011-03-03  H.J. Lu  <hongjiu.lu@intel.com>
2283
2284         * elf64-x86-64.c (elf_x86_64_check_tls_transition): Supprt TLS
2285         x32 IE->LE transition.
2286         (elf_x86_64_relocate_section): Likewise.
2287
2288 2011-03-02  Bernd Schmidt  <bernds@codesourcery.com>
2289
2290         * elflink.c (is_reloc_section): Remove function.
2291         (get_dynamic_reloc_section_name): Construct string manually.
2292
2293 2011-02-28  Kai Tietz  <kai.tietz@onevision.com>
2294
2295         * archive.c (_bfd_find_nested_archive): Use filename_(n)cmp.
2296         (adjust_relative_path): Likewise.
2297         (_bfd_construct_extended_name_table): Likewise.
2298         * corefile.c (generic_core_file_matches_executable_p): Likewise.
2299         * elf32-bfin.c (bfinfdpic_relocate_section): Likewise.
2300         * elf32-frv.c (elf32_frv_relocate_section): Likewise.
2301         * elf32-spu.c (sort_bfds): Likewise.
2302         (spu_elf_auto_overlay): Likewise.
2303         * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
2304         * xcofflink.c (xcoff_set_import_path): Likewise.
2305         * xtensa-isa.c (xtensa_regfile_lookup): Likewise.
2306         (xtensa_regfile_lookup_shortname): Likewise.
2307
2308 2011-02-28  Alan Modra  <amodra@gmail.com>
2309
2310         PR 12513
2311         * archive.c (bfd_slurp_bsd_armap_f2): Sanity check parsed_size and
2312         stringsize.  Properly sanity check symdef_count.  Remove redundant
2313         bfd_release.
2314
2315 2011-02-25  Rafael Ávila de Espíndola <respindola@mozilla.com>
2316
2317         * plugin.c (bfd_plugin_object_p): Correctly set the filesize
2318         and handle claim_file seeking. Only try to load the plugin once.
2319
2320 2011-02-22  Andreas Schwab  <schwab@redhat.com>
2321
2322         * elf32-m68k.c (elf_m68k_finish_dynamic_symbol): For a TLS_GD
2323         relocation read the value from the second GOT slot.
2324
2325 2011-02-15  Tristan Gingold  <gingold@adacore.com>
2326
2327         * vms-alpha.c (alpha_vms_link_add_archive_symbols): Add a comment.
2328
2329 2011-02-15  Alan Modra  <amodra@gmail.com>
2330
2331         * elf64-ppc.c (ppc64_elf_edit_toc): Reinstate second read of
2332         toc relocs.  Fuss over free(NULL).
2333
2334 2011-02-14  Mike Frysinger  <vapier@gentoo.org>
2335
2336         * elflink.c (bfd_elf_size_dynamic_sections): Add
2337         bfd_get_symbol_leading_char to the start of newname.
2338
2339 2011-02-13  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2340
2341         * configure: Regenerate.
2342
2343 2011-02-09  Alan Modra  <amodra@gmail.com>
2344
2345         * elf64-ppc.c (ppc64_elf_edit_toc): Don't free toc relocs until
2346         we are done.  When optimising large toc, check that a global
2347         symbol on a toc reloc is defined in a kept section.
2348
2349 2011-02-08  Nick Clifton  <nickc@redhat.com>
2350
2351         PR binutils/12467
2352         * elf.c (assign_file_positions_for_load_sections): Set the program
2353         header offset and entry size to zero if there are no program
2354         headers.
2355
2356 2011-02-08  Alan Modra  <amodra@gmail.com>
2357
2358         * elf64-ppc.c (ppc64_elf_edit_toc): Don't segfault on NULL
2359         local_syms when looking for local symbols in .toc.
2360
2361 2011-02-01  Alan Modra  <amodra@gmail.com>
2362
2363         * elf64-ppc.c (ppc64_elf_next_input_section): Use elf_gp value
2364         for toc pointer on any section having makes_toc_func_call set.
2365         (check_pasted_section): Ensure pasted .init/.fini fragments use
2366         the same toc if any has makes_toc_func_call set.
2367
2368 2011-01-28  Joseph Myers  <joseph@codesourcery.com>
2369
2370         * elf32-ppc.c (ppc_elf_link_hash_newfunc): Initialize has_sda_refs
2371         field.
2372
2373 2011-01-22  Richard Sandiford  <rdsandiford@googlemail.com>
2374
2375         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Ignore
2376         common sections too.
2377
2378 2011-01-18  H.J. Lu  <hongjiu.lu@intel.com>
2379
2380         * elf64-x86-64.c (elf_backend_want_plt_sym): Redefine to 0 after
2381         Solaris target.
2382
2383 2011-01-18  Pierre Muller  <muller@ics.u-strasbg.fr>
2384
2385         Fix compilation for mingw64.
2386         * coffcode.h (coff_slurp_symbol_table): Add intptr_t intermediate
2387         typecast to avoid warning.
2388         * elf32-rx.c: Add "bfd_stdint.h" include required for int32_t type
2389         usage.
2390         * elfxx-ia64.c (elfNN_ia64_relax_br): Use intptr_t typeacast instead
2391         of long for pointer to avoid warning.
2392         (elfNN_ia64_relax_brl): Idem.
2393         (elfNN_ia64_install_value): Idem.
2394         * vms-alpha.c (_bfd_vms_slurp_etir): Idem.
2395
2396 2011-01-17  Richard Sandiford  <richard.sandiford@linaro.org>
2397
2398         * elf32-arm.c (elf32_arm_check_relocs): Check needs_plt rather than
2399         h->needs_plt when deciding whether to record a possible dynamic reloc.
2400
2401 2011-01-17  Richard Sandiford  <richard.sandiford@linaro.org>
2402
2403         * elf32-arm.c (elf32_arm_gc_sweep_hook): Remove all registered
2404         dynamic relocs for the removed section.
2405
2406 2011-01-15  H.J. Lu  <hongjiu.lu@intel.com>
2407
2408         * elf64-x86-64.c (elf_x86_64_check_relocs): Check invalid x32
2409         relocations.
2410
2411 2011-01-14  H.J. Lu  <hongjiu.lu@intel.com>
2412
2413         * elf64-x86-64.c (elf_x86_64_link_hash_table): Add pointer_r_type.
2414         (elf_x86_64_link_hash_table_create): Set pointer_r_type.
2415         (elf_x86_64_check_relocs): Handle R_X86_64_32 like R_X86_64_64
2416         for ILP32.  Remove ABI_64_P PIC check for R_X86_64_8,
2417         R_X86_64_16, R_X86_64_32 and R_X86_64_32S.
2418         (elf_x86_64_relocate_section):  Handle R_X86_64_32 like R_X86_64_64
2419         for ILP32.
2420
2421 2011-01-14  Alan Modra  <amodra@gmail.com>
2422
2423         * bfd.c (bfd_perror): Flush stdout before and stderr after printing
2424         error.
2425         (_bfd_default_error_handler): Likewise.
2426         * elf.c (print_segment_map): Likewise.
2427         * libbfd.c (warn_deprecated): Likewise.
2428         * som.c (som_sizeof_headers): No need to do so here.
2429         * coff-i860.c: Replace use of printf for error messages with
2430         _bfd_error_handler.
2431         * coff-ppc.c: Likewise.
2432         * coff-sh.c: Likewise.
2433         * elf32-bfin.c: Likewise.
2434         * elf32-dlx.c: Likewise.
2435         * elf32-mep.c: Likewise.
2436         * elf32-v850.c: Likewise.
2437         * mach-o.c: Likewise.
2438         * pef.c: Likewise.
2439
2440 2011-01-13  H.J. Lu  <hongjiu.lu@intel.com>
2441
2442         * elf64-x86-64.c (elf_x86_64_link_hash_table): Remove
2443         swap_reloca_out.
2444         (elf_x86_64_link_hash_table_create): Don't set swap_reloca_out.
2445         (elf_x86_64_check_relocs): Align relocation section to 4 byte
2446         for 32bit.
2447         (elf_x86_64_gc_sweep_hook): Replace ELF64_ST_TYPE with
2448         ELF_ST_TYPE.
2449         (elf_x86_64_finish_dynamic_symbol): Updated.
2450         (elf_x86_64_finish_dynamic_sections): Don't use
2451         Elf64_External_Dyn, bfd_elf64_swap_dyn_in, nor
2452         bfd_elf64_swap_dyn_out.
2453
2454 2011-01-14  J. Park  <grassman@gmail.com>
2455
2456         PR ld/12339
2457         * elf32-arm.c (allocate_dynrelocs): Don't set up eh before
2458         following bfd_link_hash_warning symbol link.
2459
2460 2011-01-10  Nathan Sidwell  <nathan@codesourcery.com>
2461             Glauber de Oliveira Costa  <glommer@gmail.com>
2462
2463         * reloc.c (BFD_RELOC_ARM_TLS_GOTDESC, BFD_RELOC_ARM_TLS_CALL,
2464         BFD_RELOC_ARM_THM_TLS_CALL, BFD_RELOC_ARM_TLS_DESCSEQ,
2465         BFD_RELOC_ARM_THM_TLS_DESCSEQ, BFD_RELOC_ARM_TLS_DESC): New
2466         relocations.
2467         * libbfd.h: Rebuilt.
2468         * bfd-in2.h: Rebuilt.
2469         * elf32-arm.c (elf32_arm_howto_table_1): Add new relocations.
2470         (elf32_arm_reloc_map): Likewise.
2471         (tls_trampoline, dl_tlsdesc_lazy_trampoline): New PLT templates.
2472         (elf32_arm_stub_long_branch_any_tls_pic,
2473         elf32_arm_stub_long_branch_v4t_thumb_tls_pic): New stub templates.
2474         (DEF_STUBS): Add new stubs.
2475         (struct_elf_arm_obj_data): Add local_tlsdesc_gotent field.
2476         (elf32_arm_local_tlsdesc_gotent): New.
2477         (GOT_TLS_GDESC): New mask.
2478         (GOT_TLS_GD_ANY): Define.
2479         (struct elf32_arm_link_hash_entry): Add tlsdesc_got field.
2480         (elf32_arm_compute_jump_table_size): New.
2481         (struct elf32_arm_link_hash_table): Add next_tls_desc_index,
2482         num_tls_desc, dt_tlsdesc_plt, dt_tlsdesc_got, tls_trampoline,
2483         sgotplt_jump_table_size fields.
2484         (elf32_arm_link_hash_newfunc): Initialize tlsdesc_got field.
2485         (elf32_arm_link_hash_table_create): Initialize new fields.
2486         (arm_type_of_stub): Check TLS desc relocs too.
2487         (elf32_arm_stub_name): TLS desc relocs can be shared.
2488         (elf32_arm_tls_transition): Determine relaxation.
2489         (arm_stub_required_alignment): Add tls stubs.
2490         (elf32_arm_size_stubs): Likewise.
2491         (elf32_arm_tls_relax): Perform TLS relaxing.
2492         (elf32_arm_final_link_relocate): Process TLS DESC relocations.
2493         (IS_ARM_TLS_GNU_RELOC): New.
2494         (IS_ARM_TLS_RELOC): Use it.
2495         (elf32_arm_relocate_section): Perform TLS relaxing.
2496         (elf32_arm_check_relocs): Anticipate TLS relaxing, process tls
2497         desc relocations.
2498         (allocate_dynrelocs): Allocate tls desc relcoations.
2499         (elf32_arm_output_arch_local_syms): Emit tls trampoline mapping
2500         symbols.
2501         (elf32_arm_size_dynamic_sections): Allocate tls trampolines and
2502         got slots.
2503         (elf32_arm_always_size_sections): New. Create _TLS_MODULE_BASE
2504         symbol.
2505         (elf32_arm_finish_dynamic_symbol): Adjust.
2506         (arm_put_trampoline): New.
2507         (elf32_arm_finish_dynamic_sections): Emit new dynamic tags and tls
2508         trampolines.
2509         (elf_backend_always_size_sections): Define.
2510
2511 2011-01-06  H.J. Lu  <hongjiu.lu@intel.com>
2512
2513         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Optimized.
2514
2515 2011-01-06  H.J. Lu  <hongjiu.lu@intel.com>
2516
2517         PR ld/12366
2518         PR ld/12371
2519         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Properly
2520         handle symbols marked with regular reference, but not non-GOT
2521         reference when building shared library.
2522
2523         * elf32-i386.c (elf_i386_gc_sweep_hook): Properly handle
2524         local and global STT_GNU_IFUNC symols when building shared
2525         library.
2526         * elf64-x86-64.c (elf_x86_64_gc_sweep_hook): Likewise.
2527
2528 2011-01-05  DJ Delorie  <dj@redhat.com>
2529
2530         * reloc.c: Add BFD_RELOC_RX_OP_NEG.
2531         * libbfd.h: Regenerate.
2532         * bfd-in2.h: Regenerate.
2533         * elf32-rx.c: Add it to the list, corresponding to R_RX_OPneg.
2534
2535 2011-01-03  H.J. Lu  <hongjiu.lu@intel.com>
2536
2537         * cpu-i386.c (bfd_i386_compatible): New.
2538         (bfd_x64_32_arch_intel_syntax): Replace bfd_default_compatible
2539         with bfd_i386_compatible.
2540         (bfd_x86_64_arch_intel_syntax): Likewise.
2541         (bfd_i386_arch_intel_syntax): Likewise.
2542         (i8086_arch): Likewise.
2543         (bfd_x64_32_arch): Likewise.
2544         (bfd_x86_64_arch): Likewise.
2545         (bfd_i386_arch): Likewise.
2546
2547 For older changes see ChangeLog-2010
2548 \f
2549 Local Variables:
2550 mode: change-log
2551 left-margin: 8
2552 fill-column: 74
2553 version-control: never
2554 End: