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