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