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