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