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