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