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