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