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