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