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