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