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