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