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