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