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