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