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