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