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