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