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