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