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