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