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