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