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