riscv: Cache the max alignment of output sections
[binutils-gdb.git] / bfd / ChangeLog
1 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
2
3 PR ld/22274
4 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
5 (riscv_elf_link_hash_table_create): Initialize max_alignment to
6 (bfd_vma) -1.
7 (_bfd_riscv_relax_section): Cache the max alignment of output
8 sections if possible.
9
10 2017-10-10 Alan Modra <amodra@gmail.com>
11
12 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
13 .opd whenever .opd is present and non-zero size. Move code
14 setting abiversion to/from output file earlier. Only set
15 u.opd.func_sec when --gc-sections. Read relocs and set up
16 u.opd.func_sec values here..
17 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
18 section tests.
19 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
20
21 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
22
23 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
24 isymbuf.
25
26 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
27
28 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
29 .interp section with "ld --no-dynamic-linker".
30
31 2017-10-09 Alan Modra <amodra@gmail.com>
32
33 PR 22212
34 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
35 funcinfo_hash_table and varinfo_hash_table.
36
37 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
38
39 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
40 in read-only section with minfo.
41 (sh_elf_size_dynamic_sections): Likewise.
42
43 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
44
45 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
46 a strayed comment.
47
48 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
49
50 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
51 this_hdr.sh_entsize only if section size > 0.
52
53 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
54
55 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
56
57 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
58
59 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
60 in read-only section with minfo.
61 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
62
63 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
64
65 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
66 comments.
67
68 2017-10-06 John Baldwin <jhb@FreeBSD.org>
69
70 * elf-bfd.h (struct elf_backend_data): Add
71 `elf_backend_grok_freebsd_prstatus'.
72 * elf.c (elfcore_grok_freebsd_note): Call
73 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
74 present.
75 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
76 function.
77 (elf_backend_grok_freebsd_prstatus): Define.
78 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
79 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
80
81 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
82
83 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
84 and has_non_got_reloc with zero_undefweak.
85 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
86 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
87 zero_undefweak to 1.
88 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
89 has_non_got_reloc with zero_undefweak.
90 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
91 has_got_reloc and has_non_got_reloc with zero_undefweak.
92 (elf_x86_link_hash_entry): Likewise.
93
94 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
95
96 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
97 (VERIFY_COPY_RELOC): Likewise.
98
99 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
100
101 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
102 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
103 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
104
105 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
106
107 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
108 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
109 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
110
111 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
112
113 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
114 * elf32-i386.c (elf_i386_relocate_section): Use it.
115 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
116
117 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
118
119 * elf32-i386.c (X86_SIZE_TYPE_P): New.
120 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
121 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
122 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
123 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
124
125 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
126
127 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
128 (PLT_LOCAL_IFUNC_P): Likewise.
129 * elf32-i386.c (elf_i386_relocate_section): Use them.
130 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
131
132 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
133
134 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
135 * elf32-i386.c (elf_i386_relocate_section): Use it.
136 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
137
138 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
139
140 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
141 * elf32-i386.c (elf_i386_relocate_section): Use it.
142 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
143
144 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
145
146 * elf32-i386.c (X86_PCREL_TYPE_P): New.
147 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
148 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
149 (X86_PCREL_TYPE_P): This.
150 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
151 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
152 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
153 X86_PCREL_TYPE_P.
154 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
155
156 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
157
158 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
159 * elf32-i386.c (elf_i386_tls_transition): Use it.
160 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
161
162 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
163
164 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
165 Dump dynamic relocation in read-only section with minfo if
166 needed.
167 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
168 (maybe_set_textrel): Likewise.
169 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
170 read-only section with minfo.
171
172 2017-10-05 John Baldwin <jhb@FreeBSD.org>
173
174 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
175
176 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
177
178 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
179 in read-only section with minfo.
180 (tilepro_elf_size_dynamic_sections): Likewise.
181 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
182 (tilegx_elf_size_dynamic_sections): Likewise.
183
184 2017-10-05 Pedro Alves <palves@redhat.com>
185
186 PR 22245
187 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
188 ellipsis parameter. Split out bfd_error_on_input code to..
189 (bfd_set_input_error): .. New function.
190 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
191 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
192 * bfd-in2.h: Regenerate.
193
194 2017-10-05 Alan Modra <amodra@gmail.com>
195
196 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
197 fini_array error value.
198
199 2017-10-05 Alan Modra <amodra@gmail.com>
200
201 PR 21167
202 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
203 groups.
204 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
205 flag from section.
206 (elf_fake_sections): Adjust calls. Exit immediately on failure.
207 (bfd_elf_set_group_contents): Add associated reloc section indices
208 to group contents.
209
210 2017-10-04 Alan Modra <amodra@gmail.com>
211
212 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
213 classify symbols for ELFv2.
214
215 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
216
217 PR 22245
218 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
219 undergoes default promotion.
220 * bfd-in2.h: Regenerate.
221
222 2017-10-02 Alan Modra <amodra@gmail.com>
223
224 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
225 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
226
227 2017-10-01 Alan Modra <amodra@gmail.com>
228
229 PR 21957
230 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
231 (add_line_info): Always put end_sequence last.
232
233 2017-10-01 Alan Modra <amodra@gmail.com>
234
235 PR 22047
236 * dwarf2.c (read_section): Allocate buffer with extra byte for
237 bfd_simple_get_relocated_section_contents rather than copying
238 afterwards.
239
240 2017-09-29 Alan Modra <amodra@gmail.com>
241
242 * merge.c (merge_strings): Return FALSE on malloc failure.
243 (_bfd_merge_sections): Return failures from record_section and
244 merge_strings.
245
246 2017-09-28 Alan Modra <amodra@gmail.com>
247
248 PR 22220
249 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
250 a case where plugin_notice isn't called.
251
252 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
253
254 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
255 comparison.
256
257 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
258
259 PR ld/22199
260 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
261 output_bfd to info->callbacks->minfo.
262
263 2017-09-26 Nick Clifton <nickc@redhat.com>
264
265 PR 22172
266 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
267 assertion failure if elf_x86_64_rtype_to_howto has already issued
268 an error message.
269
270 2017-09-26 Alan Modra <amodra@gmail.com>
271
272 PR 22210
273 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
274 read data.
275
276 2017-09-26 Nick Clifton <nickc@redhat.com>
277
278 PR 22210
279 * dwarf2.c (read_formatted_entries): Fail early if we know that
280 the loop parsing data entries will overflow the end of the
281 section.
282
283 2017-09-26 Alan Modra <amodra@gmail.com>
284
285 PR 22209
286 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
287 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
288 to stash->info_ptr_memory, and check die_ref is within that memory.
289 Set info_ptr_end correctly when another CU is refd. Check die_ref
290 for DW_FORM_ref4 etc. is within CU.
291
292 2017-09-26 Alan Modra <amodra@gmail.com>
293
294 PR 22205
295 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
296 (read_formatted_entries): Init "fe".
297 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
298
299 2017-09-26 Alan Modra <amodra@gmail.com>
300
301 PR 22204
302 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
303 bounds in inner loop.
304
305 2017-09-25 Alan Modra <amodra@gmail.com>
306
307 PR 22202
308 * dwarf1.c (parse_die): Sanity check pointer against section limit
309 before dereferencing.
310 (parse_line_table): Likewise.
311
312 2017-09-25 Alan Modra <amodra@gmail.com>
313
314 PR 22201
315 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
316 has string form.
317 (parse_comp_unit): Likewise.
318
319 2017-09-25 Alan Modra <amodra@gmail.com>
320
321 PR 22200
322 * dwarf2.c (read_formatted_entries): Error on format_count zero.
323
324 2017-09-24 Alan Modra <amodra@gmail.com>
325
326 PR 22197
327 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
328 within section bounds.
329
330 2017-09-24 Alan Modra <amodra@gmail.com>
331
332 PR 22191
333 * dwarf2.c (decode_line_info): Properly free line sequences on error.
334
335 2017-09-24 Alan Modra <amodra@gmail.com>
336
337 PR 22187
338 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
339 pname param. Return status. Make name const. Don't abort,
340 return an error. Formatting. Exit if current info_ptr matches
341 orig_info_ptr. Update callers.
342 (scan_unit_for_symbols): Start at nesting_level of zero. Make
343 nested_funcs an array of structs for extensibility. Formatting.
344
345 2017-09-24 Alan Modra <amodra@gmail.com>
346
347 PR 22186
348 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
349 rather than dividing by zero.
350
351 2017-09-24 Alan Modra <amodra@gmail.com>
352
353 PR 22169
354 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
355
356 2017-09-24 Alan Modra <amodra@gmail.com>
357
358 PR 22167
359 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
360
361 2017-09-24 Alan Modra <amodra@gmail.com>
362
363 PR 22166
364 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
365 SHT_GNU_verneed section for sanity. Don't zalloc memory for
366 verref.
367
368 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
369
370 PR binutils/22170
371 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
372 corrupted PLT.
373
374 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
375
376 PR binutils/22163
377 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
378 -1 if bfd_canonicalize_dynamic_reloc returns 0.
379
380 2017-09-22 Pedro Alves <palves@redhat.com>
381 Alan Modra <amodra@gmail.com>
382
383 * version.h: Add comment.
384
385 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
386
387 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
388 NT_S390_GS_BC, correct the previously swapped invocations of
389 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
390
391 2017-09-19 Alan Modra <amodra@gmail.com>
392
393 PR 21441
394 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
395 size.
396
397 2017-09-19 Alan Modra <amodra@gmail.com>
398
399 PR 22150
400 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
401 symbols before calculating verrefs. Don't renumber dynsyms
402 after gc. Exclude .gnu.version when zero or one dynsym.
403 Localize some vars and reindent.
404
405 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
406
407 PR ld/22148
408 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
409 return from bfd_canonicalize_dynamic_reloc.
410
411 2017-09-15 Alan Modra <amodra@gmail.com>
412
413 PR 22116
414 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
415 overflows bfd_size_type.
416
417 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
418
419 PR ld/22135
420 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
421 to indicate if conversion is performed.
422 (elf_i386_check_relocs): Cache section contents and relocations
423 if conversion is performed.
424 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
425 contents and relocations if conversion is performed.
426
427 2017-09-14 Nick Clifton <nickc@redhat.com>
428
429 PR binutils/22113
430 * peXXigen.c (pe_print_idata): Extend check for HintName vector
431 entries.
432
433 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
434
435 * elfxx-x86.h: Fix a typo in comments.
436
437 2017-09-09 Kamil Rytarowski <n54@gmx.com>
438
439 * elf32-nds32.c: Rename __BIT() to N32_BIT().
440
441 2017-09-09 Alan Modra <amodra@gmail.com>
442
443 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
444 plt_stub_align.
445
446 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
447
448 * elf32-i386.c (elf_i386_relocate_section): Update usage of
449 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
450 (elf_i386_finish_dynamic_symbol): Likewise.
451 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
452 (elf_x86_64_finish_dynamic_symbol): Likewise.
453 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
454 (_bfd_x86_elf_fixup_symbol): Likewise.
455
456 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
457
458 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
459 check has_non_got_reloc.
460
461 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
462
463 PR ld/22115
464 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
465 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
466 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
467 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
468 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
469 and linker_def on __ehdr_start if it is referenced and not
470 defined.
471 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
472 and return TRUE when building executable, if a symbol has
473 non-GOT/non-PLT relocations in text section or there is no
474 dynamic linker.
475 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
476
477 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
478
479 * elfxx-x86.h: Update comments.
480
481 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
482
483 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
484 elf_x86_plt_layout_table with elf_x86_init_table.
485 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
486 Likewise.
487 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
488 Likewise.
489 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
490 (elf_x86_init_table): This.
491 (_bfd_x86_elf_link_setup_gnu_properties): Replace
492 elf_x86_plt_layout_table with elf_x86_init_table.
493
494 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
495
496 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
497 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
498 * configure: Regenerated.
499 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
500 and r_sym fields of plt_layout.
501 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
502 Likewise.
503 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
504 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
505 r_info nor r_sym fields.
506 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
507 fields of htab.
508 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
509
510 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
511
512 * (_bfd_riscv_relax_align): Call bfd_set_error and
513 print an error message when unable to relax a .align directive.
514
515 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
516
517 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
518 (riscv_record_pcrel_hi_reloc): Add absolute argument.
519 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
520 R_RISCV_PCREL_HI20 relocs, and pass the result to
521 riscv_record_pcrel_hi_reloc.
522
523 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
524
525 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
526 r_type_p. Remove the converted argument. Replace
527 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
528 the new relocation type via r_type_p.
529 (elf_i386_relocate_section): Likewise.
530 (elf_i386_finish_dynamic_symbol): Likewise.
531 (need_convert_load): Removed.
532 (check_relocs_failed): Updated.
533 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
534 instead of setting need_convert_load.
535 (_bfd_i386_elf_convert_load): Removed.
536 * elf64-x86-64.c (need_convert_load): Removed.
537 (check_relocs_failed): Updated.
538 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
539 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
540 Return the new relocation type via r_type_p.
541 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
542 instead of setting need_convert_load.
543 (elf_x86_64_check_relocs): Don't check PIC if relocation has
544 been converted.
545 (_bfd_x86_64_elf_convert_load): Removed.
546 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
547 with SYMBOL_REFERENCES_LOCAL_P.
548 (elf_x86_64_finish_dynamic_symbol): Likewise.
549 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
550 set convert_load.
551 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
552 (_bfd_x86_elf_link_symbol_references_local): New function.
553 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
554 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
555 SYMBOL_REFERENCES_LOCAL_P.
556 (elf_x86_link_hash_entry): Add local_ref.
557 (elf_x86_link_hash_table): Remove convert_load.
558 (_bfd_i386_elf_convert_load): Removed.
559 (_bfd_x86_64_elf_convert_load): Likewise.
560 (_bfd_x86_elf_link_symbol_references_local): New.
561
562 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
563
564 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
565 (elf_x86_64_info_to_howto): Get the real relocation type by
566 masking out R_X86_64_converted_reloc_bit.
567 (elf_x86_64_check_tls_transition): Get the real relocation type
568 by masking out R_X86_64_converted_reloc_bit.
569 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
570 instead of setting converted_reloc.
571 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
572 instead of converted_reloc. Get the real relocation type by
573 masking out R_X86_64_converted_reloc_bit.
574 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
575 R_X86_64_converted_reloc_bit is valid.
576 * elfxx-x86.h (converted_reloc): Removed.
577
578 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
579
580 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
581 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
582 to get the relocation type again.
583 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
584 r_type when calling elf_x86_64_tls_transition. Don't use
585 ELF32_R_TYPE to get the relocation type again.
586
587 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
588
589 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
590 converted_reloc.
591
592 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
593
594 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
595 argument. Don't check relocation overflow. Avoid relocation
596 overflow if --no-relax is used. Set converted_reloc on symbol
597 if a GOTPCREL relocation is converted.
598 (elf_x86_64_relocate_section): Issue a fatal error and suggest
599 --no-relax if GOTPCREL relocation conversion leads to relocation
600 overflow.
601 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
602
603 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
604 Edmar Wienskoski <edmar.wienskoski@nxp.com
605
606 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
607 (ppc_elf_check_relocs): Handle it.
608 (ppc_elf_vle_split20): New function.
609 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
610
611 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
612
613 PR ld/22071
614 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
615 for x86-64 if GOT_TLS_GDESC_P is true.
616
617 2017-09-03 Alan Modra <amodra@gmail.com>
618
619 PR 22067
620 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
621
622 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
623
624 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
625 tls_get_addr for x86-64 in one place.
626
627 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
628
629 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
630 with elfxx-x86.lo for 64-bit BFD.
631 * configure: Regenerated.
632
633 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
634
635 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
636 (_bfd_i386_elf_convert_load): This. Remove static.
637 (elf_i386_size_dynamic_sections): Removed.
638 (elf_backend_size_dynamic_sections): Likewise.
639 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
640 (_bfd_x86_64_elf_convert_load): This. Remove static.
641 (elf_x86_64_size_dynamic_sections): Removed.
642 (elf_backend_size_dynamic_sections): Likewise.
643 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
644 (elf_x86_allocate_dynrelocs): This. Make it static.
645 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
646 (elf_x86_allocate_local_dynreloc): This. Make it static.
647 (elf_i386_is_reloc_section): New function.
648 (elf_x86_64_is_reloc_section): Likewise.
649 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
650 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
651 Rearrange got_entry_size initialization.
652 (_bfd_x86_elf_size_dynamic_sections): New function.
653 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
654 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
655 (_bfd_i386_elf_convert_load): New.
656 (_bfd_x86_64_elf_convert_load): Likewise.
657 (_bfd_x86_elf_size_dynamic_sections): Likewise.
658 (elf_backend_size_dynamic_sections): Likewise.
659 (_bfd_x86_elf_allocate_dynrelocs): Removed.
660 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
661
662 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
663
664 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
665 update comments.
666
667 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
668
669 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
670 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
671
672 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
673
674 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
675 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
676 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
677 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
678 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
679 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
680
681 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
682
683 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
684 (elf_i386_allocate_local_dynrelocs): Likewise.
685 (elf_i386_size_dynamic_sections): Replace
686 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
687 with _bfd_x86_elf_allocate_dynrelocs and
688 _bfd_x86_elf_allocate_local_dynrelocs.
689 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
690 (elf_x86_64_allocate_local_dynrelocs): Likewise.
691 (elf_x86_64_size_dynamic_sections): Replace
692 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
693 with _bfd_x86_elf_allocate_dynrelocs and
694 _bfd_x86_elf_allocate_local_dynrelocs.
695 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
696 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
697 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
698 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
699
700 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
701
702 * elf32-i386.c (is_i386_elf): Removed.
703 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
704 (elf_i386_size_dynamic_sections): Likewise.
705 (elf_i386_relocate_section): Likewise.
706 * elf64-x86-64.c (is_x86_64_elf): Removed.
707 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
708 is_x86_elf.
709 (elf_x86_64_size_dynamic_sections): Likewise.
710 (elf_x86_64_relocate_section): Likewise.
711 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
712 target_id.
713 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
714 (is_x86_elf): New.
715
716 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
717
718 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
719 (elf_i386_allocate_dynrelocs): Replace
720 elf_i386_compute_jump_table_size with
721 elf_x86_compute_jump_table_size.
722 (elf_i386_size_dynamic_sections): Likewise.
723 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
724 (elf_x86_64_allocate_dynrelocs): Replace
725 elf_x86_64_compute_jump_table_size with
726 elf_x86_compute_jump_table_size.
727 (elf_x86_64_size_dynamic_sections): Likewise.
728 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
729 got_entry_size.
730 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
731 (elf_x86_compute_jump_table_size): New.
732
733 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
734
735 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
736 sizeof_reloc.
737 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
738 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
739
740 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
741
742 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
743 with htab->is_vxworks.
744 (elf_i386_size_dynamic_sections): Likewise.
745 (elf_i386_relocate_section): Likewise.
746 (elf_i386_finish_dynamic_symbol): Likewise.
747 (elf_i386_finish_dynamic_sections): Likewise.
748
749 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
750
751 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
752 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
753 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
754 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
755 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
756 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
757 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
758 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
759
760 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
761
762 PR ld/22064
763 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
764 ELF_COMMON_DEF_P for common symbols.
765
766 2017-09-02 Alan Modra <amodra@gmail.com>
767
768 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
769 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
770 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
771
772 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
773
774 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
775 (elf_backend_gc_mark_hook): Likewise.
776 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
777 (elf_backend_gc_mark_hook): Likewise.
778 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
779 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
780 (elf_backend_gc_mark_hook): Likewise.
781
782 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
783
784 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
785 (elf_backend_adjust_dynamic_symbol): Likewise.
786 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
787 (elf_backend_adjust_dynamic_symbol): Likewise.
788 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
789 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
790 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
791 (_bfd_x86_elf_adjust_dynamic_symbol): New.
792 (elf_backend_adjust_dynamic_symbol): Likewise.
793
794 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
795
796 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
797 comments.
798
799 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
800
801 * elf32-i386.c (elf_i386_mkobject): Removed.
802 (bfd_elf32_mkobject): Likewise.
803 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
804 (bfd_elf64_mkobject): Likewise.
805 (bfd_elf32_mkobject): Likewise.
806 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
807 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
808 (bfd_elf64_mkobject): Likewise.
809 (bfd_elf32_mkobject): Likewise.
810
811 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
812
813 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
814 Call _bfd_x86_elf_link_setup_gnu_properties.
815 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
816 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
817 entries.
818 (elf_x86_64_non_lazy_plt): Likewise.
819 (elf_x86_64_lazy_bnd_plt): Likewise.
820 (elf_x86_64_non_lazy_bnd_plt): Likewise.
821 (elf_x86_64_lazy_ibt_plt): Likewise.
822 (elf_x32_lazy_ibt_plt): Likewise.
823 (elf_x86_64_non_lazy_ibt_plt): Likewise.
824 (elf_x32_non_lazy_ibt_plt): Likewise.
825 (elf_x86_64_nacl_plt): Likewise.
826 (elf_x86_64_link_setup_gnu_properties): Updated. Call
827 _bfd_x86_elf_link_setup_gnu_properties.
828 * elfxx-x86.c: Include elf-vxworks.h".
829 (_bfd_x86_elf_link_setup_gnu_properties): New function.
830 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
831 comments for pic_plt0_entry and pic_plt_entry.
832 (elf_x86_non_lazy_plt_layout): Likewise.
833 (elf_x86_plt_layout_table): New.
834 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
835
836 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
837
838 PR ld/22061
839 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
840 .eh_frame section for the second PLT.
841 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
842 alignment of .eh_frame section for the second PLT.
843
844 2017-09-01 Nick Clifton <nickc@redhat.com>
845
846 PR 22059
847 * dwarf2.c (decode_line_info): Fix test for an overlong line info
848 structure.
849
850 2017-09-01 Nick Clifton <nickc@redhat.com>
851
852 PR 22058
853 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
854 attribute buffer is NUL terminated.
855
856 2017-08-31 Nick Clifton <nickc@redhat.com>
857
858 PR 22047
859 * dwarf2.c (read_section): If necessary add a terminating NUL byte
860 to dwarf string sections.
861
862 2017-08-31 Alan Modra <amodra@gmail.com>
863
864 * po/SRC-POTFILES.in: Regenerate.
865
866 2017-08-31 Alan Modra <amodra@gmail.com>
867
868 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
869 for a section containing just a terminator. Allow multiple
870 terminators at end of section.
871 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
872 sections when not adding alignment. Assert on terminator in
873 the middle of FDEs.
874
875 2017-08-31 Alan Modra <amodra@gmail.com>
876
877 PR 21441
878 PR 22048
879 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
880 terminators.
881
882 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
883
884 * configure.ac (bfd_backends): Add elf64.lo together with
885 elfxx-x86.lo for 64-bit BFD.
886 * configure: Regenerated.
887
888 2017-08-31 James Bowman <james.bowman@ftdichip.com>
889
890 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
891 for R_FT32_18.
892
893 2017-08-31 Alan Modra <amodra@gmail.com>
894
895 PR binutils/22032
896 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
897 before _close_and_cleanup. Call iovec->bclose after.
898 (bfd_close): Remove code common to, and call, bfd_close_all_done.
899
900 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
901
902 * elf32-i386.c (elf_i386_plt_type): Removed.
903 (elf_i386_plt): Likewise.
904 (elf_i386_get_synthetic_symtab): Updated. Call
905 _bfd_x86_elf_get_synthetic_symtab.
906 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
907 (elf_x86_64_plt): Likewise.
908 (elf_x86_64_get_synthetic_symtab): Updated. Call
909 _bfd_x86_elf_get_synthetic_symtab.
910 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
911 (elf_x86_64_get_plt_got_vma): Likewise.
912 (elf_i386_valid_plt_reloc_p): Likewise.
913 (elf_x86_64_valid_plt_reloc_p): Likewise.
914 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
915 * elfxx-x86.h (elf_x86_plt_type): New.
916 (elf_x86_plt): Likewise.
917 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
918
919 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
920
921 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
922 target_id instead of elf_machine_code.
923
924 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
925
926 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
927 (elf_i386_lazy_plt_layout): Likewise.
928 (elf_i386_non_lazy_plt_layout): Likewise.
929 (elf_i386_plt_layout): Likewise.
930 (elf_i386_link_hash_table): Likewise.
931 (elf_i386_next_tls_desc_index): Likewise.
932 (elf_i386_srelplt2): Likewise.
933 (elf_i386_plt): Likewise.
934 (elf_i386_lazy_plt): Likewise.
935 (elf_i386_non_lazy_plt): Likewise.
936 (elf_i386_link_hash_table_create): Likewise.
937 (bfd_elf32_bfd_link_hash_table_create): Likewise.
938 (elf_i386_lazy_plt): Updated.
939 (elf_i386_non_lazy_plt): Likewise.
940 (elf_i386_lazy_ibt_plt): Likewise.
941 (elf_i386_non_lazy_ibt_plt): Likewise.
942 (elf_i386_allocate_dynrelocs): Likewise.
943 (elf_i386_size_dynamic_sections): Likewise.
944 (elf_i386_relocate_section): Likewise.
945 (elf_i386_finish_dynamic_symbol): Likewise.
946 (elf_i386_finish_dynamic_sections): Likewise.
947 (elf_i386_get_synthetic_symtab): Likewise.
948 (elf_i386_link_setup_gnu_properties): Likewise.
949 (elf_i386_nacl_plt): Likewise.
950 * elf64-x86-64.c (ABI_64_P): Removed.
951 (ELF64_DYNAMIC_INTERPRETER): Likewise.
952 (ELF32_DYNAMIC_INTERPRETER): Likewise.
953 (elf_x86_64_lazy_plt_layout): Likewise.
954 (elf_x86_64_non_lazy_plt_layout): Likewise.
955 (elf_x86_64_plt_layout): Likewise.
956 (elf_x86_64_link_hash_table): Likewise.
957 (elf_x86_64_plt): Likewise.
958 (elf_x86_64_lazy_plt): Likewise.
959 (elf_x86_64_non_lazy_plt): Likewise.
960 (elf_x86_64_link_hash_table_create): Likewise.
961 (bfd_elf64_bfd_link_hash_table_create): Likewise.
962 (bfd_elf32_bfd_link_hash_table_create): Likewise.
963 (elf_x86_64_lazy_plt): Updated.
964 (elf_x86_64_non_lazy_plt): Likewise.
965 (elf_x86_64_lazy_bnd_plt): Likewise.
966 (elf_x86_64_non_lazy_bnd_plt): Likewise.
967 (elf_x86_64_lazy_ibt_plt): Likewise.
968 (elf_x32_lazy_ibt_plt): Likewise.
969 (elf_x86_64_non_lazy_ibt_plt): Likewise.
970 (elf_x32_non_lazy_ibt_plt): Likewise.
971 (elf_x86_64_allocate_dynrelocs): Likewise.
972 (elf_x86_64_size_dynamic_sections): Likewise.
973 (elf_x86_64_relocate_section): Likewise.
974 (elf_x86_64_finish_dynamic_symbol): Likewise.
975 (elf_x86_64_finish_dynamic_sections): Likewise.
976 (elf_x86_64_get_synthetic_symtab): Likewise.
977 (elf_x86_64_link_setup_gnu_properties): Likewise.
978 (elf_x86_64_nacl_plt): Likewise.
979 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
980 "elf/x86-64.h".
981 (ELF32_DYNAMIC_INTERPRETER): New.
982 (ELF64_DYNAMIC_INTERPRETER): Likewise.
983 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
984 (_bfd_x86_elf_link_hash_table_create): Likewise.
985 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
986 (elf_x86_link_hash_table_free): This. Make it static.
987 * elfxx-x86.h: Don't include "objalloc.h".
988 (ABI_64_P): New.
989 (elf_x86_lazy_plt_layout): Likewise.
990 (elf_x86_non_lazy_plt_layout): Likewise.
991 (elf_x86_plt_layout): Likewise.
992 (_bfd_x86_elf_link_hash_table_create): Likewise.
993 (bfd_elf64_bfd_link_hash_table_create): Likewise.
994 (bfd_elf32_bfd_link_hash_table_create): Likewise.
995 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
996 srelplt2 and next_tls_desc_index.
997 (_bfd_x86_elf_link_hash_table_free): Removed.
998
999 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1000
1001 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1002 branch offset interpretation.
1003
1004 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1005
1006 PR binutils/22032
1007 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1008
1009 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1010
1011 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1012 (elf_x86_64_srelplt2): Likewise.
1013
1014 2017-08-30 Alan Modra <amodra@gmail.com>
1015
1016 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1017 (ppc64_elf_tls_optimize): Set it.
1018 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1019 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1020 addis would add zero.
1021 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1022 (ppc_elf_tls_optimize): Set it.
1023 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1024 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1025
1026 2017-08-30 Alan Modra <amodra@gmail.com>
1027
1028 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1029 __tls_get_addr call sequences to LE, don't move the addi down
1030 to the nop. Replace the bl with addi and leave the nop alone.
1031
1032 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1033
1034 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1035 Re-indent.
1036 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1037 Likewise.
1038 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1039
1040 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1041
1042 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1043 (BFD64_BACKENDS): Likewise.
1044 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1045 (BFD64_BACKENDS_CFILES): Likewise.
1046 * Makefile.in: Regenerated.
1047 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1048 elf32-i386.lo and elf64-x86-64.lo.
1049 * configure: Regenerated.
1050 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1051 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1052 "objalloc.h" and "hashtab.h".
1053 (ELIMINATE_COPY_RELOCS): Removed.
1054 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1055 (SYMBOL_NO_COPYRELOC): Likewise.
1056 (elf_i386_link_hash_entry): Likewise.
1057 (GOT_UNKNOWN): Likewise.
1058 (GOT_NORMAL): Likewise.
1059 (GOT_TLS_GD): Likewise.
1060 (elf_i386_hash_entry): Likewise.
1061 (elf_i386_obj_tdata): Likewise.
1062 (elf_i386_tdata): Likewise.
1063 (elf_i386_local_got_tls_type): Likewise.
1064 (elf_i386_local_tlsdesc_gotent): Likewise.
1065 (elf_i386_hash_table): Likewise.
1066 (elf_i386_link_hash_newfunc): Likewise.
1067 (elf_i386_local_htab_hash): Likewise.
1068 (elf_i386_local_htab_eq): Likewise.
1069 (elf_i386_get_local_sym_hash): Likewise.
1070 (elf_i386_link_hash_table_free): Likewise.
1071 (elf_i386_copy_indirect_symbol): Likewise.
1072 (elf_i386_fixup_symbol): Likewise.
1073 (elf_i386_readonly_dynrelocs): Likewise.
1074 (elf_i386_always_size_sections): Likewise.
1075 (elf_i386_set_tls_module_base): Likewise.
1076 (elf_i386_dtpoff_base): Likewise.
1077 (compare_relocs): Likewise.
1078 (elf_i386_hash_symbol): Likewise.
1079 (elf_i386_parse_gnu_properties): Likewise.
1080 (elf_i386_merge_gnu_properties): Likewise.
1081 (elf_i386_link_check_relocs): Likewise.
1082 (elf_i386_merge_symbol_attribute): Likewise.
1083 (bfd_elf32_bfd_link_check_relocs): Likewise.
1084 (elf_backend_copy_indirect_symbol): Likewise.
1085 (elf_backend_always_size_sections): Likewise.
1086 (elf_backend_omit_section_dynsym): Likewise.
1087 (elf_backend_hash_symbol): Likewise.
1088 (elf_backend_fixup_symbol): Likewise.
1089 (elf_backend_parse_gnu_properties): Likewise.
1090 (elf_backend_merge_gnu_properties): Likewise.
1091 (elf_backend_merge_symbol_attribute): Likewise.
1092 (elf_i386_mkobject): Updated.
1093 (elf_i386_link_hash_table_create): Likewise.
1094 (elf_i386_check_tls_transition): Likewise.
1095 (elf_i386_tls_transition): Likewise.
1096 (elf_i386_convert_load_reloc): Likewise.
1097 (elf_i386_check_relocs): Likewise.
1098 (elf_i386_adjust_dynamic_symbol): Likewise.
1099 (elf_i386_allocate_dynrelocs): Likewise.
1100 (elf_i386_convert_load): Likewise.
1101 (elf_i386_size_dynamic_sections): Likewise.
1102 (elf_i386_relocate_section): Likewise.
1103 (elf_i386_finish_dynamic_symbol ): Likewise.
1104 (elf_i386_finish_dynamic_sections): Likewise.
1105 (elf_i386_output_arch_local_syms): Likewise.
1106 (elf_i386_get_synthetic_symtab): Likewise.
1107 (elf_i386_link_setup_gnu_properties): Likewise.
1108 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1109 of elf_link_hash_table, as base.
1110 (elf_i386_next_tls_desc_index): New.
1111 (elf_i386_srelplt2): Likewise.
1112 (elf_i386_plt): Likewise.
1113 (elf_i386_lazy_plt): Likewise.
1114 (elf_i386_non_lazy_plt): Likewise.
1115 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1116 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1117 "objalloc.h" and "hashtab.h".
1118 (ELIMINATE_COPY_RELOCS): Removed.
1119 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1120 (SYMBOL_NO_COPYRELOC): Likewise.
1121 (elf_x86_64_link_hash_entry): Likewise.
1122 (GOT_UNKNOWN): Likewise.
1123 (GOT_NORMAL): Likewise.
1124 (GOT_TLS_GD): Likewise.
1125 (elf_x86_64_hash_entry): Likewise.
1126 (elf_x86_64_obj_tdata): Likewise.
1127 (elf_x86_64_tdata): Likewise.
1128 (elf_x86_64_local_got_tls_type): Likewise.
1129 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1130 (elf_x86_64_hash_table): Likewise.
1131 (elf_x86_64_link_hash_newfunc): Likewise.
1132 (elf_x86_64_local_htab_hash): Likewise.
1133 (elf_x86_64_local_htab_eq): Likewise.
1134 (elf_x86_64_get_local_sym_hash): Likewise.
1135 (elf_x86_64_link_hash_table_free): Likewise.
1136 (elf_x86_64_copy_indirect_symbol): Likewise.
1137 (elf_x86_64_fixup_symbol): Likewise.
1138 (elf_x86_64_readonly_dynrelocs): Likewise.
1139 (elf_x86_64_always_size_sections): Likewise.
1140 (elf_x86_64_set_tls_module_base): Likewise.
1141 (elf_x86_64_dtpoff_base): Likewise.
1142 (compare_relocs): Likewise.
1143 (elf_x86_64_merge_symbol_attribute): Likewise.
1144 (elf_x86_64_hash_symbol): Likewise.
1145 (elf_x86_64_parse_gnu_properties): Likewise.
1146 (elf_x86_64_merge_gnu_properties): Likewise.
1147 (elf_x86_64_link_check_relocs): Likewise.
1148 (elf_backend_copy_indirect_symbol): Likewise.
1149 (elf_backend_always_size_sections): Likewise.
1150 (bfd_elf64_bfd_link_check_relocs): Likewise.
1151 (elf_backend_merge_symbol_attribute): Likewise.
1152 (elf_backend_hash_symbol): Likewise.
1153 (elf_backend_omit_section_dynsym): Likewise.
1154 (elf_backend_fixup_symbol): Likewise.
1155 (elf_backend_parse_gnu_properties): Likewise.
1156 (elf_backend_merge_gnu_properties): Likewise.
1157 (bfd_elf32_bfd_link_check_relocs): Likewise.
1158 (elf_x86_64_mkobject): Updated.
1159 (elf_x86_64_link_hash_table_create): Likewise.
1160 (elf_x86_64_check_tls_transition): Likewise.
1161 (elf_x86_64_tls_transition): Likewise.
1162 (elf_x86_64_convert_load_reloc): Likewise.
1163 (elf_x86_64_check_relocs): Likewise.
1164 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1165 (elf_x86_64_allocate_dynrelocs): Likewise.
1166 (elf_x86_64_convert_load): Likewise.
1167 (elf_x86_64_size_dynamic_sections): Likewise.
1168 (elf_x86_64_relocate_section): Likewise.
1169 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1170 (elf_x86_64_finish_dynamic_sections): Likewise.
1171 (elf_x86_64_output_arch_local_syms): Likewise.
1172 (elf_x86_64_get_synthetic_symtab): Likewise.
1173 (elf_x86_64_link_setup_gnu_properties): Likewise.
1174 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1175 instead of elf_link_hash_table, as base.
1176 (elf_x86_64_next_tls_desc_index): New.
1177 (elf_x86_64_srelplt2): Likewise.
1178 (elf_x86_64_plt): Likewise.
1179 (elf_x86_64_lazy_plt): Likewise.
1180 (elf_x86_64_non_lazy_plt): Likewise.
1181 * elfxx-x86.c: New file.
1182 * elfxx-x86.h: Likewise.
1183
1184 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1185
1186 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1187 return.
1188 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1189
1190 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1191
1192 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1193 sections before checking dynamic relocations and free invalid
1194 PLT section contents.
1195 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1196
1197 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1198
1199 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1200 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1201
1202 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1203
1204 PR binutils/22018
1205 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1206 PLT section size.
1207 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1208
1209 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1210
1211 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1212 def_protected.
1213 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1214
1215 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1216
1217 PR ld/21997
1218 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1219 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1220 Add a has_no_copy_on_protected bitfield.
1221 (elf_has_no_copy_on_protected): New.
1222 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1223 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1224 (elf_merge_gnu_property_list): Likewise.
1225 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1226 to FALSE for elf_has_no_copy_on_protected.
1227 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1228 (elf_i386_link_hash_entry): Add def_protected.
1229 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1230 when checking info->nocopyreloc.
1231 (elf_i386_link_setup_gnu_properties): Don't set
1232 extern_protected_data here.
1233 (elf_i386_merge_symbol_attribute): New function.
1234 (elf_backend_merge_symbol_attribute): New.
1235 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1236 (elf_x86_64_link_hash_entry): Add def_protected.
1237 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1238 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1239 when checking info->nocopyreloc.
1240 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1241 relocation run-time overflow and unresolvable R_X86_64_32S
1242 relocation against protected data symbol defined in shared object
1243 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1244 (elf_x86_64_link_setup_gnu_properties): Don't set
1245 extern_protected_data here.
1246 (elf_x86_64_merge_symbol_attribute): New function.
1247 (elf_backend_merge_symbol_attribute): New.
1248
1249 2017-08-26 Alan Modra <amodra@gmail.com>
1250
1251 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1252 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1253 (ppc_elf_relocate_section): Comment fix.
1254 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1255 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1256 Support dynamic relocs for TPREL16 when non-pic too.
1257 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1258 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1259 when non-pic too.
1260
1261 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1262
1263 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1264 "symbol" in comments.
1265 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1266
1267 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1268
1269 PR ld/22001
1270 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1271 R_X86_64_PC32 relocation run-time overflow and unresolvable
1272 R_X86_64_32S relocation with -z nocopyreloc.
1273
1274 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1275
1276 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1277 Undefined symbols may not have a type.
1278 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1279
1280 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1281
1282 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1283 bfd_link_info. Report shared, PIE or PDE object based on
1284 bfd_link_info.
1285 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1286 (elf_x86_64_relocate_section): Likewise.
1287
1288 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1289
1290 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1291 for function symbols.
1292 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1293
1294 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1295
1296 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1297 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1298 is set on any input relocatable file.
1299 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1300
1301 2017-08-23 Alan Modra <amodra@gmail.com>
1302
1303 PR 21988
1304 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1305 ensure_undefweak_dynamic. Handle undefined too.
1306 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1307 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1308 (allocate_dynrelocs): Discard undefined non-default visibility
1309 relocs first. Make undefined syms dynamic. Tidy goto.
1310
1311 2017-08-21 Alan Modra <amodra@gmail.com>
1312 H.J. Lu <hongjiu.lu@intel.com>
1313
1314 PR ld/21964
1315 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1316 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1317
1318 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1319
1320 PR ld/20125
1321 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1322 undefined weak symbols.
1323
1324 2017-08-18 Nick Clifton <nickc@redhat.com>
1325
1326 PR binutils/21962
1327 * tekhex.c (getsym): Fix check for source pointer walking off the
1328 end of the input buffer.
1329
1330 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1331
1332 PR ld/18808
1333 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1334 relocations in debug sections, change abort to _bfd_error_handler.
1335
1336 2017-08-14 Nick Clifton <nickc@redhat.com>
1337
1338 PR 21957
1339 * elf.c (setup_group): Check for an empty or very small group
1340 section.
1341 * po/bfd.pot: Regenerate.
1342
1343 2017-08-14 Alan Modra <amodra@gmail.com>
1344
1345 PR 21441
1346 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1347 alignment padding here.
1348 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1349 in a reverse pass over sections.
1350
1351 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1352
1353 PR binutils/21943
1354 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1355 for @plt suffixes first.
1356 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1357
1358 2017-08-08 Nick Clifton <nickc@redhat.com>
1359
1360 PR 21916
1361 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1362 small section lengths.
1363 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1364 table.
1365 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1366 there is enough data present in the note.
1367
1368 2017-08-08 Alan Modra <amodra@gmail.com>
1369
1370 PR 21017
1371 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1372 got.refcount for GOTOFF relocs, just create .got section.
1373
1374 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
1375
1376 * elflink.c (elf_link_add_object_symbols): Move common symbol
1377 check after bed->common_definition.
1378
1379 2017-08-07 Alan Modra <amodra@gmail.com>
1380
1381 PR 21910
1382 * elflink.c (bfd_elf_final_link): Don't segfault when sections
1383 needed to define various dynamic tags have been discarded.
1384
1385 2017-08-07 Nick Clifton <nickc@redhat.com>
1386
1387 PR 21884
1388 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
1389 has not been set then use the bfd returned by
1390 _bfd_elf_link_setup_gnu_properties. If that is null then search
1391 through all the input bfds selecting the first normal, ELF format
1392 one.
1393 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1394
1395 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1396
1397 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
1398 to 1 bit.
1399 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
1400 (elf_i386_check_tls_transition): Check tls_get_addr directly.
1401 (elf_i386_convert_load_reloc): Update tls_get_addr check.
1402 (elf_i386_link_check_relocs): New function.
1403 (bfd_elf32_bfd_link_check_relocs): New.
1404 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
1405 to 1 bit.
1406 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
1407 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
1408 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
1409 (elf_x86_64_link_check_relocs): New function.
1410 (bfd_elf64_bfd_link_check_relocs): New.
1411 (bfd_elf32_bfd_link_check_relocs): Likewise.
1412
1413 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1414
1415 PR ld/21903:
1416 * elflink.c (elf_link_add_object_symbols): Treat common symbol
1417 as undefined for --no-define-common.
1418
1419 2017-08-05 Alan Modra <amodra@gmail.com>
1420
1421 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
1422 hppa_link_hash_table.
1423
1424 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
1425
1426 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
1427 entries for sysregs with negative indices.
1428
1429 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1430
1431 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
1432 isn't the S/390 specific elf data.
1433 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1434
1435 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
1436
1437 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
1438 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
1439 [R_RISCV_ADD16]: Likewise.
1440 [R_RISCV_ADD32]: Likewise.
1441 [R_RISCV_ADD64]: Likewise.
1442 [R_RISCV_SUB6]: Likewise.
1443 [R_RISCV_SUB8]: Likewise.
1444 [R_RISCV_SUB16]: Likewise.
1445 [R_RISCV_SUB32]: Likewise.
1446 [R_RISCV_SUB64]: Likewise.
1447
1448 2017-07-31 Alan Modra <amodra@gmail.com>
1449
1450 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
1451 without ld.so checks.
1452
1453 2017-07-29 Alan Modra <amodra@gmail.com>
1454
1455 PR 21847
1456 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
1457 (ppc64_elf_merge_symbol): Set non_zero_localentry.
1458 (is_elfv2_localentry0): Test non_zero_localentry.
1459 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
1460
1461 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1462
1463 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
1464 pointer check for htab->elf.irelplt.
1465 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1466
1467 2017-07-27 Nick Clifton <nickc@redhat.com>
1468
1469 PR 21840
1470 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
1471 size is -1.
1472 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
1473 with error return.
1474 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
1475 are NULL.
1476 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
1477 of end pointer.
1478 (evax_bfd_print_emh): Check for invalid string lengths.
1479
1480 2017-07-25 Nick Clifton <nickc@redhat.com>
1481
1482 * po/fr.po: Updated French translation.
1483
1484 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
1485
1486 PR 21824
1487 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
1488 16-bit absolute branches into 10-bit pc-relative branches on the
1489 MSP430 as well as the MSP430X.
1490
1491 2017-07-25 Alan Modra <amodra@gmail.com>
1492
1493 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
1494 (stub_eh_frame_size): New function.
1495 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
1496 (group_sections): Init group tls_get_addr_opt_bctrl.
1497 (ppc64_elf_size_stubs): Update sizing and initialization of
1498 .eh_frame. Iteration over stubs via group list.
1499 (ppc64_elf_build_stubs): Iterate over stubs via group list.
1500 (ppc64_elf_finish_dynamic_sections): Update finalization of
1501 .eh_frame.
1502
1503 2017-07-24 Nick Clifton <nickc@redhat.com>
1504
1505 PR 21813
1506 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
1507 of the relocs to the canonicalize_one_reloc routine.
1508 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
1509 for the _bfd_mach_o_canonicalize_one_reloc field.
1510 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
1511 res_base parameter. Use to check for corrupt pair relocs.
1512 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
1513 Likewise.
1514 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
1515 Likewise.
1516 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
1517 Likewise.
1518
1519 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
1520 enough data in the record before attempting to parse it.
1521 (_bfd_vms_slurp_eeom): Likewise.
1522
1523 (_bfd_vms_slurp_egsd): Check for an invalid section index.
1524 (image_set_ptr): Likewise.
1525 (alpha_vms_slurp_relocs): Likewise.
1526
1527 (alpha_vms_object_p): Check for a truncated record.
1528
1529 2017-07-24 Nick Clifton <nickc@redhat.com>
1530
1531 PR 21803
1532 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
1533 an unrecognized reloc and sets the bfd_error value.
1534 * libbfd.h: Regenerate.
1535 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
1536 function.
1537 * elf32-i386.c (elf_i386_relocate_section): Likewise.
1538 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1539 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1540 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
1541 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1542
1543 2017-07-23 Alan Modra <amodra@gmail.com>
1544
1545 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
1546 restore of LR.
1547
1548 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
1549
1550 PR ld/18841
1551 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
1552 reloc_class_ifunc for ifunc symbols.
1553
1554 2017-07-19 Nick Clifton <nickc@redhat.com>
1555
1556 PR 21787
1557 * archive.c (bfd_generic_archive_p): If the bfd does not have the
1558 correct magic bytes at the start, set the error to wrong format
1559 and clear the format selector before returning NULL.
1560
1561 2017-07-19 Nick Clifton <nickc@redhat.com>
1562
1563 PR 21786
1564 * coff-rs6000.c (_bfd_strntol): New function.
1565 (_bfd_strntoll): New function.
1566 (GET_VALUE_IN_FIELD): New macro.
1567 (EQ_VALUE_IN_FIELD): new macro.
1568 (_bfd_xcoff_slurp_armap): Use new macros.
1569 (_bfd_xcoff_archive_p): Likewise.
1570 (_bfd_xcoff_read_ar_hdr): Likewise.
1571 (_bfd_xcoff_openr_next_archived_file): Likewise.
1572 (_bfd_xcoff_stat_arch_elt): Likewise.
1573 * coff64-rs6000.c (_bfd_strntol): New function.
1574 (_bfd_strntoll): New function.
1575 (GET_VALUE_IN_FIELD): New macro.
1576 (xcoff64_slurp_armap): Use new macros.
1577
1578 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
1579 John Eric Martin <John.Martin@emmicro-us.com>
1580
1581 * bfd-in2.h: Regenerate.
1582 * libbfd.h: Regenerate.
1583 * elf32-arc.c (JLI): Define.
1584 * reloc.c: Add JLI relocations.
1585
1586 2017-07-18 Nick Clifton <nickc@redhat.com>
1587
1588 PR 21775
1589 * coff-sh.c: Fix spelling typos.
1590 * compress.c: Likewise.
1591 * cpu-pdp11.c: Likewise.
1592 * ecofflink.c: Likewise.
1593 * elf-m10300.c: Likewise.
1594 * elf.c: Likewise.
1595 * elf32-arm.c: Likewise.
1596 * elf32-m68k.c: Likewise.
1597 * elf32-nds32.c: Likewise.
1598 * elf32-ppc.c: Likewise.
1599 * elf32-sh.c: Likewise.
1600 * elf32-v850.c: Likewise.
1601 * elf64-ppc.c: Likewise.
1602 * elf64-x86-64.c: Likewise.
1603 * elflink.c: Likewise.
1604 * elfnn-aarch64.c: Likewise.
1605 * elfxx-mips.c: Likewise.
1606 * som.c: Likewise.
1607 * sunos.c: Likewise.
1608 * vms-alpha.c: Likewise.
1609 * xcofflink.c: Likewise.
1610
1611 2017-07-18 Nick Clifton <nickc@redhat.com>
1612
1613 PR binutils/21781
1614 * coffcode.h (handle_COMDAT): Replace abort with an error message
1615 and return.
1616
1617 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1618
1619 PR ld/21782
1620 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
1621 to shared library.
1622
1623 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
1624
1625 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
1626
1627 2017-07-16 Alan Modra <amodra@gmail.com>
1628
1629 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
1630 __tls_index GOT entries when using __tls_get_addr_opt stub.
1631 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
1632
1633 2017-07-12 Alan Modra <amodra@gmail.com>
1634
1635 * po/es.po: Update from translationproject.org/latest/bfd/.
1636 * po/fi.po: Likewise.
1637 * po/fr.po: Likewise.
1638 * po/id.po: Likewise.
1639 * po/ja.po: Likewise.
1640 * po/ro.po: Likewise.
1641 * po/ru.po: Likewise.
1642 * po/sr.po: Likewise.
1643 * po/sv.po: Likewise.
1644 * po/tr.po: Likewise.
1645 * po/uk.po: Likewise.
1646 * po/vi.po: Likewise.
1647 * po/zh_CN.po: Likewise.
1648 * po/hr.po: New file from translationproject.org.
1649 * configure.ac (ALL_LINGUAS): Add hr. Sort.
1650 * configure: Regenerate.
1651
1652 2017-07-12 Nick Clifton <nickc@redhat.com>
1653
1654 Fix compile time warnings using gcc 7.1.1.
1655 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
1656 plt_name buffer.
1657 (elf_xtensa_get_gotplt_section): Increase length of got_name
1658 buffer.
1659 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
1660 default return of FALSE.
1661 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
1662 default return of FALSE.
1663
1664 2017-07-12 Alan Modra <amodra@gmail.com>
1665
1666 * binary.c (binary_set_section_contents): Don't print filepos in
1667 error message.
1668 (coff_write_object_contents): Cast size_t for error message.
1669 (coff_slurp_line_table): Don't use bfd_vma symndx.
1670 (coff_slurp_reloc_table): Remove unneeded cast.
1671 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
1672 error message.
1673 (find_abstract_instance_name): Likewise.
1674 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
1675 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
1676 (elf32_arm_check_relocs): Make r_symndx an int.
1677 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
1678 format string.
1679 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
1680 message arg.
1681 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
1682 error message.
1683 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
1684 * elf32-s390.c (elf_s390_check_relocs): Likewise.
1685 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
1686 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
1687 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
1688 * elf64-s390.c (elf_s390_check_relocs): Likewise.
1689 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1690 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
1691 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
1692 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
1693 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
1694 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
1695 and use %lu for error message.
1696 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
1697 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
1698 error message.
1699
1700 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
1701 in error message.
1702 (elf32_arm_final_link_relocate): Likewise.
1703 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
1704 * coffcode.h (styp_to_sec_flags): Likewise.
1705 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
1706 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
1707 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
1708 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
1709 (elf32_bfin_merge_private_bfd_data): Likewise.
1710 * elf32-cris.c (cris_elf_relocate_section): Likewise.
1711 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
1712 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
1713 (i370_elf_relocate_section): Likewise.
1714 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
1715 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
1716 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
1717 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
1718 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
1719 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
1720 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
1721 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
1722 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
1723 * ieee.c (ieee_write_id, read_id): Likewise.
1724 * mach-o.c (bfd_mach_o_write_contents): Likewise.
1725 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
1726 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
1727 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
1728 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
1729 * stabs.c (_bfd_link_section_stabs): Likewise.
1730
1731 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
1732 format.
1733 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
1734 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
1735 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
1736 * coff-sh.c (sh_relax_section): Likewise.
1737 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
1738 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
1739 * coffcode.h (coff_slurp_reloc_table): Likewise.
1740 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
1741 (_bfd_coff_read_string_table): Likewise.
1742 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
1743 * compress.c (bfd_get_full_section_contents): Likewise.
1744 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
1745 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
1746 * elf.c (bfd_elf_string_from_elf_section): Likewise.
1747 * elf32-arc.c (arc_special_overflow_checks): Likewise.
1748 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
1749 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
1750 (elf32_arm_write_section): Likewise.
1751 * elf32-bfin.c (bfin_relocate_section): Likewise.
1752 (bfinfdpic_relocate_section): Likewise.
1753 * elf32-hppa.c (hppa_build_one_stub): Likewise.
1754 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
1755 * elf32-i386.c (elf_i386_tls_transition): Likewise.
1756 (elf_i386_relocate_section): Likewise.
1757 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
1758 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
1759 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
1760 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
1761 * elf32-metag.c (elf_metag_relocate_section): Likewise.
1762 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
1763 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
1764 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
1765 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
1766 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
1767 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
1768 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
1769 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
1770 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
1771 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
1772 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
1773 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
1774 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
1775 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
1776 * elf32-sh.c (sh_elf_relax_section): Likewise.
1777 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
1778 (sh_elf_relocate_section): Likewise.
1779 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
1780 * elf32-spu.c (spu_elf_relocate_section): Likewise.
1781 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
1782 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1783 * elf32-v850.c (v850_elf_relax_section): Likewise.
1784 * elf32-vax.c (elf_vax_check_relocs): Likewise.
1785 (elf_vax_relocate_section): Likewise.
1786 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
1787 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
1788 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
1789 (do_fix_for_relocatable_link): Likewise.
1790 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
1791 (elf64_alpha_relax_with_lituse): Likewise.
1792 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
1793 (elf_hppa_final_link_relocate): Likewise.
1794 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
1795 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
1796 (elf64_vms_link_add_object_symbols): Likewise.
1797 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
1798 (mmix_final_link_relocate): Likewise.
1799 * elf64-s390.c (invalid_tls_insn): Likewise.
1800 (elf_s390_relocate_section): Likewise.
1801 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
1802 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
1803 (elf_x86_64_relocate_section): Likewise.
1804 * elfcode.h (elf_slurp_symbol_table): Likewise.
1805 * elfcore.h (elf_core_file_p): Likewise.
1806 * elflink.c (elf_link_read_relocs_from_section): Likewise.
1807 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1808 (elfNN_aarch64_relocate_section): Likewise.
1809 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
1810 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
1811 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
1812 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
1813 (_bfd_mips_elf_relocate_section): Likewise.
1814 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
1815 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
1816 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1817 * ieee.c (ieee_slurp_external_symbols): Likewise.
1818 * ihex.c (ihex_write_object_content): Likewise.
1819 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
1820 * merge.c (_bfd_merged_section_offset): Likewise.
1821 * mmo.c (mmo_write_loc_chunk): Likewise.
1822 (mmo_write_object_contents): Likewise.
1823 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
1824 * stabs.c (_bfd_link_section_stabs): Likewise.
1825 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
1826
1827 2017-07-11 Alan Modra <amodra@gmail.com>
1828
1829 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
1830
1831 2017-07-11 Alan Modra <amodra@gmail.com>
1832
1833 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
1834 instruction" error using _bfd_error_handler, not einfo.
1835
1836 2017-07-10 Nick Clifton <nickc@redhat.com>
1837
1838 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
1839 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
1840
1841 2017-07-07 John Baldwin <jhb@FreeBSD.org>
1842
1843 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
1844
1845 2017-07-07 Alan Modra <amodra@gmail.com>
1846
1847 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
1848
1849 2017-07-07 Alan Modra <amodra@gmail.com>
1850
1851 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
1852 as long long. Move code replacing "ll" with "I64", and simplify.
1853
1854 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
1855
1856 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
1857 to 1.
1858
1859 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
1860
1861 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
1862 xtime.
1863 (line_info_add_file_name): Likewise.
1864 (decode_line_info): Likewise.
1865
1866 2017-07-04 Tristan Gingold <gingold@adacore.com>
1867
1868 * version.m4: Bump version to 2.29.51
1869 * configure: Regenerate.
1870
1871 2017-07-04 Jiong Wang <jiong.wang@arm.com>
1872
1873 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
1874 sanity check at the head of this function.
1875
1876 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
1877
1878 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
1879 dwarf_line_str_size.
1880 (struct attr_abbrev): Add field implicit_const.
1881 (dwarf_debug_sections): Add .debug_line_str.
1882 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
1883 (dwarf_debug_section_assert): Add static assertion.
1884 (read_indirect_line_string): New.
1885 (read_abbrevs): Support DW_FORM_implicit_const.
1886 (is_str_attr): Support DW_FORM_line_strp.
1887 (read_attribute_value): Support DW_FORM_line_strp and
1888 DW_FORM_implicit_const.
1889 (read_attribute): Support DW_FORM_implicit_const.
1890 (line_info_add_include_dir, line_info_add_include_dir_stub):
1891 (line_info_add_file_name, read_formatted_entries): New.
1892 (decode_line_info, parse_comp_unit): Support DWARF 5.
1893 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
1894
1895 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1896
1897 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
1898 abort statement that was put for symbols that are not dynamic.
1899
1900 2017-07-03 Tristan Gingold <gingold@adacore.com>
1901
1902 * po/bfd.pot: Regenerate
1903
1904 2017-07-03 Alan Modra <amodra@gmail.com>
1905
1906 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
1907 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
1908 * elf.c (setup_group): Use "Lx" to print sh_size.
1909 (_bfd_elf_setup_sections): Remove unnecessary cast and print
1910 unknown section type in hex.
1911 (copy_special_section_fields): Style fix.
1912 (bfd_section_from_shdr): Correct format for sh_link. Use a
1913 common error message for all the variants of unrecognized
1914 section types.
1915 (assign_file_positions_for_load_sections): Use "Lx" for lma
1916 adjust error message.
1917 (assign_file_positions_for_non_load_sections): Formatting.
1918 (rewrite_elf_program_header): Formatting. Use "Lx" for
1919 bfd_vma values in error messages.
1920 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
1921 ELF_R_SYM value to type expected by format.
1922 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
1923 in error messages.
1924 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
1925 (elf_link_input_bfd): Use "Lx" for r_info.
1926 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
1927
1928 2017-07-03 Alan Modra <amodra@gmail.com>
1929
1930 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
1931 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
1932 Microsoft C library variant of long long format specifier.
1933 (PRINT20): Cast value to bfd_uint64_t not long long.
1934 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
1935 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
1936 long long. Don't cast to bfd_vma.
1937 * elf32-score.c (score3_bfd_getl48): Likewise.
1938 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
1939
1940 2017-07-03 Alan Modra <amodra@gmail.com>
1941
1942 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
1943 print d_tag.
1944 (bfd_elf_print_symbol): Don't cast symbol->flags.
1945 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
1946 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
1947 _bfd_error_handler argument order.
1948 (ppc_elf_merge_private_bfd_data): Don't cast flags.
1949
1950 2017-07-03 Alan Modra <amodra@gmail.com>
1951
1952 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
1953 AC_TYPE_LONG_DOUBLE.
1954 * configure: Regenerate.
1955 * config.in: Regenerate.
1956
1957 2017-06-29 Andrew Waterman <andrew@sifive.com>
1958
1959 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
1960 relocs.
1961
1962 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
1963
1964 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
1965 unless it is undefined weak.
1966 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
1967 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
1968 relocation.
1969 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
1970 is not dynamic in PIC, abort.
1971
1972 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1973
1974 PR ld/21402
1975 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
1976 undefined weak symbols into dynamic.
1977 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
1978 relocation for non-dynamic symbols.
1979 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
1980
1981 2017-06-29 Jiong Wang <jiong.wang@arm.com>
1982
1983 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
1984 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
1985 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
1986 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
1987 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
1988 support for them.
1989
1990 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
1991
1992 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
1993 (elfcore_write_s390_gs_bc): Likewise.
1994 * elf.c (elfcore_grok_s390_gs_cb): New function.
1995 (elfcore_grok_s390_gs_bc): New function.
1996 (elfcore_grok_note): Call them.
1997 (elfcore_write_s390_gs_cb): New function.
1998 (elfcore_write_s390_gs_bc): New function.
1999 (elfcore_write_register_note): Call them.
2000
2001 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2002
2003 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2004 bfd_get_file_size. Check archive element size.
2005 (_bfd_generic_get_section_contents_in_window): Likewise.
2006
2007 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2008
2009 * bfd-in2.h: Regenerated.
2010 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2011 (bfd_get_file_size): Likewise.
2012
2013 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2014 Matthew Fortune <matthew.fortune@imgtec.com>
2015
2016 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2017 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2018 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2019 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2020 case.
2021 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2022 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2023 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2024 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2025 `bfd_mach_mips_interaptiv_mr2' entries.
2026 * bfd-in2.h: Regenerate.
2027
2028 2017-06-27 Nick Clifton <nickc@redhat.com>
2029
2030 * tekhex.c (pass_over): Revert accidental conversion of a local
2031 array to a static array.
2032
2033 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2034
2035 PR ld/13402
2036 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2037 reloc addend if necessary. Adjust diff only if
2038 shrinked_insn_address < end_address.
2039
2040 2017-06-27 Alan Modra <amodra@gmail.com>
2041
2042 PR binutils/21665
2043 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2044 (_bfd_generic_get_section_contents_in_window): Likewise.
2045
2046 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2047
2048 * elfnn-riscv.c (perform_relocation): Support the new
2049 R_RISCV_32_PCREL relocation.
2050 (riscv_elf_relocate_section): Likewise.
2051 * elfxx-riscv.c (howto_table): Likewise.
2052 (riscv_reloc_map): Likewise.
2053 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2054 * libbfd.h: Regenerate.
2055
2056 2017-06-27 Alan Modra <amodra@gmail.com>
2057
2058 PR binutils/21665
2059 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2060 Use unsigned file pointer type, and remove cast.
2061 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2062 Add "count", not "sz".
2063
2064 2017-06-26 Pedro Alves <palves@redhat.com>
2065
2066 PR binutils/21665
2067 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2068 "sz".
2069
2070 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2071
2072 PR binutils/21665
2073 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2074 a missing line.
2075
2076 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2077
2078 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2079 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2080 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2081 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2082 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2083
2084 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2085
2086 PR binutils/21665
2087 * compress.c (bfd_get_full_section_contents): Don't check the
2088 file size here.
2089 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2090 reject a section whose size + offset is greater than the size
2091 of the entire file.
2092 (_bfd_generic_get_section_contents_in_window): Likewise.
2093
2094 2017-06-26 Nick Clifton <nickc@redhat.com>
2095
2096 PR binutils/21670
2097 * tekhex.c (getvalue): Check for the source pointer exceeding the
2098 end pointer before the first byte is read.
2099
2100 2017-06-26 Nick Clifton <nickc@redhat.com>
2101
2102 PR binutils/21665
2103 * opncls.c (get_build_id): Check that the section is big enough
2104 to contain the whole note.
2105 * compress.c (bfd_get_full_section_contents): Check for and reject
2106 a section whose size is greater than the size of the entire file.
2107 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2108 contain a notes section.
2109
2110 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2111
2112 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2113 pointer checks.
2114 (elf_s390_modify_segment_map): Likewise.
2115 (bfd_elf_s390_set_options): Lisewise.
2116
2117 2017-06-26 Alan Modra <amodra@gmail.com>
2118
2119 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2120 a --just-syms bfd.
2121 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2122 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2123 .preinit_array on --just-syms bfds.
2124 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2125 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2126 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2127
2128 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2129
2130 * elf.c (find_link): Bounds check "hint".
2131
2132 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2133
2134 * elf32-arm.c (using_thumb_only): Update list of architectures in
2135 BFD_ASSERT for which the logic is valid.
2136 (using_thumb2_bl): Likewise.
2137 (using_thumb2): Likewise and return true for ARMv8-R.
2138 (arch_has_arm_nop): Likewise.
2139 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2140 merging logic. Update commentis for value 15 of v8m_baseline,
2141 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2142 merging of value 15 of Tag_CPU_arch.
2143
2144 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2145
2146 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2147 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2148 * bfd-in2.h: Regenerate.
2149
2150 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2151
2152 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2153 the error_alignment label forward. Properly align program
2154 property note section.
2155
2156 2017-06-22 Eric Christopher <echristo@gmail.com>
2157
2158 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2159 abs to fix a truncation warning.
2160
2161 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2162
2163 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2164 local undefined weak symbol to 0.
2165 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2166
2167 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2168
2169 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2170 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2171 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2172 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2173 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2174 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2175 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2176 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2177
2178 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2179
2180 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2181 (elf_i386_lazy_ibt_plt_entry): Likewise.
2182 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2183 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2184 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2185 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2186 (elf_i386_lazy_plt_layout): Likewise.
2187 (elf_i386_non_lazy_plt_layout): Likewise.
2188 (elf_i386_link_hash_entry): Add plt_second.
2189 (elf_i386_link_hash_table): Add plt_second and
2190 plt_second_eh_frame.
2191 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2192 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2193 the second PLT. Check the second PLT.
2194 (elf_i386_relocate_section): Use the second PLT to resolve
2195 PLT reference if needed.
2196 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2197 needed.
2198 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2199 second PLT. Generate unwind info for the second PLT.
2200 (elf_i386_plt_type): Add plt_second.
2201 (elf_i386_get_synthetic_symtab): Support the second PLT.
2202 (elf_i386_parse_gnu_properties): Support
2203 GNU_PROPERTY_X86_FEATURE_1_AND.
2204 (elf_i386_merge_gnu_properties): Support
2205 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2206 on GNU_PROPERTY_X86_FEATURE_1_IBT
2207 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2208 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2209 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2210 is set on all relocatable inputs.
2211 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2212 (elf_x32_lazy_ibt_plt_entry): Likewise.
2213 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2214 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2215 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2216 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2217 (elf_x86_64_lazy_ibt_plt): Likewise.
2218 (elf_x32_lazy_ibt_plt): Likewise.
2219 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2220 (elf_x32_non_lazy_ibt_plt): Likewise.
2221 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2222 (elf_x86_64_parse_gnu_properties): Support
2223 GNU_PROPERTY_X86_FEATURE_1_AND.
2224 (elf_x86_64_merge_gnu_properties): Support
2225 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2226 on GNU_PROPERTY_X86_FEATURE_1_IBT
2227 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2228 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2229 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2230 is set on all relocatable inputs.
2231
2232 2017-06-22 Nick Clifton <nickc@redhat.com>
2233
2234 PR binutils/21649
2235 * som.c (setup_sections): NUL terminate the space_strings buffer.
2236 Check that the space.name field does not index beyond the end of
2237 the space_strings buffer.
2238
2239 2017-06-21 Nick Clifton <nickc@redhat.com>
2240
2241 PR binutils/21646
2242 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2243
2244 2017-06-21 Nick Clifton <nickc@redhat.com>
2245
2246 PR binutils/21639
2247 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2248 type of the size parameter.
2249 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2250 length of the counted string.
2251 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2252 (_bfd_vms_save_counted_string): Likewise.
2253 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2254 _bfd_vms_save_counted_string.
2255 (_bfd_vms_slurp_ehdr): Likewise.
2256 (_bfd_vms_slurp_egsd): Likewise.
2257 (Parse_module): Likewise.
2258
2259 2017-06-21 Alan Modra <amodra@gmail.com>
2260
2261 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2262 calls before tocsave calls.
2263 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2264 following nop.
2265
2266 2017-06-21 Nick Clifton <nickc@redhat.com>
2267
2268 PR binutils/21645
2269 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2270 bfd_get_full_section_contents returns no contents.
2271
2272 2017-06-21 Nick Clifton <nickc@redhat.com>
2273
2274 PR binutils/21638
2275 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2276 record.
2277
2278 2017-06-21 Nick Clifton <nickc@redhat.com>
2279
2280 PR binutils/21637
2281 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2282 list.
2283 (image_set_ptr): Likewise.
2284 (alpha_vms_fix_sec_rel): Likewise.
2285 (alpha_vms_slurp_relocs): Likewise.
2286
2287 2017-06-21 Nick Clifton <nickc@redhat.com>
2288
2289 PR binutils/21633
2290 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2291 read_id.
2292 (ieee_archive_p): Likewise.
2293 (ieee_object_p): Likewise.
2294
2295 2017-06-21 Nick Clifton <nickc@redhat.com>
2296
2297 PR binutils/21640
2298 * elf.c (setup_group): Zero the group section pointer list after
2299 allocation so that loops can be caught. Check for NULL pointers
2300 when processing a group list.
2301
2302 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2303
2304 * elf-s390.h: New file.
2305 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2306 field.
2307 (elf_s390_additional_program_headers): New function.
2308 (elf_s390_modify_segment_map): New function.
2309 (bfd_elf_s390_set_options): New function.
2310 (elf_backend_additional_program_headers)
2311 (elf_backend_modify_segment_map): Add macro definitions.
2312
2313 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2314
2315 PR ld/21626
2316 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2317 the DYNAMIC bit instead of bfd_count_sections.
2318
2319 2017-06-19 Nick Clifton <nickc@redhat.com>
2320
2321 PR binutils/21618
2322 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2323 length.
2324 (evax_bfd_print_eeom): Likewise.
2325 (evax_bfd_print_egsd): Check for an overlarge record length.
2326 (evax_bfd_print_etir): Likewise.
2327
2328 2017-06-19 Nick Clifton <nickc@redhat.com>
2329
2330 PR binutils/21612
2331 * libieee.h (struct common_header_type): Add end_p field.
2332 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2333 end_p.
2334 (read_id): Check for a length that exceeds the remaining bytes in
2335 the input buffer.
2336 (ieee_seek): Initialise end_p.
2337 (ieee_archive_p): Likewise.
2338 (ieee_object_p): Likewise.
2339
2340 2017-06-19 Nick Clifton <nickc@redhat.com>
2341
2342 PR binutils/21611
2343 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2344 before reading the EIHS structure entries.
2345
2346 2017-06-19 Nick Clifton <nickc@redhat.com>
2347
2348 PR binutils/21615
2349 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2350 gsd_size. Check that there are enough bytes remaining to read the
2351 type and size of the next egsd. Check that the size of the egsd
2352 does not exceed the size of the record.
2353
2354 2017-06-19 Alan Modra <amodra@gmail.com>
2355
2356 * config.bfd: Correct targ_underscore for cris.
2357
2358 2017-06-18 Alan Modra <amodra@gmail.com>
2359
2360 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2361 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2362
2363 2017-06-16 Nick Clifton <nickc@redhat.com>
2364
2365 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2366 bucketlist is empty because there are no symbols to add to the
2367 list.
2368
2369 2017-06-16 Alan Modra <amodra@gmail.com>
2370
2371 PR ld/20022
2372 PR ld/21557
2373 PR ld/21562
2374 PR ld/21571
2375 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
2376 (BFD_JUMP_TABLE_LINK): Likewise.
2377 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
2378 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
2379 (bfd_elf_define_start_stop): New function.
2380 * linker.c (bfd_generic_define_start_stop): New function.
2381 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
2382 new field.
2383 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
2384 * aout-target.h (MY_bfd_define_start_stop): Define.
2385 * aout-tic30.c (MY_bfd_define_start_stop): Define.
2386 * binary.c (binary_bfd_define_start_stop): Define.
2387 * bout.c (b_out_bfd_define_start_stop): Define.
2388 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
2389 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
2390 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
2391 * coffcode.h (coff_bfd_define_start_stop): Define.
2392 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
2393 * i386msdos.c (msdos_bfd_define_start_stop): Define.
2394 * i386os9k.c (os9k_bfd_define_start_stop): Define.
2395 * ieee.c (ieee_bfd_define_start_stop): Define.
2396 * ihex.c (ihex_bfd_define_start_stop): Define.
2397 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
2398 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
2399 * mmo.c (mmo_bfd_define_start_stop): Define.
2400 * nlm-target.h (nlm_bfd_define_start_stop): Define.
2401 * oasys.c (oasys_bfd_define_start_stop): Define.
2402 * pef.c (bfd_pef_bfd_define_start_stop): Define.
2403 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
2404 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
2405 * som.c (som_bfd_define_start_stop): Define.
2406 * srec.c (srec_bfd_define_start_stop): Define.
2407 * tekhex.c (tekhex_bfd_define_start_stop): Define.
2408 * versados.c (versados_bfd_define_start_stop): Define.
2409 * vms-alpha.c (vms_bfd_define_start_stop): Define.
2410 (alpha_vms_bfd_define_start_stop): Define.
2411 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
2412 * bfd-in2.h: Regenerate.
2413 * libbfd.h: Regenerate.
2414
2415 2017-06-16 Jiong Wang <jiong.wang@arm.com>
2416
2417 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
2418 SYMBOL_REFERENCES_LOCAL.
2419
2420 2017-06-15 Jiong Wang <jiong.wang@arm.com>
2421
2422 PR ld/21532
2423 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
2424 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
2425 runtime for if there needs copy relocation elimination.
2426 (need_copy_relocation_p): New function. Return true for symbol with
2427 pc-relative references and if it's against read-only sections.
2428 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
2429 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
2430 that are related with accessing external objects.
2431 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
2432 in elfNN_aarch64_check_relocs.
2433
2434 2017-06-15 Nick Clifton <nickc@redhat.com>
2435
2436 PR binutils/21582
2437 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
2438 bugs.
2439 PR binutils/21581
2440 (ieee_archive_p): Likewise.
2441
2442 2017-06-15 Nick Clifton <nickc@redhat.com>
2443
2444 PR binutils/21579
2445 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
2446
2447 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
2448
2449 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
2450 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
2451 keep both windowed and call0 ABI PLT definitions.
2452 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
2453 elf_xtensa_*_plt_entry endex.
2454 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
2455
2456 2017-06-14 Nick Clifton <nickc@redhat.com>
2457
2458 PR binutils/21578
2459 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
2460 flag value.
2461
2462 2017-06-14 Nick Clifton <nickc@redhat.com>
2463
2464 PR binutils/21589
2465 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
2466 maximum value for the ascic pointer. Check that name processing
2467 does not read beyond this value.
2468 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
2469 end of etir record.
2470
2471 2017-06-14 Nick Clifton <nickc@redhat.com>
2472
2473 PR binutils/21591
2474 * versados.c (versados_mkobject): Zero the allocated tdata structure.
2475 (process_otr): Check for an invalid offset in the otr structure.
2476
2477 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
2478
2479 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
2480
2481 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
2482
2483 PR ld/20022
2484 PR ld/21557
2485 PR ld/21562
2486 PR ld/21571
2487 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
2488 vtable field to a union.
2489 (_bfd_elf_is_start_stop): Removed.
2490 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
2491 __start_SECNAME and __stop_SECNAME symbols.
2492 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2493 * elflink.c (_bfd_elf_is_start_stop): Removed.
2494 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
2495 _bfd_elf_is_start_stop.
2496 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
2497 __stop_SECNAME symbols. Updated.
2498 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2499 (bfd_elf_gc_record_vtinherit): Likewise.
2500 (bfd_elf_gc_record_vtentry): Likewise.
2501
2502 2017-06-13 Nick Clifton <nickc@redhat.com>
2503
2504 PR ld/21524
2505 * elflink.c (elf_link_adjust_relocs): Generate an error when
2506 encountering a reloc against a symbol removed by garbage
2507 collection.
2508
2509 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2510
2511 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
2512 to merge_gnu_properties.
2513 * elf-properties.c (elf_merge_gnu_properties): Add struct
2514 bfd_link_info * and pass it to merge_gnu_properties.
2515 (elf_merge_gnu_property_list): Add struct bfd_link_info *
2516 and pass it to elf_merge_gnu_properties.
2517 (_bfd_elf_link_setup_gnu_properties): Pass info to
2518 elf_merge_gnu_property_list.
2519 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
2520 bfd_link_info *.
2521 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
2522
2523 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
2524
2525 PR 21564
2526 * binary.c (binary_set_section_contents): Scale lma by octets
2527 per byte to set filepos.
2528
2529 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2530
2531 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
2532 dynamic sections.
2533
2534 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2535
2536 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
2537 require TEXTREL.
2538
2539 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2540
2541 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
2542 patched section contents for TLS IE reloc.
2543 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
2544
2545 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2546
2547 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
2548 RELOC_FOR_GLOBAL_SYMBOL macro.
2549
2550 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2551
2552 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
2553 changes.
2554
2555 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2556
2557 * config/tc-arc.c (md_undefined_symbol): Changed.
2558 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
2559
2560 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2561
2562 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
2563 symbols.
2564
2565 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2566
2567 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
2568 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
2569
2570 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2571
2572 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
2573 object is created.
2574
2575 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
2576
2577 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
2578 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
2579 is non-zero. Add clarifying comments.
2580
2581 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
2582
2583 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
2584 name. Use local IFUNC symbol name string to report unsupported
2585 non-PIC call to IFUNC function.
2586 (elf_i386_relocate_section): Dump local IFUNC name with minfo
2587 when generating R_386_IRELATIVE relocation.
2588 (elf_i386_finish_dynamic_symbol): Likewise.
2589 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
2590 IFUNC symbol name.
2591 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
2592 when generating R_X86_64_IRELATIVE relocation.
2593 (elf_x86_64_finish_dynamic_symbol): Likewise.
2594
2595 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2596
2597 * elf.c (setup_group): Make sure BFD sections are created for all
2598 group sections in the input file when processing SHF_GROUP
2599 sections.
2600 (bfd_section_from_shdr): Avoid duplicating logic already
2601 implemented in `setup_group'.
2602
2603 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
2604
2605 PR binutils/21546
2606 * peXXigen.c (pe_print_idata): Use the address of the first thunk
2607 if the hint address is zero.
2608
2609 2017-06-06 James Clarke <jrtc27@jrtc27.com>
2610
2611 PR ld/19579
2612 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
2613 ELF_COMMON_DEF_P for common symbols.
2614
2615 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
2616
2617 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
2618 SEC_GROUP sections as SEC_EXCLUDE.
2619 (bfd_elf_set_group_contents): Replace use of abort with an assert.
2620 (assign_section_numbers): Use resolve_section_groups flag instead
2621 of relocatable link type.
2622 (_bfd_elf_init_private_section_data): Use resolve_section_groups
2623 flag instead of checking the final_link flag for part of the
2624 checks in here. Fix white space as a result.
2625 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
2626 instead of relocatable link type.
2627 (bfd_elf_final_link): Likewise.
2628
2629 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2630
2631 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
2632 variable `bed'.
2633 * elf32-score.c (score_elf_final_link_relocate): Likewise.
2634 (s3_bfd_score_elf_check_relocs): Likewise.
2635 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
2636 (score_elf_final_link_relocate): Likewise.
2637 (s7_bfd_score_elf_check_relocs): Likewise.
2638
2639 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
2640
2641 * elflink.c (init_reloc_cookie_rels): Remove unused variable
2642 `bed'.
2643
2644 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
2645
2646 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
2647 from `reloc_count' rather than decrementing it.
2648 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
2649 `reloc_count' by `int_rels_per_ext_rel'.
2650 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
2651 `reloc_count' by `int_rels_per_ext_rel' for last relocation
2652 entry determination.
2653 (s3_bfd_score_elf_check_relocs): Likewise.
2654 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
2655 (s7_bfd_score_elf_relocate_section): Likewise.
2656 (s7_bfd_score_elf_check_relocs): Likewise.
2657 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
2658 prototype and function.
2659 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
2660 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
2661 triple rather than once the sum of REL and RELA relocation entry
2662 counts.
2663 (bfd_elf64_get_reloc_upper_bound): Remove macro.
2664 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
2665 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
2666 storage allocation size determination.
2667 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
2668 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
2669 by `int_rels_per_ext_rel' for last relocation entry
2670 determination.
2671 (bfd_elf_final_link): Do not multiply `reloc_count' by
2672 `int_rels_per_ext_rel' for internal relocation storage
2673 allocation size determination.
2674 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
2675 `int_rels_per_ext_rel' for last relocation entry determination.
2676 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2677 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2678 (_bfd_mips_elf_relocate_section): Likewise.
2679
2680 2017-06-05 Alan Modra <amodra@gmail.com>
2681
2682 PR 21529
2683 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
2684
2685 2017-06-01 John Baldwin <jhb@FreeBSD.org>
2686
2687 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
2688 determine structure sizes.
2689 (elfcore_grok_freebsd_prstatus): Likewise.
2690
2691 2017-06-01 Alan Modra <amodra@gmail.com>
2692
2693 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
2694 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
2695 dynamic objects.
2696 (is_elfv2_localentry0): New function.
2697 (ppc64_elf_tls_setup): Default params->plt_localentry0.
2698 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
2699 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
2700 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
2701 optimized localentry:0 stubs.
2702 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
2703 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
2704 localentry:0 stubs.
2705 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
2706 DT_PPC64_OPT.
2707 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
2708
2709 2017-05-30 Casey Smith <clegg89@gmail.com>
2710
2711 PR ld/21523
2712 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
2713 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
2714
2715 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
2716
2717 * cpu-arc.c (arc_compatible): New function.
2718
2719 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
2720
2721 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
2722
2723 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
2724
2725 PR binutils/21519
2726 * bfdio.c (bfd_get_file_size): New function.
2727 * bfd-in2.h: Regenerated.
2728
2729 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
2730
2731 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
2732 comments.
2733
2734 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
2735
2736 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
2737 dynobj instead of htab->elf.dynobj.
2738
2739 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
2740
2741 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
2742 and function.
2743 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
2744 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
2745 actual number of internal relocations retrieved. Adjust
2746 function description.
2747 (bfd_elf64_canonicalize_reloc): Remove macro.
2748 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
2749
2750 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
2751
2752 * archures.c (bfd_mach_sparc_v9m8): Define.
2753 (bfd_mach_sparc_v8plusm8): Likewise.
2754 (bfd_mach_sparc_v9_p): Adjust to M8.
2755 (bfd_mach_sparc_64bit_p): Likewise.
2756 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
2757 bfd_mach_sparc_v8plusm8.
2758 * bfd-in2.h: Regenerated.
2759 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
2760 sparc:v8plusm8.
2761 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
2762 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
2763 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
2764 SHA3.
2765 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
2766 bfd_mach_sparc_v8plusm8.
2767
2768 2017-05-19 Alan Modra <amodra@gmail.com>
2769
2770 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
2771 debug and special sections when no non-note alloc sections in an
2772 object are kept.
2773
2774 2017-05-18 Alan Modra <amodra@gmail.com>
2775
2776 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
2777 * elf-m10300.c: Likewise.
2778 * elf.c: Likewise.
2779 * elf32-arc.c: Likewise.
2780 * elf32-bfin.c: Likewise.
2781 * elf32-m68k.c: Likewise.
2782 * elf32-nds32.c: Likewise.
2783 * elf32-tilepro.c: Likewise.
2784 * elflink.c: Likewise.
2785 * elfnn-aarch64.c: Likewise.
2786 * elfnn-riscv.c: Likewise.
2787 * elfxx-tilegx.c: Likewise.
2788 * mach-o.c: Likewise.
2789 * peXXigen.c: Likewise.
2790 * vms-alpha.c: Likewise.
2791 * vms-lib.c: Likewise.
2792
2793 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
2794
2795 PR ld/20882
2796 * elflink.c (elf_gc_mark_debug_section): New function.
2797 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
2798 referenced by kept debug sections.
2799
2800 2017-05-16 Alan Modra <amodra@gmail.com>
2801
2802 * elf-m10300.c: Rename occurrences of non_ir_ref.
2803 * elf32-arm.c: Likewise.
2804 * elf32-bfin.c: Likewise.
2805 * elf32-cr16.c: Likewise.
2806 * elf32-cris.c: Likewise.
2807 * elf32-d10v.c: Likewise.
2808 * elf32-dlx.c: Likewise.
2809 * elf32-fr30.c: Likewise.
2810 * elf32-frv.c: Likewise.
2811 * elf32-hppa.c: Likewise.
2812 * elf32-i370.c: Likewise.
2813 * elf32-i386.c: Likewise.
2814 * elf32-iq2000.c: Likewise.
2815 * elf32-lm32.c: Likewise.
2816 * elf32-m32c.c: Likewise.
2817 * elf32-m32r.c: Likewise.
2818 * elf32-m68hc1x.c: Likewise.
2819 * elf32-m68k.c: Likewise.
2820 * elf32-mcore.c: Likewise.
2821 * elf32-metag.c: Likewise.
2822 * elf32-microblaze.c: Likewise.
2823 * elf32-moxie.c: Likewise.
2824 * elf32-msp430.c: Likewise.
2825 * elf32-mt.c: Likewise.
2826 * elf32-nios2.c: Likewise.
2827 * elf32-or1k.c: Likewise.
2828 * elf32-ppc.c: Likewise.
2829 * elf32-rl78.c: Likewise.
2830 * elf32-s390.c: Likewise.
2831 * elf32-score.c: Likewise.
2832 * elf32-score7.c: Likewise.
2833 * elf32-sh.c: Likewise.
2834 * elf32-tic6x.c: Likewise.
2835 * elf32-tilepro.c: Likewise.
2836 * elf32-v850.c: Likewise.
2837 * elf32-vax.c: Likewise.
2838 * elf32-xstormy16.c: Likewise.
2839 * elf32-xtensa.c: Likewise.
2840 * elf64-alpha.c: Likewise.
2841 * elf64-hppa.c: Likewise.
2842 * elf64-ia64-vms.c: Likewise.
2843 * elf64-mmix.c: Likewise.
2844 * elf64-ppc.c: Likewise.
2845 * elf64-s390.c: Likewise.
2846 * elf64-sh64.c: Likewise.
2847 * elf64-x86-64.c: Likewise.
2848 * elflink.c: Likewise.
2849 * elfnn-aarch64.c: Likewise.
2850 * elfnn-ia64.c: Likewise.
2851 * elfnn-riscv.c: Likewise.
2852 * elfxx-mips.c: Likewise.
2853 * elfxx-sparc.c: Likewise.
2854 * elfxx-tilegx.c: Likewise.
2855 * linker.c: Likewise.
2856
2857 2017-05-16 Alan Modra <amodra@gmail.com>
2858
2859 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
2860 * elflink.c (elf_link_add_object_symbols): Update to use
2861 non_ir_ref_dynamic.
2862 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
2863 non_ir_ref.
2864 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
2865
2866 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
2867
2868 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
2869
2870 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
2871
2872 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
2873 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
2874 properties.
2875 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
2876
2877 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2878
2879 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
2880 to plt_second.
2881 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
2882 to plt_second/plt_second_eh_frame.
2883 (elf_x86_64_link_hash_newfunc): Updated.
2884 (elf_x86_64_allocate_dynrelocs): Likewise.
2885 (elf_x86_64_size_dynamic_sections): Likewise.
2886 (elf_x86_64_relocate_section): Likewise.
2887 (elf_x86_64_finish_dynamic_symbol): Likewise.
2888 (elf_x86_64_finish_dynamic_sections): Likewise.
2889 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
2890 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
2891 .plt.sec section.
2892 (elf_backend_setup_gnu_properties): Updated. Create the
2893 .plt.sec section instead of the .plt.sec section.
2894
2895 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
2896
2897 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
2898 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
2899 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
2900
2901 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2902
2903 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
2904 (bfd_elf64_set_reloc): Define.
2905 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
2906
2907 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
2908
2909 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
2910 (struct bfd_target): New field _bfd_set_reloc.
2911 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
2912 * reloc.c (_bfd_generic_set_reloc): New function.
2913 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
2914 * nlm-target.h (nlm_set_reloc): Likewise.
2915 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
2916 * aout-tic30.c (MY_set_reloc): Likewise.
2917 * aout-target.h (MY_set_reloc): Likewise.
2918 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
2919 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
2920 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
2921 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
2922 * aout-adobe.c (aout_32_set_reloc): Likewise.
2923 * bout.c (b_out_set_reloc): Likewise.
2924 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
2925 * i386os9k.c (aout_32_set_reloc): Likewise.
2926 * ieee.c (ieee_set_reloc): Likewise.
2927 * oasys.c (oasys_set_reloc): Likewise.
2928 * som.c (som_set_reloc): Likewise.
2929 * versados.c (versados_set_reloc): Likewise.
2930 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
2931 _bfd_generic_set_reloc.
2932 (rs6000_xcoff64_aix_vec): LIkewise.
2933 * libbfd.c (_bfd_norelocs_set_reloc): New function.
2934 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
2935 * i386msdos.c (msdos_set_reloc): Define to
2936 _bfd_norelocs_set_reloc.
2937 * elfcode.h (elf_set_reloc): Define.
2938 * bfd-in2.h: Regenerated.
2939
2940 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
2941
2942 PR ld/21481
2943 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
2944 for IFUNC function address.
2945
2946 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
2947
2948 * elf32-arc.c (FEATURE_LIST_NAME): Define.
2949 (CONFLICT_LIST): Likewise.
2950 (opcode/arc-attrs.h): Include.
2951 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
2952 (arc_extract_features): New file.
2953 (arc_stralloc): Likewise.
2954 (arc_elf_merge_attributes): Likewise.
2955 (arc_elf_merge_private_bfd_data): Use object attributes.
2956 (bfd_arc_get_mach_from_attributes): New function.
2957 (arc_elf_object_p): Use object attributes.
2958 (arc_elf_final_write_processing): Likewise.
2959 (elf32_arc_obj_attrs_arg_type): New function.
2960 (elf32_arc_obj_attrs_handle_unknown): Likewise.
2961 (elf32_arc_section_from_shdr): Likewise.
2962 (elf_backend_obj_attrs_vendor): Define.
2963 (elf_backend_obj_attrs_section): Likewise.
2964 (elf_backend_obj_attrs_arg_type): Likewise.
2965 (elf_backend_obj_attrs_section_type): Likewise.
2966 (elf_backend_obj_attrs_handle_unknown): Likewise.
2967 (elf_backend_section_from_shdr): Likewise.
2968
2969 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
2970
2971 PR ld/21458
2972 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
2973 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
2974 and the destination is a Thumb symbol.
2975
2976 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2977
2978 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
2979 initializer to silence GCC 4.2.
2980 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
2981
2982 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
2983
2984 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
2985 (LAZY_PLT_ENTRY_SIZE): This.
2986 (NON_LAZY_PLT_ENTRY_SIZE): New.
2987 (elf_x86_64_plt0_entry): Renamed to ...
2988 (elf_x86_64_lazy_plt0_entry): This.
2989 (elf_x86_64_plt_entry): Renamed to ...
2990 (elf_x86_64_lazy_plt_entry): This.
2991 (elf_x86_64_bnd_plt0_entry): Renamed to ...
2992 (elf_x86_64_lazy_bnd_plt0_entry): This.
2993 (elf_x86_64_legacy_plt_entry): Removed.
2994 (elf_x86_64_bnd_plt_entry): Renamed to ...
2995 (elf_x86_64_lazy_bnd_plt_entry): This.
2996 (elf_x86_64_legacy_plt2_entry): Renamed to ...
2997 (elf_x86_64_non_lazy_plt_entry): This.
2998 (elf_x86_64_bnd_plt2_entry): Renamed to ...
2999 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3000 (elf_x86_64_eh_frame_plt): Renamed to ...
3001 (elf_x86_64_eh_frame_lazy_plt): This.
3002 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3003 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3004 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3005 (elf_x86_64_eh_frame_non_lazy_plt): This.
3006 (elf_x86_64_lazy_plt_layout): New.
3007 (elf_x86_64_non_lazy_plt_layout): Likewise.
3008 (elf_x86_64_plt_layout): Likewise.
3009 (elf_x86_64_backend_data): Remove PLT layout information. Add
3010 os for target system.
3011 (GET_PLT_ENTRY_SIZE): Removed.
3012 (elf_x86_64_lazy_plt): New.
3013 (elf_x86_64_non_lazy_plt): Likewise.
3014 (elf_x86_64_lazy_bnd_plt): Likewise.
3015 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3016 (elf_x86-64_arch_bed): Updated.
3017 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3018 (elf_x86_64_create_dynamic_sections): Removed.
3019 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3020 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3021 (elf_x86-64_adjust_dynamic_symbol): Updated.
3022 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3023 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3024 size for PLT0 if there is no PLT0. Get plt_entry_size from
3025 non_lazy_plt for non-lazy PLT entries.
3026 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3027 from non_lazy_plt for non-lazy PLT entries.
3028 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3029 if there is no PLT0.
3030 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3031 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3032 entries with non-lazy PLT layout. Don't fill the second and third
3033 slots in the PLT entry if there is no PLT0.
3034 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3035 if there is no PLT0. Set sh_entsize on the .plt.got section.
3036 (compare_relocs): New.
3037 (elf_x86_64_plt_type): Likewise.
3038 (elf_x86_64_plt): Likewise.
3039 (elf_x86_64_nacl_plt): New. Forward declaration.
3040 (elf_x86_64_get_plt_sym_val): Removed.
3041 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3042 against all dynamic relocations.
3043 (elf_x86_64_link_setup_gnu_properties): New function.
3044 (elf_backend_create_dynamic_sections): Updated.
3045 (elf_backend_setup_gnu_properties): New.
3046 (elf_x86_64_nacl_plt): New.
3047 (elf_x86_64_nacl_arch_bed): Updated.
3048
3049 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3050
3051 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3052 (LAZY_PLT_ENTRY_SIZE): This.
3053 (NON_LAZY_PLT_ENTRY_SIZE): New.
3054 (elf_i386_plt0_entry): Renamed to ...
3055 (elf_i386_lazy_plt0_entry): This.
3056 (elf_i386_plt_entry): Renamed to ...
3057 (elf_i386_lazy_plt_entry): This.
3058 (elf_i386_pic_plt0_entry): Renamed to ...
3059 (elf_i386_pic_lazy_plt0_entry): This.
3060 (elf_i386_pic_plt_entry): Renamed to ...
3061 (elf_i386_pic_lazy_plt_entry): This.
3062 (elf_i386_got_plt_entry): Renamed to ...
3063 (elf_i386_non_lazy_plt_entry): This.
3064 (elf_i386_pic_got_plt_entry): Renamed to ...
3065 (elf_i386_pic_non_lazy_plt_entry): This.
3066 (elf_i386_eh_frame_plt): Renamed to ...
3067 (elf_i386_eh_frame_lazy_plt): This.
3068 (elf_i386_eh_frame_plt_got): Renamed to ...
3069 (elf_i386_eh_frame_non_lazy_plt): This.
3070 (elf_i386_plt_layout): Renamed to ...
3071 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3072 eh_frame_plt_got_size.
3073 (elf_i386_non_lazy_plt_layout): New.
3074 (elf_i386_plt_layout): Likewise.
3075 (elf_i386_non_lazy_plt): Likewise.
3076 (GET_PLT_ENTRY_SIZE): Removed.
3077 (elf_i386_plt): Renamed to ...
3078 (elf_i386_lazy_plt): This.
3079 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3080 (elf_i386_arch_bed): Updated.
3081 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3082 (elf_i386_create_dynamic_sections): Removed.
3083 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3084 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3085 (elf_i386_adjust_dynamic_symbol): Updated.
3086 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3087 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3088 size for PLT0 if there is no PLT0.
3089 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3090 output section is discarded only if GOT isn't empty.
3091 (elf_i386_relocate_section): Updated. Properly get PLT index
3092 if there is no PLT0.
3093 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3094 second and third slots in the PLT entry if there is no PLT0.
3095 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3096 if there is no PLT0. Set sh_entsize on the .plt.got section.
3097 (elf_i386_nacl_plt): Forward declaration.
3098 (elf_i386_get_plt_sym_val): Removed.
3099 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3100 against all dynamic relocations.
3101 (elf_i386_link_setup_gnu_properties): New function.
3102 (elf_backend_create_dynamic_sections): Updated.
3103 (elf_backend_setup_gnu_properties): New.
3104 (elf_i386_nacl_plt): Updated.
3105 (elf_i386_nacl_arch_bed): Likewise.
3106 (elf_i386_vxworks_arch_bed): Likewise.
3107
3108 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3109
3110 * elflink.c (elf_output_implib): Remove executable flag from import
3111 library bfd.
3112 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3113 library is a relocatable object file.
3114
3115 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3116
3117 PR ld/21404
3118 * elf32-avr.c (avr_should_move_sym): New function.
3119 (avr_should_reduce_sym_size): Likewise.
3120 (avr_should_increase_sym_size): Likewise.
3121 (elf32_avr_relax_delete_bytes): Adjust symbol values
3122 and sizes by calling new functions.
3123
3124 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3125
3126 * config.bfd (riscv32-*): Enable rv64.
3127
3128 2017-05-02 Alan Modra <amodra@gmail.com>
3129
3130 PR 21384
3131 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3132 rather than h->root.type == bfd_link_hash_new.
3133 (bfd_elf_record_link_assignment): Similarly, call
3134 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3135
3136 2017-04-29 Alan Modra <amodra@gmail.com>
3137
3138 PR 21432
3139 * reloc.c (reloc_offset_in_range): New function.
3140 (bfd_perform_relocation, bfd_install_relocation): Use it.
3141 (_bfd_final_link_relocate): Likewise.
3142
3143 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3144
3145 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3146 before using .plt.got.
3147 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3148
3149 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3150
3151 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3152 instead of "+=" to update 0.
3153
3154 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3155
3156 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3157 .plt.got section here.
3158 (elf_i386_check_relocs): Don't create the .plt.got section.
3159 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3160 the .plt.got and .plt.bnd sections here.
3161 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3162 .plt.bnd sections.
3163
3164 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3165
3166 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3167 has_bnd_reloc.
3168 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3169 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3170 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3171 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3172 has_bnd_reloc.
3173
3174 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3175
3176 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3177 to return bfd *.
3178 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3179 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3180 the first relocatable ELF input with GNU properties.
3181
3182 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3183
3184 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3185 VxWorks for non-PIC.
3186
3187 2017-04-27 Alan Modra <amodra@gmail.com>
3188
3189 * elf-bfd.h (struct elf_backend_data): Make asection param of
3190 elf_backend_eh_frame_address_size const.
3191 (_bfd_elf_eh_frame_address_size): Likewise.
3192 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3193 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3194 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3195 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3196 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3197 (next_cie_fde_offset): Constify params.
3198 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3199
3200 2017-04-27 Alan Modra <amodra@gmail.com>
3201
3202 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3203 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3204 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3205 aug_data_len.
3206 (offset_adjust): New function.
3207 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3208 (adjust_eh_frame_local_symbols): Likewise.
3209 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3210 after changing anything. Return true if anything changed.
3211 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3212 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3213
3214 2017-04-27 Alan Modra <amodra@gmail.com>
3215
3216 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3217 when force_local.
3218
3219 2017-04-27 Alan Modra <amodra@gmail.com>
3220
3221 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3222 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3223 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3224 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3225 for undef and undefweak dyn_relocs.
3226 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3227 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3228 (allocate_got, allocate_dynrelocs): Likewise.
3229 (ppc64_elf_relocate_section): Likewise.
3230
3231 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3232
3233 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3234 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3235 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3236 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3237
3238 2017-04-26 Nick Clifton <nickc@redhat.com>
3239
3240 PR binutils/21434
3241 * reloc.c (bfd_perform_relocation): Check for a negative address
3242 in the reloc.
3243
3244 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3245
3246 PR ld/21334
3247 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3248 member.
3249 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3250 (elf_backend_always_renumber_dynsyms): Define.
3251 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3252 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3253 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3254 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3255 it.
3256 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3257
3258 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3259
3260 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3261 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3262 sections have been created.
3263
3264 2017-04-26 Nick Clifton <nickc@redhat.com>
3265
3266 PR binutils/21431
3267 * compress.c (bfd_init_section_compress_status): Check the return
3268 value from bfd_malloc.
3269
3270 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3271
3272 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3273 no_finish_dynamic_symbol.
3274 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3275 0.
3276 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3277 weak symbol, don't make it dynamic.
3278 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3279 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3280 relocation for GOT reference.
3281 (elf_x86_64_finish_dynamic_symbol): Abort if
3282 no_finish_dynamic_symbol isn't 0.
3283
3284 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3285
3286 PR ld/21402
3287 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3288 undefined weak symbol, don't make it dynamic.
3289 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3290 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3291 relocation for R_386_GOT32.
3292
3293 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3294
3295 PR ld/21425
3296 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3297
3298 2017-04-23 Alan Modra <amodra@gmail.com>
3299
3300 PR 21414
3301 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3302 * elf.c (lcomm_sym): New.
3303 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3304 * bfd-in2.h: Regenerate.
3305
3306 2017-04-23 Alan Modra <amodra@gmail.com>
3307
3308 PR 21412
3309 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3310 parameters and comment.
3311 (_bfd_elf_get_reloc_section): Delete.
3312 (_bfd_elf_plt_get_reloc_section): Declare.
3313 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3314 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3315 Extracted from..
3316 (_bfd_elf_get_reloc_section): ..here. Delete.
3317 (assign_section_numbers): Call elf_get_reloc_section.
3318 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3319 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3320
3321 2017-04-23 Alan Modra <amodra@gmail.com>
3322
3323 PR 21409
3324 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3325 no symbols.
3326
3327 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3328
3329 PR ld/21402
3330 * elf32-i386.c (elf_i386_link_hash_entry): Add
3331 no_finish_dynamic_symbol.
3332 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3333 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3334 symbol, don't make it dynamic in PIE.
3335 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3336 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3337 relocation for R_386_GOT32
3338 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3339 isn't 0.
3340
3341 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3342
3343 PR ld/19617
3344 PR ld/21086
3345 * elflink.c (elf_link_add_object_symbols): Require
3346 --no-dynamic-linker with -E/--dynamic-list when creating
3347 dynamic sections.
3348
3349 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3350
3351 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3352 if forced local.
3353
3354 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3355
3356 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3357 dynamic symbol sorting.
3358
3359 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3360
3361 PR ld/21382
3362 * elflink.c (elf_link_add_object_symbols): Preserve
3363 dynamic_ref_after_ir_def when restoring the symbol table for
3364 unneeded dynamic object.
3365
3366 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3367
3368 PR ld/21401
3369 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3370 on on undefined IFUNC symbol in the second PLT.
3371
3372 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
3373
3374 * peXXigen.c (pe_print_reloc): Correct chunk_end.
3375
3376 2017-04-19 Alan Modra <amodra@gmail.com>
3377
3378 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
3379 or make dynamic for info->dynamic_undefined_weak 0 and 1.
3380 * elf32-ppc.c:Formatting.
3381 (ensure_undefweak_dynamic): Don't make dynamic when
3382 info->dynamic_undefined_weak is zero.
3383 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3384 info->dynamic_undefined_weak. Discard undef dyn_relocs when
3385 not default visibility. Discard undef and undefweak
3386 dyn_relocs earlier.
3387 (ppc_elf_relocate_section): Adjust to suit.
3388 * elf64-ppc.c: Formatting.
3389 (ensure_undefweak_dynamic): Don't make dynamic when
3390 info->dynamic_undefined_weak is zero.
3391 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3392 info->dynamic_undefined_weak. Discard them earlier.
3393
3394 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
3395
3396 PR ld/21389
3397 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
3398 before generating the version definition section.
3399
3400 2017-04-17 Alan Modra <amodra@gmail.com>
3401
3402 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
3403 state when a regular object file defines a symbol with
3404 incompatible type to that defined by an earlier shared lib.
3405
3406 2017-04-13 Alan Modra <amodra@gmail.com>
3407
3408 * coffcode.h: Wrap some overly long _bfd_error_handler args.
3409 * elf.c: Likewise.
3410 * elf32-arm.c: Likewise.
3411 * elf32-i386.c: Likewise.
3412 * elf32-mep.c: Likewise.
3413 * elf64-ia64-vms.c: Likewise.
3414 * elf64-x86-64.c: Likewise.
3415 * elflink.c: Likewise.
3416 * elfnn-ia64.c: Likewise.
3417 * elfxx-mips.c: Likewise.
3418
3419 2017-04-13 Alan Modra <amodra@gmail.com>
3420
3421 * aoutx.h: Use %B and %A in error messages throughout file.
3422 * aout-cris.c: Likewise.
3423 * archive.c: Likewise.
3424 * binary.c: Likewise.
3425 * coff-rs6000.c: Likewise.
3426 * coff-tic4x.c: Likewise.
3427 * coffcode.h: Likewise.
3428 * coffgen.c: Likewise.
3429 * cofflink.c: Likewise.
3430 * coffswap.h: Likewise.
3431 * cpu-arm.c: Likewise.
3432 * elf-eh-frame.c: Likewise.
3433 * elf-m10300.c: Likewise.
3434 * elf.c: Likewise.
3435 * elf32-arc.c: Likewise.
3436 * elf32-arm.c: Likewise.
3437 * elf32-bfin.c: Likewise.
3438 * elf32-frv.c: Likewise.
3439 * elf32-iq2000.c: Likewise.
3440 * elf32-m32c.c: Likewise.
3441 * elf32-microblaze.c: Likewise.
3442 * elf32-nds32.c: Likewise.
3443 * elf32-rl78.c: Likewise.
3444 * elf32-rx.c: Likewise.
3445 * elf32-score.c: Likewise.
3446 * elf32-score7.c: Likewise.
3447 * elf32-sh64.c: Likewise.
3448 * elf32-v850.c: Likewise.
3449 * elf32-vax.c: Likewise.
3450 * elf32-visium.c: Likewise.
3451 * elf64-ia64-vms.c: Likewise.
3452 * elf64-mmix.c: Likewise.
3453 * elf64-sh64.c: Likewise.
3454 * elfcode.h: Likewise.
3455 * elfnn-aarch64.c: Likewise.
3456 * elfnn-ia64.c: Likewise.
3457 * elfxx-mips.c: Likewise.
3458 * hpux-core.c: Likewise.
3459 * ieee.c: Likewise.
3460 * ihex.c: Likewise.
3461 * linker.c: Likewise.
3462 * merge.c: Likewise.
3463 * mmo.c: Likewise.
3464 * oasys.c: Likewise.
3465 * pdp11.c: Likewise.
3466 * peXXigen.c: Likewise.
3467 * rs6000-core.c: Likewise.
3468 * vms-alpha.c: Likewise.
3469 * xcofflink.c: Likewise.
3470
3471 2017-04-13 Alan Modra <amodra@gmail.com>
3472
3473 * bfd.c (PRINT_TYPE): Define.
3474 (_doprnt): New function.
3475 (error_handler_internal): Use _doprnt.
3476 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
3477 calls in their natural order, throughout file.
3478 * coff-mcore.c: Likewise.
3479 * coff-ppc.c: Likewise.
3480 * coff-tic80.c: Likewise.
3481 * cofflink.c: Likewise.
3482 * elf-s390-common.c: Likewise.
3483 * elf.c: Likewise.
3484 * elf32-arm.c: Likewise.
3485 * elf32-i386.c: Likewise.
3486 * elf32-m32r.c: Likewise.
3487 * elf32-msp430.c: Likewise.
3488 * elf32-spu.c: Likewise.
3489 * elf64-ia64-vms.c: Likewise.
3490 * elf64-sparc.c: Likewise.
3491 * elf64-x86-64.c: Likewise.
3492 * elflink.c: Likewise.
3493 * elfnn-aarch64.c: Likewise.
3494 * elfnn-ia64.c: Likewise.
3495 * elfxx-mips.c: Likewise.
3496
3497 2017-04-13 Alan Modra <amodra@gmail.com>
3498
3499 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
3500 branch veneers" error. Fix double space and format message.
3501 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
3502 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
3503
3504 2017-04-13 Alan Modra <amodra@gmail.com>
3505
3506 * bfd-in2.h: Regenerate.
3507
3508 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3509
3510 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
3511 extra `\n' in warning/error messages.
3512 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
3513 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3514
3515 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3516
3517 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
3518 processor-specific properties with generic ELF target vector.
3519
3520 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
3521
3522 * elf32-sparc.c (elf_backend_fixup_symbol): New.
3523 * elf64-sparc.c (elf_backend_fixup_symbol): New.
3524 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
3525 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
3526 has_non_got_reloc.
3527 (link_hash_newfunc): Initialize has_got_reloc and
3528 has_non_got_reloc.
3529 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
3530 section.
3531 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
3532 has_non_got_reloc.
3533 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
3534 has_non_got_reloc.
3535 (_bfd_sparc_elf_fixup_symbol): New function.
3536 (allocate_dynrelocs): Don't allocate space for dynamic
3537 relocations and discard relocations against resolved undefined
3538 weak symbols in executable. Don't make resolved undefined weak
3539 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
3540 relocation against undefined weak symbols in PIE.
3541 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
3542 relocations against resolved undefined weak symbols in PIE
3543 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
3544 without ynamic PLT/GOT relocations for resolved undefined weak
3545 symbols.
3546 Don't generate dynamic relocation against resolved undefined
3547 weak symbol in executable.
3548 (pie_finish_undefweak_symbol): New function.
3549 (_bfd_sparc_elf_finish_dynamic_sections): Call
3550 pie_finish_undefweak_symbol on all symbols in PIE.
3551 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
3552 (_bfd_sparc_elf_fixup_symbol): New function.
3553
3554 2017-04-10 Nick Clifton <nickc@redhat.com>
3555
3556 * config.bfd: Remove ns32k from obsolete list.
3557
3558 2017-04-10 Alan Modra <amodra@gmail.com>
3559
3560 PR 21287
3561 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
3562 (special_sections_i): Likewise for .init_array.
3563 (special_sections_p): Likewise for .preinit_array.
3564
3565 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
3566
3567 PR ld/19579
3568 PR ld/21306
3569 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
3570 ELF_COMMON_DEF_P for common symbols.
3571 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3572 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3573 * elflink.c (_bfd_elf_merge_symbol): Revert commits
3574 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
3575 07492f668d2173da7a2bda3707ff0985e0f460b6.
3576
3577 2017-04-07 Pedro Alves <palves@redhat.com>
3578
3579 * opncls.c (bfd_get_debug_link_info): Rename to...
3580 (bfd_get_debug_link_info_1): ... this. Change type of second
3581 parameter to void pointer. Adjust.
3582 (bfd_get_debug_link_info): Reimplement on top of
3583 bfd_get_debug_link_info_1.
3584 (separate_debug_file_exists, separate_alt_debug_file_exists):
3585 Change type of second parameter to void pointer. Adjust.
3586 (get_func_type, check_func_type): Change type of second parameter
3587 to void pointer.
3588 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
3589 the callback functions instead of passing the address of a local.
3590 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
3591 find_separate_debug_file.
3592 (get_alt_debug_link_info_shim): Change type of second parameter to
3593 void pointer. Adjust.
3594 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
3595 find_separate_debug_file.
3596 (get_build_id_name, bfd_boolean check_build_id_file): Change type
3597 of second parameter to void pointer. Adjust.
3598 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
3599 pointer local to find_separate_debug_file.
3600
3601 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
3602
3603 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
3604 external symbols with a definition.
3605 (_bfd_coff_gc_mark_extra_sections): Fix typo.
3606
3607 2017-04-07 Alan Modra <amodra@gmail.com>
3608
3609 * po/SRC-POTFILES.in: Regenerate.
3610
3611 2017-04-05 Alan Modra <amodra@gmail.com>
3612
3613 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
3614 reference counting.
3615
3616 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
3617
3618 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
3619 numbers for DataDirectory entry indicies passed to
3620 add_data_entry().
3621
3622 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
3623
3624 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
3625 each GNU_MBIND section and align GNU_MBIND section to page size.
3626 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
3627 segment for each GNU_MBIND section.
3628 (_bfd_elf_init_private_section_data): Copy sh_info from input
3629 for GNU_MBIND section.
3630
3631 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
3632
3633 * elfnn-riscv.c (GP_NAME): Delete.
3634 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
3635 (_bfd_riscv_relax_lui): Likewise.
3636
3637 2017-04-04 Nick Clifton <nickc@redhat.com>
3638
3639 PR binutils/21342
3640 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
3641 dereference.
3642 (bfd_elf_final_link): Only initialize the extended symbol index
3643 section if there are extended symbol tables to list.
3644
3645 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
3646
3647 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
3648 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
3649 * configure.ac (elf): Add elf-properties.lo.
3650 * Makefile.in: Regenerated.
3651 * configure: Likewise.
3652 * elf-bfd.h (elf_property_kind): New.
3653 (elf_property): Likewise.
3654 (elf_property_list): Likewise.
3655 (elf_properties): Likewise.
3656 (_bfd_elf_parse_gnu_properties): Likewise.
3657 (_bfd_elf_get_property): Likewise.
3658 (_bfd_elf_link_setup_gnu_properties): Likewise.
3659 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
3660 and setup_gnu_properties.
3661 (elf_obj_tdata): Add properties.
3662 * elf-properties.c: New file.
3663 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
3664 (elf_i386_merge_gnu_properties): Likewise.
3665 (elf_backend_parse_gnu_properties): Likewise.
3666 (elf_backend_merge_gnu_properties): Likewise.
3667 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3668 (elf_x86_64_merge_gnu_properties): Likewise.
3669 (elf_backend_parse_gnu_properties): Likewise.
3670 (elf_backend_merge_gnu_properties): Likewise.
3671 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
3672 (elf_backend_parse_gnu_properties): Likewise.
3673 (elf_backend_setup_gnu_properties): Likewise.
3674 (elfNN_bed): Add elf_backend_parse_gnu_properties,
3675 elf_backend_merge_gnu_properties and
3676 elf_backend_setup_gnu_properties.
3677
3678 2017-03-30 Pip Cet <pipcet@gmail.com>
3679
3680 * elf32-wasm32.c: Add relocation code, two relocs.
3681 * reloc.c: Add wasm32 relocations.
3682 * libbfd.h: Regenerate.
3683 * bfd-in2.h: Regenerate.
3684 * bfd/po/bfd.pot: Regenerate.
3685
3686 2017-03-29 Nick Clifton <nickc@redhat.com>
3687
3688 PR binutils/18025
3689 * coff-bfd.h (struct coff_section_data): Add new fields:
3690 saved_bias and bias.
3691 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
3692 computed for PE binaries.
3693 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
3694 missing abbrev.
3695
3696 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
3697
3698 PR ld/16044
3699 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
3700 to handle a local symbol with a hash-symbol-entry; without PLT.
3701 Add BFD_ASSERT for an incidental case with GOT entry present.
3702 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
3703 isn't forced-or-set local.
3704
3705 2017-03-27 Pip Cet <pipcet@gmail.com>
3706
3707 * wasm-module.c: New file to support WebAssembly modules.
3708 * wasm-module.h: New file to support WebAssembly modules.
3709 * doc/webassembly.texi: Start documenting wasm-module.c.
3710 * config.bfd: Add wasm_vec.
3711 * targets.c: Likewise.
3712 * configure.ac: Likewise.
3713 * Makefile.am: Add entries for wasm-module.c.
3714 * Makefile.in: Regenerate.
3715 * configure: Regenerate.
3716 * po/SRC-POTFILES.in: Regenerate.
3717
3718 2017-03-27 Pip Cet <pipcet@gmail.com>
3719
3720 * cpu-wasm32.c: New file to support wasm32 architecture.
3721 * elf32-wasm32.c: New file to support wasm32 architecture.
3722 * Makefile.am: Add wasm32 architecture.
3723 * archures.c: Likewise.
3724 * config.bfd: Likewise.
3725 * configure.ac: Likewise.
3726 * targets.c: Likewise.
3727 * Makefile.in: Regenerate.
3728 * bfd-in2.h: Regenerate.
3729 * configure: Regenerate.
3730 * po/SRC-POTFILES.in: Regenerate.
3731
3732 2017-03-20 Alan Modra <amodra@gmail.com>
3733
3734 PR 21266
3735 * elf64-ppc.c (compare_symbols): Stabilize sort.
3736
3737 2017-03-18 Alan Modra <amodra@gmail.com>
3738
3739 * elf64-ppc.c (struct ppc_link_hash_table): Add
3740 local_ifunc_resolver and maybe_local_ifunc_resolver.
3741 (ppc_build_one_stub): Set flags on emitting dynamic
3742 relocation to ifunc.
3743 (ppc64_elf_relocate_section): Likewise.
3744 (ppc64_elf_finish_dynamic_symbol): Likewise.
3745 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
3746 local dynamic relocs to ifuncs.
3747 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
3748 local_ifunc_resolver and maybe_local_ifunc_resolver.
3749 (ppc_elf_relocate_section): Set flag on emitting dynamic
3750 relocation to ifuncs.
3751 (ppc_elf_finish_dynamic_symbol): Likewise.
3752 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
3753 dynamic relocs to ifuncs.
3754
3755 2017-03-13 Nick Clifton <nickc@redhat.com>
3756
3757 PR binutils/21202
3758 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
3759 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
3760 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
3761 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
3762 * bfd-in2.h: Regenerate.
3763 * libbfd.h: Regenerate.
3764 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
3765 names.
3766 (IS_AARCH64_TLSDESC_RELOC): Likewise.
3767 (elfNN_aarch64_howto_table): Likewise.
3768 (aarch64_tls_transition_without_check): Likewise.
3769 (aarch64_reloc_got_type): Likewise.
3770 (elfNN_aarch64_final_link_relocate): Likewise.
3771 (elfNN_aarch64_tls_relax): Likewise.
3772 (elfNN_aarch64_relocate_section): Likewise.
3773 (elfNN_aarch64_gc_sweep_hook): Likewise.
3774 (elfNN_aarch64_check_relocs): Likewise.
3775 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
3776 (_bfd_aarch64_elf_resolve_relocation): Likewise.
3777
3778 2017-03-11 Alan Modra <amodra@gmail.com>
3779
3780 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
3781 parameter is in fact used. Whitespace fixes.
3782 * elf64-ppc.c: Likewise.
3783
3784 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
3785
3786 * rs6000-core.c (CORE_NEW): Simplify macro when
3787 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
3788
3789 2017-03-07 Alan Modra <amodra@gmail.com>
3790
3791 PR 21224
3792 PR 20519
3793 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
3794 dyn_relocs check.
3795
3796 2017-03-05 Alan Modra <amodra@gmail.com>
3797
3798 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
3799 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
3800 (next_cie_fde_offset): New function.
3801 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
3802 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
3803 four bytes. Align CIEs to four or eight bytes depending on
3804 per_encoding_aligned8. Align FDEs according to their encoding.
3805 Pad last FDE to output section alignment.
3806 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
3807 assertion.
3808 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
3809 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
3810 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
3811
3812 2017-03-02 Martin Bickel <binutils@ineranves.de>
3813
3814 PR ld/21212
3815 * elf.c (rewrite_elf_program_header): Do not issue a warning for
3816 empty segments which have a zero filesz, but a non-zero memsz.
3817
3818 2017-03-02 Alan Modra <amodra@gmail.com>
3819
3820 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
3821
3822 2017-02-28 Alan Modra <amodra@gmail.com>
3823
3824 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
3825 (ppc64_elf_relocate_section): Likewise.
3826
3827 2017-02-28 Alan Modra <amodra@gmail.com>
3828
3829 PR 20995
3830 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
3831 rather than elf32_nios2_hash_table or elf_hash_table.
3832 (create_got_section): Likewise.
3833 (nios2_elf32_finish_dynamic_symbol): Likewise.
3834 (nios2_elf32_adjust_dynamic_symbol): Likewise.
3835 (nios2_elf32_size_dynamic_sections): Likewise.
3836 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
3837 vars. Use htab equivalents directly instead. Don't create
3838 all dynamic sections on needing just the GOT. Use a goto
3839 rather than a fall-through with reloc test. Ensure
3840 htab->dynobj is set when making dynamic sreloc section.
3841 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
3842 equivalent directly instead. Don't segfault on looking for
3843 .dynamic when dynamic sections have not been created. Don't
3844 segfault on .got.plt being discarded.
3845 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
3846 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
3847 fixme and another not so relevant comment.
3848 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
3849 already set, set hash table dynobj on creating .sbss.
3850
3851 2017-02-28 Alan Modra <amodra@gmail.com>
3852
3853 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
3854 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
3855 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
3856 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
3857 (ppc64_elf_relocate_section): Likewise.
3858 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
3859 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
3860 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
3861 * libbfd.h: Regenerate.
3862 * bfd-in2.h: Regenerate.
3863
3864 2017-02-28 Alan Modra <amodra@gmail.com>
3865
3866 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
3867 dynamic .data.rel.ro read-only.
3868 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
3869 rather than section flags when deciding where copy reloc goes.
3870 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
3871 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
3872 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
3873 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
3874 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
3875 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
3876 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
3877 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
3878 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3879 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
3880 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
3881 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
3882 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3883 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
3884 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
3885 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
3886 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
3887 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
3888 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
3889
3890 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
3891
3892 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
3893 `jalr $0, $25' instruction encoding.
3894
3895 2017-02-27 Nick Clifton <nickc@redhat.com>
3896
3897 PR ld/21180
3898 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
3899 generating a seg-fault when encountering a symbol that has been
3900 deleted by garbage collection.
3901
3902 2017-02-25 Alan Modra <amodra@gmail.com>
3903
3904 * elf32-arc.c (struct dynamic_sections): Delete.
3905 (enum dyn_section_types): Delete.
3906 (dyn_section_names): Delete.
3907 (arc_create_dynamic_sections): Delete.
3908 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
3909 segfault on discarded .rela.plt section.
3910 (elf_arc_size_dynamic_sections): Formatting. Don't call
3911 arc_create_dynamic_sections. Don't allocate memory for sections
3912 handled by the generic linker. Correct code finding relocs in
3913 read-only sections. Set SEC_EXCLUDE on zero size .got,
3914 .got.plt, and .dynbss sections. Do set .interp for pies.
3915
3916 2017-02-24 Andrew Waterman <andrew@sifive.com>
3917
3918 * elfnn-riscv.c (GP_NAME): New macro.
3919 (riscv_global_pointer_value): Use it.
3920 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
3921 output section, consider only that section's alignment.
3922
3923 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3924
3925 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
3926 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
3927 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
3928 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
3929
3930 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
3931
3932 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
3933 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
3934 or misaligned.
3935
3936 2017-02-23 Alan Modra <amodra@gmail.com>
3937
3938 PR 20744
3939 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
3940 16D relocations.
3941 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
3942 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
3943 relocs.
3944
3945 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
3946
3947 PR ld/20828
3948 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
3949 processing ahead of the call to `elf_gc_sweep_symbol'.
3950
3951 2017-02-22 Nick Clifton <nickc@redhat.com>
3952
3953 PR binutils/21193
3954 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
3955 created section 4-byte alignment.
3956
3957 2017-02-22 Alan Modra <amodra@gmail.com>
3958
3959 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
3960 on .got or .plt output section being discarded by script.
3961 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
3962 vxworks splt temp.
3963
3964 2017-02-21 Alan Modra <amodra@gmail.com>
3965
3966 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
3967 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
3968
3969 2017-02-20 Alan Modra <amodra@gmail.com>
3970
3971 PR 21181
3972 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
3973 if DT_RELSZ/DT_RELASZ is zero.
3974
3975 2017-02-17 Nick Clifton <nickc@redhat.com>
3976
3977 * compress.c (bfd_get_full_section_contents): Remember to reduce
3978 compressed size by the sizeof the compression header when
3979 decompressing the contents.
3980
3981 2017-02-17 Pedro Alves <palves@redhat.com>
3982
3983 * srec.c (Chunk): Rename to ...
3984 (_bfd_srec_len): ... this.
3985 (S3Forced): Rename to ...
3986 (_bfd_srec_forceS3): ... this.
3987 * objcopy.c: Adjust all references.
3988
3989 2017-02-17 Pedro Alves <palves@redhat.com>
3990
3991 * archive.c (bsd_write_armap): Rename to ...
3992 (_bfd_bsd_write_armap): ... this.
3993 (coff_write_armap): Rename to ...
3994 (_bfd_coff_write_armap): ... this.
3995 * libbfd-in.h (bsd_write_armap): Rename to ...
3996 (_bfd_bsd_write_armap): ... this.
3997 (coff_write_armap): Rename to ...
3998 (_bfd_coff_write_armap): ... this.
3999 * aout-target.h, aout-tic30.c: Adjust all users.
4000 * libbfd.h: Regenerate.
4001
4002 2017-02-17 Pedro Alves <palves@redhat.com>
4003
4004 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4005 (warn_deprecated): Rename to ...
4006 (_bfd_warn_deprecated): ... this.
4007 * libbfd.c (warn_deprecated): Rename to ...
4008 (_bfd_warn_deprecated): ... this.
4009 * bfd-in2.h: Regenerate.
4010
4011 2017-02-17 Pedro Alves <palves@redhat.com>
4012
4013 * bfdio.c (real_ftell): Rename to ...
4014 (_bfd_real_ftell): ... this.
4015 (real_fseek): Rename to ...
4016 (_bfd_real_fseek): ... this.
4017 (real_fopen): Rename to ...
4018 (_bfd_real_fopen): ... this.
4019 * libbfd-in.h (real_ftell): Rename to ...
4020 (_bfd_real_ftell): ... this.
4021 (real_fseek): Rename to ...
4022 (_bfd_real_fseek): ... this.
4023 (real_fopen): Rename to ...
4024 (_bfd_real_fopen): ... this.
4025 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4026 * libbfd.h: Regenerate.
4027
4028 2017-02-17 Pedro Alves <palves@redhat.com>
4029
4030 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4031 * libbfd.c (read_unsigned_leb128): Rename to ...
4032 (_bfd_read_unsigned_leb128): ... this.
4033 (read_signed_leb128): Rename to ...
4034 (_bfd_read_signed_leb128): ... this.
4035 (safe_read_leb128): Rename to ...
4036 (_bfd_safe_read_leb128): ... this.
4037 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4038 (_bfd_read_unsigned_leb128): ... this.
4039 (read_signed_leb128): Rename to ...
4040 (_bfd_read_signed_leb128): ... this.
4041 (safe_read_leb128): Rename to ...
4042 (_bfd_safe_read_leb128): ... this.
4043 * libbfd.h: Renegerate.
4044
4045 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4046
4047 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4048 before trying to fine matching file and line information.
4049
4050 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4051
4052 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4053 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4054 not match current bfd, then reload debug information. Record bfd
4055 we're loading debug info for in the stash. If we have debug
4056 informatin in the cache then perform section placement before
4057 returning.
4058
4059 2017-02-16 Alan Modra <amodra@gmail.com>
4060
4061 PR 21000
4062 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4063 * elfxx-target.h (elf_backend_no_page_alias): Define.
4064 (elfNN_bed): Init new field.
4065 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4066 ensure PT_LOAD segment starts on a new page.
4067 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4068
4069 2017-02-16 Alan Modra <amodra@gmail.com>
4070
4071 PR 21132
4072 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4073 if pic.
4074
4075 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4076
4077 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4078 * bfd-in2.h: Regenerated.
4079
4080 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4081
4082 PR ld/21168
4083 * elf32-i386.c (elf_i386_relocate_section): Allow
4084 "lea foo@GOT, %reg" in PIC.
4085
4086 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4087
4088 PR ld/20244
4089 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4090 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4091 error against local IFUNC symbol without a base register for
4092 PIC.
4093
4094 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4095
4096 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4097 `%P: %H:' with `info->callbacks->einfo'.
4098 (ppc_elf_relocate_section): Likewise.
4099 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4100 (ppc64_elf_edit_toc): Likewise.
4101 (ppc64_elf_relocate_section): Likewise.
4102
4103 2017-02-14 Alan Modra <amodra@gmail.com>
4104
4105 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4106 --gc-keep-exported, and test versioned field of sym rather than
4107 looking for @ in name.
4108
4109 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4110
4111 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4112 __global_pointer$.
4113
4114 2017-02-13 Nick Clifton <nickc@redhat.com>
4115
4116 PR binutils/21151
4117 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4118 unit length field.
4119
4120 2017-02-07 Andrew Waterman <andrew@sifive.com>
4121
4122 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4123 entry size if PLT header is written.
4124
4125 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4126
4127 Fix sparc64 dynamic relocation processing to use the dynamic
4128 symbol count.
4129 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4130 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4131 should be used.
4132
4133 2017-02-03 Nick Clifton <nickc@redhat.com>
4134
4135 PR 21096
4136 * coffcode.h (coff_write_object_contents): Enlarge size of
4137 s_name_buf in order to avoid compile time warning about possible
4138 integer truncation.
4139 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4140 32-bits of insn value before printing into buffer.
4141
4142 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4143
4144 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4145 `max_local_dynindx'.
4146 (mips_elf_sort_hash_table): Handle it.
4147 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4148 symbols bump up `max_local_dynindx' rather than
4149 `max_non_got_dynindx'.
4150
4151 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4152
4153 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4154 `min_got_dynindx', `max_unref_got_dynindx' and
4155 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4156 (mips_elf_sort_hash_table): Adjust accordingly.
4157
4158 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4159
4160 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4161 to access the hash table.
4162
4163 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4164
4165 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4166 non-NULL `htab' to the beginning.
4167
4168 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4169
4170 * elflink.c (elf_gc_sweep): Wrap overlong line.
4171
4172 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4173
4174 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4175 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4176 * elfxx-mips.c (mips_elf_link_hash_table): Add
4177 `ignore_branch_isa' member.
4178 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4179 in branch relocation calculation as an error if
4180 `ignore_branch_isa' has been set.
4181 (_bfd_mips_elf_insn32): Rename to...
4182 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4183 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4184 Handle the new parameter.
4185
4186 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4187
4188 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4189 local variable dynobj.
4190
4191 PR ld/20995
4192 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4193 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4194 executable from read-only sections into sdynrelro.
4195 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4196 dynamic relocs in sdynrelro.
4197 (elf_backend_want_dynrelro): Define.
4198
4199 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4200
4201 * config.bfd (*-*-rtemsaout*): Mark as removed.
4202
4203 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4204
4205 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4206 (arm-*-rtems*): Move to (arm*-*-eabi*).
4207 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4208 (m68-*-rtems*): Move to (m68*-*-elf*).
4209
4210 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4211
4212 * config.bfd (*-*-rtemscoff*): Mark as removed.
4213
4214 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4215
4216 PR ld/20828
4217 * elflink.c (bfd_elf_record_link_assignment): Revert last
4218 change and don't ever clear `forced_local'. Set `mark'
4219 unconditionally.
4220 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4221 file.
4222 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4223 (bfd_elf_size_dynamic_sections): ... here.
4224 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4225 and set `mark' instead in `__tls_get_addr_opt' processing.
4226 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4227
4228 2017-01-24 Alan Modra <amodra@gmail.com>
4229
4230 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4231 where dynamic relocs are preferable. Allow ifunc too.
4232 (ensure_undefweak_dynamic): New function.
4233 (allocate_dynrelocs): Use it here. Move plt handling last and
4234 don't make symbols dynamic, simplifying loop. Only make undef
4235 weak symbols with GOT entries dynamic. Correct condition
4236 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4237 comments. Remove goto.
4238 (ppc_elf_relocate_section): Correct test for using dynamic
4239 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4240 to suit. Set up explicit tls_index entries and implicit GOT
4241 tls_index entries resolvable at link time for
4242 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4243 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4244 (ensure_undefweak_dynamic): New function.
4245 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4246 with GOT entries dynamic. Remove unnecessary test of
4247 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4248 (ppc64_elf_relocate_section): Correct test for using dynamic
4249 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4250 to suit. Set up explicit tls_index entries and implicit GOT
4251 tls_index entries resolvable at link time for __tls_get_addr_opt.
4252 Simplify expression to clear mem for prelink.
4253
4254 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4255
4256 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4257
4258 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4259
4260 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4261 (elf_backend_hash_symbol): Define.
4262
4263 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4264
4265 PR ld/20828
4266 * elflink.c (bfd_elf_record_link_assignment): Clear any
4267 `forced_local' marking for DSO symbols that are not being
4268 provided.
4269
4270 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4271
4272 * elfnn-riscv.c (riscv_elf_object_p): New function.
4273
4274 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4275
4276 PR ld/21038
4277 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4278 plt_bnd_eh_frame.
4279 (elf_x86_64_check_relocs): Create .eh_frame section for the
4280 .plt.bnd section.
4281 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4282 .eh_frame section for the .plt.bnd section.
4283 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4284 for the .plt.bnd section.
4285
4286 2017-01-12 Nick Clifton <nickc@redhat.com>
4287
4288 PR binutils/20876
4289 * opncls.c (find_separate_debug_file): Add include_dirs
4290 parameter. Only include the directory part of the bfd's filename
4291 in search paths if include_dirs is true. Add a couple of extra
4292 locations for looking for debug files.
4293 ( bfd_follow_gnu_debuglink): Update invocation of
4294 find_separate_debug_file.
4295 (bfd_follow_gnu_debugaltlink): Likewise.
4296 (get_build_id): New function: Finds the build-id of the given bfd.
4297 (get_build_id_name): New function: Computes the name of the
4298 separate debug info file for a bfd, based upon its build-id.
4299 (check_build_id_file): New function: Checks to see if a separate
4300 debug info file exists at the given location, and that its
4301 build-id matches that of the original bfd.
4302 (bfd_follow_build_id_debuglink): New function: Finds a separate
4303 debug info file for a given bfd by using the build-id method.
4304 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4305 method of locating a separate debug info file before using the
4306 debuglink method.
4307 * bfd-in2.h: Regenerate.
4308
4309 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4310
4311 PR ld/21038
4312 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4313 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4314 elf_x86_64_eh_frame_plt_got.
4315 (elf_x86_64_size_dynamic_sections): Get unwind info from
4316 elf_x86_64_bnd_arch_bed for the BND PLT.
4317
4318 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
4319
4320 * config.bfd: Add entries for i686-redox and x86_64-redox.
4321
4322 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4323
4324 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4325 to 4 bytes.
4326 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4327 .eh_frame section to 4 bytes for x32.
4328 (elf_x86_64_check_relocs): Likewise.
4329
4330 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4331
4332 PR ld/20830
4333 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4334 (PLT_GOT_FDE_LENGTH): Likewise.
4335 (elf_i386_plt_layout): Add eh_frame_plt_got and
4336 eh_frame_plt_got_size.
4337 (elf_i386_plt): Updated.
4338 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4339 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4340 (elf_i386_size_dynamic_sections): Allocate and initialize
4341 .eh_frame section for .plt.got.
4342 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4343 .plt.got.
4344 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4345 eh_frame_plt_got_size.
4346 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4347 (PLT_GOT_FDE_LENGTH): Likewise.
4348 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4349 eh_frame_plt_got_size.
4350 (elf_x86_64_arch_bed): Updated.
4351 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4352 eh_frame_plt_got_size.
4353 (elf_x86_64_nacl_arch_bed): Likewise.
4354 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4355 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4356 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4357 .eh_frame section for .plt.got.
4358 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4359 for .plt.got.
4360
4361 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4362
4363 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4364 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4365
4366 2017-01-09 Nick Clifton <nickc@redhat.com>
4367
4368 * dwarf2.c (lookup_address_in_function_table): Return early if
4369 there are no functions in the given comp unit, or if the high
4370 address of the last function in the comp unit is less than the
4371 desired address.
4372
4373 2017-01-09 Nick Clifton <nickc@redhat.com>
4374
4375 PR binutils/21013
4376 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
4377 message if there are too many symbols to load.
4378
4379 2017-01-04 James Clarke <jrtc27@jrtc27.com>
4380
4381 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
4382 if relocs are cached.
4383
4384 2017-01-03 Rich Felker <bugdal@aerifal.cx>
4385
4386 PR ld/21017
4387 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
4388 for R_MICROBLAZE_GOTOFF_64.
4389
4390 2017-01-03 Nick Clifton <nickc@redhat.com>
4391
4392 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
4393 warning about using a possibly uninitialised variable.
4394
4395 2017-01-02 Alan Modra <amodra@gmail.com>
4396
4397 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
4398 (allocate_plt_static, allocate_dynrelocs): Use it.
4399
4400 2017-01-02 Alan Modra <amodra@gmail.com>
4401
4402 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
4403 .PARISC.unwind section.
4404
4405 2017-01-02 Alan Modra <amodra@gmail.com>
4406
4407 PR ld/20989
4408 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
4409 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
4410 indirect to GOT pointer relative code edit.
4411
4412 2017-01-02 Alan Modra <amodra@gmail.com>
4413
4414 Update year range in copyright notice of all files.
4415
4416 For older changes see ChangeLog-2016
4417 \f
4418 Copyright (C) 2017 Free Software Foundation, Inc.
4419
4420 Copying and distribution of this file, with or without modification,
4421 are permitted in any medium without royalty provided the copyright
4422 notice and this notice are preserved.
4423
4424 Local Variables:
4425 mode: change-log
4426 left-margin: 8
4427 fill-column: 74
4428 version-control: never
4429 End: