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