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