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