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