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