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