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