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