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