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