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