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