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