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