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