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