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