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