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