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