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