* elflink.c (_bfd_elf_merge_symbol): Set old_alignment for
[platform/upstream/binutils.git] / bfd / ChangeLog
1 2013-03-25  Alan Modra  <amodra@gmail.com>
2
3         * elflink.c (_bfd_elf_merge_symbol): Set old_alignment for
4         usual common symbols as well as for dynamic.  Add poldbfd param.
5         Save old bfd.  Adjust callers.
6         (_bfd_elf_add_default_symbol): Add poldbfd param.  Pass "section"
7         and "value" by value, not pointer.  Adjust caller.
8         (elf_link_add_object_symbols): Combine undef_bfd and old_bfd vars.
9         Delete code to set same.  Use old_bfd and old_alignment from
10         _bfd_elf_merge_symbol instead.  Add default symbol before
11         alignment and size checks.  Wrap overlong lines.
12
13 2013-03-25  Alan Modra  <amodra@gmail.com>
14
15         * elflink.c (_bfd_elf_add_default_symbol): Delete "override" param.
16         (elf_link_add_object_symbols): Don't call _bfd_elf_add_default_symbol
17         when override is true.
18
19 2013-03-25  Alan Modra  <amodra@gmail.com>
20
21         * elflink.c (_bfd_elf_merge_symbol): Use local var holding value
22         of *sym_hash.
23
24 2013-03-25  Alan Modra  <amodra@gmail.com>
25
26         * elflink.c (_bfd_elf_merge_symbol): Don't discard TLS symbols here.
27         Wrap long lines.
28         (elf_link_add_object_symbols): Discard TLS symbols for --just-syms
29         early in symbol loop.
30
31 2013-03-25  Alan Modra  <amodra@gmail.com>
32
33         * elf-bfd.h (struct elf_backend_data <merge_symbol>): Update proto.
34         (_bfd_elf_init_reloc_shdr): Delete.
35         * elf.c (_bfd_elf_init_reloc_shdr): Make static.
36         * elf64-x86-64.c (elf_x86_64_merge_symbol): Trim parameters to
37         just what is needed.
38         * elflink.c (_bfd_elf_merge_symbol): Update bed->merge_symbol call.
39
40 2013-03-23  Alan Modra  <amodra@gmail.com>
41
42         * elf-bfd.h (_bfd_elf_merge_symbol): Delete declaration.
43         * elflink.c (_bfd_elf_merge_symbol): Make static.
44         * elf32-sh-symbian.c (sh_symbian_relocate_section): Don't call
45         _bfd_elf_merge_symbol, call _bfd_generic_link_add_one_symbol.
46
47 2013-03-23  Alan Modra  <amodra@gmail.com>
48
49         PR ld/15270
50         * elflink.c (elf_link_add_object_symbols): Don't set def_regular
51         or ref_regular for BFD_PLUGIN owned syms, or have them affect
52         def_dynamic/ref_dynamic.
53         (_bfd_elf_fix_symbol_flags): Don't set def_regular for BFD_PLUGIN
54         owned syms.
55
56 2013-03-22  David S. Miller  <davem@davemloft.net>
57
58         * elfxx-sparc.c (_bfd_sparc_elf_merge_private_bfd_data): Set type of
59         hwcaps attribute.
60
61 2013-03-22  Achille Fouilleul  <achille.fouilleul+binutils@gadz.org>
62
63         PR ld/14902
64         * elf32-h8300.c (elf32_h8_relax_delete_bytes): Fix off by one
65         errors adjusting relocs and symbols.
66
67 2013-03-21  Michael Schewe  <michael.schewe@gmx.net>
68
69         * elf32-h8300 (h8_relax_section): Add new relaxation of mov
70         @(disp:32,ERx) to mov @(disp:16,ERx).
71         (R_H8_DISP32A16): New reloc.
72         Comments added and corrected.
73         * reloc.c (BFD_RELOC_H8_DISP32A16): New reloc.
74         * bfd-in2.h: Regenerate.
75         * libbfd.h: Regenerate.
76
77 2013-03-21  Kai Tietz  <ktietz@redhat.com>
78
79         * coffgen.c (coff_real_object_p): Make global.
80         * peicode.h (coff_real_object_p): Add prototype.
81         (FILHDR): Defined for COFF_IMAGE_WITH_PE as
82         external_PEI_IMAGE_hdr structure.
83         (coff_swap_filehdr_in): Handle variable header-size.
84         * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Just handle amount
85         of directory-entiries as specified in pe-header.
86
87 2013-03-21  Nick Clifton  <nickc@redhat.com>
88
89         PR sim/15286
90         * elf32-arm.c (bfd_arm_get_mach_from_attributes): Identify XScale,
91         iWMMXt and iWMMXt2 processors from attributes.
92
93 2013-03-20  Alan Modra  <amodra@gmail.com>
94
95         * elflink.c (_bfd_elf_make_dynamic_reloc_section): Override
96         sh_type according to is_rela.
97
98 2013-03-18  Alan Modra  <amodra@gmail.com>
99
100         PR ld/12549
101         * elflink.c (elf_link_add_object_symbols): Exclude weak refs when
102         considering whether an --as-needed library is needed.
103
104 2013-03-14  Tom Tromey  <tromey@redhat.com>
105
106         * opncls.c (bfd_get_debug_link_info): Rename from
107         get_debug_link_info.  Export.  Update comment.
108         (find_separate_debug_file): Update.
109         * bfd-in2.h: Rebuild.
110
111 2013-03-08  Venkataramanan Kumar  <venkataramanan.kumar@linaro.org>
112
113         * elf64-aarch64.c (elf_backend_can_gc_sections): Enable gc-section
114         support.
115         (elf64_aarch64_gc_sweep_hook): Handle GOT, TLS and PLT related
116         relocs.
117
118 2013-03-08  Andreas Arnez  <arnez@linux.vnet.ibm.com>
119
120         * elf-bfd.h (elfcore_write_s390_tdb): Add prototype.
121         * elf.c (elfcore_write_s390_tdb): New function.
122         (elfcore_write_register_note): Call it.
123         (elfcore_grok_s390_tdb): New function.
124         (elfcore_grok_note): Call it.
125
126 2013-03-08  Maciej W. Rozycki  <macro@codesourcery.com>
127
128         * elfxx-mips.c (mips_elf_allocate_lazy_stub): Correct data type.
129
130 2013-03-05  Corinna Vinschen  <vinschen@redhat.com>
131
132         * config.bfd: Add x86_64-*-cygwin to list of supported targets.
133
134 2013-03-04  Alan Modra  <amodra@gmail.com>
135
136         * elf32-ppc.c (ppc_elf_relocate_section <R_PPC_PLTREL24>): Adjust
137         non-zero addends when relocatable, rather than addends >= 32768.
138         Always zero "addend" before applying relocation.
139
140 2013-03-04  Nick Clifton  <nickc@redhat.com>
141
142         * archive64.c (bfd_elf64_archive_write_armap): Fix calculation of
143         file pointer offsets for thin archives.
144
145 2013-02-28  Nathan Sidwell  <nathan@codesourcery.com>
146
147         * elf32-arm.c (elf32_arm_size_dynamic_sections): Don't call
148         elf32_arm_allocate_dynrelocs for source reloc for non-dynamic link.
149
150 2013-02-27  DJ Delorie  <dj@redhat.com>
151
152         * reloc.c (BFD_RELOC_RL78_CODE): Add.
153         * libbfd.h: Regenerate.
154         * bfd-in2.h: Regenerate.
155         * elf32-rl78.c (rl78_elf_relocate_section): Handle weak code
156         references in compuated relocs.
157
158 2013-02-26  Anthony Green  <green@moxielogic.com>
159
160         * config.bfd: Extend moxie-rtems target triplet name support.
161
162 2013-02-21  H.J. Lu  <hongjiu.lu@intel.com>
163
164         PR ld/15167
165         * elf64-ia64-vms.c (elf64_vms_link_add_object_symbols): Set
166         unique_global only for definition.
167         * elflink.c (_bfd_elf_merge_symbol): Don't set unique_global
168         here.
169         (elf_link_add_object_symbols): Set unique_global only
170         for definition.
171
172 2013-02-21  Alan Modra  <amodra@gmail.com>
173
174         * elf-bfd.h (struct elf_build_id): Extracted from..
175         (struct elf_build_id_info): ..here.  Delete.
176         (struct output_elf_obj_tdata): New, extracted from..
177         (struct elf_obj_tdata): ..here.  Reorganize for better packing.
178         Add "o" field.
179         (elf_program_header_size): Reference tdata->o.
180         (elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker,
181         elf_stack_flags, elf_shstrtab, elf_strtab_sec, elf_shstrtab_sec,
182         elf_section_syms, elf_num_section_syms, elf_flags_init): Likewise.
183         * elf.c (bfd_elf_allocate_object): Allocate output_elf_obj_tdata
184         when opening bfd in any mode that might write.
185         (_bfd_elf_write_object_contents): Use build_id field in
186         output_elf_obj_tdata.
187         (_bfd_elf_close_and_cleanup): Tweak elf_shstrtab test.
188         (elfobj_grok_gnu_build_id): Adjust for elf_tdata changes.
189
190 2013-02-21  Alan Modra  <amodra@gmail.com>
191
192         * elf-bfd.h (struct core_elf_obj_tdata): New.
193         (struct elf_obj_tdata): Delete core_signal, core_pid, core_lwpid,
194         core_program, and core_command.  Add "core".
195         * elf.c (bfd_elf_mkcorefile): Allocate "core" struct.
196         Update all refs to tdata core fields.
197         * elf32-am33lin.c, * elf32-arm.c, * elf32-cris.c, * elf32-frv.c,
198         * elf32-hppa.c, * elf32-i386.c, * elf32-m68k.c, * elf32-mips.c,
199         * elf32-nios2.c, * elf32-ppc.c, * elf32-s390.c, * elf32-score.c,
200         * elf32-score7.c, * elf32-sh.c, * elf32-sparc.c, * elf32-tilegx.c,
201         * elf32-tilepro.c, * elf32-xtensa.c, * elf64-aarch64.c,
202         * elf64-hppa.c, * elf64-mips.c, * elf64-ppc.c, * elf64-tilegx.c,
203         * elf64-x86-64.c, * elfcore.h, * elfn32-mips.c: Update all refs
204         to tdata core fields.
205
206 2013-02-21  Alan Modra  <amodra@gmail.com>
207
208         * elf-bfd.h (struct elf_obj_tdata): Rename segment_map to seg_map.
209         Delete num_locals and num_globals.
210         (elf_num_locals, elf_num_globals): Don't define.
211         (elf_seg_map, elf_next_file_pos, elf_eh_frame_hdr, elf_linker,
212         elf_stack_flags, elf_strtab_sec, elf_shstrtab_sec): Define.
213         * bfd.c, * elf-eh-frame.c, * elf-nacl.c, * elf-vxworks.c, * elf.c,
214         * elf32-arm.c, * elf32-lm32.c, * elf32-ppc.c, * elf32-rx.c,
215         * elf32-spu.c, * elf64-hppa.c, * elfcode.h, * elflink.c,
216         * elfnn-ia64.c, * elfxx-mips.c: Use newly defined elf_obj_tdata
217         accessor macros.
218         * elf.c (elf_map_symbols): Add pnum_locals param.  Return
219         number of locals syms via new param.
220         (swap_out_syms): Adjust to suit elf_map_symbols change.
221
222 2013-02-19  Maciej W. Rozycki  <macro@codesourcery.com>
223
224         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_symbol): Also clear
225         STO_MICROMIPS annotation.
226
227 2013-02-19  Alan Modra  <amodra@gmail.com>
228
229         * configure.in: Bump version to 2.23.52.
230         * elf-bfd.h (struct elf_build_id_info): New.
231         (struct elf_obj_tdata): Delete after_write_object_contents,
232         after_write_object_contents_info and build_id_size.  Make build_id
233         a pointer to struct elf_build_id_info.
234         * elf.c (_bfd_elf_write_object_contents): Style.  Update
235         after_write_ibject_contents invocation.
236         (elfobj_grok_gnu_build_id): Update for new build_id struct.  Don't
237         allow zero size notes.
238         * configure: Regenerate.
239
240 2013-02-18  Maciej W. Rozycki  <macro@codesourcery.com>
241
242         * elf64-mips.c (micromips_elf64_howto_table_rel): Add
243         R_MICROMIPS_SCN_DISP and R_MICROMIPS_JALR.
244         (micromips_elf64_howto_table_rela): Likewise.
245         (micromips_reloc_map): Add BFD_RELOC_MICROMIPS_JALR.
246         * elfn32-mips.c (elf_micromips_howto_table_rel): Add
247         R_MICROMIPS_SCN_DISP and R_MICROMIPS_JALR.
248         (elf_micromips_howto_table_rela): Likewise.
249         (micromips_reloc_map): Add BFD_RELOC_MICROMIPS_JALR.
250
251 2013-02-18  Paul Brook  <paul@codesourcery.com>
252
253         * elfxx-mips.c (MICROMIPS_P): New macro.
254         (_bfd_mips_elf_symbol_processing): Use it.
255
256 2013-02-18  Maciej W. Rozycki  <macro@codesourcery.com>
257
258         * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Clarify
259         comment on _PROCEDURE_LINKAGE_TABLE_ creation.
260
261 2013-02-18  Alan Modra  <amodra@gmail.com>
262
263         PR ld/12549
264         * elf-bfd.h (_bfd_elf_strtab_clear_refs): Delete.
265         (_bfd_elf_strtab_clear_all_refs): Declare.
266         (_bfd_elf_strtab_resize): Declare.
267         * elf-strtab.c (_bfd_elf_strtab_clear_refs): Delete.
268         (_bfd_elf_strtab_clear_all_refs): New function.
269         (_bfd_elf_strtab_resize): Likewise.
270         * elflink.c (elf_link_add_object_symbols): Use _bfd_elf_strtab_resize.
271
272 2013-02-18  Alan Modra  <amodra@gmail.com>
273
274         * elf-bfd.h (struct elf_obj_tdata): Move find_line_info, local_stubs,
275         local_call_stubs, elf_data_symbol, elf_text_symbol, elf_data_section,
276         and elf_text_section to..
277         * elfxx-mips.c (struct mips_elf_obj_tdata): ..here.  Update all refs.
278         * elf64-alpha.c (struct mips_elf_find_line): Rename to..
279         (struct alpha_elf_find_line): ..this.
280         (struct alpha_elf_obj_tdata): Add find_line_info, update refs.
281
282 2013-02-16  H.J. Lu  <hongjiu.lu@intel.com>
283
284         PR ld/15146
285         * elflink.c (elf_link_add_object_symbols): Don't add DT_NEEDED
286         for references from the dummy bfd.
287
288 2013-02-16  H.J. Lu  <hongjiu.lu@intel.com>
289
290         PR ld/15149
291         * elflink.c (elf_link_add_object_symbols): Also track weak
292         references.
293
294 2013-02-15  H.J. Lu  <hongjiu.lu@intel.com>
295
296         PR binutils/15151
297         * archive.c (_bfd_find_nested_archive): Don't allow a nested
298         archive pointing to itself.
299         (_bfd_get_elt_at_filepos): Revert the last 2 changes.
300
301 2013-02-15  Nick Clifton  <nickc@redhat.com>
302
303         PR binutils/15140
304         * archive.c (_bfd_get_elt_at_filepos): Prevent an infinite loop
305         accessing a corrupt nested archive.
306
307 2013-02-13  Richard Sandiford  <rdsandiford@googlemail.com>
308
309         * elfxx-mips.c (mips_got_page_ref): New structure.
310         (mips_got_page_entry): Use a section rather than a (bfd, symndx)
311         pair to represent the anchor point.
312         (mips_got_info): Add a got_page_refs field.
313         (mips_elf_link_hash_table): Add a sym_cache field.
314         (mips_got_page_ref_hash, mips_got_page_ref_eq): New functions.
315         (mips_got_page_entry_hash, mips_got_page_entry_eq): Update for
316         new anchor representation.
317         (mips_elf_create_got_info): Create got_page_refs rather than
318         got_page_entries.
319         (mips_elf_record_got_page_ref): New function.
320         (mips_elf_pages_for_range): Move further down file.
321         (mips_elf_record_got_page_entry): Likewise.  Take a got as argument.
322         Use a section rather than a (bfd, symndx) pair to represent the
323         anchor point.
324         (mips_elf_resolve_got_page_ref): New function.
325         (mips_elf_resolve_final_got_entries): Use it to populate
326         got_page_entries.
327         (_bfd_mips_elf_check_relocs): Call mips_elf_record_got_page_ref
328         rather than mips_elf_record_got_page_entry.  Only nullify h
329         afterwards.
330         (mips_elf_lay_out_got): Call mips_elf_resolve_final_got_entries
331         earlier.
332
333 2013-02-12  Richard Sandiford  <rdsandiford@googlemail.com>
334
335         * elfxx-mips.c (mips_elf_lay_out_got): Count VxWorks GOT relocs
336         in g->relocs.
337
338 2013-02-12  Alan Modra  <amodra@gmail.com>
339
340         * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Provide
341         suitable definition when using generic linker hash table.
342
343 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
344
345         * elfxx-mips.c (mips_elf_count_got_entries): Delete.
346         (mips_elf_check_recreate_got, mips_elf_recreate_got): Take a
347         mips_elf_traverse_got_arg.  Count GOT entries.
348         (mips_elf_resolve_final_got_entries): Take the bfd_link_info
349         as argument.  Update after above changes.
350         (mips_elf_merge_got, mips_elf_lay_out_got): Don't call
351         mips_elf_count_got_entries.  Update the calls to
352         mips_elf_resolve_final_got_entries.
353
354 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
355
356         * elfxx-mips.c (mips_got_tls_type): New enum.
357         (mips_got_entry): Add tls_initialized.
358         (mips_elf_got_entry_hash, mips_elf_got_entry_eq, mips_tls_got_relocs)
359         (mips_elf_count_got_entry, mips_elf_initialize_tls_index): Remove
360         GOT_TLS_TYPE masks.
361         (mips_elf_reloc_tls_type, mips_tls_got_entries)
362         (mips_elf_record_global_got_symbol, mips_elf_initialize_tls_index)
363         (_bfd_mips_elf_finish_dynamic_symbol): Use GOT_TLS_NONE rather
364         than GOT_NORMAL.
365         (mips_elf_initialize_tls_slots): Replace got_offset and tls_type_p
366         arguments with a GOT entry.  Remove GOT_TLS_TYPE masks.  Use
367         tls_initialized rather than GOT_TLS_DONE.
368         (mips_tls_got_index): Delete.
369         (mips_elf_local_got_index, mips_elf_global_got_index): Use
370         mips_elf_initialize_tls_slots rather than mips_tls_got_index.
371         (mips_elf_record_got_entry): Initialize tls_initialized.
372
373 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
374
375         * elfxx-mips.c (mips_got_entry): Remove tls_ldm_offset.
376         (mips_elf_link_hash_entry): Remove tls_ie_type, tls_gd_type,
377         tls_ie_got_offset and tls_gd_got_offset.
378         (mips_elf_link_hash_newfunc): Remove initialization.
379         (mips_elf_create_got_info): Likewise.
380         (mips_elf_count_local_got_entries, mips_elf_count_global_tls_entries)
381         (mips_tls_single_got_index): Delete.
382         (mips_elf_local_got_index): Always use the GOT entry to track
383         GOT indices.
384         (mips_elf_global_got_index): Likewise.
385         (mips_elf_create_local_got_entry): Assert that TLS entries have
386         already been allocated.
387         (mips_elf_record_global_got_symbol): Don't initialize
388         tls_ie_type or tls_gd_type.
389         (mips_elf_count_got_symbols): Only count reloc-only GOT entries here.
390         (mips_elf_initialize_tls_index): Allocate a GOT index for every TLS
391         entry.
392         (mips_elf_lay_out_got): Use mips_elf_count_got_entries to count
393         the GOT entries.
394         (_bfd_mips_elf_finish_dynamic_symbol): Assert that TLS GOT offsets
395         have been allocated.
396         (_bfd_mips_elf_copy_indirect_symbol): Remove handling of
397         tls_ie_type and tls_gd_type.
398
399 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
400
401         * elfxx-mips.c (mips_elf_create_local_got_entry): Tidy.  Avoid
402         aliasing violation.  Check for htab allocation failures.
403
404 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
405
406         * elfxx-mips.c (mips_elf_primary_global_got_index): New function,
407         split out from...
408         (mips_elf_global_got_index): ...here.  Reorder arguments so that
409         the output bfd and info come first.
410         (mips_elf_calculate_relocation): Update the call to
411         mips_elf_global_got_index accordingly.
412         (_bfd_mips_elf_finish_dynamic_symbol): Use
413         mips_elf_primary_global_got_index rather than
414         mips_elf_global_got_index.
415         (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
416
417 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
418
419         * elfxx-mips.c (mips_got_entry): Update comments.
420         (mips_elf_multi_got_entry_eq): Rename to...
421         (mips_elf_got_entry_eq): ...this, deleting the old definition.
422         (mips_elf_create_got_info): Remove master_got_p argument.
423         Always use mips_elf_got_entry_eq.
424         (mips_elf_bfd_got, mips_elf_multi_got, mips_elf_create_got_section):
425         Update calls accordingly.
426
427 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
428
429         * elfxx-mips.c (mips_got_info): Remove bfd2got.
430         (mips_elf_bfd2got_hash): Delete.
431         (mips_elf_got_per_bfd_arg): Remove bfd2got.
432         (mips_elf_replace_bfd_got, mips_elf_count_got_entries): New functions.
433         (mips_elf_global_got_index, mips_elf_create_local_got_entry): Use
434         g->next to test for the multigot case.  Use mips_elf_bfd_got rather
435         than mips_elf_got_for_ibfd.
436         (mips_elf_bfd2got_entry_hash, mips_elf_bfd2got_entry_eq)
437         (mips_elf_got_for_ibfd, mips_elf_get_got_for_bfd): Delete.
438         (mips_elf_make_got_per_bfd): Replace with...
439         (mips_elf_add_got_entry): ...this new function.
440         (mips_elf_make_got_pages_per_bfd): Replace with...
441         (mips_elf_add_got_page_entry): ...this new function.
442         (mips_elf_merge_got_with): Replace bfd2got argument with separate
443         bfd and GOT arguments.  Use mips_elf_add_got_entry and
444         mips_elf_add_got_page_entry instead of mips_elf_make_got_per_bfd
445         and mips_elf_make_got_pages_per_bfd.  Use mips_elf_replace_bfd_got
446         to set the BFD's GOT and free the old table.
447         (mips_elf_merge_got): Replace bfd2got argument with separate
448         bfd and GOT arguments.  Apply mips_elf_resolve_final_got_entries.
449         Use mips_elf_count_got_entries to count the number of entries in
450         each GOT.  Update the calls to mips_elf_merge_got_with.
451         (mips_elf_adjust_gp): Use g->next to test for the multigot case.
452         Use mips_elf_bfd_got rather than mips_elf_got_for_ibfd.
453         (mips_elf_multi_got): Don't create the bfd2got hash table.
454         Replace hash table traversal with a walk over the input bfds,
455         updating the call to mips_elf_merge_got.  Use mips_elf_replace_bfd_got
456         to set the output bfd's GOT.
457         (mips_elf_lay_out_got): Rename "sub" to "ibfd".  Record that all
458         bfds use the master GOT in the single-GOT case.
459         (_bfd_mips_elf_finish_dynamic_sections): Use mips_elf_bfd_got
460         rather than mips_elf_got_for_ibfd.
461
462 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
463
464         * elfxx-mips.c (mips_elf_obj_tdata): Add a got field.
465         (mips_elf_bfd_got, mips_elf_record_got_entry): New functions.
466         (mips_elf_record_global_got_symbol): Update the hash entry before
467         adding the mips_got_entry.  Use mips_elf_record_got_entry to do
468         the latter.
469         (mips_elf_record_local_got_symbol): Use mips_elf_record_got_entry.
470         (mips_elf_record_got_page_entry): Record the entry in both the
471         master and bfd GOTs.
472
473 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
474
475         * elfxx-mips.c (mips_elf_recreate_got): Don't change the entry;
476         create another one if necessary.
477         (mips_elf_set_gotidx): New function.
478         (mips_elf_set_global_gotidx): Use it.
479         (mips_elf_initialize_tls_index): Likewise.  Take a
480         mips_elf_traverse_got_arg as argument.
481         (mips_elf_lay_out_got): Update use of mips_elf_initialize_tls_index.
482         (mips_elf_multi_got): Likewise.  Cope with error returns from
483         mips_elf_set_global_gotidx.
484
485 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
486
487         * elfxx-mips.c (mips_got_info): Add relocs field.
488         (mips_elf_set_global_got_offset_arg, mips_elf_count_tls_arg): Replace
489         with...
490         (mips_elf_traverse_got_arg): ...this new structure.
491         (mips_elf_count_local_tls_relocs): Delete.
492         (mips_elf_count_global_tls_relocs): Likewise.
493         (mips_elf_count_got_entry): New function.
494         (mips_elf_count_local_got_entries): Likewise.
495         (mips_elf_count_global_tls_entries): Take a mips_elf_traverse_got_arg
496         rather than a mips_elf_count_tls_arg.  Count both relocs and entries.
497         (mips_elf_record_local_got_symbol): Don't count got entries here.
498         (mips_elf_make_got_per_bfd): Use mips_elf_count_got_entry.
499         (mips_elf_set_global_got_offset): Split into...
500         (mips_elf_set_global_got_area, mips_elf_set_global_gotidx): ...these
501         new functions.  Take a mips_elf_traverse_got_arg rather than a
502         mips_elf_set_global_got_offset_arg.  Don't count TLS relocs here.
503         Use g->relocs to record the number of relocs needed for global GOT
504         entries.
505         (mips_elf_multi_got): Use mips_elf_traverse_got_arg rather than
506         mips_elf_set_global_got_offset_arg.  Use the relocs field to count
507         relocations.  Update for above function split.
508         (mips_elf_lay_out_got): Use mips_elf_count_local_got_entries
509         to count both the number of GOT entries and the number of TLS
510         relocs required by local entries.  Likewise
511         mips_elf_count_global_tls_entries and global entries.
512         Remove uses of mips_elf_count_local_tls_relocs and
513         mips_elf_count_global_tls_relocs.
514
515 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
516
517         * elfxx-mips.c (mips_got_entry): Update comment above tls_type entry
518         to say that each structure represents only one type of TLS reference.
519         (GOT_TLS_TYPE): New define.
520         (mips_elf_link_hash_entry): Temporarily split tls_type and
521         tls_got_offset into two variables each.
522         (mips_elf_link_hash_newfunc): Update accordingly.
523         (mips_elf_got_entry_eq, mips_elf_got_entry_hash)
524         (mips_elf_multi_got_entry_eq): Require the tls_type to be the same.
525         (mips_elf_reloc_tls_type, mips_tls_got_entries): New functions.
526         (mips_tls_got_relocs): Use a switch statement.
527         (mips_elf_count_global_tls_entries): Handle the new hash entry fields.
528         (mips_elf_initialize_tls_slots): Use a switch statement.  Avoid
529         local "offset" variable.
530         (mips_tls_got_index): Remove r_type argument and assert.  Remove
531         code that handled entries with two TLS types; always use the
532         original got_index instead.
533         (mips_tls_single_got_index): New function.
534         (mips_elf_local_got_index): Use entry->tls_type to check for
535         TLS entries.  Use mips_tls_single_got_index.  Update call to
536         mips_tls_got_index.
537         (mips_elf_global_got_index): Use mips_elf_reloc_tls_type.
538         Use p->tls_type to check for TLS entries.  Update call to
539         mips_tls_got_index.  Use mips_tls_single_got_index.
540         (mips_elf_create_local_got_entry): Use mips_elf_reloc_tls_type.
541         Use entry.tls_type to check for TLS entries.
542         (mips_elf_record_global_got_symbol): Replace tls_flag argument
543         with r_type argument.  Use mips_elf_reloc_tls_type.
544         Set up the new hash entry fields.
545         (mips_elf_record_local_got_symbol): Replace tls_flag argument
546         with r_type argument.  Use mips_elf_reloc_tls_type and
547         mips_tls_got_entries.  Remove code that handled entries
548         with multiple TLS types.
549         (mips_elf_make_got_per_bfd): Use mips_tls_got_entries.
550         (mips_elf_initialize_tls_index): Handle new hash entry fields.
551         Use equality rather than masks when checking for specific TLS types.
552         Use mips_tls_got_entries.  Remove code that handled entries
553         with multiple TLS types.
554         (mips_elf_calculate_relocation): Use TLS_RELOC_P instead of
555         testing the hash table entry.
556         (_bfd_mips_elf_check_relocs): Update calls to
557         mips_elf_record_global_got_symbol and mips_elf_record_local_got_symbol.
558         (_bfd_mips_elf_finish_dynamic_symbol): Don't check h->type.
559         (_bfd_mips_elf_copy_indirect_symbol): Handle new hash entry fields.
560
561 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
562
563         * elfxx-mips.c (mips_elf_multi_got_entry_hash): Rename to...
564         (mips_elf_got_entry_hash): ...this, deleting the old version.
565         (mips_elf_create_got_info): Use mips_elf_got_entry_hash for
566         both types of GOT.
567
568 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
569
570         * elfxx-mips.c (mips_elf_create_got_info): New function.
571         (mips_elf_get_got_for_bfd, mips_elf_multi_got): Use it.
572         (mips_elf_create_got_section): Likewise.
573
574 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
575
576         * elfxx-mips.c (mips_elf_record_local_got_symbol): Always set
577         gotidx to -1.
578
579 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
580
581         * elfxx-mips.c (mips_elf_multi_got): Simplify size calculation.
582
583 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
584
585         * elfxx-mips.c (mips_got_info): Move global_gotsym to...
586         (mips_elf_link_hash_table): ...here.  Update rest of file accordingly.
587
588 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
589
590         * elfxx-mips.c (mips_elf_count_global_tls_entries)
591         (mips_elf_count_global_tls_relocs): Don't count indirect or
592         warning symbols.
593         (mips_elf_multi_got, mips_elf_lay_out_got): Assert that the right
594         number of TLS entries were allocated.
595
596 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
597
598         * elfxx-mips.c (mips_elf_sort_hash_table_f): Remove asserts.
599
600 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
601
602         * elfxx-mips.c (mips_elf_merge_got_with): Only use arg->global_count
603         if there are TLS relocations.
604
605 2013-02-11  Richard Sandiford  <rdsandiford@googlemail.com>
606
607         * elfxx-mips.c (mips_elf_recreate_got): Remove free.
608         (mips_elf_resolve_final_got_entries): Remove bogus comment.
609
610 2013-02-11  Alan Modra  <amodra@gmail.com>
611
612         * elfcode.h (elf_checksum_contents): Free contents.
613         * elf-bfd.h (_bfd_elf_link_hash_table_free): Declare.
614         * elflink.c (_bfd_elf_link_hash_table_free): New function.
615         (elf_final_link_free): New function, extracted from..
616         (bfd_elf_final_link): ..here.  Always call
617         _bfd_elf_write_section_eh_frame_hdr.
618         * elfxx-target.h (bfd_elfNN_bfd_link_hash_table_free): Default to
619         _bfd_elf_link_hash_table_free.
620         * libbfd-in.h (_bfd_merge_sections_free): Declare.
621         * libbfd.h: Regenerate.
622         * merge.c (_bfd_merge_sections_free): New function.
623         * elf-eh-frame.c (_bfd_elf_write_section_eh_frame_hdr): Free
624         hdr_info->array.
625         * elf-m10300.c (elf32_mn10300_link_hash_table_free): Call
626         _bfd_elf_link_hash_table_free.
627         * elf32-arm.c (elf32_arm_link_hash_table_free): Likewise.
628         * elf32-avr.c (elf32_avr_link_hash_table_free): Likewise.
629         * elf32-hppa.c (elf32_hppa_link_hash_table_free): Likewise.
630         * elf32-i386.c (elf_i386_link_hash_table_free): Likewise.
631         * elf32-m68hc1x.c (m68hc11_elf_hash_table_free): Likewise.
632         * elf32-m68k.c (elf_m68k_link_hash_table_free): Likewise.
633         * elf32-metag.c (elf_metag_link_hash_table_free): Likewise.
634         * elf32-xgate.c (xgate_elf_bfd_link_hash_table_free): Likewise.
635         * elf64-aarch64.c (elf64_aarch64_link_hash_table_free): Likewise.
636         * elf64-ia64-vms.c (elf64_ia64_hash_table_free): Likewise.
637         * elf64-ppc.c (ppc64_elf_link_hash_table_free): Likewise.
638         * elf64-x86-64.c (elf_x86_64_link_hash_table_free): Likewise.
639         * elfnn-ia64.c (elfNN_ia64_hash_table_free): Likewise.
640         * elf32-cr16.c (elf32_cr16_link_hash_table_free): Delete.
641         (bfd_elf32_bfd_link_hash_table_free): Don't define.
642         * elf32-tic6x.c (elf32_tic6x_link_hash_table_free): Delete.
643         (bfd_elf32_bfd_link_hash_table_free): Dont' define.
644
645 2013-02-10  Alan Modra  <amodra@gmail.com>
646
647         * coff-arm.c (coff_arm_link_hash_table_create): Use bfd_zmalloc.
648         * coff-h8300.c (h8300_coff_link_hash_table_create): Likewise.
649         * m68klinux.c (linux_link_hash_table_create): Likewise.
650         * sparclinux.c (linux_link_hash_table_create): Likewise.
651         * sunos.c (sunos_link_hash_table_create): Likewise.
652         * xcofflink.c (_bfd_xcoff_bfd_link_hash_table_create): Likewise.
653         * elf-m10300.c (elf32_mn10300_link_hash_table_create): Likewise.
654         * elf32-arm.c (elf32_arm_link_hash_table_create): Likewise.
655         * elf32-avr.c (elf32_avr_link_hash_table_create): Likewise.
656         * elf32-cr16.c (elf32_cr16_link_hash_table_create): Likewise.
657         * elf32-cris.c (elf_cris_link_hash_table_create): Likewise.
658         * elf32-hppa.c (elf32_hppa_link_hash_table_create): Likewise.
659         * elf32-i386.c (elf_i386_link_hash_table_create): Likewise.
660         * elf32-lm32.c (lm32_elf_link_hash_table_create): Likewise.
661         * elf32-m32r.c (m32r_elf_link_hash_table_create): Likewise.
662         * elf32-m68hc1x.c (m68hc11_elf_hash_table_create): Likewise.
663         * elf32-m68k.c (elf_m68k_link_hash_table_create): Likewise.
664         * elf32-metag.c (elf_metag_link_hash_table_create): Likewise.
665         * elf32-nios2.c (nios2_elf32_link_hash_table_create): Likewise.
666         * elf32-s390.c (elf_s390_link_hash_table_create): Likewise.
667         * elf32-score.c (elf32_score_link_hash_table_create): Likewise.
668         * elf32-spu.c (spu_elf_link_hash_table_create): Likewise.
669         * elf32-tic6x.c (elf32_tic6x_link_hash_table_create): Likewise.
670         * elf32-vax.c (elf_vax_link_hash_table_create): Likewise.
671         * elf32-xgate.c (xgate_elf_bfd_link_hash_table_create): Likewise.
672         * elf32-xtensa.c (elf_xtensa_link_hash_table_create): Likewise.
673         * elf64-aarch64.c (elf64_aarch64_link_hash_table_create): Likewise.
674         * elf64-s390.c (elf_s390_link_hash_table_create): Likewise.
675         * elf64-sh64.c (sh64_elf64_link_hash_table_create): Likewise.
676         * elf64-x86-64.c (elf_x86_64_link_hash_table_create): Likewise.
677         * elfxx-mips.c (_bfd_mips_elf_link_hash_table_create): Likewise.
678         * elflink.c (_bfd_elf_link_hash_table_create): Likewise.
679         (_bfd_elf_link_hash_table_init): Assume zero fill table on entry.
680
681 2013-02-10  Alan Modra  <amodra@gmail.com>
682
683         * i386linux.c (linux_link_hash_table_create): Allocate table
684         with bfd_zmalloc, not bfd_alloc.
685         * pdp11.c (link_hash_table_create): Allocate table with
686         bfd_malloc, not bfd_alloc.
687         * elf32-bfin.c (bfinfdpic_elf_link_hash_table_create): Allocate table
688         with bfd_zmalloc, not bfd_zalloc.
689         (bfin_link_hash_table_create): Likewise.
690         * elf32-frv.c (frvfdpic_elf_link_hash_table_create): Likewise.
691         * elf64-hppa.c (elf64_hppa_hash_table_create): Likewise.
692
693 2013-02-10  Alan Modra  <amodra@gmail.com>
694
695         PR ld/15113
696         * elf32-sh.c (sh_elf_link_hash_table_create): Use bfd_zmalloc.
697
698 2013-02-08  Markos Chandras  <markos.chandras@imgtec.com>
699
700         * elf32-metag.c: Use bfd_get_linker_section to get SEC_LINKER_CREATED
701         sections.
702         (elf_metag_adjust_dynamic_symbol): Don't error on zero size dynbss
703         symbol.
704
705 2013-02-08  Yufeng Zhang  <yufeng.zhang@arm.com>
706
707         * elf64-aarch64.c (elf64_aarch64_grok_prstatus): Change 'size' from
708         288 to 272.
709
710 2013-02-08  Alan Modra  <amodra@gmail.com>
711
712         PR binutils/15106
713         * elf-bfd.h (struct elf_obj_tdata): Add elf_find_function_cache.
714         * elf.c (elf_find_function): Revert last change.  Use new
715         tdata field rather than static vars for cache.
716
717 2013-02-07  H.J. Lu  <hongjiu.lu@intel.com>
718
719         PR ld/15107
720         * elflink.c (elf_link_output_extsym): Set STB_GNU_UNIQUE only if
721         symbol is defined in regular object.
722
723 2013-02-07  Roberto Agostino Vitillo  <ra.vitillo@gmail.com>
724
725         PR binutils/15106
726         * elf.c (elf_find_function): Don't cache if symbols change.
727
728 2013-02-07  Alan Modra  <amodra@gmail.com>
729
730         PR binutils/14873
731         * elf-attrs.c (_bfd_elf_copy_obj_attributes): Don't attempt to
732         copy attributes from or to non-ELF.
733
734 2013-02-06  H.J. Lu  <hongjiu.lu@intel.com>
735
736         * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't clear pc_count
737         for non-zero TLS symbol.
738         (elf_i386_relocate_section): Don't resolve size relocation against
739         non-zero TLS symbol.
740         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Don't clear
741         pc_count for non-zero TLS symbol.
742         (elf_x86_64_relocate_section): Don't resolve size relocation
743         against non-zero TLS symbol.
744
745 2013-02-06  Sandra Loosemore  <sandra@codesourcery.com>
746             Andrew Jenner <andrew@codesourcery.com>
747
748         Based on patches from Altera Corporation.
749
750         * Makefile.am (ALL_MACHINES): Add cpu-nios2.lo.
751         (ALL_MACHINES_CFILES): Add cpu-nios2.c.
752         (BFD_BACKENDS): Add elf32-nios2.lo.
753         (BFD32_BACKENDS_CFILES): Add elf32-nios2.c.
754         * Makefile.in: Regenerated.
755         * configure.in: Add entries for bfd_elf32_bignios2_vec and
756         bfd_elf32_littlenios2_vec.
757         * configure: Regenerated.
758         * config.bfd: Add cases for nios2.
759         * archures.c (enum bfd_architecture): Add bfd_arch_nios2.
760         (bfd_mach_nios2): Define.
761         (bfd_nios2_arch): Declare.
762         (bfd_archures_list): Add bfd_nios2_arch.
763         * targets.c (bfd_elf32_bignios2_vec): Declare.
764         (bfd_elf32_littlenios2_vec): Declare.
765         (_bfd_target_vector): Add entries for bfd_elf32_bignios2_vec and
766         bfd_elf32_littlenios2_vec.
767         * elf-bfd.h (enum elf_target_id): Add NIOS2_ELF_DATA.
768         * reloc.c (enum bfd_reloc_code_real): Add Nios II relocations.
769         * bfd-in2.h: Regenerated.
770         * libbfd.h: Regenerated.
771         * cpu-nios2.c: New file.
772         * elf32-nios2.c: New file.
773
774 2013-02-06  Alan Modra  <amodra@gmail.com>
775
776         * elf32-arm.c (elf32_arm_final_link_relocate): Only test for
777         stubs in stub_bfd.
778
779 2013-02-06  Alan Modra  <amodra@gmail.com>
780
781         * Makefile.am (SOURCE_HFILES): Add `elf-linux-psinfo.h'.
782         * Makefile.in: Regenerate.
783
784 2013-02-04  Sergio Durigan Junior  <sergiodj@redhat.com>
785             Pedro Alves  <palves@redhat.com>
786
787         * Makefile.in (SOURCE_HFILES): Add `elf-linux-psinfo.h'.
788         * elf-bfd.h (elf_internal_linux_prpsinfo): New structure
789         declaration.
790         (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64)
791         (elfcore_write_ppc32_linux_prpsinfo32): New declarations.
792         * elf-linux-psinfo.h: New file.
793         * elf.c: Include elf-linux-psinfo.h.
794         (elfcore_write_linux_prpsinfo32, elfcore_write_linux_prpsinfo64):
795         New functions.
796         * elf32-ppc.c: Include `elf-linux-psinfo.h'.
797         (elf_external_ppc_linux_prpsinfo32): New structure declaration.
798         (PPC_LINUX_PRPSINFO32_SWAP_FIELDS): New macro.
799         (elfcore_write_ppc_linux_prpsinfo32): New function.
800
801 2013-02-04  Tristan Gingold  <gingold@adacore.com>
802
803         * mach-o.c (bfd_mach_o_scan_start_address): Do not fail if no
804         start address.
805
806 2013-02-04  Alan Modra  <amodra@gmail.com>
807
808         * Makefile.am (BFD64_BACKENDS): Remove elf-nacl.lo.
809         (BFD64_BACKENDS_CFILES): Remove elf-nacl.c.
810         * Makefile.in: Regenerate.
811         * po/SRC-POTFILES.in: Regenerate.
812
813 2013-02-04  Alan Modra  <amodra@gmail.com>
814
815         * coff-tic54x.c (SWAP_OUT_RELOC_EXTRA): Delete.
816         * coff-tic80.c (SWAP_OUT_RELOC_EXTRA): Delete.
817
818 2013-02-01  Alan Modra  <amodra@gmail.com>
819
820         * elf64-ppc.c (dec_dynrel_count): Don't error when elf_gc_sweep_symbol
821         clears def_regular.
822
823 2013-01-31  Tristan Gingold  <gingold@adacore.com>
824
825         * mach-o.c (bfd_mach_o_scan): Call bfd_mach_o_flatten_sections
826         earlier.  Fix status checking of bfd_mach_o_scan_start_address.
827         (bfd_mach_o_scan_start_address): Handle LC_MAIN.
828
829 2013-01-31  Alan Modra  <amodra@gmail.com>
830             David S. Miller  <davem@davemloft.net>
831
832         PR ld/15056
833         * elfxx-sparc.c (_bfd_sparc_elf_gc_mark_hook): Handle implicit
834         references to __tls_get_addr.
835         * elf32-tilpro.c (tilepro_elf_gc_mark_hook): Likewise.  Correct
836         vtinherit and vtentry reloc handling too.
837         * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): As for tilepro.
838
839 2013-01-31  Alan Modra  <amodra@gmail.com>
840
841         * elf64-ppc.c (ppc_stub_name): Trim off trailing "+0".
842
843 2013-01-31  Alan Modra  <amodra@gmail.com>
844
845         * elf64-ppc.c (build_plt_stub): Correct plt stub branch to glink.
846
847 2013-01-28  Alan Modra  <amodra@gmail.com>
848
849         * elf64-ppc.c: Use %T to print symbols names and remove redundant
850         "relocation" in error messages throughout file.
851         (ppc64_elf_relocate_section): Remove sibling call error message,
852         replace with "call lacks nop".  Specially report errors for
853         branches to function entry points via OPD lookup and branches
854         to stubs.  Remove NULL symbol handling now done by %T.
855
856 2013-01-28  Alan Modra  <amodra@gmail.com>
857
858         * archive.c (bfd_generic_archive_p): Return target and keep
859         ardata on partial matches.
860         * format.c (bfd_check_format_matches): Adjust for above
861         change.  Remove bfd_error_file_ambiguously_recognized dead
862         code.
863
864 2013-01-26  Alan Modra  <amodra@gmail.com>
865
866         * bfd.c (struct bfd_preserve, bfd_preserve_save, bfd_preserve_restore,
867         bfd_preserve_finish): Move to..
868         * format.c: ..here, splitting out..
869         (bfd_reinit): ..this.  New function.
870         (bfd_check_format_matches): Use bfd_preserve_save/restore to
871         keep bfd state for a match.
872         * elfcode.h (elf_object_p): Don't use bfd_preserve_save/restore.
873         * elfcore.h (elf_core_file_p): Likewise.
874         * mach-o.c (bfd_mach_o_header_p): Likewise.
875         * pef.c (bfd_pef_object_p, bfd_pef_xlib_object_p): Likewise.
876         * xsym.c (bfd_sym_object_p): Likewise.
877         * mmo.c (mmo_scan): Clear abfd->symcount.
878         * opncls.c (_bfd_new_bfd): Use a smaller section hash table.
879         * section.c (bfd_section_list_clear): Clear section_htab.count.
880         * bfd-in2.h: Regenerate.
881
882 2013-01-25  Michael Schewe  <michael.schewe@gmx.net>
883
884         * elf32-h8300.c (elf32_h8_relax_section): When checking for a
885         second reloc, make sure that the reloc potentially exists first.
886
887 2013-01-24  Nick Clifton  <nickc@redhat.com>
888
889         * archures.c: Add bfd_mach_v850e3v5.
890         * bfd-in2.h: Regenerate.
891         * cpu-v850.c: Add entries for v850e2v5 and v850e3v5.
892         * cpu-v850_rh850.c: Likewise.
893         * elf32-v850.c: Add support for v850e3v5 architecture.
894
895 2013-01-23  Markos Chandras  <markos.chandras@imgtec.com>
896
897         * elf32-metag.c: Error on HIADDR16/LOADDR16 in shared link.
898
899 2013-01-23  Leif Ekblad  <leif@rdos.net>
900
901         * config.bfd (x86_64-*-rdos*): Remove targ_selvecs.
902
903 2013-01-18  H.J. Lu  <hongjiu.lu@intel.com>
904
905         * elf32-i386.c (elf_i386_allocate_dynrelocs): Clear pc_count for
906         non-zero TLS symbol.
907         (elf_i386_relocate_section): Resolve size relocation against
908         non-zero TLS symbol.
909         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Clear pc_count
910         for non-zero TLS symbol.
911         (elf_x86_64_relocate_section): Resolve size relocation against
912         non-zero TLS symbol.
913
914 2013-01-18  Mike Frysinger  <vapier@gentoo.org>
915
916         * elflink.c (bfd_elf_size_dynamic_sections): Only add DT_RPATH
917         when new_dtags is false.  Only add DT_RUNPATH when new_dtags is
918         true.
919
920 2013-01-17  H.J. Lu  <hongjiu.lu@intel.com>
921
922         * elf32-i386.c (elf_i386_check_relocs): Count size relocation as
923         PC-relative relocation.
924         * elf64-x86-64.c (elf_x86_64_check_relocs): Count size relocation
925         as PC-relative relocation.
926
927 2013-01-16  H.J. Lu  <hongjiu.lu@intel.com>
928
929         * elf32-i386.c (elf_i386_check_relocs): Update R_386_SIZE32
930         check.
931         (elf_i386_relocate_section): Don't check TLS for R_386_SIZE32.
932
933         * elf64-x86-64.c (elf_x86_64_check_relocs): Update R_X86_64_SIZE32
934         and R_X86_64_SIZE64 check.
935         (elf_x86_64_relocate_section): Don't check TLS for R_X86_64_SIZE32
936         nor R_X86_64_SIZE64.
937
938 2013-01-16  H.J. Lu  <hongjiu.lu@intel.com>
939
940         * bfd-in2.h: Regenerated.
941         * libbfd.h: Likewise.
942
943         * elf32-i386.c (elf_howto_table): Fill R_386_SIZE32 entry.
944         (elf_i386_reloc_type_lookup): Support BFD_RELOC_SIZE32.
945         (elf_i386_check_relocs): Handle R_386_SIZE32.
946         (elf_i386_gc_sweep_hook): Likewise.
947         (elf_i386_relocate_section): Likewise.
948
949         * elf64-x86-64.c (x86_64_elf_howto_table): Fill R_X86_64_SIZE32
950         and R_X86_64_SIZE64 entries.
951         (x86_64_reloc_map): Add BFD_RELOC_SIZE32 and BFD_RELOC_SIZE64,
952         (elf_x86_64_rtype_to_howto): Handle R_X86_64_SIZE32 for x32.
953         (elf_x86_64_reloc_name_lookup): Likewise.
954         (elf_x86_64_check_relocs): Handle R_X86_64_SIZE32 and
955         R_X86_64_SIZE64.
956         (elf_x86_64_gc_sweep_hook): Likewise.
957         (elf_x86_64_relocate_section): Likewise.
958
959         * reloc.c (bfd_reloc_code_type): Add BFD_RELOC_SIZE32 and
960         BFD_RELOC_SIZE64.
961
962 2013-01-15  H.J. Lu  <hongjiu.lu@intel.com>
963
964         * elf64-x86-64.c (R_X86_64_standard): Replace R_X86_64_IRELATIVE
965         with R_X86_64_RELATIVE64.
966
967 2013-01-15  Nick Clifton  <nickc@redhat.com>
968
969         * elf32-msp430.c: Fix spelling typo.
970
971 2013-01-15  Alan Modra  <amodra@gmail.com>
972
973         * elf64-ppc.c (ppc64_elf_size_stubs): Default shared libs to
974         plt-thread-safe.
975
976 2013-01-14  Alan Modra  <amodra@gmail.com>
977
978         PR binutils/14813
979         * bfdio.c (struct bfd_iovec <bclose>): Revert 2012-11-06.
980         (memory_bclose): Likewise.  Return 0 on success.
981         * cache.c (cache_bclose): Likewise.
982         * opncls.c (opncls_bclose, bfd_close): Likewise.
983         * vms-lib.c (vms_lib_bclose): Likewise.
984         * libbfd.h: Regenerate.
985
986 2013-01-13  Alan Modra  <amodra@gmail.com>
987
988         * elf-bfd.h (struct elf_link_hash_entry): Delete dynamic_weak.
989         Add ref_dynamic_nonweak.
990         * elflink.c (_bfd_elf_mark_dynamic_def_weak): Delete.
991         (_bfd_elf_merge_symbol): Don't call above function.  Move
992         setting of ref_dynamic_nonweak and dynamic_def earlier.  Don't
993         clear dynamic_def.
994         (elf_link_add_object_symbols): Delete redundant "override" test.
995         Don't set dynamic_def here.
996         (elf_link_output_extsym): Update.
997
998 2013-01-12  H.J. Lu  <hongjiu.lu@intel.com>
999
1000         * elf32-i386.c (elf_i386_check_relocs): Set bfd errror for
1001         normal and TLS symbol access.
1002         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1003
1004 2013-01-12  Alan Modra  <amodra@gmail.com>
1005
1006         * elf-bfd.h (_bfd_elf_strtab_refcount): Declare.
1007         * elf-strtab.c (_bfd_elf_strtab_refcount): New function.
1008         * elflink.c (elf_add_dt_needed_tag): Use _bfd_elf_strtab_refcount.
1009
1010 2013-01-12  Alan Modra  <amodra@gmail.com>
1011
1012         PR ld/12549
1013         * elf-bfd.h (_bfd_elf_strtab_clear_refs): Declare.
1014         (_bfd_elf_strtab_clear_all_refs): Define.
1015         * elf-strtab.c (_bfd_elf_strtab_clear_refs): New function.
1016         (_bfd_elf_strtab_clear_all_refs): Delete.
1017         * elflink.c (elf_link_add_object_symbols): Clear out added
1018         strtab refs.  Correct handling of warning common symbols.
1019
1020 2013-01-10  H.J. Lu  <hongjiu.lu@intel.com>
1021
1022         * aout0.c: Remove trailing white spaces.
1023         * archive.c: Likewise.
1024         * archures.c: Likewise.
1025         * bfd-in.h: Likewise.
1026         * bfd-in2.h: Likewise.
1027         * coff-alpha.c: Likewise.
1028         * coff-i860.c: Likewise.
1029         * coff-mips.c: Likewise.
1030         * coff-ppc.c: Likewise.
1031         * coff-tic80.c: Likewise.
1032         * coff-x86_64.c: Likewise.
1033         * coff-z80.c: Likewise.
1034         * coffcode.h: Likewise.
1035         * coffgen.c: Likewise.
1036         * cofflink.c: Likewise.
1037         * compress.c: Likewise.
1038         * corefile.c: Likewise.
1039         * cpu-arm.c: Likewise.
1040         * cpu-avr.c: Likewise.
1041         * cpu-bfin.c: Likewise.
1042         * cpu-cr16.c: Likewise.
1043         * cpu-cr16c.c: Likewise.
1044         * cpu-crx.c: Likewise.
1045         * cpu-h8300.c: Likewise.
1046         * cpu-i386.c: Likewise.
1047         * cpu-lm32.c: Likewise.
1048         * cpu-m68k.c: Likewise.
1049         * cpu-moxie.c: Likewise.
1050         * cpu-msp430.c: Likewise.
1051         * cpu-sh.c: Likewise.
1052         * cpu-xc16x.c: Likewise.
1053         * dwarf2.c: Likewise.
1054         * ecofflink.c: Likewise.
1055         * ecoffswap.h: Likewise.
1056         * elf-ifunc.c: Likewise.
1057         * elf-m10300.c: Likewise.
1058         * elf-vxworks.c: Likewise.
1059         * elf32-avr.c: Likewise.
1060         * elf32-avr.h: Likewise.
1061         * elf32-cr16.c: Likewise.
1062         * elf32-cr16c.c: Likewise.
1063         * elf32-cris.c: Likewise.
1064         * elf32-crx.c: Likewise.
1065         * elf32-frv.c: Likewise.
1066         * elf32-hppa.c: Likewise.
1067         * elf32-i860.c: Likewise.
1068         * elf32-ip2k.c: Likewise.
1069         * elf32-iq2000.c: Likewise.
1070         * elf32-m32c.c: Likewise.
1071         * elf32-m68hc1x.c: Likewise.
1072         * elf32-msp430.c: Likewise.
1073         * elf32-mt.c: Likewise.
1074         * elf32-ppc.c: Likewise.
1075         * elf32-rl78.c: Likewise.
1076         * elf32-s390.c: Likewise.
1077         * elf32-score.h: Likewise.
1078         * elf32-sh-symbian.c: Likewise.
1079         * elf32-sh.c: Likewise.
1080         * elf32-spu.c: Likewise.
1081         * elf32-tic6x.c: Likewise.
1082         * elf32-v850.c: Likewise.
1083         * elf32-xc16x.c: Likewise.
1084         * elf32-xtensa.c: Likewise.
1085         * elf64-alpha.c: Likewise.
1086         * elf64-hppa.c: Likewise.
1087         * elf64-ppc.c: Likewise.
1088         * elf64-s390.c: Likewise.
1089         * elfcore.h: Likewise.
1090         * elflink.c: Likewise.
1091         * elfxx-mips.c: Likewise.
1092         * elfxx-sparc.c: Likewise.
1093         * elfxx-tilegx.c: Likewise.
1094         * ieee.c: Likewise.
1095         * libcoff.h: Likewise.
1096         * libpei.h: Likewise.
1097         * libxcoff.h: Likewise.
1098         * linker.c: Likewise.
1099         * mach-o-i386.c: Likewise.
1100         * mach-o-target.c: Likewise.
1101         * mach-o.c: Likewise.
1102         * mach-o.h: Likewise.
1103         * mmo.c: Likewise.
1104         * opncls.c: Likewise.
1105         * pdp11.c: Likewise.
1106         * pe-x86_64.c: Likewise.
1107         * peXXigen.c: Likewise.
1108         * pef-traceback.h: Likewise.
1109         * pei-x86_64.c: Likewise.
1110         * peicode.h: Likewise.
1111         * plugin.c: Likewise.
1112         * reloc.c: Likewise.
1113         * riscix.c: Likewise.
1114         * section.c: Likewise.
1115         * som.c: Likewise.
1116         * syms.c: Likewise.
1117         * tekhex.c: Likewise.
1118         * ticoff.h: Likewise.
1119         * vaxbsd.c: Likewise.
1120         * xcofflink.c: Likewise.
1121         * xtensa-isa.c: Likewise.
1122
1123 2013-01-10  Will Newton <will.newton@imgtec.com>
1124
1125         * Makefile.am: Add Meta.
1126         * Makefile.in: Regenerate.
1127         * archures.c (bfd_mach_metag): New.
1128         * bfd-in2.h: Regenerate.
1129         * config.bfd: Add Meta.
1130         * configure: Regenerate.
1131         * configure.in: Add Meta.
1132         * cpu-metag.c: New file.
1133         * elf-bfd.h: Add Meta.
1134         * elf32-metag.c: New file.
1135         * elf32-metag.h: New file.
1136         * libbfd.h: Regenerate.
1137         * reloc.c: Add Meta relocations.
1138         * targets.c: Add Meta.
1139
1140 2013-01-08  Yufeng Zhang  <yufeng.zhang@arm.com>
1141
1142         * elf-bfd.h (elfcore_write_aarch_tls): Add prototype.
1143         (elfcore_write_aarch_hw_break): Likewise.
1144         (elfcore_write_aarch_hw_watch): Likewise.
1145         * elf.c (elfcore_grok_aarch_tls): New function.
1146         (elfcore_grok_aarch_hw_break): Likewise.
1147         (elfcore_grok_aarch_hw_watch): Likewise.
1148         (elfcore_grok_note): Call the new functions to handle the
1149         corresponding notes.
1150         (elfcore_write_aarch_tls): New function.
1151         (elfcore_write_aarch_hw_break): Likewise.
1152         (elfcore_write_aarch_hw_watch): Likewise.
1153         (elfcore_write_register_note): Call the new functions to handle the
1154         corresponding pseudo sections.
1155
1156 2013-01-07  Tom Tromey  <tromey@redhat.com>
1157
1158         * section.c (_bfd_std_section): Rename from std_section.
1159         (bfd_com_section_ptr, bfd_und_section_ptr, bfd_abs_section_ptr)
1160         (STD_SECTION): Update.
1161         * bfd-in2.h: Rebuild.
1162
1163 2013-01-04  Juergen Urban <JuergenUrban@gmx.de>
1164
1165         * archures.c (bfd_mach_mips5900): Define.
1166         * bfd-in2.h: Regenerate.
1167         * config.bfd: Add mips64-ps2-elf and mips-ps2-elf targets.
1168         * cpu-mips.c: Add support for MIPS r5900.
1169         * elfxx-mips.c: Add support for MIPS r5900 (extension of r4000).
1170
1171 2013-01-03  Nickolai Zeldovich  <nickolai@csail.mit.edu>
1172             Nick Clifton  <nickc@redhat.com>
1173
1174         * elflink.c (get_value): Prevent the use of an undefined shift
1175         operation.  Add sanity checks.
1176
1177 2013-01-02  Kaushik Phatak  <kaushik.phatak@kpitcummins.com>
1178
1179         * config.bfd (cr16*-*-uclinux*): New target support.
1180
1181
1182 For older changes see ChangeLog-2012
1183 \f
1184 Copyright (C) 2013 Free Software Foundation, Inc.
1185
1186 Copying and distribution of this file, with or without modification,
1187 are permitted in any medium without royalty provided the copyright
1188 notice and this notice are preserved.
1189
1190 Local Variables:
1191 mode: change-log
1192 left-margin: 8
1193 fill-column: 74
1194 version-control: never
1195 End: