* syms.c (_bfd_stab_section_find_nearest_line): Add last_str
[external/binutils.git] / bfd / ChangeLog
1 2013-06-03  Alan Modra  <amodra@gmail.com>
2
3         * syms.c (_bfd_stab_section_find_nearest_line): Add last_str
4         var.  Use it with last_stab.
5
6 2013-05-30  Paul Brook  <paul@codesourcery.com>
7
8         * bfd-in2.h: Regenerate.
9         * elf32-mips.c (elf_mips_eh_howto): New.
10         (bfd_elf32_bfd_reloc_type_lookup ): Support BFD_RELOC_MIPS_EH.
11         (bfd_elf32_bfd_reloc_name_lookup): Likewise.
12         (mips_elf32_rtype_to_howto): Support R_MIPS_EH.
13         * elf64-mips.c (elf_mips_eh_howto): New.
14         (bfd_elf64_bfd_reloc_type_lookup): Support BFD_RELOC_MIPS_EH.
15         (bfd_elf64_bfd_reloc_name_lookup): Likewise.
16         (mips_elf64_rtype_to_howto): Support R_MIPS_EH.
17         * libbfd.h: Regenerate.
18         * reloc.c (BFD_RELOC_MIPS_EH): New.
19
20 2013-05-29  Nick Clifton  <nickc@redhat.com>
21
22         * dwarf2.c (struct dwarf2_debug): Add fields for handling
23         alternate debug info source.
24         (dwarf_debug_sections): Add entries for alternate .debug_str and
25         .debug_info sections.
26         (dwarf_debug_section_enum): Likewise.
27         (read_alt_indirect_string): New function.  Handles a
28         DW_FORM_GNU_strp_alt attribute.
29         (read_alt_indirect_ref): New function.  Handles a
30         DW_FORM_GNU_ref_alt attribute.
31         (read_attribute_value): Process DW_FORM_GNU_ref_alt and
32         DW_FORM_GNU_strp_alt.
33         (find_abstract_instance_name): Handle DW_FORM_GNU_ref_alt
34         attributes.
35         (_bfd_dwarf2_cleanup_debug_info): Free alternate debug info
36         sources.
37         * opncls.c (GNU_DEBUGALTLINK): Define.
38         (bfd_get_alt_debug_link_info): New function.
39         (separate_alt_debug_file_exists): New function.
40         (find_separate_debug_file): Add parameters for fetch and check
41         functions.
42         (bfd_follow_gnu_debugaltlink): New function.
43         * bfd-in2.h: Regenerate.
44
45 2013-05-28  Yufeng Zhang  <yufeng.zhang@arm.com>
46
47         * reloc.c (BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE): Rename to ...
48         (BFD_RELOC_AARCH64_TLSDESC_ADR_PAGE21): ... this.
49         (BFD_RELOC_AARCH64_TLSDESC_LD64_PREL19): Rename to ...
50         (BFD_RELOC_AARCH64_TLSDESC_LD_PREL19): ...  this.
51         * bfd-in2.h: Regenerate.
52         * libbfd.h: Regenerate.
53         * elf64-aarch64.c (IS_AARCH64_TLSDESC_RELOC): Update to use
54         the correct names.
55         (elf64_aarch64_tlsdesc_howto_table): Likewise.
56         (elf64_aarch64_reloc_map): Likewise.
57         (aarch64_resolve_relocation): Likewise.
58         (bfd_elf_aarch64_put_addend): Likewise.
59         (aarch64_tls_transition_without_check): Likewise.
60         (aarch64_reloc_got_type): Likewise.
61         (elf64_aarch64_final_link_relocate): Likewise.
62         (elf64_aarch64_tls_relax): Likewise.
63         (elf64_aarch64_relocate_section): Likewise.
64         (elf64_aarch64_gc_sweep_hook): Likewise.
65         (elf64_aarch64_check_relocs): Likewise.
66
67 2013-05-26  Mark Wielaard  <mjw@redhat.com>
68
69         * cache.c (BFD_CACHE_MAX_OPEN): Remove define.
70         (max_open_files): New static int initialized to zero.
71         (bfd_cache_max_open): New static function to set and return
72         max_open_files.
73         (bfd_cache_init): Use bfd_cache_max_open.
74         (bfd_open_file): Likewise.
75         * configure.in (AC_CHECK_HEADERS): Add sys/resource.h.
76         (AC_CHECK_FUNCS): Add getrlimit.
77         * configure: Regenerated.
78         * config.in: Likewise.
79         * sysdep.h: Check and include sys/resource.h for getrlimit.
80
81 2013-05-23  Alan Modra  <amodra@gmail.com>
82
83         * format.c (bfd_check_format_matches): Don't match a target in
84         targ_selvecs if some other target is a better match.  If
85         targets implement match priority, fall back to the first of
86         the best matches.
87
88 2013-05-22  Eric Herman  <eric@freesa.org>
89
90         PR binutils/15462
91         * elfxx-mips.c (_bfd_mips_elf_relocate_section): Warning fix.
92
93 2013-05-22  Ralf Dreesen  <gamma@dreesen.net>
94
95         PR binutils/15474
96         * srec.c (srec_set_section_contents): Properly convert size
97         and offset to address when octets_per_byte is not unity.
98
99 2013-05-20  Maciej W. Rozycki  <macro@linux-mips.org>
100
101         * elf32-vax.c (elf_vax_instantiate_got_entries): Only set the
102         refcount member of the gotplt_union when resetting the reference
103         count.  Adjust comment.
104
105 2013-05-20  Will Newton  <will.newton@linaro.org>
106
107         * elf64-aarch64.c (elf64_aarch64_link_hash_entry): Remove
108         relocs_copied member.
109         (elf64_aarch64_link_hash_newfunc): Remove initialization of
110         relocs_copied member.
111         (elf64_aarch64_copy_indirect_symbol): Remove code to copy
112         relocs_copied member.
113
114 2013-05-19  Maciej W. Rozycki  <macro@linux-mips.org>
115
116         * elf32-vax.c (elf_vax_adjust_dynamic_symbol): Convert K&R
117         function definition.
118
119 2013-05-16  Cary Coutant  <ccoutant@google.com>
120
121         * ecoff.c (ecoff_link_check_archive_element): Add initializers for
122         external_ext_size and esize.
123
124 2013-05-16  Tristan Gingold  <gingold@adacore.com>
125
126         * coff-rs6000.c (_bfd_xcoff_reloc_type_lookup): Handle BFD_RELOC_16.
127         * coff64-rs6000.c (xcoff64_reloc_type_lookup): Likewise.
128
129 2013-05-15  Andreas Schwab  <schwab@suse.de>
130
131         * elf64-aarch64.c (elf_backend_default_execstack): Define to 0.
132
133 2013-05-10  Joel Brobecker  <brobecker@adacore.com>
134
135         * coffcode.h (styp_to_sec_flags) [RS6000COFF_C]: Add handling
136         of STYP_EXCEPT, STYP_LOADER and STYP_TYPCHK sections.
137
138 2013-05-09  Joel Brobecker  <brobecker@adacore.com>
139
140         * bfd.c (_bfd_default_error_handler): Replace use of putc
141         by fputc.  Add comment explaining why.
142
143 2013-05-09  Alan Modra  <amodra@gmail.com>
144
145         * elflink.c (elf_link_add_object_symbols): Don't omit reading
146         of symbols when hashes already exist.
147
148 2013-05-07  Will Newton  <will.newton@linaro.org>
149
150         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Add a
151         plt_header_size argument for ports where it differs from
152         plt_entry_size.
153         * elf-bfd.h: Likewise.
154         * elf32-i386.c: Pass plt_header_size to
155         _bfd_elf_allocate_ifunc_dyn_relocs.
156         * elf64-x86-64.c: Likewise.
157
158 2013-05-07  Will Newton  <will.newton@linaro.org>
159
160         * elf-ifunc.c (_bfd_elf_create_ifunc_dyn_reloc): Remove unused
161         function.
162         * elf-bfd.h: Likewise.
163
164 2013-05-06  Paul Brook  <paul@codesourcery.com>
165
166         * elf64-mips.c (elf_mips_gnu_pcrel32): New.
167         (bfd_elf64_bfd_reloc_type_lookup, bfd_elf64_bfd_reloc_name_lookup,
168         mips_elf64_rtype_to_howto): Handle R_MIPS_PC32.
169         * elfn32-mips.c (elf_mips_gnu_pcrel32): New.
170         (bfd_elfn32_bfd_reloc_type_lookup, bfd_elfn32_bfd_reloc_name_lookup,
171         mips_elfn32_rtype_to_howto): Handle R_MIPS_PC32.
172
173 2013-05-06  Alan Modra  <amodra@gmail.com>
174
175         * elf64-ppc.c (opd_entry_value): Handle case where symbol
176         hashes are not available.
177
178 2013-05-06  Alan Modra  <amodra@gmail.com>
179
180         * elflink.c (elf_link_add_object_symbols): Don't save symbol
181         hashes around loading as-needed library.  Zero them on allocation,
182         and restore to initial all-zero state if library not needed.
183         Arrange to reuse hashes if we load library again later.
184
185 2013-05-04  Richard Sandiford  <rdsandiford@googlemail.com>
186
187         * elf32-mips.c (elf_mips_copy_howto, elf_mips_jump_slot_howto):
188         Use _bfd_mips_elf_generic_reloc instead of bfd_elf_generic_reloc.
189         * elfn32-mips.c: Likewise.
190         * elf64-mips.c: Likewise.
191
192 2013-05-02  Nick Clifton  <nickc@redhat.com>
193
194         * archures.c: Add some more MSP430 machine numbers.
195         * config.bfd (msp430): Define targ_selvecs.
196         * configure.in: Add bfd_elf32_msp430_ti_vec.
197         * cpu-msp430.c: Add some more MSP430 machine numbers.
198         * elf32-msp430.c Add support for MSP430X relocations.
199         Add support for TI compiler generated relocations.
200         Add support for sym_diff relocations.
201         Add support for relaxing out of range short branches into long
202         branches.
203         Add support for MSP430 attribute section.
204         * reloc.c: Add MSP430X relocations.
205         * targets.c: Add bfd_elf32_msp430_ti_vec.
206         * bfd-in2.h: Regenerate.
207         * configure: Regenerate.
208         * libbfd.h: Regenerate.
209
210 2013-05-01  Maciej W. Rozycki  <macro@codesourcery.com>
211
212         * config.bfd: Replace alpha*-*-linuxecoff* pattern with
213         alpha*-*-linux*ecoff*.
214
215 2013-04-30  Olaf Flebbe  <o.flebbe@science-computing.de>
216
217         PR binutils/15417
218         * elflink.c (elf_link_add_object_symbols): Initialise 'idx' to
219         zero.
220
221 2013-04-30  Alan Modra  <amodra@gmail.com>
222
223         * elflink.c (bfd_elf_record_link_assignment): Dont make
224         STV_INTERNAL symbols STV_HIDDEN.
225
226 2013-04-29  Nick Clifton  <nickc@redhat.com>
227
228         * elflink.c (_bfd_elf_gc_mark_extra_sections): Remove mark from
229         fragmented .debug_line sections associated with unmarked code
230         sections.
231
232 2013-04-29  Will Newton  <will.newton@linaro.org>
233
234         * elf32-arm.c (elf32_arm_populate_plt_entry): Call
235         elf32_arm_add_dynreloc when emitting R_ARM_IRELATIVE relocs.
236
237 2013-04-29  Will Newton  <will.newton@linaro.org>
238
239         * elf64-aarch64.c (elf64_aarch64_check_relocs): Move relocation
240         error check up and add error message.
241
242 2013-04-26  Will Newton  <will.newton@linaro.org>
243
244         * elf64-aarch64.c (elf64_aarch64_check_relocs): Remove dead code.
245
246 2013-04-25  Alan Modra  <amodra@gmail.com>
247
248         * config.bfd: Add powerpc64le-linux.
249
250 2013-04-24  H.J. Lu  <hongjiu.lu@intel.com>
251
252         * config.bfd (targ_selvecs): Add bfd_elf32_x86_64_vec for
253         x86_64-*-elf*.
254
255 2013-04-24  Roland McGrath  <mcgrathr@google.com>
256
257         * elf32-arm.c (elf32_arm_allocate_plt_entry): If HTAB->nacl_p,
258         allocate space for PLT header even if IS_IPLT_ENTRY.
259         (arm_nacl_put_plt0): New function, broken out of ...
260         (elf32_arm_finish_dynamic_sections): ... here.  Call it.
261         If HTAB->nacl_p, set up the PLT header in .iplt too.
262         (elf32_arm_output_arch_local_syms): If HTAB->nacl_p, write
263         a mapping symbol for the start of .iplt too.
264
265 2013-04-19  Luca Pizzamiglio  <luca.pizzamiglio@gmail.com>
266
267         * ecoff.c (_bfd_ecoff_sizeof_headers): Cast the return value of
268         BFD_ALIGN to int.
269         * elf32-tic6x.c (elf32_tic6x_size_dynamic_sections): Remove unused
270         variables.
271         * elf32-v850.c (v850_elf_relax_section): Redefine the type of 'i'
272         to bfd_vma.
273         * vms-alpha.c (evax_bfd_print_etir): Initialize sec_len.
274
275 2013-04-22  Alan Modra  <amodra@gmail.com>
276
277         PR ld/15382
278         * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Don't multiply
279         sh_size or reloc_count adjustment by count.
280
281 2013-04-22  Alan Modra  <amodra@gmail.com>
282
283         * elf64-ppc.c (ppc64_elf_check_relocs): Don't call
284         create_linkage_sections here..
285         (ppc64_elf_init_stub_bfd): ..do so here.  Return status.
286         (create_linkage_sections): Move earlier in file.
287         (ppc64_elf_setup_section_lists): Remove now useless htab->brlt test.
288         * elf64-ppc.h (ppc64_elf_init_stub_bfd): Update proto.
289
290 2013-04-19  Nick Clifton  <nickc@redhat.com>
291
292         PR binutils/15356
293         * compress.c (decompress_contents): Always call inflateEnd, even
294         when another inflation operation fails.
295
296 2013-04-17  H.J. Lu  <hongjiu.lu@intel.com>
297
298         * elf-ifunc.c: Update copyright year.
299
300 2013-04-17 Luca Pizzamiglio  <luca.pizzamiglio@gmail.com>
301
302         * coffcode.h: Added a cast to void when a bfd_set_section_*()
303         macro's return value is ignored.
304         * elf32-hppa.c: Likewise.
305         * elf32-tic6x.c: Likewise.
306         * mach-o.c: Likewise.
307         * mmo.c: Likewise.
308         * opncls.c: Likewise.
309         * peicode.h: Likewise.
310         * elf32-m32r.c: Check return value of bfd_set_section_*().
311         * elfnn-ia64.c: Likewise.
312         * elfxx-mips.c: Likewise.
313         * vms-alpha.c: Likewise.
314
315 2013-04-15  H.J. Lu  <hongjiu.lu@intel.com>
316
317         PR ld/15371
318         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Check
319         regular reference without non-GOT reference when building
320         shared library.
321
322 2013-04-15  Alan Modra  <amodra@gmail.com>
323
324         * archive.c (_bfd_archive_close_and_cleanup): Clear parent
325         cache slot for archives.
326
327 2013-04-14  Hans-Peter Nilsson  <hp@bitrange.com>
328
329         * mmo.c (mmo_write_chunk): Break out abfd->tdata.mmo_data to new
330         local variable mmop.
331
332 2013-04-09  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
333
334         PR ld/12494
335         * bfd/elf32-avr.c: Consider all sections to determine if linker
336         relaxation can safely delete a ret after a call/jmp
337
338 2013-04-09  Mingjie Xing  <mingjie.xing@gmail.com>
339
340         * bfd.c (typedef bfd, Error reporting, Miscellaneous): Add
341         INODEs.
342
343 2013-04-08  Tom Tromey  <tromey@redhat.com>
344
345         * som.c (bfd_section_from_som_symbol): No longer static.
346         * som.h (bfd_section_from_som_symbol): Declare.
347
348 2013-04-06  Alan Modra  <amodra@gmail.com>
349
350         * elf32-ppc.c (ppc_elf_check_relocs): Use SYMBOLIC_BIND.
351         * elf64-ppc.c (ppc64_elf_check_relocs, dec_dynrel_count): Likewise.
352
353 2013-04-05  Nick Clifton  <nickc@redhat.com>
354
355         * elflink.c (elf_link_add_object_symbols): Revert accidental commit.
356
357 2013-04-04  Alan Modra  <amodra@gmail.com>
358
359         * bfd.c (bfd_error_type, bfd_errmsgs): Add bfd_error_missing_dso.
360         * bfd-in2.h: Regenerate.
361         * elflink.c (elf_link_add_object_symbols): Use new error.
362
363 2013-04-03  Nick Clifton  <nickc@redhat.com>
364
365         * elf32-v850.c (v850_elf_is_target_special_symbol): New function.
366         (bfd_elf32_bfd_is_target_special_symbol): Define.
367
368 2013-04-03   Venkataramanan Kumar  <venkataramanan.kumar@linaro.org>
369
370         * elf64-aarch64.c (elf64_aarch64_gc_sweep_hook): Use
371         elf64_aarch64_locals to get local GOT reference counts.
372
373 2013-04-02  DJ Delorie  <dj@redhat.com>
374
375         * elf32-rl78.c (GET_RELOC): Assert that there are relocs to get.
376         (rl78_elf_relax_section): Only fetch the next reloc if there is
377         one expected.
378
379 2013-03-30  Alan Modra  <amodra@gmail.com>
380
381         PR ld/15323
382         * elf-m10300.c (mn10300_elf_check_relocs): Set non_ir_ref for
383         global symbols referenced by relocs.
384         * elf32-arm.c (elf32_arm_check_relocs): Likewise.
385         * elf32-bfin.c (bfin_check_relocs): Likewise.
386         * elf32-cr16.c (cr16_elf_check_relocs): Likewise.
387         * elf32-cris.c (cris_elf_check_relocs): Likewise.
388         * elf32-d10v.c (elf32_d10v_check_relocs): Likewise.
389         * elf32-dlx.c (elf32_dlx_check_relocs): Likewise.
390         * elf32-fr30.c (fr30_elf_check_relocs): Likewise.
391         * elf32-frv.c (elf32_frv_check_relocs): Likewise.
392         * elf32-hppa.c (elf32_hppa_check_relocs): Likewise.
393         * elf32-i370.c (i370_elf_check_relocs): Likewise.
394         * elf32-iq2000.c (iq2000_elf_check_relocs): Likewise.
395         * elf32-lm32.c (lm32_elf_check_relocs): Likewise.
396         * elf32-m32c.c (m32c_elf_check_relocs): Likewise.
397         * elf32-m32r.c (m32r_elf_check_relocs): Likewise.
398         * elf32-m68hc1x.c (elf32_m68hc11_check_relocs): Likewise.
399         * elf32-m68k.c (elf_m68k_check_relocs): Likewise.
400         * elf32-mcore.c (mcore_elf_check_relocs): Likewise.
401         * elf32-metag.c (elf_metag_check_relocs): Likewise.
402         * elf32-microblaze.c (microblaze_elf_check_relocs): Likewise.
403         * elf32-moxie.c (moxie_elf_check_relocs): Likewise.
404         * elf32-msp430.c (elf32_msp430_check_relocs): Likewise.
405         * elf32-mt.c (mt_elf_check_relocs): Likewise.
406         * elf32-nios2.c (nios2_elf32_check_relocs): Likewise.
407         * elf32-openrisc.c (openrisc_elf_check_relocs): Likewise.
408         * elf32-ppc.c (ppc_elf_check_relocs): Likewise.
409         * elf32-rl78.c (rl78_elf_check_relocs): Likewise.
410         * elf32-s390.c (elf_s390_check_relocs): Likewise.
411         * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
412         * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
413         * elf32-sh.c (sh_elf_check_relocs): Likewise.
414         * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
415         * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
416         * elf32-v850.c (v850_elf_check_relocs): Likewise.
417         * elf32-vax.c (elf_vax_check_relocs): Likewise.
418         * elf32-xstormy16.c (xstormy16_elf_check_relocs): Likewise.
419         * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
420         * elf64-aarch64.c (elf64_aarch64_check_relocs): Likewise.
421         * elf64-alpha.c (elf64_alpha_check_relocs): Likewise.
422         * elf64-hppa.c (elf64_hppa_check_relocs): Likewise.
423         * elf64-ia64-vms.c (elf64_ia64_check_relocs): Likewise.
424         * elf64-mmix.c (mmix_elf_check_relocs): Likewise.
425         * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
426         * elf64-s390.c (elf_s390_check_relocs): Likewise.
427         * elf64-sh64.c (sh_elf64_check_relocs): Likewise.
428         * elfnn-ia64.c (elfNN_ia64_check_relocs): Likewise.
429         * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
430         * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
431         * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.  Don't
432         test indirect/warning links for NULL.
433
434 2013-03-29  H.J. Lu  <hongjiu.lu@intel.com>
435
436         PR ld/15323
437         * elf32-i386.c (elf_i386_check_relocs): Set non_ir_ref if a
438         symbol is referenced by a non-shared object.
439         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
440
441 2013-03-28  Joe Seymour  <jseymour@codesourcery.com>
442
443         * elf32-sh.c (sh_elf_relocate_section): Suppress warnings for
444         R_SH_REL32 relocations against undefined weak symbols.
445
446 2013-03-28  Alan Modra  <amodra@gmail.com>
447
448         * elf64-ppc.c (struct ppc_dyn_relocs): New.
449         (ppc64_elf_check_relocs): Separate dynrel counts for local syms
450         into ifunc and non-ifunc.
451         (dec_dynrel_count): Pass in sym rather than sym_sec.  Handle
452         separate ifunc/non-ifunc dynrel counts.
453         (allocate_got): Always use reliplt for ifunc.
454         (allocate_dynrelocs): Likewise.
455         (ppc64_elf_size_dynamic_sections): Likewise.
456         (ppc64_elf_layout_multitoc): Likewise.
457         (ppc64_elf_relocate_section): Likewise.
458
459 2013-03-28  Alan Modra  <amodra@gmail.com>
460
461         * elf32-ppc.c (struct ppc_dyn_relocs): New.
462         (ppc_elf_check_relocs): Separate dynrel counts for local syms
463         into ifunc and non-ifunc.
464         (allocate_dynrelocs): Always put ifunc relocs into reliplt.
465         (ppc_elf_size_dynamic_sections): Likewise.
466         (ppc_elf_relocate_section): Likewise.
467
468 2013-03-28  Alan Modra  <amodra@gmail.com>
469
470         * elf-bfd.h (enum elf_reloc_type_class): Add reloc_class_ifunc.
471         (struct elf_backend_data <elf_backed_reloc_type_class>): Add
472         bfd_link_info* and asection* params.
473         (_bfd_elf_reloc_type_class): Likewise.
474         * elf.c (_bfd_elf_reloc_type_class): Likewise.
475         * elflink.c (elf_link_sort_cmp2): Sort first on reloc class.
476         (elf_link_sort_relocs): Update elf_backed_reloc_type_class call.
477         * elf32-ppc.c (ppc_elf_reloc_type_class): Return reloc_class_ifunc
478         for any reliplt reloc.  Don't return reloc_class_plt for
479         R_PPC_REL24 and R_PPC_ADDR24.
480         * elf64-ppc.c (allocate_got): Formatting.
481         (ppc64_elf_reloc_type_class): Return reloc_class_ifunc for any
482         reliplt reloc.
483         * elf-m10300.c, * elf32-arm.c, * elf32-bfin.c, * elf32-cr16.c,
484         * elf32-cris.c, * elf32-hppa.c, * elf32-i386.c, * elf32-lm32.c,
485         * elf32-m32r.c, * elf32-m68k.c, * elf32-metag.c, * elf32-nios2.c,
486         * elf32-s390.c, * elf32-sh.c, * elf32-sparc.c, * elf32-tilepro.c,
487         * elf32-vax.c, * elf32-xtensa.c, * elf64-aarch64.c, * elf64-alpha.c,
488         * elf64-hppa.c, * elf64-ia64-vms.c, * elf64-s390.c, * elf64-sparc.c,
489         * elf64-x86-64.c, * elfnn-ia64.c, * elfxx-tilegx.c, * elfxx-tilegx.h:
490         Add extra params to the various reloc_type_class functions.
491
492 2013-03-27  Alan Modra  <amodra@gmail.com>
493
494         * elf32-ppc.c (ppc_elf_check_relocs): Set PLT_IFUNC in local got
495         masks for all local ifunc syms.
496         (allocate_dynrelocs): Don't use htab->relgot for ifunc.
497         (ppc_elf_size_dynamic_sections): Likewise.
498         (ppc_elf_relocate_section): Likewise.
499
500 2013-03-27  Will Newton  <will.newton@linaro.org>
501
502         * elf32-arm.c (elf32_arm_final_link_relocate): Avoid emitting a
503         dynamic reloc for symbols with dynindx == -1.
504         (allocate_dynrelocs_for_symbol): Avoid allocating space for a
505         dynamic reloc for symbols with dynindx == -1.
506
507 2013-03-27  Will Newton  <will.newton@linaro.org>
508
509         * elf32-arm.c (elf32_arm_final_link_relocate): Avoid emitting a
510         dynamic reloc for non-default visibility undefined weaks.
511         (allocate_dynrelocs_for_symbol): Avoid allocating space for a
512         dynamic reloc for non-default visibility undefined weaks.
513
514 2013-03-26  Alan Modra  <amodra@gmail.com>
515
516         * elflink.c (_bfd_elf_add_default_symbol): Preserve section
517         over _bfd_elf_merge_symbol calls.
518
519 2013-03-26  Alan Modra  <amodra@gmail.com>
520
521         * elflink.c (elf_link_add_object_symbols): Add assertion for
522         common override alignment check code.  Formatting.
523
524 2013-03-25  Alan Modra  <amodra@gmail.com>
525
526         * elflink.c (_bfd_elf_merge_symbol): Set old_alignment for
527         usual common symbols as well as for dynamic.  Add poldbfd param.
528         Save old bfd.  Adjust callers.
529         (_bfd_elf_add_default_symbol): Add poldbfd param.  Pass "section"
530         and "value" by value, not pointer.  Adjust caller.
531         (elf_link_add_object_symbols): Combine undef_bfd and old_bfd vars.
532         Delete code to set same.  Use old_bfd and old_alignment from
533         _bfd_elf_merge_symbol instead.  Add default symbol before
534         alignment and size checks.  Wrap overlong lines.
535
536 2013-03-25  Alan Modra  <amodra@gmail.com>
537
538         * elflink.c (_bfd_elf_add_default_symbol): Delete "override" param.
539         (elf_link_add_object_symbols): Don't call _bfd_elf_add_default_symbol
540         when override is true.
541
542 2013-03-25  Alan Modra  <amodra@gmail.com>
543
544         * elflink.c (_bfd_elf_merge_symbol): Use local var holding value
545         of *sym_hash.
546
547 2013-03-25  Alan Modra  <amodra@gmail.com>
548
549         * elflink.c (_bfd_elf_merge_symbol): Don't discard TLS symbols here.
550         Wrap long lines.
551         (elf_link_add_object_symbols): Discard TLS symbols for --just-syms
552         early in symbol loop.
553
554 2013-03-25  Alan Modra  <amodra@gmail.com>
555
556         * elf-bfd.h (struct elf_backend_data <merge_symbol>): Update proto.
557         (_bfd_elf_init_reloc_shdr): Delete.
558         * elf.c (_bfd_elf_init_reloc_shdr): Make static.
559         * elf64-x86-64.c (elf_x86_64_merge_symbol): Trim parameters to
560         just what is needed.
561         * elflink.c (_bfd_elf_merge_symbol): Update bed->merge_symbol call.
562
563 2013-03-23  Alan Modra  <amodra@gmail.com>
564
565         * elf-bfd.h (_bfd_elf_merge_symbol): Delete declaration.
566         * elflink.c (_bfd_elf_merge_symbol): Make static.
567         * elf32-sh-symbian.c (sh_symbian_relocate_section): Don't call
568         _bfd_elf_merge_symbol, call _bfd_generic_link_add_one_symbol.
569
570 2013-03-23  Alan Modra  <amodra@gmail.com>
571
572         PR ld/15270
573         * elflink.c (elf_link_add_object_symbols): Don't set def_regular
574         or ref_regular for BFD_PLUGIN owned syms, or have them affect
575         def_dynamic/ref_dynamic.
576         (_bfd_elf_fix_symbol_flags): Don't set def_regular for BFD_PLUGIN
577         owned syms.
578
579 2013-03-22  David S. Miller  <davem@davemloft.net>
580
581         * elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): Set type of
582         hwcaps attribute.
583
584 2013-03-22  Achille Fouilleul  <achille.fouilleul+binutils@gadz.org>
585
586         PR ld/14902
587         * elf32-h8300.c (elf32_h8_relax_delete_bytes): Fix off by one
588         errors adjusting relocs and symbols.
589
590 2013-03-21  Michael Schewe  <michael.schewe@gmx.net>
591
592         * elf32-h8300 (h8_relax_section): Add new relaxation of mov
593         @(disp:32,ERx) to mov @(disp:16,ERx).
594         (R_H8_DISP32A16): New reloc.
595         Comments added and corrected.
596         * reloc.c (BFD_RELOC_H8_DISP32A16): New reloc.
597         * bfd-in2.h: Regenerate.
598         * libbfd.h: Regenerate.
599
600 2013-03-21  Kai Tietz  <ktietz@redhat.com>
601
602         * coffgen.c (coff_real_object_p): Make global.
603         * peicode.h (coff_real_object_p): Add prototype.
604         (FILHDR): Defined for COFF_IMAGE_WITH_PE as
605         external_PEI_IMAGE_hdr structure.
606         (coff_swap_filehdr_in): Handle variable header-size.
607         * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Just handle amount
608         of directory-entiries as specified in pe-header.
609
610 2013-03-21  Nick Clifton  <nickc@redhat.com>
611
612         PR sim/15286
613         * elf32-arm.c (bfd_arm_get_mach_from_attributes): Identify XScale,
614         iWMMXt and iWMMXt2 processors from attributes.
615
616 2013-03-20  Alan Modra  <amodra@gmail.com>
617
618         * elflink.c (_bfd_elf_make_dynamic_reloc_section): Override
619         sh_type according to is_rela.
620
621 2013-03-18  Alan Modra  <amodra@gmail.com>
622
623         PR ld/12549
624         * elflink.c (elf_link_add_object_symbols): Exclude weak refs when
625         considering whether an --as-needed library is needed.
626
627 2013-03-14  Tom Tromey  <tromey@redhat.com>
628
629         * opncls.c (bfd_get_debug_link_info): Rename from
630         get_debug_link_info.  Export.  Update comment.
631         (find_separate_debug_file): Update.
632         * bfd-in2.h: Rebuild.
633
634 2013-03-08  Venkataramanan Kumar  <venkataramanan.kumar@linaro.org>
635
636         * elf64-aarch64.c (elf_backend_can_gc_sections): Enable gc-section
637         support.
638         (elf64_aarch64_gc_sweep_hook): Handle GOT, TLS and PLT related
639         relocs.
640
641 2013-03-08  Andreas Arnez  <arnez@linux.vnet.ibm.com>
642
643         * elf-bfd.h (elfcore_write_s390_tdb): Add prototype.
644         * elf.c (elfcore_write_s390_tdb): New function.
645         (elfcore_write_register_note): Call it.
646         (elfcore_grok_s390_tdb): New function.
647         (elfcore_grok_note): Call it.
648
649 2013-03-08  Maciej W. Rozycki  <macro@codesourcery.com>
650
651         * elfxx-mips.c (mips_elf_allocate_lazy_stub): Correct data type.
652
653 2013-03-05  Corinna Vinschen  <vinschen@redhat.com>
654
655         * config.bfd: Add x86_64-*-cygwin to list of supported targets.
656
657 2013-03-04  Alan Modra  <amodra@gmail.com>
658
659         * elf32-ppc.c (ppc_elf_relocate_section <R_PPC_PLTREL24>): Adjust
660         non-zero addends when relocatable, rather than addends >= 32768.
661         Always zero "addend" before applying relocation.
662
663 2013-03-04  Nick Clifton  <nickc@redhat.com>
664
665         * archive64.c (bfd_elf64_archive_write_armap): Fix calculation of
666         file pointer offsets for thin archives.
667
668 2013-02-28  Nathan Sidwell  <nathan@codesourcery.com>
669
670         * elf32-arm.c (elf32_arm_size_dynamic_sections): Don't call
671         elf32_arm_allocate_dynrelocs for source reloc for non-dynamic link.
672
673 2013-02-27  DJ Delorie  <dj@redhat.com>
674
675         * reloc.c (BFD_RELOC_RL78_CODE): Add.
676         * libbfd.h: Regenerate.
677         * bfd-in2.h: Regenerate.
678         * elf32-rl78.c (rl78_elf_relocate_section): Handle weak code
679         references in compuated relocs.
680
681 2013-02-26  Anthony Green  <green@moxielogic.com>
682
683         * config.bfd: Extend moxie-rtems target triplet name support.
684
685 2013-02-21  H.J. Lu  <hongjiu.lu@intel.com>
686
687         PR ld/15167
688         * elf64-ia64-vms.c (elf64_vms_link_add_object_symbols): Set
689         unique_global only for definition.
690         * elflink.c (_bfd_elf_merge_symbol): Don't set unique_global
691         here.
692         (elf_link_add_object_symbols): Set unique_global only
693         for definition.
694
695 2013-02-21  Alan Modra  <amodra@gmail.com>
696
697         * elf-bfd.h (struct elf_build_id): Extracted from..
698         (struct elf_build_id_info): ..here.  Delete.
699         (struct output_elf_obj_tdata): New, extracted from..
700         (struct elf_obj_tdata): ..here.  Reorganize for better packing.
701         Add "o" field.
702         (elf_program_header_size): Reference tdata->o.
703         (elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker,
704         elf_stack_flags, elf_shstrtab, elf_strtab_sec, elf_shstrtab_sec,
705         elf_section_syms, elf_num_section_syms, elf_flags_init): Likewise.
706         * elf.c (bfd_elf_allocate_object): Allocate output_elf_obj_tdata
707         when opening bfd in any mode that might write.
708         (_bfd_elf_write_object_contents): Use build_id field in
709         output_elf_obj_tdata.
710         (_bfd_elf_close_and_cleanup): Tweak elf_shstrtab test.
711         (elfobj_grok_gnu_build_id): Adjust for elf_tdata changes.
712
713 2013-02-21  Alan Modra  <amodra@gmail.com>
714
715         * elf-bfd.h (struct core_elf_obj_tdata): New.
716         (struct elf_obj_tdata): Delete core_signal, core_pid, core_lwpid,
717         core_program, and core_command.  Add "core".
718         * elf.c (bfd_elf_mkcorefile): Allocate "core" struct.
719         Update all refs to tdata core fields.
720         * elf32-am33lin.c, * elf32-arm.c, * elf32-cris.c, * elf32-frv.c,
721         * elf32-hppa.c, * elf32-i386.c, * elf32-m68k.c, * elf32-mips.c,
722         * elf32-nios2.c, * elf32-ppc.c, * elf32-s390.c, * elf32-score.c,
723         * elf32-score7.c, * elf32-sh.c, * elf32-sparc.c, * elf32-tilegx.c,
724         * elf32-tilepro.c, * elf32-xtensa.c, * elf64-aarch64.c,
725         * elf64-hppa.c, * elf64-mips.c, * elf64-ppc.c, * elf64-tilegx.c,
726         * elf64-x86-64.c, * elfcore.h, * elfn32-mips.c: Update all refs
727         to tdata core fields.
728
729 2013-02-21  Alan Modra  <amodra@gmail.com>
730
731         * elf-bfd.h (struct elf_obj_tdata): Rename segment_map to seg_map.
732         Delete num_locals and num_globals.
733         (elf_num_locals, elf_num_globals): Don't define.
734         (elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker,
735         elf_stack_flags, elf_strtab_sec, elf_shstrtab_sec): Define.
736         * bfd.c, * elf-eh-frame.c, * elf-nacl.c, * elf-vxworks.c, * elf.c,
737         * elf32-arm.c, * elf32-lm32.c, * elf32-ppc.c, * elf32-rx.c,
738         * elf32-spu.c, * elf64-hppa.c, * elfcode.h, * elflink.c,
739         * elfnn-ia64.c, * elfxx-mips.c: Use newly defined elf_obj_tdata
740         accessor macros.
741         * elf.c (elf_map_symbols): Add pnum_locals param.  Return
742         number of locals syms via new param.
743         (swap_out_syms): Adjust to suit elf_map_symbols change.
744
745 2013-02-19  Maciej W. Rozycki  <macro@codesourcery.com>
746
747         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Also clear
748         STO_MICROMIPS annotation.
749
750 2013-02-19  Alan Modra  <amodra@gmail.com>
751
752         * configure.in: Bump version to 2.23.52.
753         * elf-bfd.h (struct elf_build_id_info): New.
754         (struct elf_obj_tdata): Delete after_write_object_contents,
755         after_write_object_contents_info and build_id_size.  Make build_id
756         a pointer to struct elf_build_id_info.
757         * elf.c (_bfd_elf_write_object_contents): Style.  Update
758         after_write_ibject_contents invocation.
759         (elfobj_grok_gnu_build_id): Update for new build_id struct.  Don't
760         allow zero size notes.
761         * configure: Regenerate.
762
763 2013-02-18  Maciej W. Rozycki  <macro@codesourcery.com>
764
765         * elf64-mips.c (micromips_elf64_howto_table_rel): Add
766         R_MICROMIPS_SCN_DISP and R_MICROMIPS_JALR.
767         (micromips_elf64_howto_table_rela): Likewise.
768         (micromips_reloc_map): Add BFD_RELOC_MICROMIPS_JALR.
769         * elfn32-mips.c (elf_micromips_howto_table_rel): Add
770         R_MICROMIPS_SCN_DISP and R_MICROMIPS_JALR.
771         (elf_micromips_howto_table_rela): Likewise.
772         (micromips_reloc_map): Add BFD_RELOC_MICROMIPS_JALR.
773
774 2013-02-18  Paul Brook  <paul@codesourcery.com>
775
776         * elfxx-mips.c (MICROMIPS_P): New macro.
777         (_bfd_mips_elf_symbol_processing): Use it.
778
779 2013-02-18  Maciej W. Rozycki  <macro@codesourcery.com>
780
781         * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Clarify
782         comment on _PROCEDURE_LINKAGE_TABLE_ creation.
783
784 2013-02-18  Alan Modra  <amodra@gmail.com>
785
786         PR ld/12549
787         * elf-bfd.h (_bfd_elf_strtab_clear_refs): Delete.
788         (_bfd_elf_strtab_clear_all_refs): Declare.
789         (_bfd_elf_strtab_resize): Declare.
790         * elf-strtab.c (_bfd_elf_strtab_clear_refs): Delete.
791         (_bfd_elf_strtab_clear_all_refs): New function.
792         (_bfd_elf_strtab_resize): Likewise.
793         * elflink.c (elf_link_add_object_symbols): Use _bfd_elf_strtab_resize.
794
795 2013-02-18  Alan Modra  <amodra@gmail.com>
796
797         * elf-bfd.h (struct elf_obj_tdata): Move find_line_info, local_stubs,
798         local_call_stubs, elf_data_symbol, elf_text_symbol, elf_data_section,
799         and elf_text_section to..
800         * elfxx-mips.c (struct mips_elf_obj_tdata): ..here.  Update all refs.
801         * elf64-alpha.c (struct mips_elf_find_line): Rename to..
802         (struct alpha_elf_find_line): ..this.
803         (struct alpha_elf_obj_tdata): Add find_line_info, update refs.
804
805 2013-02-16  H.J. Lu  <hongjiu.lu@intel.com>
806
807         PR ld/15146
808         * elflink.c (elf_link_add_object_symbols): Don't add DT_NEEDED
809         for references from the dummy bfd.
810
811 2013-02-16  H.J. Lu  <hongjiu.lu@intel.com>
812
813         PR ld/15149
814         * elflink.c (elf_link_add_object_symbols): Also track weak
815         references.
816
817 2013-02-15  H.J. Lu  <hongjiu.lu@intel.com>
818
819         PR binutils/15151
820         * archive.c (_bfd_find_nested_archive): Don't allow a nested
821         archive pointing to itself.
822         (_bfd_get_elt_at_filepos): Revert the last 2 changes.
823
824 2013-02-15  Nick Clifton  <nickc@redhat.com>
825
826         PR binutils/15140
827         * archive.c (_bfd_get_elt_at_filepos): Prevent an infinite loop
828         accessing a corrupt nested archive.
829
830 2013-02-13  Richard Sandiford  <rdsandiford@googlemail.com>
831
832         * elfxx-mips.c (mips_got_page_ref): New structure.
833         (mips_got_page_entry): Use a section rather than a (bfd, symndx)
834         pair to represent the anchor point.
835         (mips_got_info): Add a got_page_refs field.
836         (mips_elf_link_hash_table): Add a sym_cache field.
837         (mips_got_page_ref_hash, mips_got_page_ref_eq): New functions.
838         (mips_got_page_entry_hash, mips_got_page_entry_eq): Update for
839         new anchor representation.
840         (mips_elf_create_got_info): Create got_page_refs rather than
841         got_page_entries.
842         (mips_elf_record_got_page_ref): New function.
843         (mips_elf_pages_for_range): Move further down file.
844         (mips_elf_record_got_page_entry): Likewise.  Take a got as argument.
845         Use a section rather than a (bfd, symndx) pair to represent the
846         anchor point.
847         (mips_elf_resolve_got_page_ref): New function.
848         (mips_elf_resolve_final_got_entries): Use it to populate
849         got_page_entries.
850         (_bfd_mips_elf_check_relocs): Call mips_elf_record_got_page_ref
851         rather than mips_elf_record_got_page_entry.  Only nullify h
852         afterwards.
853         (mips_elf_lay_out_got): Call mips_elf_resolve_final_got_entries
854         earlier.
855
856 2013-02-12  Richard Sandiford  <rdsandiford@googlemail.com>
857
858         * elfxx-mips.c (mips_elf_lay_out_got): Count VxWorks GOT relocs
859         in g->relocs.
860
861 2013-02-12  Alan Modra  <amodra@gmail.com>
862
863         * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Provide
864         suitable definition when using generic linker hash table.
865
866 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
867
868         * elfxx-mips.c (mips_elf_count_got_entries): Delete.
869         (mips_elf_check_recreate_got, mips_elf_recreate_got): Take a
870         mips_elf_traverse_got_arg.  Count GOT entries.
871         (mips_elf_resolve_final_got_entries): Take the bfd_link_info
872         as argument.  Update after above changes.
873         (mips_elf_merge_got, mips_elf_lay_out_got): Don't call
874         mips_elf_count_got_entries.  Update the calls to
875         mips_elf_resolve_final_got_entries.
876
877 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
878
879         * elfxx-mips.c (mips_got_tls_type): New enum.
880         (mips_got_entry): Add tls_initialized.
881         (mips_elf_got_entry_hash, mips_elf_got_entry_eq, mips_tls_got_relocs)
882         (mips_elf_count_got_entry, mips_elf_initialize_tls_index): Remove
883         GOT_TLS_TYPE masks.
884         (mips_elf_reloc_tls_type, mips_tls_got_entries)
885         (mips_elf_record_global_got_symbol, mips_elf_initialize_tls_index)
886         (_bfd_mips_elf_finish_dynamic_symbol): Use GOT_TLS_NONE rather
887         than GOT_NORMAL.
888         (mips_elf_initialize_tls_slots): Replace got_offset and tls_type_p
889         arguments with a GOT entry.  Remove GOT_TLS_TYPE masks.  Use
890         tls_initialized rather than GOT_TLS_DONE.
891         (mips_tls_got_index): Delete.
892         (mips_elf_local_got_index, mips_elf_global_got_index): Use
893         mips_elf_initialize_tls_slots rather than mips_tls_got_index.
894         (mips_elf_record_got_entry): Initialize tls_initialized.
895
896 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
897
898         * elfxx-mips.c (mips_got_entry): Remove tls_ldm_offset.
899         (mips_elf_link_hash_entry): Remove tls_ie_type, tls_gd_type,
900         tls_ie_got_offset and tls_gd_got_offset.
901         (mips_elf_link_hash_newfunc): Remove initialization.
902         (mips_elf_create_got_info): Likewise.
903         (mips_elf_count_local_got_entries, mips_elf_count_global_tls_entries)
904         (mips_tls_single_got_index): Delete.
905         (mips_elf_local_got_index): Always use the GOT entry to track
906         GOT indices.
907         (mips_elf_global_got_index): Likewise.
908         (mips_elf_create_local_got_entry): Assert that TLS entries have
909         already been allocated.
910         (mips_elf_record_global_got_symbol): Don't initialize
911         tls_ie_type or tls_gd_type.
912         (mips_elf_count_got_symbols): Only count reloc-only GOT entries here.
913         (mips_elf_initialize_tls_index): Allocate a GOT index for every TLS
914         entry.
915         (mips_elf_lay_out_got): Use mips_elf_count_got_entries to count
916         the GOT entries.
917         (_bfd_mips_elf_finish_dynamic_symbol): Assert that TLS GOT offsets
918         have been allocated.
919         (_bfd_mips_elf_copy_indirect_symbol): Remove handling of
920         tls_ie_type and tls_gd_type.
921
922 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
923
924         * elfxx-mips.c (mips_elf_create_local_got_entry): Tidy.  Avoid
925         aliasing violation.  Check for htab allocation failures.
926
927 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
928
929         * elfxx-mips.c (mips_elf_primary_global_got_index): New function,
930         split out from...
931         (mips_elf_global_got_index): ...here.  Reorder arguments so that
932         the output bfd and info come first.
933         (mips_elf_calculate_relocation): Update the call to
934         mips_elf_global_got_index accordingly.
935         (_bfd_mips_elf_finish_dynamic_symbol): Use
936         mips_elf_primary_global_got_index rather than
937         mips_elf_global_got_index.
938         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
939
940 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
941
942         * elfxx-mips.c (mips_got_entry): Update comments.
943         (mips_elf_multi_got_entry_eq): Rename to...
944         (mips_elf_got_entry_eq): ...this, deleting the old definition.
945         (mips_elf_create_got_info): Remove master_got_p argument.
946         Always use mips_elf_got_entry_eq.
947         (mips_elf_bfd_got, mips_elf_multi_got, mips_elf_create_got_section):
948         Update calls accordingly.
949
950 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
951
952         * elfxx-mips.c (mips_got_info): Remove bfd2got.
953         (mips_elf_bfd2got_hash): Delete.
954         (mips_elf_got_per_bfd_arg): Remove bfd2got.
955         (mips_elf_replace_bfd_got, mips_elf_count_got_entries): New functions.
956         (mips_elf_global_got_index, mips_elf_create_local_got_entry): Use
957         g->next to test for the multigot case.  Use mips_elf_bfd_got rather
958         than mips_elf_got_for_ibfd.
959         (mips_elf_bfd2got_entry_hash, mips_elf_bfd2got_entry_eq)
960         (mips_elf_got_for_ibfd, mips_elf_get_got_for_bfd): Delete.
961         (mips_elf_make_got_per_bfd): Replace with...
962         (mips_elf_add_got_entry): ...this new function.
963         (mips_elf_make_got_pages_per_bfd): Replace with...
964         (mips_elf_add_got_page_entry): ...this new function.
965         (mips_elf_merge_got_with): Replace bfd2got argument with separate
966         bfd and GOT arguments.  Use mips_elf_add_got_entry and
967         mips_elf_add_got_page_entry instead of mips_elf_make_got_per_bfd
968         and mips_elf_make_got_pages_per_bfd.  Use mips_elf_replace_bfd_got
969         to set the BFD's GOT and free the old table.
970         (mips_elf_merge_got): Replace bfd2got argument with separate
971         bfd and GOT arguments.  Apply mips_elf_resolve_final_got_entries.
972         Use mips_elf_count_got_entries to count the number of entries in
973         each GOT.  Update the calls to mips_elf_merge_got_with.
974         (mips_elf_adjust_gp): Use g->next to test for the multigot case.
975         Use mips_elf_bfd_got rather than mips_elf_got_for_ibfd.
976         (mips_elf_multi_got): Don't create the bfd2got hash table.
977         Replace hash table traversal with a walk over the input bfds,
978         updating the call to mips_elf_merge_got.  Use mips_elf_replace_bfd_got
979         to set the output bfd's GOT.
980         (mips_elf_lay_out_got): Rename "sub" to "ibfd".  Record that all
981         bfds use the master GOT in the single-GOT case.
982         (_bfd_mips_elf_finish_dynamic_sections): Use mips_elf_bfd_got
983         rather than mips_elf_got_for_ibfd.
984
985 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
986
987         * elfxx-mips.c (mips_elf_obj_tdata): Add a got field.
988         (mips_elf_bfd_got, mips_elf_record_got_entry): New functions.
989         (mips_elf_record_global_got_symbol): Update the hash entry before
990         adding the mips_got_entry.  Use mips_elf_record_got_entry to do
991         the latter.
992         (mips_elf_record_local_got_symbol): Use mips_elf_record_got_entry.
993         (mips_elf_record_got_page_entry): Record the entry in both the
994         master and bfd GOTs.
995
996 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
997
998         * elfxx-mips.c (mips_elf_recreate_got): Don't change the entry;
999         create another one if necessary.
1000         (mips_elf_set_gotidx): New function.
1001         (mips_elf_set_global_gotidx): Use it.
1002         (mips_elf_initialize_tls_index): Likewise.  Take a
1003         mips_elf_traverse_got_arg as argument.
1004         (mips_elf_lay_out_got): Update use of mips_elf_initialize_tls_index.
1005         (mips_elf_multi_got): Likewise.  Cope with error returns from
1006         mips_elf_set_global_gotidx.
1007
1008 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
1009
1010         * elfxx-mips.c (mips_got_info): Add relocs field.
1011         (mips_elf_set_global_got_offset_arg, mips_elf_count_tls_arg): Replace
1012         with...
1013         (mips_elf_traverse_got_arg): ...this new structure.
1014         (mips_elf_count_local_tls_relocs): Delete.
1015         (mips_elf_count_global_tls_relocs): Likewise.
1016         (mips_elf_count_got_entry): New function.
1017         (mips_elf_count_local_got_entries): Likewise.
1018         (mips_elf_count_global_tls_entries): Take a mips_elf_traverse_got_arg
1019         rather than a mips_elf_count_tls_arg.  Count both relocs and entries.
1020         (mips_elf_record_local_got_symbol): Don't count got entries here.
1021         (mips_elf_make_got_per_bfd): Use mips_elf_count_got_entry.
1022         (mips_elf_set_global_got_offset): Split into...
1023         (mips_elf_set_global_got_area, mips_elf_set_global_gotidx): ...these
1024         new functions.  Take a mips_elf_traverse_got_arg rather than a
1025         mips_elf_set_global_got_offset_arg.  Don't count TLS relocs here.
1026         Use g->relocs to record the number of relocs needed for global GOT
1027         entries.
1028         (mips_elf_multi_got): Use mips_elf_traverse_got_arg rather than
1029         mips_elf_set_global_got_offset_arg.  Use the relocs field to count
1030         relocations.  Update for above function split.
1031         (mips_elf_lay_out_got): Use mips_elf_count_local_got_entries
1032         to count both the number of GOT entries and the number of TLS
1033         relocs required by local entries.  Likewise
1034         mips_elf_count_global_tls_entries and global entries.
1035         Remove uses of mips_elf_count_local_tls_relocs and
1036         mips_elf_count_global_tls_relocs.
1037
1038 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
1039
1040         * elfxx-mips.c (mips_got_entry): Update comment above tls_type entry
1041         to say that each structure represents only one type of TLS reference.
1042         (GOT_TLS_TYPE): New define.
1043         (mips_elf_link_hash_entry): Temporarily split tls_type and
1044         tls_got_offset into two variables each.
1045         (mips_elf_link_hash_newfunc): Update accordingly.
1046         (mips_elf_got_entry_eq, mips_elf_got_entry_hash)
1047         (mips_elf_multi_got_entry_eq): Require the tls_type to be the same.
1048         (mips_elf_reloc_tls_type, mips_tls_got_entries): New functions.
1049         (mips_tls_got_relocs): Use a switch statement.
1050         (mips_elf_count_global_tls_entries): Handle the new hash entry fields.
1051         (mips_elf_initialize_tls_slots): Use a switch statement.  Avoid
1052         local "offset" variable.
1053         (mips_tls_got_index): Remove r_type argument and assert.  Remove
1054         code that handled entries with two TLS types; always use the
1055         original got_index instead.
1056         (mips_tls_single_got_index): New function.
1057         (mips_elf_local_got_index): Use entry->tls_type to check for
1058         TLS entries.  Use mips_tls_single_got_index.  Update call to
1059         mips_tls_got_index.
1060         (mips_elf_global_got_index): Use mips_elf_reloc_tls_type.
1061         Use p->tls_type to check for TLS entries.  Update call to
1062         mips_tls_got_index.  Use mips_tls_single_got_index.
1063         (mips_elf_create_local_got_entry): Use mips_elf_reloc_tls_type.
1064         Use entry.tls_type to check for TLS entries.
1065         (mips_elf_record_global_got_symbol): Replace tls_flag argument
1066         with r_type argument.  Use mips_elf_reloc_tls_type.
1067         Set up the new hash entry fields.
1068         (mips_elf_record_local_got_symbol): Replace tls_flag argument
1069         with r_type argument.  Use mips_elf_reloc_tls_type and
1070         mips_tls_got_entries.  Remove code that handled entries
1071         with multiple TLS types.
1072         (mips_elf_make_got_per_bfd): Use mips_tls_got_entries.
1073         (mips_elf_initialize_tls_index): Handle new hash entry fields.
1074         Use equality rather than masks when checking for specific TLS types.
1075         Use mips_tls_got_entries.  Remove code that handled entries
1076         with multiple TLS types.
1077         (mips_elf_calculate_relocation): Use TLS_RELOC_P instead of
1078         testing the hash table entry.
1079         (_bfd_mips_elf_check_relocs): Update calls to
1080         mips_elf_record_global_got_symbol and mips_elf_record_local_got_symbol.
1081         (_bfd_mips_elf_finish_dynamic_symbol): Don't check h->type.
1082         (_bfd_mips_elf_copy_indirect_symbol): Handle new hash entry fields.
1083
1084 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
1085
1086         * elfxx-mips.c (mips_elf_multi_got_entry_hash): Rename to...
1087         (mips_elf_got_entry_hash): ...this, deleting the old version.
1088         (mips_elf_create_got_info): Use mips_elf_got_entry_hash for
1089         both types of GOT.
1090
1091 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
1092
1093         * elfxx-mips.c (mips_elf_create_got_info): New function.
1094         (mips_elf_get_got_for_bfd, mips_elf_multi_got): Use it.
1095         (mips_elf_create_got_section): Likewise.
1096
1097 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
1098
1099         * elfxx-mips.c (mips_elf_record_local_got_symbol): Always set
1100         gotidx to -1.
1101
1102 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
1103
1104         * elfxx-mips.c (mips_elf_multi_got): Simplify size calculation.
1105
1106 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
1107
1108         * elfxx-mips.c (mips_got_info): Move global_gotsym to...
1109         (mips_elf_link_hash_table): ...here.  Update rest of file accordingly.
1110
1111 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
1112
1113         * elfxx-mips.c (mips_elf_count_global_tls_entries)
1114         (mips_elf_count_global_tls_relocs): Don't count indirect or
1115         warning symbols.
1116         (mips_elf_multi_got, mips_elf_lay_out_got): Assert that the right
1117         number of TLS entries were allocated.
1118
1119 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
1120
1121         * elfxx-mips.c (mips_elf_sort_hash_table_f): Remove asserts.
1122
1123 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
1124
1125         * elfxx-mips.c (mips_elf_merge_got_with): Only use arg->global_count
1126         if there are TLS relocations.
1127
1128 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
1129
1130         * elfxx-mips.c (mips_elf_recreate_got): Remove free.
1131         (mips_elf_resolve_final_got_entries): Remove bogus comment.
1132
1133 2013-02-11  Alan Modra  <amodra@gmail.com>
1134
1135         * elfcode.h (elf_checksum_contents): Free contents.
1136         * elf-bfd.h (_bfd_elf_link_hash_table_free): Declare.
1137         * elflink.c (_bfd_elf_link_hash_table_free): New function.
1138         (elf_final_link_free): New function, extracted from..
1139         (bfd_elf_final_link): ..here.  Always call
1140         _bfd_elf_write_section_eh_frame_hdr.
1141         * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Default to
1142         _bfd_elf_link_hash_table_free.
1143         * libbfd-in.h (_bfd_merge_sections_free): Declare.
1144         * libbfd.h: Regenerate.
1145         * merge.c (_bfd_merge_sections_free): New function.
1146         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): Free
1147         hdr_info->array.
1148         * elf-m10300.c (elf32_mn10300_link_hash_table_free): Call
1149         _bfd_elf_link_hash_table_free.
1150         * elf32-arm.c (elf32_arm_link_hash_table_free): Likewise.
1151         * elf32-avr.c (elf32_avr_link_hash_table_free): Likewise.
1152         * elf32-hppa.c (elf32_hppa_link_hash_table_free): Likewise.
1153         * elf32-i386.c (elf_i386_link_hash_table_free): Likewise.
1154         * elf32-m68hc1x.c (m68hc11_elf_hash_table_free): Likewise.
1155         * elf32-m68k.c (elf_m68k_link_hash_table_free): Likewise.
1156         * elf32-metag.c (elf_metag_link_hash_table_free): Likewise.
1157         * elf32-xgate.c (xgate_elf_bfd_link_hash_table_free): Likewise.
1158         * elf64-aarch64.c (elf64_aarch64_link_hash_table_free): Likewise.
1159         * elf64-ia64-vms.c (elf64_ia64_hash_table_free): Likewise.
1160         * elf64-ppc.c (ppc64_elf_link_hash_table_free): Likewise.
1161         * elf64-x86-64.c (elf_x86_64_link_hash_table_free): Likewise.
1162         * elfnn-ia64.c (elfNN_ia64_hash_table_free): Likewise.
1163         * elf32-cr16.c (elf32_cr16_link_hash_table_free): Delete.
1164         (bfd_elf32_bfd_link_hash_table_free): Don't define.
1165         * elf32-tic6x.c (elf32_tic6x_link_hash_table_free): Delete.
1166         (bfd_elf32_bfd_link_hash_table_free): Dont' define.
1167
1168 2013-02-10  Alan Modra  <amodra@gmail.com>
1169
1170         * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_zmalloc.
1171         * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise.
1172         * m68klinux.c (linux_link_hash_table_create): Likewise.
1173         * sparclinux.c (linux_link_hash_table_create): Likewise.
1174         * sunos.c (sunos_link_hash_table_create): Likewise.
1175         * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise.
1176         * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise.
1177         * elf32-arm.c (elf32_arm_link_hash_table_create): Likewise.
1178         * elf32-avr.c (elf32_avr_link_hash_table_create): Likewise.
1179         * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
1180         * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
1181         * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise.
1182         * elf32-i386.c (elf_i386_link_hash_table_create): Likewise.
1183         * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
1184         * elf32-m32r.c (m32r_elf_link_hash_table_create): Likewise.
1185         * elf32-m68hc1x.c (m68hc11_elf_hash_table_create): Likewise.
1186         * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
1187         * elf32-metag.c (elf_metag_link_hash_table_create): Likewise.
1188         * elf32-nios2.c (nios2_elf32_link_hash_table_create): Likewise.
1189         * elf32-s390.c (elf_s390_link_hash_table_create): Likewise.
1190         * elf32-score.c (elf32_score_link_hash_table_create): Likewise.
1191         * elf32-spu.c (spu_elf_link_hash_table_create): Likewise.
1192         * elf32-tic6x.c (elf32_tic6x_link_hash_table_create): Likewise.
1193         * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
1194         * elf32-xgate.c (xgate_elf_bfd_link_hash_table_create): Likewise.
1195         * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Likewise.
1196         * elf64-aarch64.c (elf64_aarch64_link_hash_table_create): Likewise.
1197         * elf64-s390.c (elf_s390_link_hash_table_create): Likewise.
1198         * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise.
1199         * elf64-x86-64.c (elf_x86_64_link_hash_table_create): Likewise.
1200         * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
1201         * elflink.c (_bfd_elf_link_hash_table_create): Likewise.
1202         (_bfd_elf_link_hash_table_init): Assume zero fill table on entry.
1203
1204 2013-02-10  Alan Modra  <amodra@gmail.com>
1205
1206         * i386linux.c (linux_link_hash_table_create): Allocate table
1207         with bfd_zmalloc, not bfd_alloc.
1208         * pdp11.c (link_hash_table_create): Allocate table with
1209         bfd_malloc, not bfd_alloc.
1210         * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create): Allocate table
1211         with bfd_zmalloc, not bfd_zalloc.
1212         (bfin_link_hash_table_create): Likewise.
1213         * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
1214         * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
1215
1216 2013-02-10  Alan Modra  <amodra@gmail.com>
1217
1218         PR ld/15113
1219         * elf32-sh.c (sh_elf_link_hash_table_create): Use bfd_zmalloc.
1220
1221 2013-02-08  Markos Chandras  <markos.chandras@imgtec.com>
1222
1223         * elf32-metag.c: Use bfd_get_linker_section to get SEC_LINKER_CREATED
1224         sections.
1225         (elf_metag_adjust_dynamic_symbol): Don't error on zero size dynbss
1226         symbol.
1227
1228 2013-02-08  Yufeng Zhang  <yufeng.zhang@arm.com>
1229
1230         * elf64-aarch64.c (elf64_aarch64_grok_prstatus): Change 'size' from
1231         288 to 272.
1232
1233 2013-02-08  Alan Modra  <amodra@gmail.com>
1234
1235         PR binutils/15106
1236         * elf-bfd.h (struct elf_obj_tdata): Add elf_find_function_cache.
1237         * elf.c (elf_find_function): Revert last change.  Use new
1238         tdata field rather than static vars for cache.
1239
1240 2013-02-07  H.J. Lu  <hongjiu.lu@intel.com>
1241
1242         PR ld/15107
1243         * elflink.c (elf_link_output_extsym): Set STB_GNU_UNIQUE only if
1244         symbol is defined in regular object.
1245
1246 2013-02-07  Roberto Agostino Vitillo  <ra.vitillo@gmail.com>
1247
1248         PR binutils/15106
1249         * elf.c (elf_find_function): Don't cache if symbols change.
1250
1251 2013-02-07  Alan Modra  <amodra@gmail.com>
1252
1253         PR binutils/14873
1254         * elf-attrs.c (_bfd_elf_copy_obj_attributes): Don't attempt to
1255         copy attributes from or to non-ELF.
1256
1257 2013-02-06  H.J. Lu  <hongjiu.lu@intel.com>
1258
1259         * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't clear pc_count
1260         for non-zero TLS symbol.
1261         (elf_i386_relocate_section): Don't resolve size relocation against
1262         non-zero TLS symbol.
1263         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Don't clear
1264         pc_count for non-zero TLS symbol.
1265         (elf_x86_64_relocate_section): Don't resolve size relocation
1266         against non-zero TLS symbol.
1267
1268 2013-02-06  Sandra Loosemore  <sandra@codesourcery.com>
1269             Andrew Jenner <andrew@codesourcery.com>
1270
1271         Based on patches from Altera Corporation.
1272
1273         * Makefile.am (ALL_MACHINES): Add cpu-nios2.lo.
1274         (ALL_MACHINES_CFILES): Add cpu-nios2.c.
1275         (BFD_BACKENDS): Add elf32-nios2.lo.
1276         (BFD32_BACKENDS_CFILES): Add elf32-nios2.c.
1277         * Makefile.in: Regenerated.
1278         * configure.in: Add entries for bfd_elf32_bignios2_vec and
1279         bfd_elf32_littlenios2_vec.
1280         * configure: Regenerated.
1281         * config.bfd: Add cases for nios2.
1282         * archures.c (enum bfd_architecture): Add bfd_arch_nios2.
1283         (bfd_mach_nios2): Define.
1284         (bfd_nios2_arch): Declare.
1285         (bfd_archures_list): Add bfd_nios2_arch.
1286         * targets.c (bfd_elf32_bignios2_vec): Declare.
1287         (bfd_elf32_littlenios2_vec): Declare.
1288         (_bfd_target_vector): Add entries for bfd_elf32_bignios2_vec and
1289         bfd_elf32_littlenios2_vec.
1290         * elf-bfd.h (enum elf_target_id): Add NIOS2_ELF_DATA.
1291         * reloc.c (enum bfd_reloc_code_real): Add Nios II relocations.
1292         * bfd-in2.h: Regenerated.
1293         * libbfd.h: Regenerated.
1294         * cpu-nios2.c: New file.
1295         * elf32-nios2.c: New file.
1296
1297 2013-02-06  Alan Modra  <amodra@gmail.com>
1298
1299         * elf32-arm.c (elf32_arm_final_link_relocate): Only test for
1300         stubs in stub_bfd.
1301
1302 2013-02-06  Alan Modra  <amodra@gmail.com>
1303
1304         * Makefile.am (SOURCE_HFILES): Add `elf-linux-psinfo.h'.
1305         * Makefile.in: Regenerate.
1306
1307 2013-02-04  Sergio Durigan Junior  <sergiodj@redhat.com>
1308             Pedro Alves  <palves@redhat.com>
1309
1310         * Makefile.in (SOURCE_HFILES): Add `elf-linux-psinfo.h'.
1311         * elf-bfd.h (elf_internal_linux_prpsinfo): New structure
1312         declaration.
1313         (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64)
1314         (elfcore_write_ppc32_linux_prpsinfo32): New declarations.
1315         * elf-linux-psinfo.h: New file.
1316         * elf.c: Include elf-linux-psinfo.h.
1317         (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64):
1318         New functions.
1319         * elf32-ppc.c: Include `elf-linux-psinfo.h'.
1320         (elf_external_ppc_linux_prpsinfo32): New structure declaration.
1321         (PPC_LINUX_PRPSINFO32_SWAP_FIELDS): New macro.
1322         (elfcore_write_ppc_linux_prpsinfo32): New function.
1323
1324 2013-02-04  Tristan Gingold  <gingold@adacore.com>
1325
1326         * mach-o.c (bfd_mach_o_scan_start_address): Do not fail if no
1327         start address.
1328
1329 2013-02-04  Alan Modra  <amodra@gmail.com>
1330
1331         * Makefile.am (BFD64_BACKENDS): Remove elf-nacl.lo.
1332         (BFD64_BACKENDS_CFILES): Remove elf-nacl.c.
1333         * Makefile.in: Regenerate.
1334         * po/SRC-POTFILES.in: Regenerate.
1335
1336 2013-02-04  Alan Modra  <amodra@gmail.com>
1337
1338         * coff-tic54x.c (SWAP_OUT_RELOC_EXTRA): Delete.
1339         * coff-tic80.c (SWAP_OUT_RELOC_EXTRA): Delete.
1340
1341 2013-02-01  Alan Modra  <amodra@gmail.com>
1342
1343         * elf64-ppc.c (dec_dynrel_count): Don't error when elf_gc_sweep_symbol
1344         clears def_regular.
1345
1346 2013-01-31  Tristan Gingold  <gingold@adacore.com>
1347
1348         * mach-o.c (bfd_mach_o_scan): Call bfd_mach_o_flatten_sections
1349         earlier.  Fix status checking of bfd_mach_o_scan_start_address.
1350         (bfd_mach_o_scan_start_address): Handle LC_MAIN.
1351
1352 2013-01-31  Alan Modra  <amodra@gmail.com>
1353             David S. Miller  <davem@davemloft.net>
1354
1355         PR ld/15056
1356         * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Handle implicit
1357         references to __tls_get_addr.
1358         * elf32-tilpro.c (tilepro_elf_gc_mark_hook): Likewise.  Correct
1359         vtinherit and vtentry reloc handling too.
1360         * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): As for tilepro.
1361
1362 2013-01-31  Alan Modra  <amodra@gmail.com>
1363
1364         * elf64-ppc.c (ppc_stub_name): Trim off trailing "+0".
1365
1366 2013-01-31  Alan Modra  <amodra@gmail.com>
1367
1368         * elf64-ppc.c (build_plt_stub): Correct plt stub branch to glink.
1369
1370 2013-01-28  Alan Modra  <amodra@gmail.com>
1371
1372         * elf64-ppc.c: Use %T to print symbols names and remove redundant
1373         "relocation" in error messages throughout file.
1374         (ppc64_elf_relocate_section): Remove sibling call error message,
1375         replace with "call lacks nop".  Specially report errors for
1376         branches to function entry points via OPD lookup and branches
1377         to stubs.  Remove NULL symbol handling now done by %T.
1378
1379 2013-01-28  Alan Modra  <amodra@gmail.com>
1380
1381         * archive.c (bfd_generic_archive_p): Return target and keep
1382         ardata on partial matches.
1383         * format.c (bfd_check_format_matches): Adjust for above
1384         change.  Remove bfd_error_file_ambiguously_recognized dead
1385         code.
1386
1387 2013-01-26  Alan Modra  <amodra@gmail.com>
1388
1389         * bfd.c (struct bfd_preserve, bfd_preserve_save, bfd_preserve_restore,
1390         bfd_preserve_finish): Move to..
1391         * format.c: ..here, splitting out..
1392         (bfd_reinit): ..this.  New function.
1393         (bfd_check_format_matches): Use bfd_preserve_save/restore to
1394         keep bfd state for a match.
1395         * elfcode.h (elf_object_p): Don't use bfd_preserve_save/restore.
1396         * elfcore.h (elf_core_file_p): Likewise.
1397         * mach-o.c (bfd_mach_o_header_p): Likewise.
1398         * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
1399         * xsym.c (bfd_sym_object_p): Likewise.
1400         * mmo.c (mmo_scan): Clear abfd->symcount.
1401         * opncls.c (_bfd_new_bfd): Use a smaller section hash table.
1402         * section.c (bfd_section_list_clear): Clear section_htab.count.
1403         * bfd-in2.h: Regenerate.
1404
1405 2013-01-25  Michael Schewe  <michael.schewe@gmx.net>
1406
1407         * elf32-h8300.c (elf32_h8_relax_section): When checking for a
1408         second reloc, make sure that the reloc potentially exists first.
1409
1410 2013-01-24  Nick Clifton  <nickc@redhat.com>
1411
1412         * archures.c: Add bfd_mach_v850e3v5.
1413         * bfd-in2.h: Regenerate.
1414         * cpu-v850.c: Add entries for v850e2v5 and v850e3v5.
1415         * cpu-v850_rh850.c: Likewise.
1416         * elf32-v850.c: Add support for v850e3v5 architecture.
1417
1418 2013-01-23  Markos Chandras  <markos.chandras@imgtec.com>
1419
1420         * elf32-metag.c: Error on HIADDR16/LOADDR16 in shared link.
1421
1422 2013-01-23  Leif Ekblad  <leif@rdos.net>
1423
1424         * config.bfd (x86_64-*-rdos*): Remove targ_selvecs.
1425
1426 2013-01-18  H.J. Lu  <hongjiu.lu@intel.com>
1427
1428         * elf32-i386.c (elf_i386_allocate_dynrelocs): Clear pc_count for
1429         non-zero TLS symbol.
1430         (elf_i386_relocate_section): Resolve size relocation against
1431         non-zero TLS symbol.
1432         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Clear pc_count
1433         for non-zero TLS symbol.
1434         (elf_x86_64_relocate_section): Resolve size relocation against
1435         non-zero TLS symbol.
1436
1437 2013-01-18  Mike Frysinger  <vapier@gentoo.org>
1438
1439         * elflink.c (bfd_elf_size_dynamic_sections): Only add DT_RPATH
1440         when new_dtags is false.  Only add DT_RUNPATH when new_dtags is
1441         true.
1442
1443 2013-01-17  H.J. Lu  <hongjiu.lu@intel.com>
1444
1445         * elf32-i386.c (elf_i386_check_relocs): Count size relocation as
1446         PC-relative relocation.
1447         * elf64-x86-64.c (elf_x86_64_check_relocs): Count size relocation
1448         as PC-relative relocation.
1449
1450 2013-01-16  H.J. Lu  <hongjiu.lu@intel.com>
1451
1452         * elf32-i386.c (elf_i386_check_relocs): Update R_386_SIZE32
1453         check.
1454         (elf_i386_relocate_section): Don't check TLS for R_386_SIZE32.
1455
1456         * elf64-x86-64.c (elf_x86_64_check_relocs): Update R_X86_64_SIZE32
1457         and R_X86_64_SIZE64 check.
1458         (elf_x86_64_relocate_section): Don't check TLS for R_X86_64_SIZE32
1459         nor R_X86_64_SIZE64.
1460
1461 2013-01-16  H.J. Lu  <hongjiu.lu@intel.com>
1462
1463         * bfd-in2.h: Regenerated.
1464         * libbfd.h: Likewise.
1465
1466         * elf32-i386.c (elf_howto_table): Fill R_386_SIZE32 entry.
1467         (elf_i386_reloc_type_lookup): Support BFD_RELOC_SIZE32.
1468         (elf_i386_check_relocs): Handle R_386_SIZE32.
1469         (elf_i386_gc_sweep_hook): Likewise.
1470         (elf_i386_relocate_section): Likewise.
1471
1472         * elf64-x86-64.c (x86_64_elf_howto_table): Fill R_X86_64_SIZE32
1473         and R_X86_64_SIZE64 entries.
1474         (x86_64_reloc_map): Add BFD_RELOC_SIZE32 and BFD_RELOC_SIZE64,
1475         (elf_x86_64_rtype_to_howto): Handle R_X86_64_SIZE32 for x32.
1476         (elf_x86_64_reloc_name_lookup): Likewise.
1477         (elf_x86_64_check_relocs): Handle R_X86_64_SIZE32 and
1478         R_X86_64_SIZE64.
1479         (elf_x86_64_gc_sweep_hook): Likewise.
1480         (elf_x86_64_relocate_section): Likewise.
1481
1482         * reloc.c (bfd_reloc_code_type): Add BFD_RELOC_SIZE32 and
1483         BFD_RELOC_SIZE64.
1484
1485 2013-01-15  H.J. Lu  <hongjiu.lu@intel.com>
1486
1487         * elf64-x86-64.c (R_X86_64_standard): Replace R_X86_64_IRELATIVE
1488         with R_X86_64_RELATIVE64.
1489
1490 2013-01-15  Nick Clifton  <nickc@redhat.com>
1491
1492         * elf32-msp430.c: Fix spelling typo.
1493
1494 2013-01-15  Alan Modra  <amodra@gmail.com>
1495
1496         * elf64-ppc.c (ppc64_elf_size_stubs): Default shared libs to
1497         plt-thread-safe.
1498
1499 2013-01-14  Alan Modra  <amodra@gmail.com>
1500
1501         PR binutils/14813
1502         * bfdio.c (struct bfd_iovec <bclose>): Revert 2012-11-06.
1503         (memory_bclose): Likewise.  Return 0 on success.
1504         * cache.c (cache_bclose): Likewise.
1505         * opncls.c (opncls_bclose, bfd_close): Likewise.
1506         * vms-lib.c (vms_lib_bclose): Likewise.
1507         * libbfd.h: Regenerate.
1508
1509 2013-01-13  Alan Modra  <amodra@gmail.com>
1510
1511         * elf-bfd.h (struct elf_link_hash_entry): Delete dynamic_weak.
1512         Add ref_dynamic_nonweak.
1513         * elflink.c (_bfd_elf_mark_dynamic_def_weak): Delete.
1514         (_bfd_elf_merge_symbol): Don't call above function.  Move
1515         setting of ref_dynamic_nonweak and dynamic_def earlier.  Don't
1516         clear dynamic_def.
1517         (elf_link_add_object_symbols): Delete redundant "override" test.
1518         Don't set dynamic_def here.
1519         (elf_link_output_extsym): Update.
1520
1521 2013-01-12  H.J. Lu  <hongjiu.lu@intel.com>
1522
1523         * elf32-i386.c (elf_i386_check_relocs): Set bfd errror for
1524         normal and TLS symbol access.
1525         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1526
1527 2013-01-12  Alan Modra  <amodra@gmail.com>
1528
1529         * elf-bfd.h (_bfd_elf_strtab_refcount): Declare.
1530         * elf-strtab.c (_bfd_elf_strtab_refcount): New function.
1531         * elflink.c (elf_add_dt_needed_tag): Use _bfd_elf_strtab_refcount.
1532
1533 2013-01-12  Alan Modra  <amodra@gmail.com>
1534
1535         PR ld/12549
1536         * elf-bfd.h (_bfd_elf_strtab_clear_refs): Declare.
1537         (_bfd_elf_strtab_clear_all_refs): Define.
1538         * elf-strtab.c (_bfd_elf_strtab_clear_refs): New function.
1539         (_bfd_elf_strtab_clear_all_refs): Delete.
1540         * elflink.c (elf_link_add_object_symbols): Clear out added
1541         strtab refs.  Correct handling of warning common symbols.
1542
1543 2013-01-10  H.J. Lu  <hongjiu.lu@intel.com>
1544
1545         * aout0.c: Remove trailing white spaces.
1546         * archive.c: Likewise.
1547         * archures.c: Likewise.
1548         * bfd-in.h: Likewise.
1549         * bfd-in2.h: Likewise.
1550         * coff-alpha.c: Likewise.
1551         * coff-i860.c: Likewise.
1552         * coff-mips.c: Likewise.
1553         * coff-ppc.c: Likewise.
1554         * coff-tic80.c: Likewise.
1555         * coff-x86_64.c: Likewise.
1556         * coff-z80.c: Likewise.
1557         * coffcode.h: Likewise.
1558         * coffgen.c: Likewise.
1559         * cofflink.c: Likewise.
1560         * compress.c: Likewise.
1561         * corefile.c: Likewise.
1562         * cpu-arm.c: Likewise.
1563         * cpu-avr.c: Likewise.
1564         * cpu-bfin.c: Likewise.
1565         * cpu-cr16.c: Likewise.
1566         * cpu-cr16c.c: Likewise.
1567         * cpu-crx.c: Likewise.
1568         * cpu-h8300.c: Likewise.
1569         * cpu-i386.c: Likewise.
1570         * cpu-lm32.c: Likewise.
1571         * cpu-m68k.c: Likewise.
1572         * cpu-moxie.c: Likewise.
1573         * cpu-msp430.c: Likewise.
1574         * cpu-sh.c: Likewise.
1575         * cpu-xc16x.c: Likewise.
1576         * dwarf2.c: Likewise.
1577         * ecofflink.c: Likewise.
1578         * ecoffswap.h: Likewise.
1579         * elf-ifunc.c: Likewise.
1580         * elf-m10300.c: Likewise.
1581         * elf-vxworks.c: Likewise.
1582         * elf32-avr.c: Likewise.
1583         * elf32-avr.h: Likewise.
1584         * elf32-cr16.c: Likewise.
1585         * elf32-cr16c.c: Likewise.
1586         * elf32-cris.c: Likewise.
1587         * elf32-crx.c: Likewise.
1588         * elf32-frv.c: Likewise.
1589         * elf32-hppa.c: Likewise.
1590         * elf32-i860.c: Likewise.
1591         * elf32-ip2k.c: Likewise.
1592         * elf32-iq2000.c: Likewise.
1593         * elf32-m32c.c: Likewise.
1594         * elf32-m68hc1x.c: Likewise.
1595         * elf32-msp430.c: Likewise.
1596         * elf32-mt.c: Likewise.
1597         * elf32-ppc.c: Likewise.
1598         * elf32-rl78.c: Likewise.
1599         * elf32-s390.c: Likewise.
1600         * elf32-score.h: Likewise.
1601         * elf32-sh-symbian.c: Likewise.
1602         * elf32-sh.c: Likewise.
1603         * elf32-spu.c: Likewise.
1604         * elf32-tic6x.c: Likewise.
1605         * elf32-v850.c: Likewise.
1606         * elf32-xc16x.c: Likewise.
1607         * elf32-xtensa.c: Likewise.
1608         * elf64-alpha.c: Likewise.
1609         * elf64-hppa.c: Likewise.
1610         * elf64-ppc.c: Likewise.
1611         * elf64-s390.c: Likewise.
1612         * elfcore.h: Likewise.
1613         * elflink.c: Likewise.
1614         * elfxx-mips.c: Likewise.
1615         * elfxx-sparc.c: Likewise.
1616         * elfxx-tilegx.c: Likewise.
1617         * ieee.c: Likewise.
1618         * libcoff.h: Likewise.
1619         * libpei.h: Likewise.
1620         * libxcoff.h: Likewise.
1621         * linker.c: Likewise.
1622         * mach-o-i386.c: Likewise.
1623         * mach-o-target.c: Likewise.
1624         * mach-o.c: Likewise.
1625         * mach-o.h: Likewise.
1626         * mmo.c: Likewise.
1627         * opncls.c: Likewise.
1628         * pdp11.c: Likewise.
1629         * pe-x86_64.c: Likewise.
1630         * peXXigen.c: Likewise.
1631         * pef-traceback.h: Likewise.
1632         * pei-x86_64.c: Likewise.
1633         * peicode.h: Likewise.
1634         * plugin.c: Likewise.
1635         * reloc.c: Likewise.
1636         * riscix.c: Likewise.
1637         * section.c: Likewise.
1638         * som.c: Likewise.
1639         * syms.c: Likewise.
1640         * tekhex.c: Likewise.
1641         * ticoff.h: Likewise.
1642         * vaxbsd.c: Likewise.
1643         * xcofflink.c: Likewise.
1644         * xtensa-isa.c: Likewise.
1645
1646 2013-01-10  Will Newton <will.newton@imgtec.com>
1647
1648         * Makefile.am: Add Meta.
1649         * Makefile.in: Regenerate.
1650         * archures.c (bfd_mach_metag): New.
1651         * bfd-in2.h: Regenerate.
1652         * config.bfd: Add Meta.
1653         * configure: Regenerate.
1654         * configure.in: Add Meta.
1655         * cpu-metag.c: New file.
1656         * elf-bfd.h: Add Meta.
1657         * elf32-metag.c: New file.
1658         * elf32-metag.h: New file.
1659         * libbfd.h: Regenerate.
1660         * reloc.c: Add Meta relocations.
1661         * targets.c: Add Meta.
1662
1663 2013-01-08  Yufeng Zhang  <yufeng.zhang@arm.com>
1664
1665         * elf-bfd.h (elfcore_write_aarch_tls): Add prototype.
1666         (elfcore_write_aarch_hw_break): Likewise.
1667         (elfcore_write_aarch_hw_watch): Likewise.
1668         * elf.c (elfcore_grok_aarch_tls): New function.
1669         (elfcore_grok_aarch_hw_break): Likewise.
1670         (elfcore_grok_aarch_hw_watch): Likewise.
1671         (elfcore_grok_note): Call the new functions to handle the
1672         corresponding notes.
1673         (elfcore_write_aarch_tls): New function.
1674         (elfcore_write_aarch_hw_break): Likewise.
1675         (elfcore_write_aarch_hw_watch): Likewise.
1676         (elfcore_write_register_note): Call the new functions to handle the
1677         corresponding pseudo sections.
1678
1679 2013-01-07  Tom Tromey  <tromey@redhat.com>
1680
1681         * section.c (_bfd_std_section): Rename from std_section.
1682         (bfd_com_section_ptr, bfd_und_section_ptr, bfd_abs_section_ptr)
1683         (STD_SECTION): Update.
1684         * bfd-in2.h: Rebuild.
1685
1686 2013-01-04  Juergen Urban <JuergenUrban@gmx.de>
1687
1688         * archures.c (bfd_mach_mips5900): Define.
1689         * bfd-in2.h: Regenerate.
1690         * config.bfd: Add mips64-ps2-elf and mips-ps2-elf targets.
1691         * cpu-mips.c: Add support for MIPS r5900.
1692         * elfxx-mips.c: Add support for MIPS r5900 (extension of r4000).
1693
1694 2013-01-03  Nickolai Zeldovich  <nickolai@csail.mit.edu>
1695             Nick Clifton  <nickc@redhat.com>
1696
1697         * elflink.c (get_value): Prevent the use of an undefined shift
1698         operation.  Add sanity checks.
1699
1700 2013-01-02  Kaushik Phatak  <kaushik.phatak@kpitcummins.com>
1701
1702         * config.bfd (cr16*-*-uclinux*): New target support.
1703
1704
1705 For older changes see ChangeLog-2012
1706 \f
1707 Copyright (C) 2013 Free Software Foundation, Inc.
1708
1709 Copying and distribution of this file, with or without modification,
1710 are permitted in any medium without royalty provided the copyright
1711 notice and this notice are preserved.
1712
1713 Local Variables:
1714 mode: change-log
1715 left-margin: 8
1716 fill-column: 74
1717 version-control: never
1718 End: