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