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