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