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