Set sh_entsize for .init_array and similar.
[external/binutils.git] / bfd / ChangeLog
1 2016-05-20  Alan Modra  <amodra@gmail.com>
2
3         PR gas/20118
4         * elf.c (elf_fake_sections): Set sh_entsize for SHT_INIT_ARRAY,
5         SHT_FINI_ARRAY, and SHT_PREINIT_ARRAY.
6
7 2016-05-19  Cupertino Miranda  <cmiranda@synopsys.com>
8
9         * elf32-arc.c (arc_elf_final_write_processing): Changed.
10         (debug_arc_reloc): Likewise.
11         (elf_arc_relocate_section): Likewise.
12         (elf_arc_check_relocs): Likewise.
13         (elf_arc_adjust_dynamic_symbol): Likewise.
14         (elf_arc_add_symbol_hook): Likewise.
15
16 2016-05-19  Maciej W. Rozycki  <macro@imgtec.com>
17
18         * config.bfd: Remove `am34-*-linux*' support.
19
20 2016-05-19  Alan Modra  <amodra@gmail.com>
21
22         * elf64-ppc.c (allocate_dynrelocs): Allocate got and other dynamic
23         relocs before plt relocs.
24
25 2016-05-19  Alan Modra  <amodra@gmail.com>
26
27         * elf64-ppc.c (ppc64_elf_branch_reloc): Check for NULL owner
28         before dereferencing.
29
30 2016-05-18  Nick Clifton  <nickc@redhat.com>
31
32         * po/sv.po: Updated Swedish translation.
33
34 2016-05-18  Alan Modra  <amodra@gmail.com>
35
36         * elf32-arm.c (elf32_arm_size_stubs): Free or cache local syms
37         for each BFD.  Don't goto error_ret_free_local from outside loop.
38
39 2016-05-17  Maciej W. Rozycki  <macro@imgtec.com>
40
41         * elf-s390-common.c (elf_s390_add_symbol_hook): Remove
42         STB_GNU_UNIQUE handling.
43         * elf32-arc.c (elf_arc_add_symbol_hook): Likewise.
44         * elf32-arm.c (elf32_arm_add_symbol_hook): Likewise.
45         * elf32-m68k.c (elf_m68k_add_symbol_hook): Likewise.
46         * elf32-ppc.c (ppc_elf_add_symbol_hook): Likewise.
47         * elf32-sparc.c (elf32_sparc_add_symbol_hook): Likewise.
48         * elf64-ppc.c (ppc64_elf_add_symbol_hook): Likewise.
49         * elf64-sparc.c (elf64_sparc_add_symbol_hook): Likewise.
50         * elf64-x86-64.c (elf_x86_64_add_symbol_hook): Likewise.
51         * elfxx-aarch64.c (_bfd_aarch64_elf_add_symbol_hook): Likewise.
52         * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Likewise.
53         * elf32-i386.c (elf_i386_add_symbol_hook): Remove function.
54         (elf_backend_add_symbol_hook): Remove macro.
55         * elflink.c (elf_link_add_object_symbols): Set `has_gnu_symbols'
56         for STB_GNU_UNIQUE symbols.
57
58 2016-05-16  Maciej W. Rozycki  <macro@imgtec.com>
59
60         * elf32-v850.c (v850_elf_copy_notes): New function, factored out
61         from...
62         (v850_elf_copy_private_bfd_data): ... here.  Call the new
63         function and `_bfd_elf_copy_private_bfd_data'.
64
65 2016-05-13  H.J. Lu  <hongjiu.lu@intel.com>
66
67         PR ld/20093
68         * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Don't convert
69         GOTPCREL relocation against large section.
70
71 2016-05-13  Alan Modra  <amodra@gmail.com>
72
73         * elf-m10300.c (_bfd_mn10300_elf_finish_dynamic_sections): Use
74         linker dynamic sections in calculating size and address of
75         dynamic tags rather than using output sections.  Remove asserts.
76         * elf32-arm.c (elf32_arm_finish_dynamic_sections): Likewise.
77         * elf32-cr16.c (_bfd_cr16_elf_finish_dynamic_sections): Likewise.
78         * elf32-cris.c (elf_cris_finish_dynamic_sections): Likewise.
79         * elf32-i370.c (i370_elf_finish_dynamic_sections): Likewise.
80         * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
81         * elf32-m32r.c (m32r_elf_finish_dynamic_sections): Likewise.
82         * elf32-m68k.c (elf_m68k_finish_dynamic_sections): Likewise.
83         * elf32-metag.c (elf_metag_finish_dynamic_sections): Likewise.
84         * elf32-microblaze.c (microblaze_elf_finish_dynamic_sections): Likewise.
85         * elf32-nds32.c (nds32_elf_finish_dynamic_sections): Likewise.
86         * elf32-nios2.c (nios2_elf32_finish_dynamic_sections): Likewise.
87         * elf32-or1k.c (or1k_elf_finish_dynamic_sections): Likewise.
88         * elf32-s390.c (elf_s390_finish_dynamic_sections): Likewise.
89         * elf32-score.c (s3_bfd_score_elf_finish_dynamic_sections): Likewise.
90         * elf32-score7.c (s7_bfd_score_elf_finish_dynamic_sections): Likewise.
91         * elf32-vax.c (elf_vax_finish_dynamic_sections): Likewise.
92         * elf32-xtensa.c (elf_xtensa_finish_dynamic_sections): Likewise.
93         * elf64-alpha.c (elf64_alpha_finish_dynamic_sections): Likewise.
94         * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
95         * elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise.
96         * elflink.c (bfd_elf_final_link): Likewise.
97         * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections): Likewise.
98         * elfxx-sparc.c (sparc_finish_dyn): Likewise.  Adjust error message.
99         * elf32-arc.c (GET_SYMBOL_OR_SECTION): Remove ASSERT arg and
100         don't set doit.  Look up dynobj section.
101         (elf_arc_finish_dynamic_sections): Adjust GET_SYMBOL_OR_SECTION
102         invocation and dynamic tag vma calculation.  Don't test
103         boolean var == TRUE.
104         * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_sections): Fix
105         DT_JMPREL calc.
106
107 2016-05-13  Alan Modra  <amodra@gmail.com>
108
109         * elflink.c (elf_link_sort_relocs): Wrap overlong lines.  Fix
110         octets_per_byte.  Put dynamic .rela.plt last in link orders.
111         Assign output_offset for reloc sections rather than writing
112         sorted relocs from block corresponding to output_offset.
113
114 2016-05-12  Alan Modra  <amodra@gmail.com>
115
116         * elf-bfd.h (elf_reloc_type_class): Put reloc_class_plt last.
117
118 2016-05-11  Andrew Bennett  <andrew.bennett@imgtec.com>
119
120         * elfxx-mips.c (print_mips_ases): Add DSPR3.
121
122 2016-05-11  Alan Modra  <amodra@gmail.com>
123
124         * elf32-hppa.c (elf32_hppa_init_stub_bfd): New function.
125         (elf32_hppa_check_relocs): Don't set dynobj.
126         (elf32_hppa_size_stubs): Test !SEC_LINKER_CREATED for stub sections.
127         (elf32_hppa_build_stubs): Likewise.
128         * elf32-hppa.h (elf32_hppa_init_stub_bfd): Declare.
129
130 2016-05-11  Alan Modra  <amodra@gmail.com>
131
132         PR 20060
133         * elf64-ppc.c (ppc64_elf_tls_setup): Clear forced_local.
134         * elf32-ppc.c (ppc_elf_tls_setup): Likewise.
135
136 2016-05-10  Jiong Wang  <jiong.wang@arm.com>
137
138         * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Remove redundant
139         aarch64_tls_transition check.
140
141 2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>
142
143         * elf32-arm.c (enum elf32_arm_stub_type): New max_stub_type
144         enumerator.
145         (arm_stub_sym_claimed): New function.
146         (elf32_arm_create_stub): Use veneered symbol name and section if
147         veneer needs to claim its symbol, and keep logic unchanged otherwise.
148         (arm_stub_claim_sym): New function.
149         (arm_map_one_stub): Call arm_stub_claim_sym if veneer needs to claim
150         veneered symbol, otherwise create local symbol as before.
151
152 2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>
153
154         * elf32-arm.c (elf32_arm_size_stubs): Use new macros
155         ARM_GET_SYM_BRANCH_TYPE and ARM_SET_SYM_BRANCH_TYPE to respectively get
156         and set branch type of a symbol.
157         (bfd_elf32_arm_process_before_allocation): Likewise.
158         (elf32_arm_relocate_section): Likewise and fix identation along the
159         way.
160         (allocate_dynrelocs_for_symbol): Likewise.
161         (elf32_arm_finish_dynamic_symbol): Likewise.
162         (elf32_arm_swap_symbol_in): Likewise.
163         (elf32_arm_swap_symbol_out): Likewise.
164
165 2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>
166
167         * bfd-in.h (elf32_arm_size_stubs): Add an output section parameter.
168         * bfd-in2.h: Regenerated.
169         * elf32-arm.c (struct elf32_arm_link_hash_table): Add an output section
170         parameter to add_stub_section callback.
171         (elf32_arm_create_or_find_stub_sec): Get output section from link_sec
172         and pass it down to add_stub_section.
173         (elf32_arm_add_stub): Set section to stub_sec if NULL before using it
174         for error message.
175         (elf32_arm_size_stubs): Add output section parameter to
176         add_stub_section function pointer parameter.
177
178 2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>
179
180         * elf32-arm.c (elf32_arm_create_stub): New function.
181         (elf32_arm_size_stubs): Use elf32_arm_create_stub for stub creation.
182
183 2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>
184
185         * elf32-arm.c (enum elf32_arm_stub_type): Delete
186         arm_stub_a8_veneer_lwm enumerator.
187         (arm_stub_a8_veneer_lwm): New unsigned constant to replace
188         aforementioned enumerator.
189         (struct elf32_arm_stub_hash_entry): Delete target_addend
190         field and add source_value.
191         (struct a8_erratum_fix): Delete addend field and add target_offset.
192         (stub_hash_newfunc): Initialize source_value field amd remove
193         initialization for target_addend.
194         (arm_build_one_stub): Stop special casing Thumb relocations: promote
195         the else to being always executed, moving the
196         arm_stub_a8_veneer_b_cond specific code in it.  Remove
197         stub_entry->target_addend from points_to computation.
198         (cortex_a8_erratum_scan): Store in a8_erratum_fix structure the offset
199         to target symbol from start of section rather than the offset from the
200         stub address.
201         (elf32_arm_size_stubs): Set stub_entry's source_value and target_value
202         fields from struct a8_erratum_fix's offset and target_offset
203         respectively.
204         (make_branch_to_a8_stub): Rename target variable to loc.  Compute
205         veneered_insn_loc and loc using stub_entry's source_value.
206
207 2016-05-10  Thomas Preud'homme  <thomas.preudhomme@arm.com>
208
209         (elf32_arm_merge_eabi_attributes): Add merging logic for
210         Tag_DSP_extension.
211
212 2016-05-10  Pip Cet  <pipcet@gmail.com>
213
214         PR ld/20059
215         * elfxx-target.h (bfd_elfNN_bfd_copy_link_hash_symbol_type):
216         Define as _bfd_generic_copy_link_hash_symbol_type when using
217         generic hash table.
218
219 2016-05-09  Nick Clifton  <nickc@redhat.com>
220
221         PR binutils/20063
222         * elf.c (bfd_elf_get_elf_syms): Check for out of range sh_link
223         field before accessing sections array.
224
225 2016-05-09  Christophe Monat  <christophe.monat@st.com>
226
227         PR ld/20030
228         * elf32-arm.c (is_thumb2_vldm): Account for T1 (DP) encoding.
229         (stm32l4xx_need_create_replacing_stub): Rename ambiguous nb_regs
230         to nb_words.
231         (create_instruction_vldmia): Add is_dp to disambiguate SP/DP
232         encoding.
233         (create_instruction_vldmdb): Likewise.
234         (stm32l4xx_create_replacing_stub_vldm): is_dp detects DP encoding,
235         uses it to re-encode.
236
237 2016-05-09  Nick Clifton  <nickc@redhat.com>
238
239         PR 19938
240         * elf32-arm.c (elf32_arm_adjust_dynamic_symbol): Revert accidental
241         commit.
242
243 2016-05-09  Alan Modra  <amodra@gmail.com>
244
245         * elf64-ppc.c (ppc64_elf_init_stub_bfd): Remove redundant NULL check.
246
247 2016-05-06  H.J. Lu  <hongjiu.lu@intel.com>
248
249         PR ld/17550
250         * elf-bfd.h (elf_link_hash_entry): Update comments for indx,
251         documenting that indx == -3 if symbol is defined in a discarded
252         section.
253         * elflink.c (elf_link_add_object_symbols): Set indx to -3 if
254         symbol is defined in a discarded section.
255         (elf_link_output_extsym): Strip a global symbol defined in a
256         discarded section.
257
258 2016-05-06  H.J. Lu  <hongjiu.lu@intel.com>
259
260         * elf32-i386.c (elf_backend_add_symbol_hook): Defined for Intel
261         MCU.
262
263 2016-05-05  H.J. Lu  <hongjiu.lu@intel.com>
264
265         * elf32-i386.c (elf_i386_convert_load): Extract the GOT load
266         conversion to ...
267         (elf_i386_convert_load_reloc): This.  New function.
268         * elf64-x86-64.c (elf_x86_64_convert_load): Extract the GOT load
269         conversion to ...
270         (elf_x86_64_convert_load_reloc): This.  New function.
271
272 2016-05-05  H.J. Lu  <hongjiu.lu@intel.com>
273
274         * elf32-i386.c (elf_i386_check_tls_transition): Remove abfd.
275         Don't check if contents == NULL.
276         (elf_i386_tls_transition): Add from_relocate_section.  Check
277         from_relocate_section instead of contents != NULL.  Update
278         elf_i386_check_tls_transition call.
279         (elf_i386_check_relocs): Cache the section contents if
280         keep_memory is FALSE.  Pass FALSE as from_relocate_section to
281         elf_i386_tls_transition.
282         (elf_i386_relocate_section): Pass TRUE as from_relocate_section
283         to elf_i386_tls_transition.
284         (elf_backend_caches_rawsize): New.
285         * elf64-x86-64.c (elf_x86_64_check_tls_transition): Don't check
286         if contents == NULL.
287         (elf_x86_64_tls_transition): Add from_relocate_section.  Check
288         from_relocate_section instead of contents != NULL.
289         (elf_x86_64_check_relocs): Cache the section contents if
290         keep_memory is FALSE.  Pass FALSE as from_relocate_section to
291         elf_x86_64_tls_transition.
292         (elf_x86_64_relocate_section): Pass TRUE as from_relocate_section
293         to elf_x86_64_tls_transition.
294         (elf_backend_caches_rawsize): New.
295
296 2016-05-03  Maciej W. Rozycki  <macro@imgtec.com>
297
298         PR 10549
299         * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Handle
300         STB_GNU_UNIQUE.
301
302 2016-05-03  Jiong Wang  <jiong.wang@arm.com>
303
304         * bfd-in.h (bfd_elf64_aarch64_set_options): Update prototype.
305         * bfd-in2.h (bfd_elf64_aarch64_set_options): Likewise.
306         * elfnn-aarch64.c (bfd_elfNN_aarch64_set_options): Initialize
307         no_apply_dynamic_relocs.
308         (elfNN_aarch64_final_link_relocate): Apply absolute relocations even though
309         dynamic relocations generated.
310
311 2016-04-29  H.J. Lu  <hongjiu.lu@intel.com>
312
313         * elf32-i386.c (elf_i386_size_dynamic_sections): Move interp
314         setting to ...
315         (elf_i386_create_dynamic_sections): Here.
316         * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Move
317         interp setting to ...
318         (elf_x86_64_create_dynamic_sections): Here.
319
320 2016-04-29  H.J. Lu  <hongjiu.lu@intel.com>
321
322         * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Take GOT_RELOC
323         and replace (EH)->has_got_reloc with GOT_RELOC.
324         (elf_i386_fixup_symbol): Pass has_got_reloc to
325         UNDEFINED_WEAK_RESOLVED_TO_ZERO.
326         (elf_i386_allocate_dynrelocs): Likewise.
327         (elf_i386_relocate_section): Likewise.
328         (elf_i386_finish_dynamic_symbol): Likewise.
329         (elf_i386_convert_load): Pass TRUE to
330         UNDEFINED_WEAK_RESOLVED_TO_ZERO.
331         * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Take
332         GOT_RELOC and replace (EH)->has_got_reloc with GOT_RELOC.
333         (elf_x86_64_fixup_symbol): Pass has_got_reloc to
334         UNDEFINED_WEAK_RESOLVED_TO_ZERO.
335         (elf_x86_64_allocate_dynrelocs): Likewise.
336         (elf_x86_64_relocate_section): Likewise.
337         (elf_x86_64_finish_dynamic_symbol): Likewise.
338         (elf_x86_64_convert_load): Pass TRUE to
339         UNDEFINED_WEAK_RESOLVED_TO_ZERO.
340
341 2016-04-29  H.J. Lu  <hongjiu.lu@intel.com>
342
343         * elf32-i386.c (check_relocs_failed): New.
344         (elf_i386_check_relocs): Set check_relocs_failed on error.
345         (elf_i386_relocate_section): Skip if check_relocs failed.
346
347 2016-04-29  H.J. Lu  <hongjiu.lu@intel.com>
348
349         * elf64-x86-64.c (elf_x86_64_check_relocs): Set
350         check_relocs_failed on error.
351
352 2016-04-29  Nick Clifton  <nickc@redhat.com>
353
354         PR 19938
355         * elf-bfd.h (struct elf_backend_data): Rename
356         elf_backend_set_special_section_info_and_link to
357         elf_backend_copy_special_section_fields.
358         * elfxx-target.h: Likewise.
359         * elf.c (section_match): Ignore the SHF_INFO_LINK flag when
360         comparing section flags.
361         (copy_special_section_fields): New function.
362         (_bfd_elf_copy_private_bfd_data): Copy the EI_ABIVERSION field.
363         Perform two scans over special sections.  The first one looks for
364         a direct mapping between the output section and an input section.
365         The second scan looks for a possible match based upon section
366         characteristics.
367         * elf32-arm.c (elf32_arm_copy_special_section_fields): New
368         function.  Handle setting the sh_link field of SHT_ARM_EXIDX
369         sections.
370         * elf32-i386.c (elf32_i386_set_special_info_link): Rename to
371         elf32_i386_copy_solaris_special_section_fields.
372         * elf32-sparc.c (elf32_sparc_set_special_section_info_link):
373         Rename to elf32_sparc_copy_solaris_special_section_fields.
374         * elf64-x86-64.c (elf64_x86_64_set_special_info_link): Rename to
375         elf64_x86_64_copy_solaris_special_section_fields.
376
377 2016-04-28  Nick Clifton  <nickc@redhat.com>
378
379         * po/zh_CN.po: Updated Chinese (simplified) translation.
380
381 2016-04-27  H.J. Lu  <hongjiu.lu@intel.com>
382
383         PR ld/20006
384         * elf64-x86-64.c (elf_x86_64_convert_load): Skip debug sections
385         when estimating distances between output sections.
386
387 2016-04-27  Alan Modra  <amodra@gmail.com>
388
389         * elflink.c (_bfd_elf_is_start_stop): New function.
390         (_bfd_elf_gc_mark_rsec): Use it.
391         * elf-bfd.h (_bfd_elf_is_start_stop): Declare.
392
393 2016-04-26  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
394
395         * elf32-rx.c (rx_set_section_contents): Avoid arithmetic on void *.
396         * mmo.c (mmo_get_section_contents): Likewise.
397         (mmo_set_section_contents): Likewise.
398
399 2016-04-26  H.J. Lu  <hongjiu.lu@intel.com>
400
401         * elf-bfd.h (elf_link_hash_table): Update comments for
402         dynsymcount.
403         * elflink.c (_bfd_elf_link_renumber_dynsyms): Always count for
404         the unused NULL entry at the head of dynamic symbol table.
405         (bfd_elf_size_dynsym_hash_dynstr): Remove dynsymcount != 0
406         checks.
407
408 2016-04-21  H.J. Lu  <hongjiu.lu@intel.com>
409
410         * elflink.c (_bfd_elf_link_create_dynstrtab): Exclude linker
411         created file from dynobj.
412
413 2016-04-21  H.J. Lu  <hongjiu.lu@intel.com>
414
415         * elflink.c (_bfd_elf_link_create_dynstrtab): Set dynobj to a
416         normal input file if possible.
417
418 2016-04-21  Nick Clifton  <nickc@redhat.com>
419
420         * aout-adobe.c: Use _bfd_generic_link_check_relocs.
421         * aout-target.h: Likewise.
422         * aout-tic30.c: Likewise.
423         * binary.c: Likewise.
424         * bout.c: Likewise.
425         * coff-alpha.c: Likewise.
426         * coff-rs6000.c: Likewise.
427         * coff64-rs6000.c: Likewise.
428         * coffcode.h: Likewise.
429         * i386msdos.c: Likewise.
430         * i386os9k.c: Likewise.
431         * ieee.c: Likewise.
432         * ihex.c: Likewise.
433         * libbfd-in.h: Likewise.
434         * libecoff.h: Likewise.
435         * mach-o-target.c: Likewise.
436         * mmo.c: Likewise.
437         * nlm-target.h: Likewise.
438         * oasys.c: Likewise.
439         * pef.c: Likewise.
440         * plugin.c: Likewise.
441         * ppcboot.c: Likewise.
442         * som.c: Likewise.
443         * srec.c: Likewise.
444         * tekhex.c: Likewise.
445         * versados.c: Likewise.
446         * vms-alpha.c: Likewise.
447         * xsym.c: Likewise.
448         * elfxx-target.h: Use _bfd_elf_link_check_relocs.
449         * linker.c (bfd_link_check_relocs): New function.
450         (_bfd_generic_link_check_relocs): New function.
451         * targets.c (BFD_JUMP_TABLE_LINK): Add initialization of
452         _bfd_link_check_relocs field.
453         (struct bfd_target)L Add _bfd_link_check_relocs field.
454         * bfd-in2.h: Regenerate.
455         * libbfd.h: Regenerate.
456
457 2016-04-20  H.J. Lu  <hongjiu.lu@intel.com>
458
459         * elf32-i386.c (elf_i386_gc_sweep_hook): Removed.
460         (elf_backend_gc_sweep_hook): Likewise.
461         * elf64-x86-64.c (elf_x86_64_gc_sweep_hook): Likewise.
462         (elf_backend_gc_sweep_hook): Likewise.
463
464 2016-04-20  H.J. Lu  <hongjiu.lu@intel.com>
465
466         * elflink.c (_bfd_elf_link_check_relocs): Don't check relocations
467         in excluded sections
468
469 2016-04-20  H.J. Lu  <hongjiu.lu@intel.com>
470
471         PR ld/19969
472         * elf64-x86-64.c (check_relocs_failed): New.
473         (elf_x86_64_need_pic): Moved before elf_x86_64_check_relocs.
474         Support relocation agaist local symbol.  Set check_relocs_failed.
475         (elf_x86_64_check_relocs): Use elf_x86_64_need_pic.  Check
476         R_X86_64_32 relocation overflow.
477         (elf_x86_64_relocate_section): Skip if check_relocs failed.
478         Update one elf_x86_64_need_pic and remove one elf_x86_64_need_pic.
479
480 2016-04-20  H.J. Lu  <hongjiu.lu@intel.com>
481
482         * elf32-i386.c (elf_i386_check_relocs): Call
483         _bfd_elf_create_ifunc_sections only for STT_GNU_IFUNC symbol.
484         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
485
486 2016-04-20  H.J. Lu  <hongjiu.lu@intel.com>
487
488         * elf-bfd.h (_bfd_elf_link_check_relocs): New.
489         * elflink.c (_bfd_elf_link_check_relocs): New function.
490         (elf_link_add_object_symbols): Call _bfd_elf_link_check_relocs
491         if check_relocs_after_open_input is FALSE.
492
493 2016-04-20  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
494
495         * cache.c: Update old style function definitions.
496         * elf32-m68k.c: Likewise.
497         * elf64-mmix.c: Likewise.
498         * stab-syms.c: Likewise.
499
500 2016-04-20  Trevor Saunders  <tbsaunde+binutils@tbsaunde.org>
501
502         * elf32-arm.c (put_thumb2_insn): Change argument type to bfd_byte *.
503
504 2016-04-15  H.J. Lu  <hongjiu.lu@intel.com>
505
506         * Makefile.in: Regenerated with automake 1.11.6.
507         * aclocal.m4: Likewise.
508         * doc/Makefile.in: Likewise.
509
510 2016-04-14  Andrew Burgess  <andrew.burgess@embecosm.com>
511
512         * reloc.c: Add BFD_RELOC_ARC_NPS_CMEM16 entry.
513         * bfd-in2.h: Regenerate.
514         * libbfd.h: Regenerate.
515         * elf32-arc.c: Add 'opcode/arc.h' include.
516         (struct arc_relocation_data): Add symbol_name.
517         (arc_special_overflow_checks): New function.
518         (arc_do_relocation): Use arc_special_overflow_checks, reindent as
519         required, add an extra comment.
520         (elf_arc_relocate_section): Setup symbol_name in reloc_data.
521
522 2016-04-14  Andrew Burgess  <andrew.burgess@embecosm.com>
523
524         * elf32-arc.c (tls_got_entries): Add 'TLS_GOT_' prefix to all
525         entries.
526         (elf_arc_relocate_section): Update enum uses.
527         (elf_arc_check_relocs): Likewise.
528         (elf_arc_finish_dynamic_symbol): Likewise.
529
530 2016-04-14  H.J. Lu  <hongjiu.lu@intel.com>
531
532         * elf.c (_bfd_elf_copy_private_bfd_data): Replace "link" with
533         "sh_link".
534
535 2016-04-14  Nick Clifton  <nickc@redhat.com>
536
537         PR target/19938
538         * elf-bbfd.h (struct elf_backend_data): New field:
539         elf_strtab_flags.
540         New field: elf_backend_set_special_section_info_and_link
541         * elfxx-target.h (elf_backend_strtab_flags): Define if not already
542         defined.
543         (elf_backend_set_special_section_info_and_link): Define if not
544         already defined.
545         (elfNN_bed): Use elf_backend_set_special_section_info_and_link and
546         elf_backend_strtab_flags macros to initialise fields in structure.
547         * elf.c (_bfd_elf_make_section_from_shdr): Check for SHF_STRINGS
548         being set even if SHF_MERGE is not set.
549         (elf_fake_sections): Likewise.
550         (section_match): New function.  Matches two ELF sections based
551         upon fixed characteristics.
552         (find_link): New function.  Locates a section in a BFD that
553         matches a section in a different BFD.
554         (_bfd_elf_copy_private_bfd_data): Copy the sh_info and sh_link
555         fields of reserved sections.
556         (bfd_elf_compute_section_file_positions): Set the flags for the
557         .shstrtab section based upon the elf_strtab_flags field in the
558         elf_backend_data structure.
559         (swap_out_syms): Likewise for the .strtab section.
560         * elflink.c (bfd_elf_final_link): Set the flags for the
561         .strtab section based upon the elf_strtab_flags field in the
562         elf_backend_data structure.
563         * elf32-i386.c (elf32_i386_set_special_info_link): New function.
564         (elf_backend_strtab_flags): Set to SHF_STRINGS for Solaris
565         targets.
566         (elf_backend_set_special_section_info_and_link): Define for
567         Solaris targets.
568         * elf32-sparc.c: Likewise.
569         * elf64-x86-64.c: Likewise.
570
571 2016-04-11  H.J. Lu  <hongjiu.lu@intel.com>
572
573         PR ld/19939
574         * elf-bfd.h (_bfd_elf_allocate_ifunc_dyn_relocs): Add a pointer
575         to bfd_boolean.
576         * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
577         Set *readonly_dynrelocs_against_ifunc_p to TRUE if dynamic reloc
578         applies to read-only section.
579         * elf32-i386.c (elf_i386_link_hash_table): Add
580         readonly_dynrelocs_against_ifunc.
581         (elf_i386_allocate_dynrelocs): Updated.
582         (elf_i386_size_dynamic_sections): Issue an error for read-only
583         segment with dynamic IFUNC relocations only if
584         readonly_dynrelocs_against_ifunc is TRUE.
585         * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
586         readonly_dynrelocs_against_ifunc.
587         (elf_x86_64_allocate_dynrelocs): Updated.
588         (elf_x86_64_size_dynamic_sections): Issue an error for read-only
589         segment with dynamic IFUNC relocations only if
590         readonly_dynrelocs_against_ifunc is TRUE.
591         * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
592         Updated.
593
594 2016-04-06  Thomas Preud'homme  <thomas.preudhomme@arm.com>
595
596         * elf32-arm.c (elf32_arm_size_stubs): Move error_ret_free_local to be
597         a fall through from error_ret_free_internal.  Free local_syms in
598         error_ret_free_local if allocated from bfd_elf_get_elf_syms ().
599
600 2016-04-05  Cupertino Miranda  <cmiranda@synopsys.com>
601
602         * elf32-arc.c (plt_do_relocs_for_symbol): Changed.
603         (relocate_plt_for_entry): Likewise.
604
605 2016-04-05  Cupertino Miranda  <cmiranda@synopsys.com>
606
607         * elf32-arc.c (elf_arc_check_relocs): Changed
608
609 2016-04-05  Cupertino Miranda  <cmiranda@synopsys.com>
610
611         * elf32-arc.c (name_for_global_symbol): Changed assert.
612         (get_replace_function): Created.:
613         (struct arc_relocation_data): Changed to signed types.
614         (defines S, L, P, PDATA): Casted to signed type.
615         (defines SECTSTART, _SDA_BASE_, TLS_REL): Likewise.
616         (PRINT_DEBUG_RELOC_INFO_BEFORE): Changed.
617         (arc_do_relocation): Changed.
618
619 2016-04-05  Cupertino Miranda  <cmiranda@synopsys.com>
620
621         * elf32-arc.c (name_for_global_symbol): Added assert to check for
622         symbol index.
623         (elf_arc_relocate_section): Added and changed asserts, validating
624         the synamic symbol index.
625         (elf_arc_finish_dynamic_symbol): Do not fill the dynamic
626         relocation if symbol has dynindx set to -1.
627
628 2016-04-05  Maciej W. Rozycki  <macro@imgtec.com>
629
630         * elflink.c (elf_link_add_object_symbols): Always turn hidden
631         and internal symbols which have a dynamic index into local
632         ones.
633
634 2016-04-04  Nick Clifton  <nickc@redhat.com>
635
636         PR 19872
637         * dwarf2.c (parse_comp_unit): Skip warning about unrecognised
638         version number if the version is zero.
639
640 2016-04-01  Alan Modra  <amodra@gmail.com>
641
642         PR 19886
643         * elflink.c (on_needed_list): Recursively check needed status.
644         (elf_link_add_object_symbols): Adjust.
645
646 2016-03-30  Senthil Kumar Selvaraj  <senthil_kumar.selvaraj@atmel.com>
647
648         * elf32-avr.c (avr_elf32_load_records_from_section): Free
649         internal_relocs only if they aren't cached.
650
651 2016-03-29  Nick Clifton  <nickc@redhat.com>
652
653         PR 17334
654         * elf32-bfin.c (elf32_bfinfdpic_finish_dynamic_sections): Relax
655         assertion on the size of the got section to allow it to be bigger
656         than the number of relocs.
657
658 2016-03-29  Toni Spets  <toni.spets@iki.fi>
659
660         PR 19878
661         * coffcode.h (coff_write_object_contents): Revert accidental
662         2014-11-10 change.
663
664 2016-03-22  Alan Modra  <amodra@gmail.com>
665
666         PR 19850
667         * dwarf2.c (read_attribute_value): Skip info_ptr check for
668         DW_FORM_flag_present.
669
670 2016-03-22  Nick Clifton  <nickc@redhat.com>
671
672         * cpu-v850_rh850.c (arch_info_struct): Restore v850-rh850 as an
673         architecture name for backwards compatibility.
674
675         * peXXigen.c (_bfd_XXi_write_codeview_record): Fix possible
676         unbounded stack use.
677
678         * warning.m4 (GCC_WARN_CFLAGS): Only add -Wstack-usage if using a
679         sufficiently recent version of GCC.
680         * configure: Regenerate.
681
682 2016-03-22  Alan Modra  <amodra@gmail.com>
683
684         PR 19851
685         * plugin.c (try_load_plugin): Avoid -Wstack-usage warning.
686
687 2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
688
689         * archures.c (bfd_mach_arc_nps400): Define.
690         * bfd-in2.h: Regenerate.
691         * cpu-arc.c (arch_info_struct): New entry for nps400, renumber
692         some existing entries to make space.
693         * elf32-arc.c (arc_elf_object_p): Add nps400 case.
694         (arc_elf_final_write_processing): Likewise.
695
696 2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
697
698         * elf32-arc.c (arc_elf_print_private_bfd_data): Remove use of
699         EF_ARC_CPU_GENERIC.
700         (arc_elf_final_write_processing): Don't bother setting cpu field
701         in e_flags, this will have been set elsewhere.
702
703 2016-03-21  Andrew Burgess  <andrew.burgess@embecosm.com>
704
705         * elf32-arc.c (arc_elf_final_write_processing): Switch to using
706         EF_ARC_MACH_MSK.
707
708 2016-03-21  Nick Clifton  <nickc@redhat.com>
709
710         * warning.m4 (GCC_WARN_CFLAGS): Add -Wstack-usage=262144
711         * configure: Regenerate.
712         * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Replace use of
713         alloca with call to xmalloc.
714         * elf32-nds32.c: Likewise.
715         * elf64-hppa.c: Likewise.
716         * elfxx-mips.c: Likewise.
717         * pef.c: Likewise.
718         * pei-x86_64.c: Likewise.
719         * som.c: Likewise.
720         * xsym.c: Likewise.
721
722 2016-03-15  H.J. Lu  <hongjiu.lu@intel.com>
723
724         PR ld/19827
725         * elf32-i386.c (elf_i386_check_relocs): Bind defined symbol
726         locally in PIE.
727         (elf_i386_relocate_section): Likewise.
728         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
729         (elf_x86_64_relocate_section): Likewise.
730
731 2016-03-15  H.J. Lu  <hongjiu.lu@intel.com>
732
733         PR ld/19807
734         * elf64-x86-64.c (elf_x86_64_relocate_section): Check
735         no_reloc_overflow_check to diable R_X86_64_32/R_X86_64_32S
736         relocation overflow check.
737
738 2016-03-14  H.J. Lu  <hongjiu.lu@intel.com>
739
740         * bfd-in2.h: Regenerated.
741
742 2016-03-11  Dan Gissel  <dgisselq@ieee.org>
743
744         PR 19713
745         * elf.c (_bfd_elf_section_offset): Ensure that the returned offset
746         uses bytes not octets.
747         * elflink.c (resolve_section): Likewise.
748         Add a bfd parameter.
749         (eval_section): Pass the input_bfd to resolve_section.
750         (bfd_elf_perform_complex_relocation): Convert byte offset to
751         octets before read and writing values.
752         (elf_link_input_bfd): Add byte to octet conversions.
753         (elf_reloc_link_order): Likewise.
754         (elf_fixup_link_order): Likewise.
755         (bfd_elf_final_link): Likewise.
756         * reloc.c (_bfd_final_link_relocate): Likewise.
757         * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
758
759 2016-03-10  Nick Clifton  <nickc@redhat.com>
760
761         * config.bfd: Mark the i370 target as obsolete.
762
763 2016-03-09  Pedro Alves  <palves@redhat.com>
764
765         * cpu-v850.c (N): Append ":old-gcc-abi" instead of " (using old
766         gcc ABI)" to printable name.
767         * cpu-v850_rh850.c (bfd_v850_rh850_arch): Use "v850:rh850" instead
768         of "v850-rh850" as printable name.
769
770 2016-03-09  Leon Winter  <winter-gcc@bfw-online.de>
771
772         PR ld/19623
773         * cofflink.c (_bfd_coff_generic_relocate_section): Do not apply
774         relocations against absolute symbols.
775
776 2016-03-09  Alan Modra  <amodra@gmail.com>
777
778         PR binutils/19775
779         * coff-alpha.c (alpha_ecoff_openr_next_archived_file): Allow zero
780         length elements in the archive.
781
782 2016-03-08  H.J. Lu  <hongjiu.lu@intel.com>
783
784         PR ld/19789
785         * elflink.c (elf_link_add_object_symbols): Create dynamic sections
786         for -E/--dynamic-list only when not relocatable.
787
788 2016-03-08  H.J. Lu  <hongjiu.lu@intel.com>
789
790         PR ld/19784
791         * elf32-i386.c (elf_i386_check_relocs): Increment PLT reference
792         count for locally defined local IFUNC symbols in shared object.
793         * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
794
795 2016-03-08  H.J. Lu  <hongjiu.lu@intel.com>
796
797         PR ld/19579
798         * elflink.c (_bfd_elf_merge_symbol): Group common symbol checking
799         together.
800
801 2016-03-08  Cupertino Miranda  <Cupertino.Miranda@synopsys.com>
802             Andrew Burgess  <andrew.burgess@embecosm.com>
803
804         * elf32-arc.c (arc_bfd_get_32): Becomes an alias for bfd_get_32.
805         (arc_bfd_put_32): Becomes an alias for bfd_put_32.
806         (arc_elf_howto_init): Added assert to validate relocations.
807         (get_middle_endian_relocation): Delete.
808         (middle_endian_convert): New function.
809         (ME): Redefine, now does nothing.
810         (IS_ME): New define.
811         (arc_do_relocation): Extend the attached 'ARC_RELOC_HOWTO'
812         definition to call middle_endian_convert.  Add a new local
813         variable and make use of this throughout. Added call to
814         arc_bfd_get_8 and arc_bfd_put_8 for 8 bit relocations.
815
816 2016-03-07  Nick Clifton  <nickc@redhat.com>
817
818         PR binutils/19775
819         * archive.c (bfd_generic_openr_next_archived_file): Allow zero
820         length elements in the archive.
821
822 2016-03-07  Jiong Wang  <jiong.wang@arm.com>
823
824         * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Always create .got
825         section if the symbol "_GLOBAL_OFFSET_TABLE_" is referenced.
826
827 2016-03-04  H.J. Lu  <hongjiu.lu@intel.com>
828
829         PR ld/19579
830         * elflink.c (_bfd_elf_merge_symbol): Treat common symbol in
831         executable as definition if the new definition comes from a
832         shared library.
833
834 2016-03-02  Alan Modra  <amodra@gmail.com>
835
836         * Makefile.in: Regenerate.
837         * po/SRC-POTFILES.in: Regenerate.
838
839 2016-02-29  Cupertino Miranda  <cmiranda@synopsys.com>
840
841         * elf32-arc.c (elf_arc_relocate_section): Added rules to fix the
842         relocation addend when sections get merged.
843
844 2016-02-29  Cupertino Miranda <Cupertino.Miranda@synopsys.com>
845
846         * elf32-arc.c (arc_elf_final_write_processing): Add condition to
847         the flag change.
848         (elf_arc_relocate_section): Fixes and conditions to support PIE.
849         Assert for code sections dynamic relocs.
850
851 2016-02-26  Renlin Li  <renlin.li@arm.com>
852
853         * elfnn-aarch64.c (elfNN_aarch64_howto_table): Fix signed overflow
854         check for MOVW_SABS_G0, MOVW_SABS_G1, MOVW_SABS_G2.
855
856 2016-02-26  H.J. Lu  <hongjiu.lu@intel.com>
857
858         PR ld/19609
859         * elf32-i386.c (elf_i386_convert_load): Convert to R_386_32 for
860         load with locally bound symbols if PIC is false or there is no
861         base register.  Optimize branch to 0 if PIC is false.
862         (elf_i386_relocate_section): Don't generate dynamic relocations
863         against undefined weak symbols if PIC is false.
864         * elf64-x86-64.c (elf_x86_64_convert_load): Disable optimization
865         if we can't estimate relocation overflow with --no-relax.
866         Convert to R_X86_64_32S/R_X86_64_32 for load with locally bound
867         symbols if PIC is false.  Optimize branch to 0 if PIC is false.
868         (elf_x86_64_relocate_section): Don't generate dynamic relocations
869         against undefined weak symbols if PIC is false.
870
871 2016-02-26  H.J. Lu  <hongjiu.lu@intel.com>
872
873         PR ld/19645
874         * bfd.c (bfd): Change flags to 20 bits.
875         (BFD_CONVERT_ELF_COMMON): New.
876         (BFD_USE_ELF_STT_COMMON): Likewise.
877         (BFD_FLAGS_SAVED): Add BFD_CONVERT_ELF_COMMON and
878         BFD_USE_ELF_STT_COMMON.
879         (BFD_FLAGS_FOR_BFD_USE_MASK): Likewise.
880         * configure.ac: Remove --enable-elf-stt-common.
881         * elf.c (swap_out_syms): Choose STT_COMMON or STT_OBJECT for
882         common symbol depending on BFD_CONVERT_ELF_COMMON and
883         BFD_USE_ELF_STT_COMMON.
884         * elfcode.h (elf_slurp_symbol_table): Set BSF_ELF_COMMON for
885         STT_COMMON.
886         * elflink.c (bfd_elf_link_mark_dynamic_symbol): Also check
887         STT_COMMON.
888         (elf_link_convert_common_type): New function.
889         (elf_link_output_extsym): Choose STT_COMMON or STT_OBJECT for
890         common symbol depending on BFD_CONVERT_ELF_COMMON and
891         BFD_USE_ELF_STT_COMMON.  Set sym.st_info after sym.st_shndx.
892         * elfxx-target.h (TARGET_BIG_SYM): Add BFD_CONVERT_ELF_COMMON
893         and BFD_USE_ELF_STT_COMMON to object_flags.
894         (TARGET_LITTLE_SYM): Likewise.
895         * syms.c (BSF_KEEP_G): Renamed to ...
896         (BSF_ELF_COMMON): This.
897         * bfd-in2.h: Regenerated.
898         * config.in: Likewise.
899         * configure: Likewise.
900
901 2016-02-26  H.J. Lu  <hongjiu.lu@intel.com>
902
903         PR ld/19636
904         PR ld/19704
905         PR ld/19719
906         * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
907         (elf_i386_link_hash_entry): Add has_got_reloc and
908         has_non_got_reloc.
909         (elf_i386_link_hash_table): Add interp.
910         (elf_i386_link_hash_newfunc): Initialize has_got_reloc and
911         has_non_got_reloc.
912         (elf_i386_copy_indirect_symbol): Copy has_got_reloc and
913         has_non_got_reloc.
914         (elf_i386_check_relocs): Set has_got_reloc and has_non_got_reloc.
915         (elf_i386_fixup_symbol): New function.
916         (elf_i386_pie_finish_undefweak_symbol): Likewise.
917         (elf_i386_allocate_dynrelocs): Don't allocate space for dynamic
918         relocations and discard relocations against resolved undefined
919         weak symbols in executable.  Don't make resolved undefined weak
920         symbols in executable dynamic.  Keep dynamic non-GOT/non-PLT
921         relocation against undefined weak symbols in PIE.
922         (elf_i386_size_dynamic_sections): Set interp to .interp section.
923         (elf_i386_relocate_section): Don't generate dynamic relocations
924         against resolved undefined weak symbols in PIE, except for
925         R_386_PC32.
926         (elf_i386_finish_dynamic_symbol): Keep PLT/GOT entries without
927         dynamic PLT/GOT relocations for resolved undefined weak symbols.
928         Don't generate dynamic relocation against resolved undefined weak
929         symbol in executable.
930         (elf_i386_finish_dynamic_sections): Call
931         elf_i386_pie_finish_undefweak_symbol on all symbols in PIE.
932         (elf_backend_fixup_symbol): New.
933         * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
934         (elf_x86_64_link_hash_entry): Add has_got_reloc and
935         has_non_got_reloc.
936         (elf_x86_64_link_hash_table): Add interp.
937         (elf_x86_64_link_hash_newfunc): Initialize has_got_reloc and
938         has_non_got_reloc.
939         (elf_x86_64_copy_indirect_symbol): Copy has_got_reloc and
940         has_non_got_reloc.
941         (elf_x86_64_check_relocs): Set has_got_reloc and
942         has_non_got_reloc.
943         (elf_x86_64_fixup_symbol): New function.
944         (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
945         (elf_x86_64_allocate_dynrelocs): Don't allocate space for dynamic
946         relocations and discard relocations against resolved undefined
947         weak symbols in executable.  Don't make resolved undefined weak
948         symbols in executable dynamic.
949         (elf_x86_64_size_dynamic_sections): Set interp to .interp section.
950         (elf_x86_64_relocate_section): Check relocation overflow for
951         dynamic relocations against unresolved weak undefined symbols.
952         Don't generate dynamic relocations against resolved weak
953         undefined symbols in PIE.
954         (elf_x86_64_finish_dynamic_symbol): Keep PLT/GOT entries without
955         dynamic PLT/GOT relocations for resolved undefined weak symbols.
956         Don't generate dynamic relocation against resolved undefined weak
957         symbol in executable.
958         (elf_x86_64_finish_dynamic_sections): Call
959         elf_x86_64_pie_finish_undefweak_symbol on all symbols in PIE.
960         (elf_backend_fixup_symbol): New.
961
962 2016-02-26  Alan Modra  <amodra@gmail.com>
963
964         * elf64-ppc.c (create_linkage_sections): Create sfpr when
965         save_restore_funcs, rest of sections when not relocatable.
966         (ppc64_elf_init_stub_bfd): Always call create_linkage_sections.
967         (sfpr_define): Define all symbols on emitted code.
968         (ppc64_elf_func_desc_adjust): Adjust for sfpr now being created
969         when relocatable.  Move sfpr_define loop earlier.
970
971 2016-02-24  H.J. Lu  <hongjiu.lu@intel.com>
972
973         * elf64-x86-64.c (elf_x86_64_need_pic): New function.
974         (elf_x86_64_relocate_section): Use it.  Replace
975         x86_64_elf_howto_table[r_type] with howto.
976
977 2016-02-24  H.J. Lu  <hongjiu.lu@intel.com>
978
979         PR ld/19698
980         * elflink.c (bfd_elf_record_link_assignment): Set versioned if
981         symbol version is unknown.
982
983 2016-02-24  H.J. Lu  <hongjiu.lu@intel.com>
984
985         * elf32-i386.c (elf_i386_allocate_dynrelocs): Set plt_got.offset
986         to (bfd_vma) -1 when setting needs_plt to 0.
987         * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
988
989 2016-02-23  H.J. Lu  <hongjiu.lu@intel.com>
990
991         * elflink.c (bfd_elf_record_link_assignment): Check for shared
992         library, instead of PIC, and don't check PDE when making linker
993         assigned symbol dynamic.
994
995 2016-02-23  Faraz Shahbazker  <faraz.shahbazker@imgtec.com>
996
997         * bfd/elfxx-mips.c (_bfd_mips_post_process_headers): Increment
998         ABIVERSION for non-executable stack.
999
1000 2016-02-23  Rich Felker  <bugdal@aerifal.cx>
1001
1002         PR target/19516
1003         * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol):
1004         Always produce a RELATIVE reloc for a local symbol.
1005
1006 2016-02-23  Hans-Peter Nilsson  <hp@axis.com>
1007
1008         Fix test-case ld-elf/pr19617b
1009         * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
1010         discard unused non-function symbols when --dynamic-list-data.
1011
1012 2016-02-22  H.J. Lu  <hongjiu.lu@intel.com>
1013
1014         * elflink.c (_bfd_elf_link_renumber_dynsyms): Always create the
1015         dynsym section, even if it is empty, with dynamic sections.
1016
1017 2016-02-22  H.J. Lu  <hongjiu.lu@intel.com>
1018
1019         * syms.c: Remove BSF_COMMON from comments.
1020         * bfd-in2.h: Regenerated.
1021
1022 2016-02-22  Jiong Wang  <jiong.wang@arm.com>
1023
1024         * elfnn-aarch64. (aarch64_type_of_stub): Remove redundation calcuation
1025         for destination.  Remove useless function parameters.
1026         (elfNN_aarch64_size_stubs): Update parameters for aarch64_type_of_stub.
1027
1028 2016-02-19  Nick Clifton  <nickc@redhat.com>
1029
1030         PR ld/19629
1031         * aoutx.h (aout_link_add_symbols): Check for out of range string
1032         table offsets.
1033
1034         PR ld/19628
1035         * reloc.c (bfd_generic_get_relocated_section_contents): Stop
1036         processing if we encounter a reloc without an associated symbol.
1037
1038 2016-02-18  H.J. Lu  <hongjiu.lu@intel.com>
1039
1040         PR ld/19617
1041         * elflink.c (elf_link_add_object_symbols): Always create dynamic
1042         sections for -E/--dynamic-list.
1043
1044 2016-02-17  H.J. Lu  <hongjiu.lu@intel.com>
1045
1046         * elf64-x86-64.c (elf_backend_omit_section_dynsym): New.  Defined
1047         to bfd_true.
1048
1049 2016-02-16  Joseph Myers  <joseph@codesourcery.com>
1050
1051         * plugin.c (plugin_vec): Set match priority to 255.
1052         * format.c (bfd_check_format_matches) [BFD_SUPPORTS_PLUGINS]: When
1053         matching against the plugin vector, take priority from there not
1054         from TEMP.
1055
1056 2016-02-15  Nick Clifton  <nickc@redhat.com>
1057
1058         * elf-bfd.h (struct bfd_elf_special_section): Use unsigned values
1059         for length and type fields.  Use a signed value for the
1060         suffix_length field.
1061
1062 2016-02-10  H.J. Lu  <hongjiu.lu@intel.com>
1063
1064         PR ld/19601
1065         * elf32-i386.c (elf_i386_relocate_section): Mask off the least
1066         significant bit in GOT offset for R_386_GOT32X.
1067
1068 2016-02-10  Nick Clifton  <nickc@redhat.com>
1069
1070         PR 19405
1071         * elf32-nios2.c (nios2_elf32_install_imm16): Allow for signed
1072         immediate values.
1073         * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Limit the
1074         number of messages about FDE encoding preventing .eh_frame_hdr
1075         generation.
1076
1077 2016-02-09  Nick Clifton  <nickc@redhat.com>
1078
1079         * oasys.c (oasys_archive_p): Fix indentation.
1080         * elf32-nds32.c (nds32_elf_relax_section): Use an unsigned
1081         constant for left shifting.
1082
1083         * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Add a more
1084         helpful warning message to explain why certain AArch64 relocs
1085         might overflow.
1086
1087 2016-02-05  Simon Marchi  <simon.marchi@ericsson.com>
1088
1089         * pe-mips.c (coff_mips_reloc): Fix formatting.
1090
1091 2016-02-05  Cupertino Miranda  <Cupertino.Miranda@synopsys.com>
1092
1093         * cpu-arc.c: Change default archure from bfd_mach_arc_arcv2
1094         to bfd_mach_arc_arc600.
1095
1096 2016-02-04  Alan Modra  <amodra@gmail.com>
1097
1098         * elf64-ppc.c (ppc64_elf_relocate_section): Adjust last patch
1099         for big-endian.
1100
1101 2016-02-02  H.J. Lu  <hongjiu.lu@intel.com>
1102
1103         PR ld/19542
1104         * elf64-x86-64.c (elf_x86_64_convert_load): Store the estimated
1105         distances in the compressed_size field of the output section.
1106
1107 2016-02-02  Alan Modra  <amodra@gmail.com>
1108
1109         * elf64-ppc.c (ppc64_elf_relocate_section): Further restrict
1110         ELFv2 entry optimization.
1111
1112 2016-02-02  H.J. Lu  <hongjiu.lu@intel.com>
1113
1114         PR binutils/19547
1115         * elf.c (assign_section_numbers): Clear HAS_RELOC if there are
1116         no relocations in relocatable files.
1117
1118 2016-02-01  H.J. Lu  <hongjiu.lu@intel.com>
1119
1120         PR ld/19553
1121         * elflink.c (elf_link_add_object_symbols): Don't add DT_NEEDED
1122         if a symbol from a library loaded via DT_NEEDED doesn't match
1123         the symbol referenced by regular object.
1124
1125 2016-02-01  Nathaniel Smith  <njs@pobox.com>
1126
1127         * peicode.h (pe_ILF_build_a_bfd): Create an import symbol for both
1128         CODE and DATA.
1129
1130 2016-02-01  Alan Modra  <amodra@gmail.com>
1131
1132         * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Don't abort on
1133         an out of range reloc_index.
1134         * elf32-i386.c (elf_i386_get_plt_sym_val): Likewise.
1135
1136 2016-02-01  Kamil Rytarowski  <n54@gmx.com>
1137
1138         * Makefile.am (OPTIONAL_BACKENDS): Add netbsd-core.lo.
1139         (OPTIONAL_BACKENDS_CFILES): Add netbsd-core.c.
1140         * Makefile.in: Regenerated.
1141
1142 2016-02-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
1143
1144         * elf64-s390.c (elf_s390_reloc_name_lookup): Fix indentation.
1145
1146 2016-01-31  John David Anglin  <danglin@gcc.gnu.org>
1147
1148         PR ld/19526
1149         * elf32-hppa.c (elf32_hppa_final_link): Don't sort non-regular output
1150         files.
1151         * elf64-hppa.c (elf32_hppa_final_link): Likewise.  Remove retval.
1152
1153 2016-01-30  H.J. Lu  <hongjiu.lu@intel.com>
1154
1155         PR ld/19539
1156         * elf32-i386.c (elf_i386_reloc_type_class): Check relocation
1157         against STT_GNU_IFUNC symbol only with dynamic symbols.
1158         * elf64-x86-64.c (elf_x86_64_reloc_type_class): Likewise.
1159
1160 2016-01-28  H.J. Lu  <hongjiu.lu@intel.com>
1161
1162         PR binutils/19523
1163         * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Set BFD_DECOMPRESS to
1164         decompress debug sections.
1165
1166 2016-01-25  Maciej W. Rozycki  <macro@imgtec.com>
1167
1168         * elf32-arc.c (elf_arc_finish_dynamic_symbol): Rename `index' to
1169         `dynindx'.
1170
1171 2016-01-25  Nick Clifton  <nickc@redhat.com>
1172
1173         PR target/19435
1174         * mach-o.c (bfd_mach_o_close_and_cleanup): Suppress code to free
1175         dsym filename buffer.
1176
1177 2016-01-24  Maciej W. Rozycki  <macro@imgtec.com>
1178
1179         * elfxx-mips.c (BZ16_REG_FIELD): Simplify calculation.
1180
1181 2016-01-24  Maciej W. Rozycki  <macro@imgtec.com>
1182
1183         * elfxx-mips.c (BZ16_REG): Correct calculation.
1184
1185 2016-01-21  Nick Clifton  <nickc@redhat.com>
1186
1187         * elf32-arc.c (ADD_RELA): Fix compile time warning errors by
1188         changing the type of _loc to be bfd_byte *.
1189         (elf_arc_finish_dynamic_symbol): Likewise.
1190
1191 2016-01-21  Nick Clifton  <nickc@redhat.com>
1192
1193         PR ld/19455
1194         * elf32-arm.c (elf32_arm_create_dynamic_sections): Set the ELF
1195         class of the linker stub bfd.
1196         (elf32_arm_check_relocs): Skip check for pic format after
1197         processing a vxWorks R_ARM_ABS12 reloc.
1198         * elflink.c (bfd_elf_final_link): Check for ELFCLASSNONE when
1199         reporting a class mismatch.
1200
1201 2016-01-21  Jiong Wang  <jiong.wang@arm.com>
1202
1203         * elfnn-aarch64.c (aarch64_type_of_stub): Allow insert long branch
1204         veneer for sym_sec != input_sec.
1205         (elfNN_aarch64_size_stub): Support STT_SECTION symbol.
1206         (elfNN_aarch64_final_link_relocate): Take rela addend into account when
1207         calculation destination.
1208
1209 2016-01-21  Alan Modra  <amodra@gmail.com>
1210
1211         * elf-linux-core.h (swap_linux_prpsinfo32_out): New function.
1212         (swap_linux_prpsinfo64_out): New function.
1213         (LINUX_PRPSINFO32_SWAP_FIELDS): Delete.
1214         (LINUX_PRPSINFO64_SWAP_FIELDS): Delete.
1215         * elf.c (elfcore_write_linux_prpsinfo32): Adjust.  Don't memset.
1216         (elfcore_write_linux_prpsinfo64): Likewise.
1217         * elf32-ppc.c (swap_ppc_linux_prpsinfo32_out): New function.
1218         (PPC_LINUX_PRPSINFO32_SWAP_FIELDS): Delete.
1219         (elfcore_write_ppc_linux_prpsinfo32): Adjust.  Don't memset.
1220
1221 2016-01-21  Alan Modra  <amodra@gmail.com>
1222
1223         * elf-linux-core.h: Rename from elf-linux-psinfo.h.
1224         * elf.c: Adjust #include.
1225         * elf32-ppc.c: Don't #include elf-linux-psinfo.h
1226         * Makefile.am (SOURCE_HFILES): Update.
1227         * Makefile.in: Regenerate.
1228         * po/SRC-PORFILES.in: Regenerate.
1229
1230 2016-01-21  Alan Modra  <amodra@gmail.com>
1231
1232         * configure.ac: Move corefile selection later in file.  Move
1233         tdefaults code immediately after other target vector code.
1234         * configure: Regenerate.
1235
1236 2016-01-20  Mickael Guene  <mickael.guene@st.com>
1237
1238         * elf32-arm.c (elf32_arm_special_sections): Remove catch of noread
1239         section using '.text.noread' pattern.
1240
1241 2016-01-19  John Baldwin  <jhb@FreeBSD.org>
1242
1243         * elf.c (elfcore_grok_note): Recognize NT_FREEBSD_THRMISC notes.
1244
1245 2016-01-18  Miranda Cupertino  <Cupertino.Miranda@synopsys.com>
1246             Zissulescu Claudiu  <Claudiu.Zissulescu@synopsys.com>
1247
1248         * arc-plt.def: New file.
1249         * arc-plt.h: Likewise.
1250         * elf32-arc.c (elf_arc_abs_plt0_entry, elf_arc_abs_pltn_entry,
1251                        elf_arcV2_abs_plt0_entry, elf_arcV2_abs_pltn_entry,
1252                        elf_arc_pic_plt0_entry, elf_arc_pic_pltn_entry,
1253                        elf_arcV2_pic_plt0_entry, elf_arcV2_pic_pltn_entry): Remove.
1254         (name_for_global_symbol): Added.
1255         (ADD_RELA): Helper to create dynamic relocs.
1256         (new_got_entry_to_list): Create a new got entry in linked list.
1257         (symbol_has_entry_of_type): Search for specific type of entry in
1258         list.
1259         (is_reloc_for_GOT): return FALSE for any TLS related relocs.
1260         (is_reloc_for_TLS, arc_elf_set_private_flags)
1261         (arc_elf_print_private_bfd_data, arc_elf_copy_private_bfd_data)
1262         (arc_elf_merge_private_bfd_data): New functions.
1263         (debug_arc_reloc): Cleaned debug info printing.
1264         (PDATA reloc): Changed not to perform address alignment.
1265         (reverse_me): Added. Fix for ARC_32 relocs.
1266         (arc_do_relocation): Return bfd_reloc_of when no relocation should
1267         occur.
1268         (arc_get_local_got_ents): Renamed from arc_get_local_got_offsets.
1269         Changed function to access an array of list of GOT entries instead
1270         of just an array of offsets.
1271         (elf_arc_relocate_section): Added support for PIC and TLS related relocations.
1272         (elf_arc_check_relocs): Likewise.
1273         (elf_arc_adjust_dynamic_symbol, elf_arc_finish_dynamic_symbol,
1274         (elf_arc_finish_dynamic_sections): Likewise
1275         (arc_create_dynamic_sections): Modified conditions to create
1276         dynamic sections.
1277         (ADD_SYMBOL_REF_SEC_AND_RELOC): New macro.
1278         (plt_do_relocs_for_symbol, relocate_plt_for_symbol)
1279         (relocate_plt_for_entry): Changed to support new way to define PLT
1280         related code.
1281         (add_symbol_to_plt): Likewise.
1282         (arc_elf_link_hash_table_create): New function.
1283
1284 2016-01-18  Nick Clifton  <nickc@redhat.com>
1285
1286         PR ld/19440
1287         * coff-rs6000.c (_bfd_xcoff_swap_sym_in): Sign extend external
1288         section number into internal section number.
1289         * coff64-rs6000.c (_bfd_xcoff64_swap_sym_in): Likewise.
1290         * coffswap.h (coff_swap_sym_in): Likewise.
1291         * peXXigen.c (_bfd_XXi_swap_sym_in): Likewise.
1292         * coffcode.h (_coff_bigobj_swap_sym_in): Make sure that internal
1293         section number field is big enough to hold the external value.
1294
1295 2016-01-17  Alan Modra  <amodra@gmail.com>
1296
1297         * configure: Regenerate.
1298
1299 2016-01-12  Yury Usishchev  <y.usishchev@samsung.com>
1300
1301         * elf32-arm.c (elf32_arm_fix_exidx_coverage): Insert cantunwind
1302         when address in first unwind entry does not match start of
1303         section.
1304
1305 2016-01-08  Richard Sandiford  <richard.sandiford@arm.com>
1306             Jiong Wang  <jiong.wang@arm.com>
1307
1308         PR ld/19368
1309         * elf32-arm.c (elf32_arm_reloc_type_class): Map R_ARM_IRELATIVE to
1310         reloc_class_ifunc.
1311
1312 2016-01-06  Andrew Burgess  <andrew.burgess@embecosm.com>
1313
1314         * elf32-arc.c (reloc_type_to_name): Change ARC_RELOC_HOWTO to
1315         place 'R_' before the reloc name returned.
1316         (elf_arc_howto_table): Change ARC_RELOC_HOWTO to place 'R_' before
1317         the relocation string.
1318
1319 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
1320
1321         * elfxx-mips.c (mips_elf_merge_obj_abiflags): New function,
1322         factored out from...
1323         (_bfd_mips_elf_merge_private_bfd_data): ... here.
1324
1325 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
1326
1327         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Move
1328         attribute check after ELF file header flag check.
1329
1330 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
1331
1332         * elfxx-mips.c (mips_elf_merge_obj_attributes): Propagate the
1333         return status from `_bfd_elf_merge_object_attributes'.
1334
1335 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
1336
1337         * elfxx-mips.c (mips_elf_merge_obj_e_flags): New function,
1338         factored out from...
1339         (_bfd_mips_elf_merge_private_bfd_data): ... here.
1340
1341 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
1342
1343         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Fold the
1344         handling of input MIPS ABI flags together.
1345
1346 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
1347
1348         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Suppress
1349         attribute checks for null input.
1350
1351 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
1352
1353         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Use local
1354         pointers to target data.
1355
1356 2016-01-04  Maciej W. Rozycki  <macro@imgtec.com>
1357
1358         * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Correct
1359         an FP ABI warning.
1360
1361 2016-01-01  Alan Modra  <amodra@gmail.com>
1362
1363         Update year range in copyright notice of all files.
1364
1365 For older changes see ChangeLog-2015 and doc/ChangeLog-0415
1366 \f
1367 Copyright (C) 2016 Free Software Foundation, Inc.
1368
1369 Copying and distribution of this file, with or without modification,
1370 are permitted in any medium without royalty provided the copyright
1371 notice and this notice are preserved.
1372
1373 Local Variables:
1374 mode: change-log
1375 left-margin: 8
1376 fill-column: 74
1377 version-control: never
1378 End: