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