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