Set dynobj to a normal input file if possible
[external/binutils.git] / bfd / ChangeLog
1 2016-04-21  H.J. Lu  <hongjiu.lu@intel.com>
2
3         * elflink.c (_bfd_elf_link_create_dynstrtab): Set dynobj to a
4         normal input file if possible.
5
6 2016-04-21  Nick Clifton  <nickc@redhat.com>
7
8         * aout-adobe.c: Use _bfd_generic_link_check_relocs.
9         * aout-target.h: Likewise.
10         * aout-tic30.c: Likewise.
11         * binary.c: Likewise.
12         * bout.c: Likewise.
13         * coff-alpha.c: Likewise.
14         * coff-rs6000.c: Likewise.
15         * coff64-rs6000.c: Likewise.
16         * coffcode.h: Likewise.
17         * i386msdos.c: Likewise.
18         * i386os9k.c: Likewise.
19         * ieee.c: Likewise.
20         * ihex.c: Likewise.
21         * libbfd-in.h: Likewise.
22         * libecoff.h: Likewise.
23         * mach-o-target.c: Likewise.
24         * mmo.c: Likewise.
25         * nlm-target.h: Likewise.
26         * oasys.c: Likewise.
27         * pef.c: Likewise.
28         * plugin.c: Likewise.
29         * ppcboot.c: Likewise.
30         * som.c: Likewise.
31         * srec.c: Likewise.
32         * tekhex.c: Likewise.
33         * versados.c: Likewise.
34         * vms-alpha.c: Likewise.
35         * xsym.c: Likewise.
36         * elfxx-target.h: Use _bfd_elf_link_check_relocs.
37         * linker.c (bfd_link_check_relocs): New function.
38         (_bfd_generic_link_check_relocs): New function.
39         * targets.c (BFD_JUMP_TABLE_LINK): Add initialization of
40         _bfd_link_check_relocs field.
41         (struct bfd_target)L Add _bfd_link_check_relocs field.
42         * bfd-in2.h: Regenerate.
43         * libbfd.h: Regenerate.
44
45 2016-04-20  H.J. Lu  <hongjiu.lu@intel.com>
46
47         * elf32-i386.c (elf_i386_gc_sweep_hook): Removed.
48         (elf_backend_gc_sweep_hook): Likewise.
49         * elf64-x86-64.c (elf_x86_64_gc_sweep_hook): Likewise.
50         (elf_backend_gc_sweep_hook): Likewise.
51
52 2016-04-20  H.J. Lu  <hongjiu.lu@intel.com>
53
54         * elflink.c (_bfd_elf_link_check_relocs): Don't check relocations
55         in excluded sections
56
57 2016-04-20  H.J. Lu  <hongjiu.lu@intel.com>
58
59         PR ld/19969
60         * elf64-x86-64.c (check_relocs_failed): New.
61         (elf_x86_64_need_pic): Moved before elf_x86_64_check_relocs.
62         Support relocation agaist local symbol.  Set check_relocs_failed.
63         (elf_x86_64_check_relocs): Use elf_x86_64_need_pic.  Check
64         R_X86_64_32 relocation overflow.
65         (elf_x86_64_relocate_section): Skip if check_relocs failed.
66         Update one elf_x86_64_need_pic and remove one elf_x86_64_need_pic.
67
68 2016-04-20  H.J. Lu  <hongjiu.lu@intel.com>
69
70         * elf32-i386.c (elf_i386_check_relocs): Call
71         _bfd_elf_create_ifunc_sections only for STT_GNU_IFUNC symbol.
72         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
73
74 2016-04-20  H.J. Lu  <hongjiu.lu@intel.com>
75
76         * elf-bfd.h (_bfd_elf_link_check_relocs): New.
77         * elflink.c (_bfd_elf_link_check_relocs): New function.
78         (elf_link_add_object_symbols): Call _bfd_elf_link_check_relocs
79         if check_relocs_after_open_input is FALSE.
80
81 2016-04-20  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
82
83         * cache.c: Update old style function definitions.
84         * elf32-m68k.c: Likewise.
85         * elf64-mmix.c: Likewise.
86         * stab-syms.c: Likewise.
87
88 2016-04-20  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
89
90         * elf32-arm.c (put_thumb2_insn): Change argument type to bfd_byte *.
91
92 2016-04-15  H.J. Lu  <hongjiu.lu@intel.com>
93
94         * Makefile.in: Regenerated with automake 1.11.6.
95         * aclocal.m4: Likewise.
96         * doc/Makefile.in: Likewise.
97
98 2016-04-14  Andrew Burgess  <andrew.burgess@embecosm.com>
99
100         * reloc.c: Add BFD_RELOC_ARC_NPS_CMEM16 entry.
101         * bfd-in2.h: Regenerate.
102         * libbfd.h: Regenerate.
103         * elf32-arc.c: Add 'opcode/arc.h' include.
104         (struct arc_relocation_data): Add symbol_name.
105         (arc_special_overflow_checks): New function.
106         (arc_do_relocation): Use arc_special_overflow_checks, reindent as
107         required, add an extra comment.
108         (elf_arc_relocate_section): Setup symbol_name in reloc_data.
109
110 2016-04-14  Andrew Burgess  <andrew.burgess@embecosm.com>
111
112         * elf32-arc.c (tls_got_entries): Add 'TLS_GOT_' prefix to all
113         entries.
114         (elf_arc_relocate_section): Update enum uses.
115         (elf_arc_check_relocs): Likewise.
116         (elf_arc_finish_dynamic_symbol): Likewise.
117
118 2016-04-14  H.J. Lu  <hongjiu.lu@intel.com>
119
120         * elf.c (_bfd_elf_copy_private_bfd_data): Replace "link" with
121         "sh_link".
122
123 2016-04-14  Nick Clifton  <nickc@redhat.com>
124
125         PR target/19938
126         * elf-bbfd.h (struct elf_backend_data): New field:
127         elf_strtab_flags.
128         New field: elf_backend_set_special_section_info_and_link
129         * elfxx-target.h (elf_backend_strtab_flags): Define if not already
130         defined.
131         (elf_backend_set_special_section_info_and_link): Define if not
132         already defined.
133         (elfNN_bed): Use elf_backend_set_special_section_info_and_link and
134         elf_backend_strtab_flags macros to initialise fields in structure.
135         * elf.c (_bfd_elf_make_section_from_shdr): Check for SHF_STRINGS
136         being set even if SHF_MERGE is not set.
137         (elf_fake_sections): Likewise.
138         (section_match): New function.  Matches two ELF sections based
139         upon fixed characteristics.
140         (find_link): New function.  Locates a section in a BFD that
141         matches a section in a different BFD.
142         (_bfd_elf_copy_private_bfd_data): Copy the sh_info and sh_link
143         fields of reserved sections.
144         (bfd_elf_compute_section_file_positions): Set the flags for the
145         .shstrtab section based upon the elf_strtab_flags field in the
146         elf_backend_data structure.
147         (swap_out_syms): Likewise for the .strtab section.
148         * elflink.c (bfd_elf_final_link): Set the flags for the
149         .strtab section based upon the elf_strtab_flags field in the
150         elf_backend_data structure.
151         * elf32-i386.c (elf32_i386_set_special_info_link): New function.
152         (elf_backend_strtab_flags): Set to SHF_STRINGS for Solaris
153         targets.
154         (elf_backend_set_special_section_info_and_link): Define for
155         Solaris targets.
156         * elf32-sparc.c: Likewise.
157         * elf64-x86-64.c: Likewise.
158
159 2016-04-11  H.J. Lu  <hongjiu.lu@intel.com>
160
161         PR ld/19939
162         * elf-bfd.h (_bfd_elf_allocate_ifunc_dyn_relocs): Add a pointer
163         to bfd_boolean.
164         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
165         Set *readonly_dynrelocs_against_ifunc_p to TRUE if dynamic reloc
166         applies to read-only section.
167         * elf32-i386.c (elf_i386_link_hash_table): Add
168         readonly_dynrelocs_against_ifunc.
169         (elf_i386_allocate_dynrelocs): Updated.
170         (elf_i386_size_dynamic_sections): Issue an error for read-only
171         segment with dynamic IFUNC relocations only if
172         readonly_dynrelocs_against_ifunc is TRUE.
173         * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
174         readonly_dynrelocs_against_ifunc.
175         (elf_x86_64_allocate_dynrelocs): Updated.
176         (elf_x86_64_size_dynamic_sections): Issue an error for read-only
177         segment with dynamic IFUNC relocations only if
178         readonly_dynrelocs_against_ifunc is TRUE.
179         * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
180         Updated.
181
182 2016-04-06  Thomas Preud'homme  <thomas.preudhomme@arm.com>
183
184         * elf32-arm.c (elf32_arm_size_stubs): Move error_ret_free_local to be
185         a fall through from error_ret_free_internal.  Free local_syms in
186         error_ret_free_local if allocated from bfd_elf_get_elf_syms ().
187
188 2016-04-05  Cupertino Miranda  <cmiranda@synopsys.com>
189
190         * elf32-arc.c (plt_do_relocs_for_symbol): Changed.
191         (relocate_plt_for_entry): Likewise.
192
193 2016-04-05  Cupertino Miranda  <cmiranda@synopsys.com>
194
195         * elf32-arc.c (elf_arc_check_relocs): Changed
196
197 2016-04-05  Cupertino Miranda  <cmiranda@synopsys.com>
198
199         * elf32-arc.c (name_for_global_symbol): Changed assert.
200         (get_replace_function): Created.:
201         (struct arc_relocation_data): Changed to signed types.
202         (defines S, L, P, PDATA): Casted to signed type.
203         (defines SECTSTART, _SDA_BASE_, TLS_REL): Likewise.
204         (PRINT_DEBUG_RELOC_INFO_BEFORE): Changed.
205         (arc_do_relocation): Changed.
206
207 2016-04-05  Cupertino Miranda  <cmiranda@synopsys.com>
208
209         * elf32-arc.c (name_for_global_symbol): Added assert to check for
210         symbol index.
211         (elf_arc_relocate_section): Added and changed asserts, validating
212         the synamic symbol index.
213         (elf_arc_finish_dynamic_symbol): Do not fill the dynamic
214         relocation if symbol has dynindx set to -1.
215
216 2016-04-05  Maciej W. Rozycki  <macro@imgtec.com>
217
218         * elflink.c (elf_link_add_object_symbols): Always turn hidden
219         and internal symbols which have a dynamic index into local
220         ones.
221
222 2016-04-04  Nick Clifton  <nickc@redhat.com>
223
224         PR 19872
225         * dwarf2.c (parse_comp_unit): Skip warning about unrecognised
226         version number if the version is zero.
227
228 2016-04-01  Alan Modra  <amodra@gmail.com>
229
230         PR 19886
231         * elflink.c (on_needed_list): Recursively check needed status.
232         (elf_link_add_object_symbols): Adjust.
233
234 2016-03-30  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
235
236         * elf32-avr.c (avr_elf32_load_records_from_section): Free
237         internal_relocs only if they aren't cached.
238
239 2016-03-29  Nick Clifton  <nickc@redhat.com>
240
241         PR 17334
242         * elf32-bfin.c (elf32_bfinfdpic_finish_dynamic_sections): Relax
243         assertion on the size of the got section to allow it to be bigger
244         than the number of relocs.
245
246 2016-03-29  Toni Spets  <toni.spets@iki.fi>
247
248         PR 19878
249         * coffcode.h (coff_write_object_contents): Revert accidental
250         2014-11-10 change.
251
252 2016-03-22  Alan Modra  <amodra@gmail.com>
253
254         PR 19850
255         * dwarf2.c (read_attribute_value): Skip info_ptr check for
256         DW_FORM_flag_present.
257
258 2016-03-22  Nick Clifton  <nickc@redhat.com>
259
260         * cpu-v850_rh850.c (arch_info_struct): Restore v850-rh850 as an
261         architecture name for backwards compatibility.
262
263         * peXXigen.c (_bfd_XXi_write_codeview_record): Fix possible
264         unbounded stack use.
265
266         * warning.m4 (GCC_WARN_CFLAGS): Only add -Wstack-usage if using a
267         sufficiently recent version of GCC.
268         * configure: Regenerate.
269
270 2016-03-22  Alan Modra  <amodra@gmail.com>
271
272         PR 19851
273         * plugin.c (try_load_plugin): Avoid -Wstack-usage warning.
274
275 2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
276
277         * archures.c (bfd_mach_arc_nps400): Define.
278         * bfd-in2.h: Regenerate.
279         * cpu-arc.c (arch_info_struct): New entry for nps400, renumber
280         some existing entries to make space.
281         * elf32-arc.c (arc_elf_object_p): Add nps400 case.
282         (arc_elf_final_write_processing): Likewise.
283
284 2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
285
286         * elf32-arc.c (arc_elf_print_private_bfd_data): Remove use of
287         EF_ARC_CPU_GENERIC.
288         (arc_elf_final_write_processing): Don't bother setting cpu field
289         in e_flags, this will have been set elsewhere.
290
291 2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
292
293         * elf32-arc.c (arc_elf_final_write_processing): Switch to using
294         EF_ARC_MACH_MSK.
295
296 2016-03-21  Nick Clifton  <nickc@redhat.com>
297
298         * warning.m4 (GCC_WARN_CFLAGS): Add -Wstack-usage=262144
299         * configure: Regenerate.
300         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Replace use of
301         alloca with call to xmalloc.
302         * elf32-nds32.c: Likewise.
303         * elf64-hppa.c: Likewise.
304         * elfxx-mips.c: Likewise.
305         * pef.c: Likewise.
306         * pei-x86_64.c: Likewise.
307         * som.c: Likewise.
308         * xsym.c: Likewise.
309
310 2016-03-15  H.J. Lu  <hongjiu.lu@intel.com>
311
312         PR ld/19827
313         * elf32-i386.c (elf_i386_check_relocs): Bind defined symbol
314         locally in PIE.
315         (elf_i386_relocate_section): Likewise.
316         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
317         (elf_x86_64_relocate_section): Likewise.
318
319 2016-03-15  H.J. Lu  <hongjiu.lu@intel.com>
320
321         PR ld/19807
322         * elf64-x86-64.c (elf_x86_64_relocate_section): Check
323         no_reloc_overflow_check to diable R_X86_64_32/R_X86_64_32S
324         relocation overflow check.
325
326 2016-03-14  H.J. Lu  <hongjiu.lu@intel.com>
327
328         * bfd-in2.h: Regenerated.
329
330 2016-03-11  Dan Gissel  <dgisselq@ieee.org>
331
332         PR 19713
333         * elf.c (_bfd_elf_section_offset): Ensure that the returned offset
334         uses bytes not octets.
335         * elflink.c (resolve_section): Likewise.
336         Add a bfd parameter.
337         (eval_section): Pass the input_bfd to resolve_section.
338         (bfd_elf_perform_complex_relocation): Convert byte offset to
339         octets before read and writing values.
340         (elf_link_input_bfd): Add byte to octet conversions.
341         (elf_reloc_link_order): Likewise.
342         (elf_fixup_link_order): Likewise.
343         (bfd_elf_final_link): Likewise.
344         * reloc.c (_bfd_final_link_relocate): Likewise.
345         * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
346
347 2016-03-10  Nick Clifton  <nickc@redhat.com>
348
349         * config.bfd: Mark the i370 target as obsolete.
350
351 2016-03-09  Pedro Alves  <palves@redhat.com>
352
353         * cpu-v850.c (N): Append ":old-gcc-abi" instead of " (using old
354         gcc ABI)" to printable name.
355         * cpu-v850_rh850.c (bfd_v850_rh850_arch): Use "v850:rh850" instead
356         of "v850-rh850" as printable name.
357
358 2016-03-09  Leon Winter  <winter-gcc@bfw-online.de>
359
360         PR ld/19623
361         * cofflink.c (_bfd_coff_generic_relocate_section): Do not apply
362         relocations against absolute symbols.
363
364 2016-03-09  Alan Modra  <amodra@gmail.com>
365
366         PR binutils/19775
367         * coff-alpha.c (alpha_ecoff_openr_next_archived_file): Allow zero
368         length elements in the archive.
369
370 2016-03-08  H.J. Lu  <hongjiu.lu@intel.com>
371
372         PR ld/19789
373         * elflink.c (elf_link_add_object_symbols): Create dynamic sections
374         for -E/--dynamic-list only when not relocatable.
375
376 2016-03-08  H.J. Lu  <hongjiu.lu@intel.com>
377
378         PR ld/19784
379         * elf32-i386.c (elf_i386_check_relocs): Increment PLT reference
380         count for locally defined local IFUNC symbols in shared object.
381         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
382
383 2016-03-08  H.J. Lu  <hongjiu.lu@intel.com>
384
385         PR ld/19579
386         * elflink.c (_bfd_elf_merge_symbol): Group common symbol checking
387         together.
388
389 2016-03-08  Cupertino Miranda  <Cupertino.Miranda@synopsys.com>
390             Andrew Burgess  <andrew.burgess@embecosm.com>
391
392         * elf32-arc.c (arc_bfd_get_32): Becomes an alias for bfd_get_32.
393         (arc_bfd_put_32): Becomes an alias for bfd_put_32.
394         (arc_elf_howto_init): Added assert to validate relocations.
395         (get_middle_endian_relocation): Delete.
396         (middle_endian_convert): New function.
397         (ME): Redefine, now does nothing.
398         (IS_ME): New define.
399         (arc_do_relocation): Extend the attached 'ARC_RELOC_HOWTO'
400         definition to call middle_endian_convert.  Add a new local
401         variable and make use of this throughout. Added call to
402         arc_bfd_get_8 and arc_bfd_put_8 for 8 bit relocations.
403
404 2016-03-07  Nick Clifton  <nickc@redhat.com>
405
406         PR binutils/19775
407         * archive.c (bfd_generic_openr_next_archived_file): Allow zero
408         length elements in the archive.
409
410 2016-03-07  Jiong Wang  <jiong.wang@arm.com>
411
412         * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Always create .got
413         section if the symbol "_GLOBAL_OFFSET_TABLE_" is referenced.
414
415 2016-03-04  H.J. Lu  <hongjiu.lu@intel.com>
416
417         PR ld/19579
418         * elflink.c (_bfd_elf_merge_symbol): Treat common symbol in
419         executable as definition if the new definition comes from a
420         shared library.
421
422 2016-03-02  Alan Modra  <amodra@gmail.com>
423
424         * Makefile.in: Regenerate.
425         * po/SRC-POTFILES.in: Regenerate.
426
427 2016-02-29  Cupertino Miranda  <cmiranda@synopsys.com>
428
429         * elf32-arc.c (elf_arc_relocate_section): Added rules to fix the
430         relocation addend when sections get merged.
431
432 2016-02-29  Cupertino Miranda <Cupertino.Miranda@synopsys.com>
433
434         * elf32-arc.c (arc_elf_final_write_processing): Add condition to
435         the flag change.
436         (elf_arc_relocate_section): Fixes and conditions to support PIE.
437         Assert for code sections dynamic relocs.
438
439 2016-02-26  Renlin Li  <renlin.li@arm.com>
440
441         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Fix signed overflow
442         check for MOVW_SABS_G0, MOVW_SABS_G1, MOVW_SABS_G2.
443
444 2016-02-26  H.J. Lu  <hongjiu.lu@intel.com>
445
446         PR ld/19609
447         * elf32-i386.c (elf_i386_convert_load): Convert to R_386_32 for
448         load with locally bound symbols if PIC is false or there is no
449         base register.  Optimize branch to 0 if PIC is false.
450         (elf_i386_relocate_section): Don't generate dynamic relocations
451         against undefined weak symbols if PIC is false.
452         * elf64-x86-64.c (elf_x86_64_convert_load): Disable optimization
453         if we can't estimate relocation overflow with --no-relax.
454         Convert to R_X86_64_32S/R_X86_64_32 for load with locally bound
455         symbols if PIC is false.  Optimize branch to 0 if PIC is false.
456         (elf_x86_64_relocate_section): Don't generate dynamic relocations
457         against undefined weak symbols if PIC is false.
458
459 2016-02-26  H.J. Lu  <hongjiu.lu@intel.com>
460
461         PR ld/19645
462         * bfd.c (bfd): Change flags to 20 bits.
463         (BFD_CONVERT_ELF_COMMON): New.
464         (BFD_USE_ELF_STT_COMMON): Likewise.
465         (BFD_FLAGS_SAVED): Add BFD_CONVERT_ELF_COMMON and
466         BFD_USE_ELF_STT_COMMON.
467         (BFD_FLAGS_FOR_BFD_USE_MASK): Likewise.
468         * configure.ac: Remove --enable-elf-stt-common.
469         * elf.c (swap_out_syms): Choose STT_COMMON or STT_OBJECT for
470         common symbol depending on BFD_CONVERT_ELF_COMMON and
471         BFD_USE_ELF_STT_COMMON.
472         * elfcode.h (elf_slurp_symbol_table): Set BSF_ELF_COMMON for
473         STT_COMMON.
474         * elflink.c (bfd_elf_link_mark_dynamic_symbol): Also check
475         STT_COMMON.
476         (elf_link_convert_common_type): New function.
477         (elf_link_output_extsym): Choose STT_COMMON or STT_OBJECT for
478         common symbol depending on BFD_CONVERT_ELF_COMMON and
479         BFD_USE_ELF_STT_COMMON.  Set sym.st_info after sym.st_shndx.
480         * elfxx-target.h (TARGET_BIG_SYM): Add BFD_CONVERT_ELF_COMMON
481         and BFD_USE_ELF_STT_COMMON to object_flags.
482         (TARGET_LITTLE_SYM): Likewise.
483         * syms.c (BSF_KEEP_G): Renamed to ...
484         (BSF_ELF_COMMON): This.
485         * bfd-in2.h: Regenerated.
486         * config.in: Likewise.
487         * configure: Likewise.
488
489 2016-02-26  H.J. Lu  <hongjiu.lu@intel.com>
490
491         PR ld/19636
492         PR ld/19704
493         PR ld/19719
494         * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
495         (elf_i386_link_hash_entry): Add has_got_reloc and
496         has_non_got_reloc.
497         (elf_i386_link_hash_table): Add interp.
498         (elf_i386_link_hash_newfunc): Initialize has_got_reloc and
499         has_non_got_reloc.
500         (elf_i386_copy_indirect_symbol): Copy has_got_reloc and
501         has_non_got_reloc.
502         (elf_i386_check_relocs): Set has_got_reloc and has_non_got_reloc.
503         (elf_i386_fixup_symbol): New function.
504         (elf_i386_pie_finish_undefweak_symbol): Likewise.
505         (elf_i386_allocate_dynrelocs): Don't allocate space for dynamic
506         relocations and discard relocations against resolved undefined
507         weak symbols in executable.  Don't make resolved undefined weak
508         symbols in executable dynamic.  Keep dynamic non-GOT/non-PLT
509         relocation against undefined weak symbols in PIE.
510         (elf_i386_size_dynamic_sections): Set interp to .interp section.
511         (elf_i386_relocate_section): Don't generate dynamic relocations
512         against resolved undefined weak symbols in PIE, except for
513         R_386_PC32.
514         (elf_i386_finish_dynamic_symbol): Keep PLT/GOT entries without
515         dynamic PLT/GOT relocations for resolved undefined weak symbols.
516         Don't generate dynamic relocation against resolved undefined weak
517         symbol in executable.
518         (elf_i386_finish_dynamic_sections): Call
519         elf_i386_pie_finish_undefweak_symbol on all symbols in PIE.
520         (elf_backend_fixup_symbol): New.
521         * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
522         (elf_x86_64_link_hash_entry): Add has_got_reloc and
523         has_non_got_reloc.
524         (elf_x86_64_link_hash_table): Add interp.
525         (elf_x86_64_link_hash_newfunc): Initialize has_got_reloc and
526         has_non_got_reloc.
527         (elf_x86_64_copy_indirect_symbol): Copy has_got_reloc and
528         has_non_got_reloc.
529         (elf_x86_64_check_relocs): Set has_got_reloc and
530         has_non_got_reloc.
531         (elf_x86_64_fixup_symbol): New function.
532         (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
533         (elf_x86_64_allocate_dynrelocs): Don't allocate space for dynamic
534         relocations and discard relocations against resolved undefined
535         weak symbols in executable.  Don't make resolved undefined weak
536         symbols in executable dynamic.
537         (elf_x86_64_size_dynamic_sections): Set interp to .interp section.
538         (elf_x86_64_relocate_section): Check relocation overflow for
539         dynamic relocations against unresolved weak undefined symbols.
540         Don't generate dynamic relocations against resolved weak
541         undefined symbols in PIE.
542         (elf_x86_64_finish_dynamic_symbol): Keep PLT/GOT entries without
543         dynamic PLT/GOT relocations for resolved undefined weak symbols.
544         Don't generate dynamic relocation against resolved undefined weak
545         symbol in executable.
546         (elf_x86_64_finish_dynamic_sections): Call
547         elf_x86_64_pie_finish_undefweak_symbol on all symbols in PIE.
548         (elf_backend_fixup_symbol): New.
549
550 2016-02-26  Alan Modra  <amodra@gmail.com>
551
552         * elf64-ppc.c (create_linkage_sections): Create sfpr when
553         save_restore_funcs, rest of sections when not relocatable.
554         (ppc64_elf_init_stub_bfd): Always call create_linkage_sections.
555         (sfpr_define): Define all symbols on emitted code.
556         (ppc64_elf_func_desc_adjust): Adjust for sfpr now being created
557         when relocatable.  Move sfpr_define loop earlier.
558
559 2016-02-24  H.J. Lu  <hongjiu.lu@intel.com>
560
561         * elf64-x86-64.c (elf_x86_64_need_pic): New function.
562         (elf_x86_64_relocate_section): Use it.  Replace
563         x86_64_elf_howto_table[r_type] with howto.
564
565 2016-02-24  H.J. Lu  <hongjiu.lu@intel.com>
566
567         PR ld/19698
568         * elflink.c (bfd_elf_record_link_assignment): Set versioned if
569         symbol version is unknown.
570
571 2016-02-24  H.J. Lu  <hongjiu.lu@intel.com>
572
573         * elf32-i386.c (elf_i386_allocate_dynrelocs): Set plt_got.offset
574         to (bfd_vma) -1 when setting needs_plt to 0.
575         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
576
577 2016-02-23  H.J. Lu  <hongjiu.lu@intel.com>
578
579         * elflink.c (bfd_elf_record_link_assignment): Check for shared
580         library, instead of PIC, and don't check PDE when making linker
581         assigned symbol dynamic.
582
583 2016-02-23  Faraz Shahbazker  <faraz.shahbazker@imgtec.com>
584
585         * bfd/elfxx-mips.c (_bfd_mips_post_process_headers): Increment
586         ABIVERSION for non-executable stack.
587
588 2016-02-23  Rich Felker  <bugdal@aerifal.cx>
589
590         PR target/19516
591         * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol):
592         Always produce a RELATIVE reloc for a local symbol.
593
594 2016-02-23  Hans-Peter Nilsson  <hp@axis.com>
595
596         Fix test-case ld-elf/pr19617b
597         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
598         discard unused non-function symbols when --dynamic-list-data.
599
600 2016-02-22  H.J. Lu  <hongjiu.lu@intel.com>
601
602         * elflink.c (_bfd_elf_link_renumber_dynsyms): Always create the
603         dynsym section, even if it is empty, with dynamic sections.
604
605 2016-02-22  H.J. Lu  <hongjiu.lu@intel.com>
606
607         * syms.c: Remove BSF_COMMON from comments.
608         * bfd-in2.h: Regenerated.
609
610 2016-02-22  Jiong Wang  <jiong.wang@arm.com>
611
612         * elfnn-aarch64. (aarch64_type_of_stub): Remove redundation calcuation
613         for destination.  Remove useless function parameters.
614         (elfNN_aarch64_size_stubs): Update parameters for aarch64_type_of_stub.
615
616 2016-02-19  Nick Clifton  <nickc@redhat.com>
617
618         PR ld/19629
619         * aoutx.h (aout_link_add_symbols): Check for out of range string
620         table offsets.
621
622         PR ld/19628
623         * reloc.c (bfd_generic_get_relocated_section_contents): Stop
624         processing if we encounter a reloc without an associated symbol.
625
626 2016-02-18  H.J. Lu  <hongjiu.lu@intel.com>
627
628         PR ld/19617
629         * elflink.c (elf_link_add_object_symbols): Always create dynamic
630         sections for -E/--dynamic-list.
631
632 2016-02-17  H.J. Lu  <hongjiu.lu@intel.com>
633
634         * elf64-x86-64.c (elf_backend_omit_section_dynsym): New.  Defined
635         to bfd_true.
636
637 2016-02-16  Joseph Myers  <joseph@codesourcery.com>
638
639         * plugin.c (plugin_vec): Set match priority to 255.
640         * format.c (bfd_check_format_matches) [BFD_SUPPORTS_PLUGINS]: When
641         matching against the plugin vector, take priority from there not
642         from TEMP.
643
644 2016-02-15  Nick Clifton  <nickc@redhat.com>
645
646         * elf-bfd.h (struct bfd_elf_special_section): Use unsigned values
647         for length and type fields.  Use a signed value for the
648         suffix_length field.
649
650 2016-02-10  H.J. Lu  <hongjiu.lu@intel.com>
651
652         PR ld/19601
653         * elf32-i386.c (elf_i386_relocate_section): Mask off the least
654         significant bit in GOT offset for R_386_GOT32X.
655
656 2016-02-10  Nick Clifton  <nickc@redhat.com>
657
658         PR 19405
659         * elf32-nios2.c (nios2_elf32_install_imm16): Allow for signed
660         immediate values.
661         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Limit the
662         number of messages about FDE encoding preventing .eh_frame_hdr
663         generation.
664
665 2016-02-09  Nick Clifton  <nickc@redhat.com>
666
667         * oasys.c (oasys_archive_p): Fix indentation.
668         * elf32-nds32.c (nds32_elf_relax_section): Use an unsigned
669         constant for left shifting.
670
671         * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Add a more
672         helpful warning message to explain why certain AArch64 relocs
673         might overflow.
674
675 2016-02-05  Simon Marchi  <simon.marchi@ericsson.com>
676
677         * pe-mips.c (coff_mips_reloc): Fix formatting.
678
679 2016-02-05  Cupertino Miranda  <Cupertino.Miranda@synopsys.com>
680
681         * cpu-arc.c: Change default archure from bfd_mach_arc_arcv2
682         to bfd_mach_arc_arc600.
683
684 2016-02-04  Alan Modra  <amodra@gmail.com>
685
686         * elf64-ppc.c (ppc64_elf_relocate_section): Adjust last patch
687         for big-endian.
688
689 2016-02-02  H.J. Lu  <hongjiu.lu@intel.com>
690
691         PR ld/19542
692         * elf64-x86-64.c (elf_x86_64_convert_load): Store the estimated
693         distances in the compressed_size field of the output section.
694
695 2016-02-02  Alan Modra  <amodra@gmail.com>
696
697         * elf64-ppc.c (ppc64_elf_relocate_section): Further restrict
698         ELFv2 entry optimization.
699
700 2016-02-02  H.J. Lu  <hongjiu.lu@intel.com>
701
702         PR binutils/19547
703         * elf.c (assign_section_numbers): Clear HAS_RELOC if there are
704         no relocations in relocatable files.
705
706 2016-02-01  H.J. Lu  <hongjiu.lu@intel.com>
707
708         PR ld/19553
709         * elflink.c (elf_link_add_object_symbols): Don't add DT_NEEDED
710         if a symbol from a library loaded via DT_NEEDED doesn't match
711         the symbol referenced by regular object.
712
713 2016-02-01  Nathaniel Smith  <njs@pobox.com>
714
715         * peicode.h (pe_ILF_build_a_bfd): Create an import symbol for both
716         CODE and DATA.
717
718 2016-02-01  Alan Modra  <amodra@gmail.com>
719
720         * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Don't abort on
721         an out of range reloc_index.
722         * elf32-i386.c (elf_i386_get_plt_sym_val): Likewise.
723
724 2016-02-01  Kamil Rytarowski  <n54@gmx.com>
725
726         * Makefile.am (OPTIONAL_BACKENDS): Add netbsd-core.lo.
727         (OPTIONAL_BACKENDS_CFILES): Add netbsd-core.c.
728         * Makefile.in: Regenerated.
729
730 2016-02-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
731
732         * elf64-s390.c (elf_s390_reloc_name_lookup): Fix indentation.
733
734 2016-01-31  John David Anglin  <danglin@gcc.gnu.org>
735
736         PR ld/19526
737         * elf32-hppa.c (elf32_hppa_final_link): Don't sort non-regular output
738         files.
739         * elf64-hppa.c (elf32_hppa_final_link): Likewise.  Remove retval.
740
741 2016-01-30  H.J. Lu  <hongjiu.lu@intel.com>
742
743         PR ld/19539
744         * elf32-i386.c (elf_i386_reloc_type_class): Check relocation
745         against STT_GNU_IFUNC symbol only with dynamic symbols.
746         * elf64-x86-64.c (elf_x86_64_reloc_type_class): Likewise.
747
748 2016-01-28  H.J. Lu  <hongjiu.lu@intel.com>
749
750         PR binutils/19523
751         * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Set BFD_DECOMPRESS to
752         decompress debug sections.
753
754 2016-01-25  Maciej W. Rozycki  <macro@imgtec.com>
755
756         * elf32-arc.c (elf_arc_finish_dynamic_symbol): Rename `index' to
757         `dynindx'.
758
759 2016-01-25  Nick Clifton  <nickc@redhat.com>
760
761         PR target/19435
762         * mach-o.c (bfd_mach_o_close_and_cleanup): Suppress code to free
763         dsym filename buffer.
764
765 2016-01-24  Maciej W. Rozycki  <macro@imgtec.com>
766
767         * elfxx-mips.c (BZ16_REG_FIELD): Simplify calculation.
768
769 2016-01-24  Maciej W. Rozycki  <macro@imgtec.com>
770
771         * elfxx-mips.c (BZ16_REG): Correct calculation.
772
773 2016-01-21  Nick Clifton  <nickc@redhat.com>
774
775         * elf32-arc.c (ADD_RELA): Fix compile time warning errors by
776         changing the type of _loc to be bfd_byte *.
777         (elf_arc_finish_dynamic_symbol): Likewise.
778
779 2016-01-21  Nick Clifton  <nickc@redhat.com>
780
781         PR ld/19455
782         * elf32-arm.c (elf32_arm_create_dynamic_sections): Set the ELF
783         class of the linker stub bfd.
784         (elf32_arm_check_relocs): Skip check for pic format after
785         processing a vxWorks R_ARM_ABS12 reloc.
786         * elflink.c (bfd_elf_final_link): Check for ELFCLASSNONE when
787         reporting a class mismatch.
788
789 2016-01-21  Jiong Wang  <jiong.wang@arm.com>
790
791         * elfnn-aarch64.c (aarch64_type_of_stub): Allow insert long branch
792         veneer for sym_sec != input_sec.
793         (elfNN_aarch64_size_stub): Support STT_SECTION symbol.
794         (elfNN_aarch64_final_link_relocate): Take rela addend into account when
795         calculation destination.
796
797 2016-01-21  Alan Modra  <amodra@gmail.com>
798
799         * elf-linux-core.h (swap_linux_prpsinfo32_out): New function.
800         (swap_linux_prpsinfo64_out): New function.
801         (LINUX_PRPSINFO32_SWAP_FIELDS): Delete.
802         (LINUX_PRPSINFO64_SWAP_FIELDS): Delete.
803         * elf.c (elfcore_write_linux_prpsinfo32): Adjust.  Don't memset.
804         (elfcore_write_linux_prpsinfo64): Likewise.
805         * elf32-ppc.c (swap_ppc_linux_prpsinfo32_out): New function.
806         (PPC_LINUX_PRPSINFO32_SWAP_FIELDS): Delete.
807         (elfcore_write_ppc_linux_prpsinfo32): Adjust.  Don't memset.
808
809 2016-01-21  Alan Modra  <amodra@gmail.com>
810
811         * elf-linux-core.h: Rename from elf-linux-psinfo.h.
812         * elf.c: Adjust #include.
813         * elf32-ppc.c: Don't #include elf-linux-psinfo.h
814         * Makefile.am (SOURCE_HFILES): Update.
815         * Makefile.in: Regenerate.
816         * po/SRC-PORFILES.in: Regenerate.
817
818 2016-01-21  Alan Modra  <amodra@gmail.com>
819
820         * configure.ac: Move corefile selection later in file.  Move
821         tdefaults code immediately after other target vector code.
822         * configure: Regenerate.
823
824 2016-01-20  Mickael Guene  <mickael.guene@st.com>
825
826         * elf32-arm.c (elf32_arm_special_sections): Remove catch of noread
827         section using '.text.noread' pattern.
828
829 2016-01-19  John Baldwin  <jhb@FreeBSD.org>
830
831         * elf.c (elfcore_grok_note): Recognize NT_FREEBSD_THRMISC notes.
832
833 2016-01-18  Miranda Cupertino  <Cupertino.Miranda@synopsys.com>
834             Zissulescu Claudiu  <Claudiu.Zissulescu@synopsys.com>
835
836         * arc-plt.def: New file.
837         * arc-plt.h: Likewise.
838         * elf32-arc.c (elf_arc_abs_plt0_entry, elf_arc_abs_pltn_entry,
839                        elf_arcV2_abs_plt0_entry, elf_arcV2_abs_pltn_entry,
840                        elf_arc_pic_plt0_entry, elf_arc_pic_pltn_entry,
841                        elf_arcV2_pic_plt0_entry, elf_arcV2_pic_pltn_entry): Remove.
842         (name_for_global_symbol): Added.
843         (ADD_RELA): Helper to create dynamic relocs.
844         (new_got_entry_to_list): Create a new got entry in linked list.
845         (symbol_has_entry_of_type): Search for specific type of entry in
846         list.
847         (is_reloc_for_GOT): return FALSE for any TLS related relocs.
848         (is_reloc_for_TLS, arc_elf_set_private_flags)
849         (arc_elf_print_private_bfd_data, arc_elf_copy_private_bfd_data)
850         (arc_elf_merge_private_bfd_data): New functions.
851         (debug_arc_reloc): Cleaned debug info printing.
852         (PDATA reloc): Changed not to perform address alignment.
853         (reverse_me): Added. Fix for ARC_32 relocs.
854         (arc_do_relocation): Return bfd_reloc_of when no relocation should
855         occur.
856         (arc_get_local_got_ents): Renamed from arc_get_local_got_offsets.
857         Changed function to access an array of list of GOT entries instead
858         of just an array of offsets.
859         (elf_arc_relocate_section): Added support for PIC and TLS related relocations.
860         (elf_arc_check_relocs): Likewise.
861         (elf_arc_adjust_dynamic_symbol, elf_arc_finish_dynamic_symbol,
862         (elf_arc_finish_dynamic_sections): Likewise
863         (arc_create_dynamic_sections): Modified conditions to create
864         dynamic sections.
865         (ADD_SYMBOL_REF_SEC_AND_RELOC): New macro.
866         (plt_do_relocs_for_symbol, relocate_plt_for_symbol)
867         (relocate_plt_for_entry): Changed to support new way to define PLT
868         related code.
869         (add_symbol_to_plt): Likewise.
870         (arc_elf_link_hash_table_create): New function.
871
872 2016-01-18  Nick Clifton  <nickc@redhat.com>
873
874         PR ld/19440
875         * coff-rs6000.c (_bfd_xcoff_swap_sym_in): Sign extend external
876         section number into internal section number.
877         * coff64-rs6000.c (_bfd_xcoff64_swap_sym_in): Likewise.
878         * coffswap.h (coff_swap_sym_in): Likewise.
879         * peXXigen.c (_bfd_XXi_swap_sym_in): Likewise.
880         * coffcode.h (_coff_bigobj_swap_sym_in): Make sure that internal
881         section number field is big enough to hold the external value.
882
883 2016-01-17  Alan Modra  <amodra@gmail.com>
884
885         * configure: Regenerate.
886
887 2016-01-12  Yury Usishchev  <y.usishchev@samsung.com>
888
889         * elf32-arm.c (elf32_arm_fix_exidx_coverage): Insert cantunwind
890         when address in first unwind entry does not match start of
891         section.
892
893 2016-01-08  Richard Sandiford  <richard.sandiford@arm.com>
894             Jiong Wang  <jiong.wang@arm.com>
895
896         PR ld/19368
897         * elf32-arm.c (elf32_arm_reloc_type_class): Map R_ARM_IRELATIVE to
898         reloc_class_ifunc.
899
900 2016-01-06  Andrew Burgess  <andrew.burgess@embecosm.com>
901
902         * elf32-arc.c (reloc_type_to_name): Change ARC_RELOC_HOWTO to
903         place 'R_' before the reloc name returned.
904         (elf_arc_howto_table): Change ARC_RELOC_HOWTO to place 'R_' before
905         the relocation string.
906
907 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
908
909         * elfxx-mips.c (mips_elf_merge_obj_abiflags): New function,
910         factored out from...
911         (_bfd_mips_elf_merge_private_bfd_data): ... here.
912
913 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
914
915         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Move
916         attribute check after ELF file header flag check.
917
918 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
919
920         * elfxx-mips.c (mips_elf_merge_obj_attributes): Propagate the
921         return status from `_bfd_elf_merge_object_attributes'.
922
923 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
924
925         * elfxx-mips.c (mips_elf_merge_obj_e_flags): New function,
926         factored out from...
927         (_bfd_mips_elf_merge_private_bfd_data): ... here.
928
929 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
930
931         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Fold the
932         handling of input MIPS ABI flags together.
933
934 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
935
936         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Suppress
937         attribute checks for null input.
938
939 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
940
941         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Use local
942         pointers to target data.
943
944 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
945
946         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Correct
947         an FP ABI warning.
948
949 2016-01-01  Alan Modra  <amodra@gmail.com>
950
951         Update year range in copyright notice of all files.
952
953 For older changes see ChangeLog-2015 and doc/ChangeLog-0415
954 \f
955 Copyright (C) 2016 Free Software Foundation, Inc.
956
957 Copying and distribution of this file, with or without modification,
958 are permitted in any medium without royalty provided the copyright
959 notice and this notice are preserved.
960
961 Local Variables:
962 mode: change-log
963 left-margin: 8
964 fill-column: 74
965 version-control: never
966 End: