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