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