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