1 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
4 * elf32-tilepro.c (tilepro_elf_tls_transition): Replace
5 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
6 bfd_link_executable for TLS check.
7 (tilepro_elf_check_relocs): Likewise.
8 (allocate_dynrelocs): Likewise.
9 (tilepro_elf_relocate_section): Likewise.
11 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
14 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
15 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
16 bfd_link_executable for TLS check.
17 (_bfd_sparc_elf_check_relocs): Likewise.
18 (allocate_dynrelocs): Likewise.
19 (_bfd_sparc_elf_relocate_section): Likewise.
21 2017-10-18 H.J. Lu <hongjiu.lu@intel.com>
23 * elf32-tilepro.c (tilepro_elf_gc_mark_hook): Call
24 _bfd_generic_link_add_one_symbol to mark __tls_get_addr.
25 * elfxx-tilegx.c (tilegx_elf_gc_mark_hook): Likewise.
27 2017-10-17 H.J. Lu <hongjiu.lu@intel.com>
29 * elf32-microblaze.c (microblaze_elf_check_relocs): Check for
30 indirect and warning symbols.
32 2017-10-17 Alan Modra <amodra@gmail.com>
35 * elf-properties.c (_bfd_elf_parse_gnu_properties): Compare datasz
36 against size left rather than comparing pointers. Reorganise loop.
38 2017-10-17 Alan Modra <amodra@gmail.com>
41 * aoutx.h (aout_get_external_symbols): Handle stringsize of zero,
42 and error for any other size that doesn't cover the header word.
44 2017-10-16 H.J. Lu <hongjiu.lu@intel.com>
46 * elf-bfd.h (elf_backend_data): Remove gc_sweep_hook.
47 * elf32-arm.c (elf32_arm_gc_sweep_hook): Removed.
48 (elf_backend_gc_sweep_hook): Likewise.
49 * elf32-bfin.c (bfin_gc_sweep_hook): Likewise.
50 (bfinfdpic_gc_sweep_hook): Likewise.
51 (elf_backend_gc_sweep_hook): Likewise.
52 * elf32-cr16.c (elf32_cr16_gc_sweep_hook): Likewise.
53 (elf_backend_gc_sweep_hook): Likewise.
54 * elf32-cris.c (cris_elf_gc_sweep_hook): Likewise.
55 (elf_backend_gc_sweep_hook): Likewise.
56 * elf32-hppa.c (elf32_hppa_gc_sweep_hook): Likewise.
57 (elf_backend_gc_sweep_hook): Likewise.
58 * elf32-lm32.c (lm32_elf_gc_sweep_hook): Likewise.
59 (elf_backend_gc_sweep_hook): Likewise.
60 * elf32-m32r.c (m32r_elf_gc_sweep_hook): Likewise.
61 (elf_backend_gc_sweep_hook): Likewise.
62 * elf32-m68k.c (elf_m68k_got_entry): Remove elf_m68k_gc_sweep_hook
64 (elf_m68k_remove_got_entry_type): Removed.
65 (elf_m68k_find_got_entry_ptr): Likewise.
66 (elf_m68k_remove_got_entry): Likewise.
67 (elf_m68k_gc_sweep_hook): Likewise.
68 (elf_backend_gc_sweep_hook): Likewise.
69 * elf32-mcore.c (mcore_elf_gc_sweep_hook): Likewise.
70 (elf_backend_gc_sweep_hook): Likewise.
71 * elf32-metag.c (elf_metag_gc_sweep_hook): Likewise.
72 (elf_backend_gc_sweep_hook): Likewise.
73 * elf32-microblaze.c (elf_backend_gc_sweep_hook): Likewise.
74 (elf_backend_gc_sweep_hook): Likewise.
75 * elf32-mips.c (elf_backend_gc_sweep_hook): Likewise.
76 (elf_backend_gc_sweep_hook): Likewise.
77 * elf32-nds32.c (nds32_elf_gc_sweep_hook): Likewise.
78 (elf_backend_gc_sweep_hook): Likewise.
79 * elf32-nios2.c (nios2_elf32_gc_sweep_hook): Likewise.
80 (elf_backend_gc_sweep_hook): Likewise.
81 * elf32-or1k.c (or1k_elf_gc_sweep_hook): Likewise.
82 (elf_backend_gc_sweep_hook): Likewise.
83 * elf32-ppc.c (ppc_elf_gc_sweep_hook): Likewise.
84 (elf_backend_gc_sweep_hook): Likewise.
85 * elf32-s390.c (elf_s390_gc_sweep_hook): Likewise.
86 (elf_backend_gc_sweep_hook): Likewise.
87 * elf32-sparc.c (elf_backend_gc_sweep_hook): Likewise.
88 * elf32-tic6x.c (elf32_tic6x_gc_sweep_hook): Likewise.
89 (elf_backend_gc_sweep_hook): Likewise.
90 * elf32-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
91 * elf32-tilepro.c (tilepro_elf_gc_sweep_hook): Likewise.
92 (elf_backend_gc_sweep_hook): Likewise.
93 * elf32-vax.c (elf_vax_gc_sweep_hook): Likewise.
94 (elf_backend_gc_sweep_hook): Likewise.
95 * elf32-xtensa.c (elf_xtensa_gc_sweep_hook): Likewise.
96 (elf_backend_gc_sweep_hook): Likewise.
97 * elf64-alpha.c (elf64_alpha_gc_sweep_hook): Likewise.
98 (elf_backend_gc_sweep_hook): Likewise.
99 * elf64-mips.c (elf_backend_gc_sweep_hook): Likewise.
100 * elf64-mmix.c (mmix_elf_gc_sweep_hook): Likewise.
101 (elf_backend_gc_sweep_hook): Likewise.
102 * elf64-ppc.c (elf_backend_gc_sweep_hook): Likewise.
103 (ppc64_elf_gc_sweep_hook): Likewise.
104 * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
105 (elf_backend_gc_sweep_hook): Likewise.
106 * elf64-sparc.c (elf_backend_gc_sweep_hook): Likewise.
107 * elf64-tilegx.c (elf_backend_gc_sweep_hook): Likewise.
108 * elflink.c (elf_link_add_object_symbols): Don't call
109 _bfd_elf_link_check_relocs here.
110 (gc_sweep_hook_fn): Removed.
111 (elf_gc_sweep): Remove gc_sweep_hook.
112 * elfnn-aarch64.c (elfNN_aarch64_gc_sweep_hook): Removed.
113 (elf_backend_gc_sweep_hook): Likewise.
114 * elfnn-riscv.c (riscv_elf_gc_sweep_hook): Likewise.
115 (elf_backend_gc_sweep_hook): Likewise.
116 * elfxx-mips.c (_bfd_mips_elf_gc_sweep_hook): Likewise.
117 * elfxx-mips.h (_bfd_mips_elf_gc_sweep_hook): Likewise.
118 (elf_backend_gc_sweep_hook): Likewise.
119 * elfxx-sparc.c (_bfd_sparc_elf_gc_sweep_hook): Likewise.
120 * elfxx-sparc.h (_bfd_sparc_elf_gc_sweep_hook): Likewise.
121 * elfxx-target.h (elf_backend_gc_sweep_hook): Likewise.
122 (elfNN_bed): Remove elf_backend_gc_sweep_hook.
123 * elfxx-tilegx.c (tilegx_elf_gc_sweep_hook): Removed.
124 * elfxx-tilegx.h (tilegx_elf_gc_sweep_hook): Likewise.
126 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
128 * elf32-i386.c (elf_i386_backend_data): Removed.
129 (get_elf_i386_backend_data): Likewise.
130 (elf_i386_arch_bed): Replace elf_i386_backend_data with
131 elf_x86_backend_data.
132 (elf_i386_get_synthetic_symtab): Likewise.
133 (elf_i386_nacl_arch_bed): Likewise.
134 (elf_i386_vxworks_arch_bed): Likewise.
135 (elf_i386_relocate_section): Check target_os instead of
137 (elf_i386_finish_dynamic_symbol): Likewise.
138 (elf_i386_finish_dynamic_sections): Use htab->plt0_pad_byte.
139 Check target_os instead of is_vxworks.
140 (elf_i386_link_setup_gnu_properties): Remove normal_target and
141 is_vxworks. Initialize plt0_pad_byte.
142 * elf64-x86-64.c (elf_x86_64_backend_data); Removed.
143 (get_elf_x86_64_arch_data): Likewise.
144 (get_elf_x86_64_backend_data): Likewise.
145 (elf_x86_64_arch_bed): Replace elf_x86_64_backend_data with
146 elf_x86_backend_data.
147 (elf_x86_64_get_synthetic_symtab): Likewise.
148 (elf_x86_64_nacl_arch_bed): Likewise.
149 (elf_x86_64_link_setup_gnu_properties): Remove is_vxworks and
150 normal_target. Initialize plt0_pad_byte.
151 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check target_os
152 instead of is_vxworks.
153 (_bfd_x86_elf_size_dynamic_sections): Likewise.
154 (_bfd_x86_elf_finish_dynamic_sections): Likewise.
155 (_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
156 (_bfd_x86_elf_link_hash_table_create): Initialize target_os.
157 (_bfd_x86_elf_link_setup_gnu_properties): Remove is_vxworks.
158 Update normal_target. Set up plt0_pad_byte. Check target_os
159 instead of is_vxworks.
160 * elfxx-x86.h (elf_x86_target_os): New.
161 (elf_x86_backend_data): Likewise.
162 (get_elf_x86_backend_data): Likewise.
163 (elf_x86_link_hash_table): Remove is_vxworks. Add plt0_pad_byte
165 (elf_x86_init_table): Remove normal_target and is_vxworks. Add
168 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
170 * elf32-i386.c (elf_i386_finish_dynamic_sections): Call
171 _bfd_x86_elf_finish_dynamic_sections.
172 * elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Likewise.
173 * elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): New
175 * elfxx-x86.h (_bfd_x86_elf_finish_dynamic_sections): New
178 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
181 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
182 hide symbol which was forced to be dynamic.
184 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
187 * elf32-cris.c (cris_elf_relocate_section): Don't generate
188 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
189 (cris_elf_check_relocs): Don't allocate dynamic relocation
190 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
192 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
195 * elf32-sh.c (allocate_dynrelocs): Discard dynamic relocations
196 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
197 (sh_elf_relocate_section): Don't generate dynamic relocation if
198 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
200 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
203 * elf32-s390.c (allocate_dynrelocs): Discard dynamic
204 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
205 (elf_s390_relocate_section): Don't generate dynamic relocation
206 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
207 * elf64-s390.c (allocate_dynrelocs): Discard dynamic
208 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
209 (elf_s390_relocate_section): Don't generate dynamic relocation
210 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
212 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
215 * elf32-nios2.c (nios2_elf32_relocate_section): Don't generate
216 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
217 (allocate_dynrelocs): Discard dynamic relocations if
218 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
220 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
223 * elf32-microblaze.c (microblaze_elf_relocate_section): Don't
224 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
226 (allocate_dynrelocs): Discard dynamic relocations if
227 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
229 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
232 * elf32-m68k.c (elf_m68k_check_relocs): Don't allocate dynamic
233 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
234 (elf_m68k_adjust_dynamic_symbol): Don't make symbol dynamic if
235 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
236 (elf_m68k_relocate_section): Don't generate dynamic relocation
237 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
239 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
242 * elf32-hppa.c (ensure_undef_dynamic): Don't make undefined
243 symbol dynamic if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
244 (allocate_dynrelocs): Discard dynamic relocations if
245 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
246 (elf32_hppa_relocate_section): Don't generate dynamic
247 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
249 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
252 * elfnn-ia64.c (elfNN_ia64_check_relocs): Don't allocate
253 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
254 (allocate_fptr): Don't allocate function pointer if
255 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
256 (allocate_dynrel_entries): Don't allocate dynamic relocation
257 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
258 (set_got_entry): Don't set GOT entry if
259 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
260 (set_pltoff_entry): Don't set PLTOFF entry if
261 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
262 (elfNN_ia64_relocate_section): Don't install dynamic relocation
263 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
265 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
268 * elfxx-mips.c (mips_elf_calculate_relocation): Don't generate
269 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
270 (allocate_dynrelocs): Don't allocate dynamic relocations if
271 UNDEFWEAK_NO_DYNAMIC_RELOC is true.
273 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
276 * elf32-arm.c (elf32_arm_final_link_relocate): Don't generate
277 dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
278 (allocate_dynrelocs_for_symbol): Discard dynamic relocations
279 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
281 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
284 * elf32-tilepro.c (allocate_dynrelocs): Discard dynamic
285 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
286 (tilepro_elf_relocate_section): Don't generate dynamic
287 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
288 * elfxx-tilegx.c (allocate_dynrelocs): Discard dynamic
289 relocations if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
290 (tilegx_elf_relocate_section): Don't generate dynamic
291 relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
293 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
296 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Don't
297 generate dynamic relocation if UNDEFWEAK_NO_DYNAMIC_RELOC is
299 (elfNN_aarch64_allocate_dynrelocs): Discard dynamic relocations
300 if UNDEFWEAK_NO_DYNAMIC_RELOC is true.
302 2017-10-14 H.J. Lu <hongjiu.lu@intel.com>
304 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Moved to ...
305 * elf-bfd.h (UNDEFWEAK_NO_DYNAMIC_RELOC): Here.
306 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Removed.
308 2017-10-12 James Bowman <james.bowman@ftdichip.com>
310 * bfd-in2.h: Regenerate.
311 * libbfd.h: Regenerate.
312 * elf32-ft32.c: Add HOWTO R_FT32_15.
313 * reloc.c: Add BFD_RELOC_FT32_15.
315 2017-10-12 Nick Clifton <nickc@redhat.com>
317 * reloc.c (enum bfd_reloc_status): Start values at 2.
318 * bfd-in2.h: Regenerate.
319 * elfnn-aarch64.c (aarch64_relocate): Invert sense of function, so
320 that a TRUE return indicates success. Compare the result of
321 calling _bfd_aarch64_elf_put_addend against bfd_reloc_ok.
322 (build_one_stub): Change sense of tests against aarch64_relocate
324 (elfNN_aarch64_tls_relax): Return bfd_reloc_notsupported, rather
325 than FALSE, when an error is detected.
326 (elfNN_aarch64_final_link_relocate): Likewise.
328 2017-10-12 H.J. Lu <hongjiu.lu@intel.com>
330 * elf32-i386.c (elf_backend_hide_symbol): New.
331 * elf64-x86-64.c (elf_backend_hide_symbol): Likewise.
332 * elfxx-x86.c (_bfd_x86_elf_hide_symbol): Likewise.
333 * elfxx-x86.h (_bfd_x86_elf_hide_symbol): Likewise.
335 2017-10-12 Alan Modra <amodra@gmail.com>
337 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Call
338 elf_backend_hide_symbol, not _bfd_elf_link_hash_hide_symbol.
339 (bfd_elf_define_start_stop): Likewise.
341 2017-10-12 Alan Modra <amodra@gmail.com>
343 * elf32-nds32.c (nds32_elf_size_dynamic_sections): Set .interp
344 when executable rather than non-PIC.
345 * elf32-score.c (s3_bfd_score_elf_size_dynamic_sections): Likewise.
346 * elf32-score7.c (s7_bfd_score_elf_size_dynamic_sections): Likewise.
348 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
350 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo64_ugid16'
352 * elf-linux-core.h (elf_external_linux_prpsinfo64): Rename to...
353 (elf_external_linux_prpsinfo64_ugid32): ... this.
354 (swap_linux_prpsinfo32_out): Rename to...
355 (swap_linux_prpsinfo32_ugid32_out): ... this.
356 (elf_external_linux_prpsinfo64_ugid16): New structure.
357 (swap_linux_prpsinfo64_ugid16_out): New function.
358 * elfxx-target.h [!elf_backend_linux_prpsinfo64_ugid16]
359 (elf_backend_linux_prpsinfo64_ugid16): Define.
360 (elfNN_bed): Initialize `linux_prpsinfo64_ugid16' member.
361 * elf.c (elfcore_write_linux_prpsinfo64): Handle both variants
362 of the 64-bit Linux core PRPSINFO note.
363 * elf64-sh64.c (elf_backend_linux_prpsinfo64_ugid16): Define.
365 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
367 * elf-bfd.h (elf_backend_data): Add `linux_prpsinfo32_ugid16'
369 (elfcore_write_ppc_linux_prpsinfo32): Remove prototype.
370 * elf32-ppc.c (elfcore_write_ppc_linux_prpsinfo32): Remove.
371 (elf_external_ppc_linux_prpsinfo32)
372 (swap_ppc_linux_prpsinfo32_out): Move to...
373 * elf-linux-core.h (elf_external_linux_prpsinfo32_ugid32)
374 (swap_linux_prpsinfo32_ugid32_out): ... these.
375 (elf_external_linux_prpsinfo32): Rename to...
376 (elf_external_linux_prpsinfo32_ugid16): ... this.
377 (swap_linux_prpsinfo32_out): Rename to...
378 (swap_linux_prpsinfo32_ugid16_out): ... this.
379 * elfxx-target.h [!elf_backend_linux_prpsinfo32_ugid16]
380 (elf_backend_linux_prpsinfo32_ugid16): Define.
381 (elfNN_bed): Initialize `linux_prpsinfo32_ugid16' member.
382 * elf.c (elfcore_write_linux_prpsinfo32): Handle both variants
383 of the 32-bit Linux core PRPSINFO note.
384 * elf32-am33lin.c (elf_backend_linux_prpsinfo32_ugid16): Define.
385 * elf32-arm.c (elf_backend_linux_prpsinfo32_ugid16): Define.
386 * elf32-cris.c (elf_backend_linux_prpsinfo32_ugid16): Define.
387 * elf32-frv.c (elf_backend_linux_prpsinfo32_ugid16): Define.
388 * elf32-i386.c (elf_backend_linux_prpsinfo32_ugid16): Define.
389 * elf32-m32r.c (elf_backend_linux_prpsinfo32_ugid16): Define.
390 * elf32-m68k.c (elf_backend_linux_prpsinfo32_ugid16): Define.
391 * elf32-s390.c (elf_backend_linux_prpsinfo32_ugid16): Define.
392 * elf32-sh.c (elf_backend_linux_prpsinfo32_ugid16): Define.
393 * elf32-sparc.c (elf_backend_linux_prpsinfo32_ugid16): Define.
395 2017-10-11 Maciej W. Rozycki <macro@imgtec.com>
397 * elf-linux-core.h (elf_external_linux_prpsinfo64): Move the
398 `gap' member ahead of `pr_flag'.
400 2017-10-11 Pedro Alves <palves@redhat.com>
402 * bfd.c (_doprnt): Rename to ...
403 (_bfd_doprnt): ... this.
404 (error_handler_internal): Adjust.
406 2017-10-10 H.J. Lu <hongjiu.lu@intel.com>
408 * elf32-i386.c (elf_i386_check_relocs): Set GOT refcount to 1
409 instead of incrementing it.
410 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
412 2017-10-10 Renlin Li <renlin.li@arm.com>
415 * elf32-arm.c (allocate_dynrelocs_for_symbol): Only make undefined weak
416 symbols into dynamic.
418 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
421 * elfnn-riscv.c (riscv_elf_link_hash_table): Add max_alignment.
422 (riscv_elf_link_hash_table_create): Initialize max_alignment to
424 (_bfd_riscv_relax_section): Cache the max alignment of output
425 sections if possible.
427 2017-10-10 Alan Modra <amodra@gmail.com>
429 * elf64-ppc.c (ppc64_elf_before_check_relocs): Set sec_type for
430 .opd whenever .opd is present and non-zero size. Move code
431 setting abiversion to/from output file earlier. Only set
432 u.opd.func_sec when --gc-sections. Read relocs and set up
433 u.opd.func_sec values here..
434 (ppc64_elf_check_relocs): ..rather than here. Simplify opd
436 (ppc64_elf_edit_opd): Don't set sec_type for .opd here.
438 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
440 * elf-m10300.c (mn10300_elf_check_relocs): Don't free cached
443 2017-10-09 H.J. Lu <hongjiu.lu@intel.com>
445 * elf32-bfin.c (bfin_size_dynamic_sections): Don't create the
446 .interp section with "ld --no-dynamic-linker".
448 2017-10-09 Alan Modra <amodra@gmail.com>
451 * dwarf2.c (_bfd_dwarf2_cleanup_debug_info): Free
452 funcinfo_hash_table and varinfo_hash_table.
454 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
456 * elf32-sh.c (readonly_dynrelocs): Dump dynamic relocation
457 in read-only section with minfo.
458 (sh_elf_size_dynamic_sections): Likewise.
460 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
462 * elfxx-sparc.c (_bfd_sparc_elf_size_dynamic_sections): Remove
465 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
467 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_sections): Set
468 this_hdr.sh_entsize only if section size > 0.
470 2017-10-08 H.J. Lu <hongjiu.lu@intel.com>
472 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Reformat.
474 2017-10-07 H.J. Lu <hongjiu.lu@intel.com>
476 * elfxx-sparc.c (readonly_dynrelocs): Dump dynamic relocation
477 in read-only section with minfo.
478 (_bfd_sparc_elf_size_dynamic_sections): Likewise.
480 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
482 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Update
485 2017-10-06 John Baldwin <jhb@FreeBSD.org>
487 * elf-bfd.h (struct elf_backend_data): Add
488 `elf_backend_grok_freebsd_prstatus'.
489 * elf.c (elfcore_grok_freebsd_note): Call
490 `elf_backend_grok_freebsd_prstatus' to handle NT_PRSTATUS if
492 * elfn32-mips.c (elf_n32_mips_grok_freebsd_prstatus): New
494 (elf_backend_grok_freebsd_prstatus): Define.
495 * elfxx-target.h (elf_backend_grok_freebsd_prstatus): Define.
496 (elfNN_bed): Initialize `elf_backend_grok_freebsd_prstatus'.
498 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
500 * elf32-i386.c (elf_i386_check_relocs): Replace has_got_reloc
501 and has_non_got_reloc with zero_undefweak.
502 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
503 * elfxx-x86.c (_bfd_x86_elf_link_hash_newfunc): Initialize
505 (_bfd_x86_elf_copy_indirect_symbol): Replace has_got_reloc and
506 has_non_got_reloc with zero_undefweak.
507 * elfxx-x86.h (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace
508 has_got_reloc and has_non_got_reloc with zero_undefweak.
509 (elf_x86_link_hash_entry): Likewise.
511 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
513 * elfxx-x86.h (COPY_INPUT_RELOC_P): Add "do/while(0);".
514 (VERIFY_COPY_RELOC): Likewise.
516 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
518 * elfxx-x86.h (VERIFY_COPY_RELOC): New.
519 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
520 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
522 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
524 * elfxx-x86.h (VERIFY_PLT_ENTRY): New.
525 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Use it.
526 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
528 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
530 * elfxx-x86.h (COPY_INPUT_RELOC_P): New.
531 * elf32-i386.c (elf_i386_relocate_section): Use it.
532 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
534 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
536 * elf32-i386.c (X86_SIZE_TYPE_P): New.
537 (elf_i386_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
538 * elf64-x86-64.c (X86_SIZE_TYPE_P): New.
539 (elf_x86_64_relocate_section): Use GENERATE_DYNAMIC_RELOCATION_P.
540 * elfxx-x86.h (GENERATE_DYNAMIC_RELOCATION_P): New.
542 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
544 * elfxx-x86.h (POINTER_LOCAL_IFUNC_P): New.
545 (PLT_LOCAL_IFUNC_P): Likewise.
546 * elf32-i386.c (elf_i386_relocate_section): Use them.
547 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
549 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
551 * elfxx-x86.h (GENERATE_RELATIVE_RELOC_P): New.
552 * elf32-i386.c (elf_i386_relocate_section): Use it.
553 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
555 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
557 * elfxx-x86.h (RESOLVED_LOCALLY_P): New.
558 * elf32-i386.c (elf_i386_relocate_section): Use it.
559 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
561 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
563 * elf32-i386.c (X86_PCREL_TYPE_P): New.
564 (elf_i386_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
565 * elf64-x86-64.c (IS_X86_64_PCREL_TYPE): Renamed to ...
566 (X86_PCREL_TYPE_P): This.
567 (elf_x86_64_check_relocs): Use NEED_DYNAMIC_RELOCATION_P.
568 Replace IS_X86_64_PCREL_TYPE with X86_PCREL_TYPE_P.
569 (elf_x86_64_relocate_section): Replace IS_X86_64_PCREL_TYPE with
571 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): New.
573 2017-10-06 H.J. Lu <hongjiu.lu@intel.com>
575 * elfxx-x86.h (TLS_TRANSITION_IE_TO_LE_P): New.
576 * elf32-i386.c (elf_i386_tls_transition): Use it.
577 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
579 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
581 * elf32-ppc.c (readonly_dynrelocs): Add a link_info argument.
582 Dump dynamic relocation in read-only section with minfo if
584 (ppc_elf_adjust_dynamic_symbol): Pass NULL to readonly_dynrelocs.
585 (maybe_set_textrel): Likewise.
586 (ppc_elf_size_dynamic_sections): Dump dynamic relocation in
587 read-only section with minfo.
589 2017-10-05 John Baldwin <jhb@FreeBSD.org>
591 * elf.c (elfcore_grok_freebsd_note): Handle NT_ARM_VFP.
593 2017-10-05 H.J. Lu <hongjiu.lu@intel.com>
595 * elf32-tilepro.c (readonly_dynrelocs): Dump dynamic relocation
596 in read-only section with minfo.
597 (tilepro_elf_size_dynamic_sections): Likewise.
598 * elfxx-tilegx.c (readonly_dynrelocs): Likewise.
599 (tilegx_elf_size_dynamic_sections): Likewise.
601 2017-10-05 Pedro Alves <palves@redhat.com>
604 * bfd.c (bfd_set_error): Revert 2017-10-04 change. Remove
605 ellipsis parameter. Split out bfd_error_on_input code to..
606 (bfd_set_input_error): .. New function.
607 * archive.c (_bfd_write_archive_contents): Use bfd_set_input_error.
608 * vms-lib.c (_bfd_vms_lib_write_archive_contents): Likewise.
609 * bfd-in2.h: Regenerate.
611 2017-10-05 Alan Modra <amodra@gmail.com>
613 * elflink.c (elf_link_input_bfd): Correct ctor/dtor in init_array/
614 fini_array error value.
616 2017-10-05 Alan Modra <amodra@gmail.com>
619 * elf.c (_bfd_elf_setup_sections): Don't trim reloc sections from
621 (_bfd_elf_init_reloc_shdr): Pass sec_hdr, use it to copy SHF_GROUP
623 (elf_fake_sections): Adjust calls. Exit immediately on failure.
624 (bfd_elf_set_group_contents): Add associated reloc section indices
627 2017-10-04 Alan Modra <amodra@gmail.com>
629 * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't sort or
630 classify symbols for ELFv2.
632 2017-10-04 Pavel I. Kryukov <kryukov@frtk.ru>
635 * bfd.c (bfd_set_error): Avoid UB on passing arg to va_start that
636 undergoes default promotion.
637 * bfd-in2.h: Regenerate.
639 2017-10-02 Alan Modra <amodra@gmail.com>
641 * elf32-ppc.c (ppc_elf_relocate_section): Fix comment typo.
642 * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
644 2017-10-01 Alan Modra <amodra@gmail.com>
647 * dwarf2.c (new_line_sorts_after): Remove end_sequence comparison.
648 (add_line_info): Always put end_sequence last.
650 2017-10-01 Alan Modra <amodra@gmail.com>
653 * dwarf2.c (read_section): Allocate buffer with extra byte for
654 bfd_simple_get_relocated_section_contents rather than copying
657 2017-09-29 Alan Modra <amodra@gmail.com>
659 * merge.c (merge_strings): Return FALSE on malloc failure.
660 (_bfd_merge_sections): Return failures from record_section and
663 2017-09-28 Alan Modra <amodra@gmail.com>
666 * elflink.c (_bfd_elf_merge_symbol): Set non_ir_ref_dynamic in
667 a case where plugin_notice isn't called.
669 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
671 * elf32-nds32.c (nds32_elf_relax_section): Fix a tautological
674 2017-09-26 H.J. Lu <hongjiu.lu@intel.com>
677 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't pass
678 output_bfd to info->callbacks->minfo.
680 2017-09-26 Nick Clifton <nickc@redhat.com>
683 * elf64-x86-64.c (elf_x86_64_info_to_howto): Do not trigger an
684 assertion failure if elf_x86_64_rtype_to_howto has already issued
687 2017-09-26 Alan Modra <amodra@gmail.com>
690 * dwarf2.c (read_formatted_entries): Use read_attribute_value to
693 2017-09-26 Nick Clifton <nickc@redhat.com>
696 * dwarf2.c (read_formatted_entries): Fail early if we know that
697 the loop parsing data entries will overflow the end of the
700 2017-09-26 Alan Modra <amodra@gmail.com>
703 * dwarf2.c (struct comp_unit): Delete sec_info_ptr field.
704 (find_abstract_instance_name): Calculate DW_FORM_ref_addr relative
705 to stash->info_ptr_memory, and check die_ref is within that memory.
706 Set info_ptr_end correctly when another CU is refd. Check die_ref
707 for DW_FORM_ref4 etc. is within CU.
709 2017-09-26 Alan Modra <amodra@gmail.com>
712 * dwarf2.c (concat_filename): Return "<unknown>" on NULL filename.
713 (read_formatted_entries): Init "fe".
714 (decode_line_info <DW_LNE_define_file>): Use line_info_add_file_name.
716 2017-09-26 Alan Modra <amodra@gmail.com>
719 * dwarf2.c (decode_line_info): Ensure line_ptr stays within
720 bounds in inner loop.
722 2017-09-25 Alan Modra <amodra@gmail.com>
725 * dwarf1.c (parse_die): Sanity check pointer against section limit
726 before dereferencing.
727 (parse_line_table): Likewise.
729 2017-09-25 Alan Modra <amodra@gmail.com>
732 * dwarf2.c (scan_unit_for_symbols): Ignore DW_AT_name unless it
734 (parse_comp_unit): Likewise.
736 2017-09-25 Alan Modra <amodra@gmail.com>
739 * dwarf2.c (read_formatted_entries): Error on format_count zero.
741 2017-09-24 Alan Modra <amodra@gmail.com>
744 * opncls.c (bfd_get_debug_link_info_1): Properly check that crc is
745 within section bounds.
747 2017-09-24 Alan Modra <amodra@gmail.com>
750 * dwarf2.c (decode_line_info): Properly free line sequences on error.
752 2017-09-24 Alan Modra <amodra@gmail.com>
755 * dwarf2.c (find_abstract_instance_name): Add orig_info_ptr and
756 pname param. Return status. Make name const. Don't abort,
757 return an error. Formatting. Exit if current info_ptr matches
758 orig_info_ptr. Update callers.
759 (scan_unit_for_symbols): Start at nesting_level of zero. Make
760 nested_funcs an array of structs for extensibility. Formatting.
762 2017-09-24 Alan Modra <amodra@gmail.com>
765 * dwarf2.c (decode_line_info): Fail on lh.line_range of zero
766 rather than dividing by zero.
768 2017-09-24 Alan Modra <amodra@gmail.com>
771 * dwarf2.c (decode_line_info): Correct .debug_line unit_length check.
773 2017-09-24 Alan Modra <amodra@gmail.com>
776 * dwarf2.c (scan_unit_for_symbols): Check u.blk->data is non-NULL.
778 2017-09-24 Alan Modra <amodra@gmail.com>
781 * elf.c (_bfd_elf_slurp_version_tables): Test sh_info on
782 SHT_GNU_verneed section for sanity. Don't zalloc memory for
785 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
788 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Guard against
791 2017-09-22 H.J. Lu <hongjiu.lu@intel.com>
794 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Also return
795 -1 if bfd_canonicalize_dynamic_reloc returns 0.
797 2017-09-22 Pedro Alves <palves@redhat.com>
798 Alan Modra <amodra@gmail.com>
800 * version.h: Add comment.
802 2017-09-21 Andreas Arnez <arnez@linux.vnet.ibm.com>
804 * elf.c (elfcore_grok_note): For the cases NT_S390_GS_CB and
805 NT_S390_GS_BC, correct the previously swapped invocations of
806 elfcore_grok_s390_gs_bc and elfcore_grok_s390_gs_cb.
808 2017-09-19 Alan Modra <amodra@gmail.com>
811 * elf64-ppc.c (ppc64_elf_build_stubs): Don't check glink_eh_frame
814 2017-09-19 Alan Modra <amodra@gmail.com>
817 * elflink.c (bfd_elf_size_dynamic_sections): Garbage collect
818 symbols before calculating verrefs. Don't renumber dynsyms
819 after gc. Exclude .gnu.version when zero or one dynsym.
820 Localize some vars and reindent.
822 2017-09-18 H.J. Lu <hongjiu.lu@intel.com>
825 * elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Check error
826 return from bfd_canonicalize_dynamic_reloc.
828 2017-09-15 Alan Modra <amodra@gmail.com>
831 * archive.c (bfd_ar_hdr_from_filesystem): Detect when status.st_size
832 overflows bfd_size_type.
834 2017-09-14 H.J. Lu <hongjiu.lu@intel.com>
837 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument
838 to indicate if conversion is performed.
839 (elf_i386_check_relocs): Cache section contents and relocations
840 if conversion is performed.
841 * elf64-x86-64.c (elf_x86_64_check_relocs): Cache section
842 contents and relocations if conversion is performed.
844 2017-09-14 Nick Clifton <nickc@redhat.com>
847 * peXXigen.c (pe_print_idata): Extend check for HintName vector
850 2017-09-13 H.J. Lu <hongjiu.lu@intel.com>
852 * elfxx-x86.h: Fix a typo in comments.
854 2017-09-09 Kamil Rytarowski <n54@gmx.com>
856 * elf32-nds32.c: Rename __BIT() to N32_BIT().
858 2017-09-09 Alan Modra <amodra@gmail.com>
860 * elf64-ppp.c (plt_stub_pad): Handle positive and negative
863 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
865 * elf32-i386.c (elf_i386_relocate_section): Update usage of
866 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
867 (elf_i386_finish_dynamic_symbol): Likewise.
868 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
869 (elf_x86_64_finish_dynamic_symbol): Likewise.
870 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Likewise.
871 (_bfd_x86_elf_fixup_symbol): Likewise.
873 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
875 * elfxx-x86.c (_bfd_x86_elf_link_symbol_references_local): Don't
876 check has_non_got_reloc.
878 2017-09-09 H.J. Lu <hongjiu.lu@intel.com>
881 * elf32-i386.c (elf_i386_convert_load_reloc): Check linker_def.
882 Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
883 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Check
884 linker_def. Don't use UNDEFINED_WEAK_RESOLVED_TO_ZERO.
885 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Set local_ref
886 and linker_def on __ehdr_start if it is referenced and not
888 (_bfd_x86_elf_link_symbol_references_local): Also set local_ref
889 and return TRUE when building executable, if a symbol has
890 non-GOT/non-PLT relocations in text section or there is no
892 * elfxx-x86.h (elf_x86_link_hash_entry): Add linker_def.
894 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
896 * elfxx-x86.h: Update comments.
898 2017-09-08 H.J. Lu <hongjiu.lu@intel.com>
900 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Replace
901 elf_x86_plt_layout_table with elf_x86_init_table.
902 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
904 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties):
906 * elfxx-x86.h (elf_x86_plt_layout_table): Renamed to ...
907 (elf_x86_init_table): This.
908 (_bfd_x86_elf_link_setup_gnu_properties): Replace
909 elf_x86_plt_layout_table with elf_x86_init_table.
911 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
913 * configure.ac (bfd_backends): Don't add elf64-x86-64.lo nor
914 elf64.lo together with elfxx-x86.lo for 64-bit BFD.
915 * configure: Regenerated.
916 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set r_info
917 and r_sym fields of plt_layout.
918 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties):
920 * elfxx-x86.c (elf_x86_64_is_reloc_section): Remove BFD64 check.
921 (_bfd_x86_elf_link_hash_table_create): Likewise. Don't set
922 r_info nor r_sym fields.
923 (_bfd_x86_elf_link_setup_gnu_properties): Set r_info and r_sym
925 * elfxx-x86.h (elf_x86_plt_layout_table): Add r_info and r_sym.
927 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
929 * (_bfd_riscv_relax_align): Call bfd_set_error and
930 print an error message when unable to relax a .align directive.
932 2017-09-07 Palmer Dabbelt <palmer@dabbelt.com>
934 * elfnn-riscv.c (riscv_zero_pcrel_hi_reloc): New function.
935 (riscv_record_pcrel_hi_reloc): Add absolute argument.
936 (riscv_elf_relocate_section): Call riscv_zero_pcrel_hi_reloc for
937 R_RISCV_PCREL_HI20 relocs, and pass the result to
938 riscv_record_pcrel_hi_reloc.
940 2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
942 * elf32-i386.c (elf_i386_convert_load_reloc): Add an argument,
943 r_type_p. Remove the converted argument. Replace
944 SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P. Return
945 the new relocation type via r_type_p.
946 (elf_i386_relocate_section): Likewise.
947 (elf_i386_finish_dynamic_symbol): Likewise.
948 (need_convert_load): Removed.
949 (check_relocs_failed): Updated.
950 (elf_i386_check_relocs): Call elf_i386_convert_load_reloc,
951 instead of setting need_convert_load.
952 (_bfd_i386_elf_convert_load): Removed.
953 * elf64-x86-64.c (need_convert_load): Removed.
954 (check_relocs_failed): Updated.
955 (elf_x86_64_convert_load_reloc): Add an argument, r_type_p.
956 Replace SYMBOL_REFERENCES_LOCAL with SYMBOL_REFERENCES_LOCAL_P.
957 Return the new relocation type via r_type_p.
958 (elf_x86_64_check_relocs): Call elf_x86_64_convert_load_reloc,
959 instead of setting need_convert_load.
960 (elf_x86_64_check_relocs): Don't check PIC if relocation has
962 (_bfd_x86_64_elf_convert_load): Removed.
963 (elf_x86_64_relocate_section): Replace SYMBOL_REFERENCES_LOCAL
964 with SYMBOL_REFERENCES_LOCAL_P.
965 (elf_x86_64_finish_dynamic_symbol): Likewise.
966 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Don't
968 (_bfd_x86_elf_size_dynamic_sections): Don't call convert_load.
969 (_bfd_x86_elf_link_symbol_references_local): New function.
970 * elfxx-x86.h (SYMBOL_REFERENCES_LOCAL_P): New.
971 (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Replace elf.forced_local with
972 SYMBOL_REFERENCES_LOCAL_P.
973 (elf_x86_link_hash_entry): Add local_ref.
974 (elf_x86_link_hash_table): Remove convert_load.
975 (_bfd_i386_elf_convert_load): Removed.
976 (_bfd_x86_64_elf_convert_load): Likewise.
977 (_bfd_x86_elf_link_symbol_references_local): New.
979 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
981 * elf64-x86-64.c (R_X86_64_converted_reloc_bit): New.
982 (elf_x86_64_info_to_howto): Get the real relocation type by
983 masking out R_X86_64_converted_reloc_bit.
984 (elf_x86_64_check_tls_transition): Get the real relocation type
985 by masking out R_X86_64_converted_reloc_bit.
986 (elf_x86_64_convert_load_reloc): Set R_X86_64_converted_reloc_bit
987 instead of setting converted_reloc.
988 (elf_x86_64_relocate_section): Check R_X86_64_converted_reloc_bit
989 instead of converted_reloc. Get the real relocation type by
990 masking out R_X86_64_converted_reloc_bit.
991 (elf_x86_64_link_setup_gnu_properties): Verify that the value of
992 R_X86_64_converted_reloc_bit is valid.
993 * elfxx-x86.h (converted_reloc): Removed.
995 2017-09-06 H.J. Lu <hongjiu.lu@intel.com>
997 * elf32-i386.c (elf_i386_relocate_section): Don't change r_type
998 when calling elf_i386_tls_transition. Don't use ELF32_R_TYPE
999 to get the relocation type again.
1000 * elf64-x86-64.c (elf_x86_64_relocate_section): Don't change
1001 r_type when calling elf_x86_64_tls_transition. Don't use
1002 ELF32_R_TYPE to get the relocation type again.
1004 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1006 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Properly set
1009 2017-09-05 H.J. Lu <hongjiu.lu@intel.com>
1011 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Remove the sec
1012 argument. Don't check relocation overflow. Avoid relocation
1013 overflow if --no-relax is used. Set converted_reloc on symbol
1014 if a GOTPCREL relocation is converted.
1015 (elf_x86_64_relocate_section): Issue a fatal error and suggest
1016 --no-relax if GOTPCREL relocation conversion leads to relocation
1018 * elfxx-x86.h (elf_x86_link_hash_entry): Add converted_reloc.
1020 2017-09-05 Alexander Fedotov <alexander.fedotov@nxp.com>
1021 Edmar Wienskoski <edmar.wienskoski@nxp.com
1023 * elf32-ppc.c (ppc_elf_howto_raw): Add R_PPC_VLE_ADDR20.
1024 (ppc_elf_check_relocs): Handle it.
1025 (ppc_elf_vle_split20): New function.
1026 (ppc_elf_relocate_section): Handle R_PPC_VLE_ADDR20.
1028 2017-09-03 H.J. Lu <hongjiu.lu@intel.com>
1031 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Set tlsdesc_plt
1032 for x86-64 if GOT_TLS_GDESC_P is true.
1034 2017-09-03 Alan Modra <amodra@gmail.com>
1037 * elfxx-x86.h (elf_x86_hash_table): Check is_elf_hash_table first.
1039 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1041 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1042 tls_get_addr for x86-64 in one place.
1044 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1046 * configure.ac (bfd_backends): Add elf64-x86-64.lo together
1047 with elfxx-x86.lo for 64-bit BFD.
1048 * configure: Regenerated.
1050 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1052 * elf32-i386.c (elf_i386_convert_load): Renamed to ...
1053 (_bfd_i386_elf_convert_load): This. Remove static.
1054 (elf_i386_size_dynamic_sections): Removed.
1055 (elf_backend_size_dynamic_sections): Likewise.
1056 * elf64-x86-64.c (elf_x86_64_convert_load): Renamed to ...
1057 (_bfd_x86_64_elf_convert_load): This. Remove static.
1058 (elf_x86_64_size_dynamic_sections): Removed.
1059 (elf_backend_size_dynamic_sections): Likewise.
1060 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): Renamed to ...
1061 (elf_x86_allocate_dynrelocs): This. Make it static.
1062 (_bfd_x86_elf_allocate_local_dynrelocs): Renamed to ...
1063 (elf_x86_allocate_local_dynreloc): This. Make it static.
1064 (elf_i386_is_reloc_section): New function.
1065 (elf_x86_64_is_reloc_section): Likewise.
1066 (_bfd_x86_elf_link_hash_table_create): Initialize convert_load,
1067 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1068 Rearrange got_entry_size initialization.
1069 (_bfd_x86_elf_size_dynamic_sections): New function.
1070 * elfxx-x86.h (elf_x86_link_hash_table): Add convert_load,
1071 is_reloc_section, dt_reloc, dt_reloc_sz and dt_reloc_ent.
1072 (_bfd_i386_elf_convert_load): New.
1073 (_bfd_x86_64_elf_convert_load): Likewise.
1074 (_bfd_x86_elf_size_dynamic_sections): Likewise.
1075 (elf_backend_size_dynamic_sections): Likewise.
1076 (_bfd_x86_elf_allocate_dynrelocs): Removed.
1077 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1079 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1081 * elfxx-x86.h (elf_x86_link_hash_table): Rearrange fields and
1084 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1086 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
1087 sgotplt_jump_table_size with elf_x86_compute_jump_table_size.
1089 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1091 * elf32-i386.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1092 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Moved to ...
1093 * elfxx-x86.h (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1094 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Here.
1095 * elf64-x86-64.c (PLT_CIE_LENGTH, PLT_FDE_LENGTH,
1096 PLT_FDE_START_OFFSET, PLT_FDE_LEN_OFFSET): Removed.
1098 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1100 * elf32-i386.c (elf_i386_allocate_dynrelocs): Removed.
1101 (elf_i386_allocate_local_dynrelocs): Likewise.
1102 (elf_i386_size_dynamic_sections): Replace
1103 elf_i386_allocate_dynrelocs/elf_i386_allocate_local_dynrelocs
1104 with _bfd_x86_elf_allocate_dynrelocs and
1105 _bfd_x86_elf_allocate_local_dynrelocs.
1106 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Removed.
1107 (elf_x86_64_allocate_local_dynrelocs): Likewise.
1108 (elf_x86_64_size_dynamic_sections): Replace
1109 elf_x86_64_allocate_dynrelocs/elf_x86_64_allocate_local_dynrelocs
1110 with _bfd_x86_elf_allocate_dynrelocs and
1111 _bfd_x86_elf_allocate_local_dynrelocs.
1112 * elfxx-x86.c (_bfd_x86_elf_allocate_dynrelocs): New function.
1113 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1114 * elfxx-x86.h (_bfd_x86_elf_allocate_dynrelocs): New prototype.
1115 (_bfd_x86_elf_allocate_local_dynrelocs): Likewise.
1117 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1119 * elf32-i386.c (is_i386_elf): Removed.
1120 (elf_i386_check_relocs): Replace is_i386_elf with is_x86_elf.
1121 (elf_i386_size_dynamic_sections): Likewise.
1122 (elf_i386_relocate_section): Likewise.
1123 * elf64-x86-64.c (is_x86_64_elf): Removed.
1124 (elf_x86_64_check_relocs): Replace is_x86_64_elf with
1126 (elf_x86_64_size_dynamic_sections): Likewise.
1127 (elf_x86_64_relocate_section): Likewise.
1128 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1130 * elfxx-x86.h (elf_x86_link_hash_table): Add target_id.
1133 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1135 * elf32-i386.c (elf_i386_compute_jump_table_size): Removed.
1136 (elf_i386_allocate_dynrelocs): Replace
1137 elf_i386_compute_jump_table_size with
1138 elf_x86_compute_jump_table_size.
1139 (elf_i386_size_dynamic_sections): Likewise.
1140 * elf64-x86-64.c (elf_x86_64_compute_jump_table_size): Removed.
1141 (elf_x86_64_allocate_dynrelocs): Replace
1142 elf_x86_64_compute_jump_table_size with
1143 elf_x86_compute_jump_table_size.
1144 (elf_x86_64_size_dynamic_sections): Likewise.
1145 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1147 * elfxx-x86.h (elf_x86_link_hash_table): Add got_entry_size.
1148 (elf_x86_compute_jump_table_size): New.
1150 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1152 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Initialize
1154 (_bfd_x86_elf_adjust_dynamic_symbol): Use sizeof_reloc.
1155 * elfxx-x86.h (elf_x86_link_hash_table): Add sizeof_reloc.
1157 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1159 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check VxWorks
1160 with htab->is_vxworks.
1161 (elf_i386_size_dynamic_sections): Likewise.
1162 (elf_i386_relocate_section): Likewise.
1163 (elf_i386_finish_dynamic_symbol): Likewise.
1164 (elf_i386_finish_dynamic_sections): Likewise.
1166 2017-09-02 H.J. Lu <hongjiu.lu@intel.com>
1168 * elf32-i386.c (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1169 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1170 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Moved to ...
1171 * elfxx-x86.h (GOT_TLS_IE, GOT_TLS_IE_POS, GOT_TLS_IE_NEG,
1172 GOT_TLS_IE_BOTH, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1173 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Here.
1174 * elf64-x86-64.c (GOT_TLS_IE, GOT_TLS_GDESC, GOT_TLS_GD_BOTH_P,
1175 GOT_TLS_GD_P, GOT_TLS_GDESC_P, GOT_TLS_GD_ANY_P): Removed.
1177 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1180 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Check
1181 ELF_COMMON_DEF_P for common symbols.
1183 2017-09-02 Alan Modra <amodra@gmail.com>
1185 * elf-eh-frame.c (offset_adjust): Avoid false positive gcc warning.
1186 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Likewise.
1187 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
1189 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1191 * elf32-i386.c (elf_i386_gc_mark_hook): Removed.
1192 (elf_backend_gc_mark_hook): Likewise.
1193 * elf64-x86-64.c (elf_x86_64_gc_mark_hook): Likewise.
1194 (elf_backend_gc_mark_hook): Likewise.
1195 * elfxx-x86.c (_bfd_x86_elf_gc_mark_hook): New function.
1196 * elfxx-x86.h (_bfd_x86_elf_gc_mark_hook): New.
1197 (elf_backend_gc_mark_hook): Likewise.
1199 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1201 * elf32-i386.c (elf_i386_adjust_dynamic_symbol): Removed.
1202 (elf_backend_adjust_dynamic_symbol): Likewise.
1203 * elf64-x86-64.c (elf_x86_64_adjust_dynamic_symbol): Likewise.
1204 (elf_backend_adjust_dynamic_symbol): Likewise.
1205 * elfxx-x86.c (_bfd_x86_elf_adjust_dynamic_symbol): New function.
1206 (_bfd_x86_elf_link_setup_gnu_properties): Copy is_vxworks.
1207 * elfxx-x86.h (elf_x86_link_hash_table): Add is_vxworks.
1208 (_bfd_x86_elf_adjust_dynamic_symbol): New.
1209 (elf_backend_adjust_dynamic_symbol): Likewise.
1211 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1213 * elfxx-x86.h (elf_x86_plt_layout_table): Fix a typo in
1216 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1218 * elf32-i386.c (elf_i386_mkobject): Removed.
1219 (bfd_elf32_mkobject): Likewise.
1220 * elf64-x86-64.c (elf_x86_64_mkobject): Likewise.
1221 (bfd_elf64_mkobject): Likewise.
1222 (bfd_elf32_mkobject): Likewise.
1223 * elfxx-x86.c (_bfd_x86_elf_mkobject): New function.
1224 * elfxx-x86.h (_bfd_x86_elf_mkobject): New.
1225 (bfd_elf64_mkobject): Likewise.
1226 (bfd_elf32_mkobject): Likewise.
1228 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1230 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
1231 Call _bfd_x86_elf_link_setup_gnu_properties.
1232 * elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
1233 pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
1235 (elf_x86_64_non_lazy_plt): Likewise.
1236 (elf_x86_64_lazy_bnd_plt): Likewise.
1237 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1238 (elf_x86_64_lazy_ibt_plt): Likewise.
1239 (elf_x32_lazy_ibt_plt): Likewise.
1240 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1241 (elf_x32_non_lazy_ibt_plt): Likewise.
1242 (elf_x86_64_nacl_plt): Likewise.
1243 (elf_x86_64_link_setup_gnu_properties): Updated. Call
1244 _bfd_x86_elf_link_setup_gnu_properties.
1245 * elfxx-x86.c: Include elf-vxworks.h".
1246 (_bfd_x86_elf_link_setup_gnu_properties): New function.
1247 * elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
1248 comments for pic_plt0_entry and pic_plt_entry.
1249 (elf_x86_non_lazy_plt_layout): Likewise.
1250 (elf_x86_plt_layout_table): New.
1251 (_bfd_x86_elf_link_setup_gnu_properties): Likewise.
1253 2017-09-01 H.J. Lu <hongjiu.lu@intel.com>
1256 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Create
1257 .eh_frame section for the second PLT.
1258 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Correct
1259 alignment of .eh_frame section for the second PLT.
1261 2017-09-01 Nick Clifton <nickc@redhat.com>
1264 * dwarf2.c (decode_line_info): Fix test for an overlong line info
1267 2017-09-01 Nick Clifton <nickc@redhat.com>
1270 * elf-attrs.c (_bfd_elf_parse_attributes): Ensure that the
1271 attribute buffer is NUL terminated.
1273 2017-08-31 Nick Clifton <nickc@redhat.com>
1276 * dwarf2.c (read_section): If necessary add a terminating NUL byte
1277 to dwarf string sections.
1279 2017-08-31 Alan Modra <amodra@gmail.com>
1281 * po/SRC-POTFILES.in: Regenerate.
1283 2017-08-31 Alan Modra <amodra@gmail.com>
1285 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Don't exit early
1286 for a section containing just a terminator. Allow multiple
1287 terminators at end of section.
1288 * elflink.c (bfd_elf_discard_info): Iterate over .eh_frame
1289 sections when not adding alignment. Assert on terminator in
1292 2017-08-31 Alan Modra <amodra@gmail.com>
1296 * elflink.c (bfd_elf_discard_info): Don't pad embedded zero
1299 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1301 * configure.ac (bfd_backends): Add elf64.lo together with
1302 elfxx-x86.lo for 64-bit BFD.
1303 * configure: Regenerated.
1305 2017-08-31 James Bowman <james.bowman@ftdichip.com>
1307 * elf32-ft32.c (ft32_elf_howto_table): Use complain_overflow_dont
1310 2017-08-31 Alan Modra <amodra@gmail.com>
1313 * opncls.c (bfd_close_all_done): Don't call bfd_cache_close
1314 before _close_and_cleanup. Call iovec->bclose after.
1315 (bfd_close): Remove code common to, and call, bfd_close_all_done.
1317 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1319 * elf32-i386.c (elf_i386_plt_type): Removed.
1320 (elf_i386_plt): Likewise.
1321 (elf_i386_get_synthetic_symtab): Updated. Call
1322 _bfd_x86_elf_get_synthetic_symtab.
1323 * elf64-x86-64.c (elf_x86_64_plt_type): Removed.
1324 (elf_x86_64_plt): Likewise.
1325 (elf_x86_64_get_synthetic_symtab): Updated. Call
1326 _bfd_x86_elf_get_synthetic_symtab.
1327 * elfxx-x86.c (elf_i386_get_plt_got_vma): New function.
1328 (elf_x86_64_get_plt_got_vma): Likewise.
1329 (elf_i386_valid_plt_reloc_p): Likewise.
1330 (elf_x86_64_valid_plt_reloc_p): Likewise.
1331 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1332 * elfxx-x86.h (elf_x86_plt_type): New.
1333 (elf_x86_plt): Likewise.
1334 (_bfd_x86_elf_get_synthetic_symtab): Likewise.
1336 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1338 * elfxx-x86.c (_bfd_x86_elf_link_hash_table_create): Check
1339 target_id instead of elf_machine_code.
1341 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1343 * elf32-i386.c (ELF_DYNAMIC_INTERPRETER): Removed.
1344 (elf_i386_lazy_plt_layout): Likewise.
1345 (elf_i386_non_lazy_plt_layout): Likewise.
1346 (elf_i386_plt_layout): Likewise.
1347 (elf_i386_link_hash_table): Likewise.
1348 (elf_i386_next_tls_desc_index): Likewise.
1349 (elf_i386_srelplt2): Likewise.
1350 (elf_i386_plt): Likewise.
1351 (elf_i386_lazy_plt): Likewise.
1352 (elf_i386_non_lazy_plt): Likewise.
1353 (elf_i386_link_hash_table_create): Likewise.
1354 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1355 (elf_i386_lazy_plt): Updated.
1356 (elf_i386_non_lazy_plt): Likewise.
1357 (elf_i386_lazy_ibt_plt): Likewise.
1358 (elf_i386_non_lazy_ibt_plt): Likewise.
1359 (elf_i386_allocate_dynrelocs): Likewise.
1360 (elf_i386_size_dynamic_sections): Likewise.
1361 (elf_i386_relocate_section): Likewise.
1362 (elf_i386_finish_dynamic_symbol): Likewise.
1363 (elf_i386_finish_dynamic_sections): Likewise.
1364 (elf_i386_get_synthetic_symtab): Likewise.
1365 (elf_i386_link_setup_gnu_properties): Likewise.
1366 (elf_i386_nacl_plt): Likewise.
1367 * elf64-x86-64.c (ABI_64_P): Removed.
1368 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1369 (ELF32_DYNAMIC_INTERPRETER): Likewise.
1370 (elf_x86_64_lazy_plt_layout): Likewise.
1371 (elf_x86_64_non_lazy_plt_layout): Likewise.
1372 (elf_x86_64_plt_layout): Likewise.
1373 (elf_x86_64_link_hash_table): Likewise.
1374 (elf_x86_64_plt): Likewise.
1375 (elf_x86_64_lazy_plt): Likewise.
1376 (elf_x86_64_non_lazy_plt): Likewise.
1377 (elf_x86_64_link_hash_table_create): Likewise.
1378 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1379 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1380 (elf_x86_64_lazy_plt): Updated.
1381 (elf_x86_64_non_lazy_plt): Likewise.
1382 (elf_x86_64_lazy_bnd_plt): Likewise.
1383 (elf_x86_64_non_lazy_bnd_plt): Likewise.
1384 (elf_x86_64_lazy_ibt_plt): Likewise.
1385 (elf_x32_lazy_ibt_plt): Likewise.
1386 (elf_x86_64_non_lazy_ibt_plt): Likewise.
1387 (elf_x32_non_lazy_ibt_plt): Likewise.
1388 (elf_x86_64_allocate_dynrelocs): Likewise.
1389 (elf_x86_64_size_dynamic_sections): Likewise.
1390 (elf_x86_64_relocate_section): Likewise.
1391 (elf_x86_64_finish_dynamic_symbol): Likewise.
1392 (elf_x86_64_finish_dynamic_sections): Likewise.
1393 (elf_x86_64_get_synthetic_symtab): Likewise.
1394 (elf_x86_64_link_setup_gnu_properties): Likewise.
1395 (elf_x86_64_nacl_plt): Likewise.
1396 * elfxx-x86.c: Include "objalloc.h", "elf/i386.h" and
1398 (ELF32_DYNAMIC_INTERPRETER): New.
1399 (ELF64_DYNAMIC_INTERPRETER): Likewise.
1400 (ELFX32_DYNAMIC_INTERPRETER): Likewise.
1401 (_bfd_x86_elf_link_hash_table_create): Likewise.
1402 (_bfd_x86_elf_link_hash_table_free): Renamed to ...
1403 (elf_x86_link_hash_table_free): This. Make it static.
1404 * elfxx-x86.h: Don't include "objalloc.h".
1406 (elf_x86_lazy_plt_layout): Likewise.
1407 (elf_x86_non_lazy_plt_layout): Likewise.
1408 (elf_x86_plt_layout): Likewise.
1409 (_bfd_x86_elf_link_hash_table_create): Likewise.
1410 (bfd_elf64_bfd_link_hash_table_create): Likewise.
1411 (bfd_elf32_bfd_link_hash_table_create): Likewise.
1412 (elf_x86_link_hash_table): Add plt, lazy_plt, non_lazy_plt,
1413 srelplt2 and next_tls_desc_index.
1414 (_bfd_x86_elf_link_hash_table_free): Removed.
1416 2017-08-30 Maciej W. Rozycki <macro@imgtec.com>
1418 * elfxx-mips.c (mips_elf_perform_relocation): Correct microMIPS
1419 branch offset interpretation.
1421 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1424 * opncls.c (bfd_close_all_done): Call _close_and_cleanup.
1426 2017-08-30 H.J. Lu <hongjiu.lu@intel.com>
1428 * elf64-x86-64.c (elf_x86_64_next_tls_desc_index): Removed.
1429 (elf_x86_64_srelplt2): Likewise.
1431 2017-08-30 Alan Modra <amodra@gmail.com>
1433 * elf64-ppc.c (struct ppc_link_hash_table): Add do_tls_opt.
1434 (ppc64_elf_tls_optimize): Set it.
1435 (ppc64_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1436 insn on TPREL16_LO and TPREL16_LO_DS relocs to use r13 when
1437 addis would add zero.
1438 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add do_tls_opt.
1439 (ppc_elf_tls_optimize): Set it.
1440 (ppc_elf_relocate_section): Nop addis on TPREL16_HA, and convert
1441 insn on TPREL16_LO relocs to use r2 when addis would add zero.
1443 2017-08-30 Alan Modra <amodra@gmail.com>
1445 * elf64-ppc.c (ppc64_elf_relocate_section): When optimizing
1446 __tls_get_addr call sequences to LE, don't move the addi down
1447 to the nop. Replace the bl with addi and leave the nop alone.
1449 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1451 * elf32-i386.c (elf_i386_pie_finish_undefweak_symbol):
1453 * elf64-x86-64.c (elf_x86_64_finish_local_dynamic_symbol):
1455 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
1457 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1459 * Makefile.am (BFD32_BACKENDS): Add elfxx-x86.lo.
1460 (BFD64_BACKENDS): Likewise.
1461 (BFD32_BACKENDS_CFILES): Add elfxx-x86.c.
1462 (BFD64_BACKENDS_CFILES): Likewise.
1463 * Makefile.in: Regenerated.
1464 * configure.ac (bfd_backends): Add elfxx-x86.lo together with
1465 elf32-i386.lo and elf64-x86-64.lo.
1466 * configure: Regenerated.
1467 * elf32-i386.c: Include "elfxx-x86.h" instead of "sysdep.h",
1468 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1469 "objalloc.h" and "hashtab.h".
1470 (ELIMINATE_COPY_RELOCS): Removed.
1471 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1472 (SYMBOL_NO_COPYRELOC): Likewise.
1473 (elf_i386_link_hash_entry): Likewise.
1474 (GOT_UNKNOWN): Likewise.
1475 (GOT_NORMAL): Likewise.
1476 (GOT_TLS_GD): Likewise.
1477 (elf_i386_hash_entry): Likewise.
1478 (elf_i386_obj_tdata): Likewise.
1479 (elf_i386_tdata): Likewise.
1480 (elf_i386_local_got_tls_type): Likewise.
1481 (elf_i386_local_tlsdesc_gotent): Likewise.
1482 (elf_i386_hash_table): Likewise.
1483 (elf_i386_link_hash_newfunc): Likewise.
1484 (elf_i386_local_htab_hash): Likewise.
1485 (elf_i386_local_htab_eq): Likewise.
1486 (elf_i386_get_local_sym_hash): Likewise.
1487 (elf_i386_link_hash_table_free): Likewise.
1488 (elf_i386_copy_indirect_symbol): Likewise.
1489 (elf_i386_fixup_symbol): Likewise.
1490 (elf_i386_readonly_dynrelocs): Likewise.
1491 (elf_i386_always_size_sections): Likewise.
1492 (elf_i386_set_tls_module_base): Likewise.
1493 (elf_i386_dtpoff_base): Likewise.
1494 (compare_relocs): Likewise.
1495 (elf_i386_hash_symbol): Likewise.
1496 (elf_i386_parse_gnu_properties): Likewise.
1497 (elf_i386_merge_gnu_properties): Likewise.
1498 (elf_i386_link_check_relocs): Likewise.
1499 (elf_i386_merge_symbol_attribute): Likewise.
1500 (bfd_elf32_bfd_link_check_relocs): Likewise.
1501 (elf_backend_copy_indirect_symbol): Likewise.
1502 (elf_backend_always_size_sections): Likewise.
1503 (elf_backend_omit_section_dynsym): Likewise.
1504 (elf_backend_hash_symbol): Likewise.
1505 (elf_backend_fixup_symbol): Likewise.
1506 (elf_backend_parse_gnu_properties): Likewise.
1507 (elf_backend_merge_gnu_properties): Likewise.
1508 (elf_backend_merge_symbol_attribute): Likewise.
1509 (elf_i386_mkobject): Updated.
1510 (elf_i386_link_hash_table_create): Likewise.
1511 (elf_i386_check_tls_transition): Likewise.
1512 (elf_i386_tls_transition): Likewise.
1513 (elf_i386_convert_load_reloc): Likewise.
1514 (elf_i386_check_relocs): Likewise.
1515 (elf_i386_adjust_dynamic_symbol): Likewise.
1516 (elf_i386_allocate_dynrelocs): Likewise.
1517 (elf_i386_convert_load): Likewise.
1518 (elf_i386_size_dynamic_sections): Likewise.
1519 (elf_i386_relocate_section): Likewise.
1520 (elf_i386_finish_dynamic_symbol ): Likewise.
1521 (elf_i386_finish_dynamic_sections): Likewise.
1522 (elf_i386_output_arch_local_syms): Likewise.
1523 (elf_i386_get_synthetic_symtab): Likewise.
1524 (elf_i386_link_setup_gnu_properties): Likewise.
1525 (elf_i386_link_hash_table): Use elf_x86_link_hash_table, instead
1526 of elf_link_hash_table, as base.
1527 (elf_i386_next_tls_desc_index): New.
1528 (elf_i386_srelplt2): Likewise.
1529 (elf_i386_plt): Likewise.
1530 (elf_i386_lazy_plt): Likewise.
1531 (elf_i386_non_lazy_plt): Likewise.
1532 * elf32-x86-64.c: Include "elfxx-x86.h" instead of "sysdep.h",
1533 "bfd.h", "bfdlink.h", "libbfd.h", "elf-bfd.h", "bfd_stdint.h",
1534 "objalloc.h" and "hashtab.h".
1535 (ELIMINATE_COPY_RELOCS): Removed.
1536 (UNDEFINED_WEAK_RESOLVED_TO_ZERO):Likewise.
1537 (SYMBOL_NO_COPYRELOC): Likewise.
1538 (elf_x86_64_link_hash_entry): Likewise.
1539 (GOT_UNKNOWN): Likewise.
1540 (GOT_NORMAL): Likewise.
1541 (GOT_TLS_GD): Likewise.
1542 (elf_x86_64_hash_entry): Likewise.
1543 (elf_x86_64_obj_tdata): Likewise.
1544 (elf_x86_64_tdata): Likewise.
1545 (elf_x86_64_local_got_tls_type): Likewise.
1546 (elf_x86_64_local_tlsdesc_gotent): Likewise.
1547 (elf_x86_64_hash_table): Likewise.
1548 (elf_x86_64_link_hash_newfunc): Likewise.
1549 (elf_x86_64_local_htab_hash): Likewise.
1550 (elf_x86_64_local_htab_eq): Likewise.
1551 (elf_x86_64_get_local_sym_hash): Likewise.
1552 (elf_x86_64_link_hash_table_free): Likewise.
1553 (elf_x86_64_copy_indirect_symbol): Likewise.
1554 (elf_x86_64_fixup_symbol): Likewise.
1555 (elf_x86_64_readonly_dynrelocs): Likewise.
1556 (elf_x86_64_always_size_sections): Likewise.
1557 (elf_x86_64_set_tls_module_base): Likewise.
1558 (elf_x86_64_dtpoff_base): Likewise.
1559 (compare_relocs): Likewise.
1560 (elf_x86_64_merge_symbol_attribute): Likewise.
1561 (elf_x86_64_hash_symbol): Likewise.
1562 (elf_x86_64_parse_gnu_properties): Likewise.
1563 (elf_x86_64_merge_gnu_properties): Likewise.
1564 (elf_x86_64_link_check_relocs): Likewise.
1565 (elf_backend_copy_indirect_symbol): Likewise.
1566 (elf_backend_always_size_sections): Likewise.
1567 (bfd_elf64_bfd_link_check_relocs): Likewise.
1568 (elf_backend_merge_symbol_attribute): Likewise.
1569 (elf_backend_hash_symbol): Likewise.
1570 (elf_backend_omit_section_dynsym): Likewise.
1571 (elf_backend_fixup_symbol): Likewise.
1572 (elf_backend_parse_gnu_properties): Likewise.
1573 (elf_backend_merge_gnu_properties): Likewise.
1574 (bfd_elf32_bfd_link_check_relocs): Likewise.
1575 (elf_x86_64_mkobject): Updated.
1576 (elf_x86_64_link_hash_table_create): Likewise.
1577 (elf_x86_64_check_tls_transition): Likewise.
1578 (elf_x86_64_tls_transition): Likewise.
1579 (elf_x86_64_convert_load_reloc): Likewise.
1580 (elf_x86_64_check_relocs): Likewise.
1581 (elf_x86_64_adjust_dynamic_symbol): Likewise.
1582 (elf_x86_64_allocate_dynrelocs): Likewise.
1583 (elf_x86_64_convert_load): Likewise.
1584 (elf_x86_64_size_dynamic_sections): Likewise.
1585 (elf_x86_64_relocate_section): Likewise.
1586 (elf_x86_64_finish_dynamic_symbol ): Likewise.
1587 (elf_x86_64_finish_dynamic_sections): Likewise.
1588 (elf_x86_64_output_arch_local_syms): Likewise.
1589 (elf_x86_64_get_synthetic_symtab): Likewise.
1590 (elf_x86_64_link_setup_gnu_properties): Likewise.
1591 (elf_x86_64_link_hash_table): Use elf_x86_link_hash_table,
1592 instead of elf_link_hash_table, as base.
1593 (elf_x86_64_next_tls_desc_index): New.
1594 (elf_x86_64_srelplt2): Likewise.
1595 (elf_x86_64_plt): Likewise.
1596 (elf_x86_64_lazy_plt): Likewise.
1597 (elf_x86_64_non_lazy_plt): Likewise.
1598 * elfxx-x86.c: New file.
1599 * elfxx-x86.h: Likewise.
1601 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1603 * elf32-i386.c (elf_i386_get_synthetic_symtab): Simplify bad
1605 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1607 2017-08-29 H.J. Lu <hongjiu.lu@intel.com>
1609 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check valid PLT
1610 sections before checking dynamic relocations and free invalid
1611 PLT section contents.
1612 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1614 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1616 * elf-bfd.h (_bfd_elf_ifunc_get_synthetic_symtab): Removed.
1617 * elf-ifunc.c (_bfd_elf_ifunc_get_synthetic_symtab): Likewise.
1619 2017-08-28 H.J. Lu <hongjiu.lu@intel.com>
1622 * elf32-i386.c (elf_i386_get_synthetic_symtab): Check for valid
1624 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1626 2017-08-27 H.J. Lu <hongjiu.lu@intel.com>
1628 * elf32-i386.c (elf_i386_link_hash_newfunc): Initialize
1630 * elf64-x86-64.c (elf_x86_64_link_hash_newfunc): Likewise.
1632 2017-08-26 H.J. Lu <hongjiu.lu@intel.com>
1635 * elf-bfd.h (elf_obj_tdata): Use ENUM_BITFIELD on object_id,
1636 dyn_lib_class and has_gnu_symbols. Change bad_symtab to bitfield.
1637 Add a has_no_copy_on_protected bitfield.
1638 (elf_has_no_copy_on_protected): New.
1639 * elf-properties.c (_bfd_elf_parse_gnu_properties): Set
1640 elf_has_no_copy_on_protected for GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1641 (elf_merge_gnu_property_list): Likewise.
1642 (_bfd_elf_link_setup_gnu_properties): Set extern_protected_data
1643 to FALSE for elf_has_no_copy_on_protected.
1644 * elf32-i386.c (SYMBOL_NO_COPYRELOC): New.
1645 (elf_i386_link_hash_entry): Add def_protected.
1646 (elf_i386_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1647 when checking info->nocopyreloc.
1648 (elf_i386_link_setup_gnu_properties): Don't set
1649 extern_protected_data here.
1650 (elf_i386_merge_symbol_attribute): New function.
1651 (elf_backend_merge_symbol_attribute): New.
1652 * elf64-x86-64.c (SYMBOL_NO_COPYRELOC): New.
1653 (elf_x86_64_link_hash_entry): Add def_protected.
1654 (elf_x86_64_need_pic): Report protected symbol for def_protected.
1655 (elf_x86_64_adjust_dynamic_symbol): Also check SYMBOL_NO_COPYRELOC
1656 when checking info->nocopyreloc.
1657 (elf_x86_64_relocate_section): Also check for R_X86_64_PC32
1658 relocation run-time overflow and unresolvable R_X86_64_32S
1659 relocation against protected data symbol defined in shared object
1660 with GNU_PROPERTY_NO_COPY_ON_PROTECTED.
1661 (elf_x86_64_link_setup_gnu_properties): Don't set
1662 extern_protected_data here.
1663 (elf_x86_64_merge_symbol_attribute): New function.
1664 (elf_backend_merge_symbol_attribute): New.
1666 2017-08-26 Alan Modra <amodra@gmail.com>
1668 * elf32-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1669 (ppc_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1670 (ppc_elf_relocate_section): Comment fix.
1671 * elf64-ppc.c (must_be_dyn_reloc): Use bfd_link_dll. Comment.
1672 (ppc64_elf_check_relocs): Only set DF_STATIC_TLS in shared libs.
1673 Support dynamic relocs for TPREL16 when non-pic too.
1674 (dec_dynrel_count): Adjust TPREL16 handling as per check_relocs.
1675 (ppc64_elf_relocate_section): Support dynamic relocs for TPREL16
1678 2017-08-25 H.J. Lu <hongjiu.lu@intel.com>
1680 * elf32-i386.c (elf_i386_link_hash_entry): Remove redundant
1681 "symbol" in comments.
1682 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Likewise.
1684 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1687 * elf64-x86-64.c (elf_x86_64_relocate_section): Check for
1688 R_X86_64_PC32 relocation run-time overflow and unresolvable
1689 R_X86_64_32S relocation with -z nocopyreloc.
1691 2017-08-24 H.J. Lu <hongjiu.lu@intel.com>
1693 * elf32-i386.c (elf_i386_check_relocs): Revert the last change.
1694 Undefined symbols may not have a type.
1695 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1697 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1699 * elf64-x86-64.c (elf_x86_64_need_pic): Add an argument for
1700 bfd_link_info. Report shared, PIE or PDE object based on
1702 (elf_x86_64_check_relocs): Update elf_x86_64_need_pic call.
1703 (elf_x86_64_relocate_section): Likewise.
1705 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1707 * elf32-i386.c (elf_i386_check_relocs): Increment PLT count only
1708 for function symbols.
1709 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
1711 2017-08-23 H.J. Lu <hongjiu.lu@intel.com>
1713 * elf32-i386.c (elf_i386_link_setup_gnu_properties): Set
1714 extern_protected_data to FALSE if GNU_PROPERTY_NO_COPY_ON_PROTECTED
1715 is set on any input relocatable file.
1716 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1718 2017-08-23 Alan Modra <amodra@gmail.com>
1721 * elf64-ppc.c (ensure_undef_dynamic): Rename from
1722 ensure_undefweak_dynamic. Handle undefined too.
1723 * elf32-ppc.c (ensure_undef_dynamic): Likewise.
1724 * elf32-hppa.c (ensure_undef_dynamic): Likewise.
1725 (allocate_dynrelocs): Discard undefined non-default visibility
1726 relocs first. Make undefined syms dynamic. Tidy goto.
1728 2017-08-21 Alan Modra <amodra@gmail.com>
1729 H.J. Lu <hongjiu.lu@intel.com>
1732 * elf-bfd.h (SYMBOLIC_BIND): Return TRUE for __start/__stop symbols.
1733 * elflink.c (bfd_elf_define_start_stop): Rewrite.
1735 2017-08-21 Hans-Peter Nilsson <hp@bitrange.com>
1738 * elf64-mmix.c (mmix_elf_relax_section): Correct handling of
1739 undefined weak symbols.
1741 2017-08-18 Nick Clifton <nickc@redhat.com>
1744 * tekhex.c (getsym): Fix check for source pointer walking off the
1745 end of the input buffer.
1747 2017-08-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
1750 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Skip IFUNC
1751 relocations in debug sections, change abort to _bfd_error_handler.
1753 2017-08-14 Nick Clifton <nickc@redhat.com>
1756 * elf.c (setup_group): Check for an empty or very small group
1758 * po/bfd.pot: Regenerate.
1760 2017-08-14 Alan Modra <amodra@gmail.com>
1763 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Don't add
1764 alignment padding here.
1765 * elflink.c (bfd_elf_discard_info): Add .eh_frame padding here
1766 in a reverse pass over sections.
1768 2017-08-11 H.J. Lu <hongjiu.lu@intel.com>
1771 * elf32-i386.c (elf_i386_get_synthetic_symtab): Allocate space
1772 for @plt suffixes first.
1773 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
1775 2017-08-08 Nick Clifton <nickc@redhat.com>
1778 * elf-attrs.c (_bfd_elf_parse_attributes): Complain about very
1779 small section lengths.
1780 * elf.c (_bfd_elf_setup_sections): Skip empty entries in the group
1782 (elfcore_grok_freebsd_prstatus): Add checks to make sure that
1783 there is enough data present in the note.
1785 2017-08-08 Alan Modra <amodra@gmail.com>
1788 * elf32-microblaze.c (microblaze_elf_check_relocs): Don't bump
1789 got.refcount for GOTOFF relocs, just create .got section.
1791 2017-08-07 H.J. Lu <hongjiu.lu@intel.com>
1793 * elflink.c (elf_link_add_object_symbols): Move common symbol
1794 check after bed->common_definition.
1796 2017-08-07 Alan Modra <amodra@gmail.com>
1799 * elflink.c (bfd_elf_final_link): Don't segfault when sections
1800 needed to define various dynamic tags have been discarded.
1802 2017-08-07 Nick Clifton <nickc@redhat.com>
1805 * elf32-i386.c (elf_i386_link_setup_gnu_properties): If the dynobj
1806 has not been set then use the bfd returned by
1807 _bfd_elf_link_setup_gnu_properties. If that is null then search
1808 through all the input bfds selecting the first normal, ELF format
1810 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Likewise.
1812 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1814 * elf32-i386.c (elf_i386_link_hash_entry): Change tls_get_addr
1816 (elf_i386_link_hash_newfunc): Initialize tls_get_addr to 0.
1817 (elf_i386_check_tls_transition): Check tls_get_addr directly.
1818 (elf_i386_convert_load_reloc): Update tls_get_addr check.
1819 (elf_i386_link_check_relocs): New function.
1820 (bfd_elf32_bfd_link_check_relocs): New.
1821 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Change tls_get_addr
1823 (elf_x86_64_link_hash_newfunc): Initialize tls_get_addr to 0.
1824 (elf_x86_64_check_tls_transition): Check tls_get_addr directly.
1825 (elf_x86_64_convert_load_reloc): Update tls_get_addr check.
1826 (elf_x86_64_link_check_relocs): New function.
1827 (bfd_elf64_bfd_link_check_relocs): New.
1828 (bfd_elf32_bfd_link_check_relocs): Likewise.
1830 2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
1833 * elflink.c (elf_link_add_object_symbols): Treat common symbol
1834 as undefined for --no-define-common.
1836 2017-08-05 Alan Modra <amodra@gmail.com>
1838 * elf32-hppa.c (elf32_hppa_set_gp): Don't require an
1839 hppa_link_hash_table.
1841 2017-08-02 Max Filippov <jcmvbkbc@gmail.com>
1843 * xtensa-isa.c (xtensa_isa_init): Don't update lookup table
1844 entries for sysregs with negative indices.
1846 2017-08-01 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1848 * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
1849 isn't the S/390 specific elf data.
1850 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1852 2017-07-31 Kuan-Lin Chen <rufus@andestech.com>
1854 * elfxx-riscv.c (riscv_elf_add_sub_reloc): New function.
1855 * (howto_table) [R_RISCV_ADD8]: Use riscv_elf_add_sub_reloc.
1856 [R_RISCV_ADD16]: Likewise.
1857 [R_RISCV_ADD32]: Likewise.
1858 [R_RISCV_ADD64]: Likewise.
1859 [R_RISCV_SUB6]: Likewise.
1860 [R_RISCV_SUB8]: Likewise.
1861 [R_RISCV_SUB16]: Likewise.
1862 [R_RISCV_SUB32]: Likewise.
1863 [R_RISCV_SUB64]: Likewise.
1865 2017-07-31 Alan Modra <amodra@gmail.com>
1867 * elf64-ppc.c (ppc64_elf_tls_setup): Warn on --plt-localentry
1868 without ld.so checks.
1870 2017-07-29 Alan Modra <amodra@gmail.com>
1873 * elf64-ppc.c (struct ppc_link_hash_entry): Add non_zero_localentry.
1874 (ppc64_elf_merge_symbol): Set non_zero_localentry.
1875 (is_elfv2_localentry0): Test non_zero_localentry.
1876 (ppc64_elf_tls_setup): Default to --no-plt-localentry.
1878 2017-07-28 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
1880 * elf32-s390.c (elf_s390_finish_dynamic_sections): Add NULL
1881 pointer check for htab->elf.irelplt.
1882 * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
1884 2017-07-27 Nick Clifton <nickc@redhat.com>
1887 * mach-o.c (bfd_mach_o_read_symtab_strtab): Fail if the symtab
1889 * nlmcode.h (nlm_swap_auxiliary_headers_in): Replace assertion
1891 * section.c (bfd_make_section_with_flags): Fail if the name or bfd
1893 * vms-alpha.c (bfd_make_section_with_flags): Correct computation
1895 (evax_bfd_print_emh): Check for invalid string lengths.
1897 2017-07-25 Nick Clifton <nickc@redhat.com>
1899 * po/fr.po: Updated French translation.
1901 2017-07-25 Benjamin Green <bengreen5mx@gmail.com>
1904 * elf32-msp430.c (msp430_elf_relax_section): Allow conversion of
1905 16-bit absolute branches into 10-bit pc-relative branches on the
1906 MSP430 as well as the MSP430X.
1908 2017-07-25 Alan Modra <amodra@gmail.com>
1910 * elf64-ppc.c (struct map_stub): Add tls_get_addr_opt_bctrl.
1911 (stub_eh_frame_size): New function.
1912 (ppc_size_one_stub): Set group tls_get_addr_opt_bctrl.
1913 (group_sections): Init group tls_get_addr_opt_bctrl.
1914 (ppc64_elf_size_stubs): Update sizing and initialization of
1915 .eh_frame. Iteration over stubs via group list.
1916 (ppc64_elf_build_stubs): Iterate over stubs via group list.
1917 (ppc64_elf_finish_dynamic_sections): Update finalization of
1920 2017-07-24 Nick Clifton <nickc@redhat.com>
1923 * mach-o.c (bfd_mach_o_canonicalize_relocs): Pass the base address
1924 of the relocs to the canonicalize_one_reloc routine.
1925 * mach-o.h (struct bfd_mach_o_backend_data): Update the prototype
1926 for the _bfd_mach_o_canonicalize_one_reloc field.
1927 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add
1928 res_base parameter. Use to check for corrupt pair relocs.
1929 * mach-o-aarch64.c (bfd_mach_o_arm64_canonicalize_one_reloc):
1931 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc):
1933 * mach-o-x86-64.c (bfd_mach_o_x86_64_canonicalize_one_reloc):
1936 * vms-alpha.c (_bfd_vms_slurp_eihd): Make sure that there is
1937 enough data in the record before attempting to parse it.
1938 (_bfd_vms_slurp_eeom): Likewise.
1940 (_bfd_vms_slurp_egsd): Check for an invalid section index.
1941 (image_set_ptr): Likewise.
1942 (alpha_vms_slurp_relocs): Likewise.
1944 (alpha_vms_object_p): Check for a truncated record.
1946 2017-07-24 Nick Clifton <nickc@redhat.com>
1949 * reloc.c (_bfd_unrecognized_reloc): New function. Reports
1950 an unrecognized reloc and sets the bfd_error value.
1951 * libbfd.h: Regenerate.
1952 * elf32-arm.c (elf32_arm_final_link_relocate): Use the new
1954 * elf32-i386.c (elf_i386_relocate_section): Likewise.
1955 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
1956 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
1957 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Likewise.
1958 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
1960 2017-07-23 Alan Modra <amodra@gmail.com>
1962 * elf64-ppc.c (ppc64_elf_size_stubs): Correct advance to
1965 2017-07-19 Szabolcs Nagy <szabolcs.nagy@arm.com>
1968 * elfnn-aarch64.c (elfNN_aarch64_reloc_type_class): Return
1969 reloc_class_ifunc for ifunc symbols.
1971 2017-07-19 Nick Clifton <nickc@redhat.com>
1974 * archive.c (bfd_generic_archive_p): If the bfd does not have the
1975 correct magic bytes at the start, set the error to wrong format
1976 and clear the format selector before returning NULL.
1978 2017-07-19 Nick Clifton <nickc@redhat.com>
1981 * coff-rs6000.c (_bfd_strntol): New function.
1982 (_bfd_strntoll): New function.
1983 (GET_VALUE_IN_FIELD): New macro.
1984 (EQ_VALUE_IN_FIELD): new macro.
1985 (_bfd_xcoff_slurp_armap): Use new macros.
1986 (_bfd_xcoff_archive_p): Likewise.
1987 (_bfd_xcoff_read_ar_hdr): Likewise.
1988 (_bfd_xcoff_openr_next_archived_file): Likewise.
1989 (_bfd_xcoff_stat_arch_elt): Likewise.
1990 * coff64-rs6000.c (_bfd_strntol): New function.
1991 (_bfd_strntoll): New function.
1992 (GET_VALUE_IN_FIELD): New macro.
1993 (xcoff64_slurp_armap): Use new macros.
1995 2017-07-19 Claudiu Zissulescu <claziss@synopsys.com>
1996 John Eric Martin <John.Martin@emmicro-us.com>
1998 * bfd-in2.h: Regenerate.
1999 * libbfd.h: Regenerate.
2000 * elf32-arc.c (JLI): Define.
2001 * reloc.c: Add JLI relocations.
2003 2017-07-18 Nick Clifton <nickc@redhat.com>
2006 * coff-sh.c: Fix spelling typos.
2007 * compress.c: Likewise.
2008 * cpu-pdp11.c: Likewise.
2009 * ecofflink.c: Likewise.
2010 * elf-m10300.c: Likewise.
2012 * elf32-arm.c: Likewise.
2013 * elf32-m68k.c: Likewise.
2014 * elf32-nds32.c: Likewise.
2015 * elf32-ppc.c: Likewise.
2016 * elf32-sh.c: Likewise.
2017 * elf32-v850.c: Likewise.
2018 * elf64-ppc.c: Likewise.
2019 * elf64-x86-64.c: Likewise.
2020 * elflink.c: Likewise.
2021 * elfnn-aarch64.c: Likewise.
2022 * elfxx-mips.c: Likewise.
2024 * sunos.c: Likewise.
2025 * vms-alpha.c: Likewise.
2026 * xcofflink.c: Likewise.
2028 2017-07-18 Nick Clifton <nickc@redhat.com>
2031 * coffcode.h (handle_COMDAT): Replace abort with an error message
2034 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2037 * elf64-x86-64.c (elf_x86_64_relocate_section): Limit PIC check
2040 2017-07-17 H.J. Lu <hongjiu.lu@intel.com>
2042 * elf64-x86-64.c (elf_x86_64_relocate_section): Re-indent.
2044 2017-07-16 Alan Modra <amodra@gmail.com>
2046 * elf64-ppc.c (ppc64_elf_relocate_section): Don't optimize
2047 __tls_index GOT entries when using __tls_get_addr_opt stub.
2048 * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
2050 2017-07-12 Alan Modra <amodra@gmail.com>
2052 * po/es.po: Update from translationproject.org/latest/bfd/.
2053 * po/fi.po: Likewise.
2054 * po/fr.po: Likewise.
2055 * po/id.po: Likewise.
2056 * po/ja.po: Likewise.
2057 * po/ro.po: Likewise.
2058 * po/ru.po: Likewise.
2059 * po/sr.po: Likewise.
2060 * po/sv.po: Likewise.
2061 * po/tr.po: Likewise.
2062 * po/uk.po: Likewise.
2063 * po/vi.po: Likewise.
2064 * po/zh_CN.po: Likewise.
2065 * po/hr.po: New file from translationproject.org.
2066 * configure.ac (ALL_LINGUAS): Add hr. Sort.
2067 * configure: Regenerate.
2069 2017-07-12 Nick Clifton <nickc@redhat.com>
2071 Fix compile time warnings using gcc 7.1.1.
2072 * elf32-xtensa.c (elf_xtensa_get_plt_section): Increase length of
2074 (elf_xtensa_get_gotplt_section): Increase length of got_name
2076 * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add a
2077 default return of FALSE.
2078 * mach-o-i386.c (bfd_mach_o_i386_canonicalize_one_reloc): Add a
2079 default return of FALSE.
2081 2017-07-12 Alan Modra <amodra@gmail.com>
2083 * binary.c (binary_set_section_contents): Don't print filepos in
2085 (coff_write_object_contents): Cast size_t for error message.
2086 (coff_slurp_line_table): Don't use bfd_vma symndx.
2087 (coff_slurp_reloc_table): Remove unneeded cast.
2088 * dwarf2.c (read_section): Cast bfd_int64_t to long long for
2090 (find_abstract_instance_name): Likewise.
2091 * elf32-arm.c (arm_type_of_stub): Correct error arg order.
2092 (bfd_elf32_arm_stm32l4xx_erratum_scan): Don't cast error arg.
2093 (elf32_arm_check_relocs): Make r_symndx an int.
2094 * elf32-cris.c (cris_elf_check_relocs): Delete extraneous %s in
2096 * elf32-metag.c (elf_metag_relocate_section): Delete extra error
2098 * elf32-nds32.c (nds32_elf_ex9_build_hash_table): Rewrite bogus
2100 * elf32-i386.c (elf_i386_check_relocs): Make r_symndx an int.
2101 * elf32-s390.c (elf_s390_check_relocs): Likewise.
2102 * elf32-tic6x.c (elf32_tic6x_check_relocs): Likewise.
2103 * elf32-tilepro.c (tilepro_elf_check_relocs): Likewise.
2104 * elf32-xtensa.c (elf_xtensa_check_relocs): Likewise.
2105 * elf64-s390.c (elf_s390_check_relocs): Likewise.
2106 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
2107 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Likewise.
2108 * elfnn-riscv.c (riscv_elf_check_relocs): Likewise.
2109 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs): Likewise.
2110 * elfxx-tilegx.c (tilegx_elf_check_relocs): Likewise.
2111 * elf64-mmix.c (_bfd_mmix_after_linker_allocation): Cast size_t args
2112 and use %lu for error message.
2113 * elflink.c (elf_link_adjust_relocs): Delete extra error message arg.
2114 * mmo.c (mmo_scan): Make stab_loc a file_ptr. Cast expression for
2117 * elf32-arm.c (elf32_arm_tls_relax): Correct format string and args
2119 (elf32_arm_final_link_relocate): Likewise.
2120 * coff-arm.c (bfd_arm_process_before_allocation): Likewise.
2121 * coffcode.h (styp_to_sec_flags): Likewise.
2122 * cofflink.c (_bfd_coff_write_global_sym): Likewise.
2123 * ecoff.c (_bfd_ecoff_slurp_symbol_table): Likewise.
2124 * elf32-arc.c (arc_elf_merge_private_bfd_data): Likewise.
2125 * elf32-bfin.c (bfinfdpic_check_relocs): Likewise.
2126 (elf32_bfin_merge_private_bfd_data): Likewise.
2127 * elf32-cris.c (cris_elf_relocate_section): Likewise.
2128 * elf32-frv.c (frv_elf_merge_private_bfd_data): Likewise.
2129 * elf32-i370.c (i370_elf_merge_private_bfd_data): Likewise.
2130 (i370_elf_relocate_section): Likewise.
2131 * elf32-iq2000.c (iq2000_elf_merge_private_bfd_data): Likewise.
2132 * elf32-m32c.c (m32c_elf_merge_private_bfd_data): Likewise.
2133 * elf32-m68hc1x.c (_bfd_m68hc11_elf_merge_private_bfd_data): Likewise.
2134 * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
2135 * elf32-mep.c (mep_elf_merge_private_bfd_data): Likewise.
2136 * elf32-mt.c (mt_elf_merge_private_bfd_data): Likewise.
2137 * elf64-sparc.c (elf64_sparc_merge_private_bfd_data): Likewise.
2138 * elfxx-mips.c (mips_elf_merge_obj_e_flags): Likewise.
2139 (_bfd_mips_elf_merge_private_bfd_data): Likewise.
2140 * ieee.c (ieee_write_id, read_id): Likewise.
2141 * mach-o.c (bfd_mach_o_write_contents): Likewise.
2142 (bfd_mach_o_layout_commands, bfd_mach_o_read_section_32): Likewise.
2143 (bfd_mach_o_read_section_64, bfd_mach_o_read_symtab_symbol): Likewise.
2144 (bfd_mach_o_read_command, bfd_mach_o_header_p): Likewise.
2145 * peXXigen.c (_bfd_XXi_swap_aouthdr_in): Likewise.
2146 * stabs.c (_bfd_link_section_stabs): Likewise.
2148 * coff-arm.c (coff_arm_relocate_section): Use L modifier in error
2150 * coff-mcore.c (coff_mcore_relocate_section): Likewise.
2151 * coff-ppc.c (coff_ppc_relocate_section): Likewise.
2152 * coff-rs6000.c (xcoff_reloc_type_toc): Likewise.
2153 * coff-sh.c (sh_relax_section): Likewise.
2154 (sh_relax_delete_bytes, sh_swap_insns): Likewise.
2155 * coff-tic80.c (coff_tic80_relocate_section): Likewise.
2156 * coffcode.h (coff_slurp_reloc_table): Likewise.
2157 * coffgen.c (_bfd_coff_get_external_symbols): Likewise.
2158 (_bfd_coff_read_string_table): Likewise.
2159 * cofflink.c (_bfd_coff_generic_relocate_section): Likewise.
2160 * compress.c (bfd_get_full_section_contents): Likewise.
2161 * dwarf2.c (read_formatted_entries, decode_line_info): Likewise.
2162 * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
2163 * elf.c (bfd_elf_string_from_elf_section): Likewise.
2164 * elf32-arc.c (arc_special_overflow_checks): Likewise.
2165 * elf32-arm.c (elf32_arm_tls_relax): Likewise.
2166 (elf32_arm_final_link_relocate, elf32_arm_relocate_section): Likewise.
2167 (elf32_arm_write_section): Likewise.
2168 * elf32-bfin.c (bfin_relocate_section): Likewise.
2169 (bfinfdpic_relocate_section): Likewise.
2170 * elf32-hppa.c (hppa_build_one_stub): Likewise.
2171 (final_link_relocate, elf32_hppa_relocate_section): Likewise.
2172 * elf32-i386.c (elf_i386_tls_transition): Likewise.
2173 (elf_i386_relocate_section): Likewise.
2174 * elf32-ip2k.c (ip2k_final_link_relocate): Likewise.
2175 * elf32-lm32.c (lm32_elf_finish_dynamic_sections): Likewise.
2176 * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
2177 * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
2178 * elf32-metag.c (elf_metag_relocate_section): Likewise.
2179 * elf32-nds32.c (unrecognized_reloc_msg): Likewise.
2180 (nds32_elf_relax_longcall1, nds32_elf_relax_longcall2): Likewise.
2181 (nds32_elf_relax_longcall3, nds32_elf_relax_longjump1): Likewise.
2182 (nds32_elf_relax_longjump2, nds32_elf_relax_longjump3): Likewise.
2183 (nds32_elf_relax_longcall4, nds32_elf_relax_longcall5): Likewise.
2184 (nds32_elf_relax_longcall6, nds32_elf_relax_longjump4): Likewise.
2185 (nds32_elf_relax_longjump5, nds32_elf_relax_longjump6): Likewise.
2186 (nds32_elf_relax_longjump7, nds32_elf_relax_loadstore): Likewise.
2187 (nds32_elf_relax_ptr, nds32_elf_ex9_build_hash_table): Likewise.
2188 * elf32-nios2.c (nios2_elf32_relocate_section): Likewise.
2189 * elf32-rx.c (UNSAFE_FOR_PID): Likewise.
2190 * elf32-s390.c (invalid_tls_insn, elf_s390_relocate_section): Likewise.
2191 * elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
2192 * elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
2193 * elf32-sh.c (sh_elf_relax_section): Likewise.
2194 (sh_elf_relax_delete_bytes, sh_elf_swap_insns): Likewise.
2195 (sh_elf_relocate_section): Likewise.
2196 * elf32-sh64.c (shmedia_prepare_reloc): Likewise.
2197 * elf32-spu.c (spu_elf_relocate_section): Likewise.
2198 * elf32-tic6x.c (elf32_tic6x_relocate_section): Likewise.
2199 * elf32-tilepro.c (tilepro_elf_relocate_section): Likewise.
2200 * elf32-v850.c (v850_elf_relax_section): Likewise.
2201 * elf32-vax.c (elf_vax_check_relocs): Likewise.
2202 (elf_vax_relocate_section): Likewise.
2203 * elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
2204 (extend_ebb_bounds_forward, extend_ebb_bounds_backward): Likewise.
2205 (compute_text_actions, compute_ebb_proposed_actions): Likewise.
2206 (do_fix_for_relocatable_link): Likewise.
2207 * elf64-alpha.c (elf64_alpha_relax_got_load): Likewise.
2208 (elf64_alpha_relax_with_lituse): Likewise.
2209 * elf64-hppa.c (elf64_hppa_finish_dynamic_symbol): Likewise.
2210 (elf_hppa_final_link_relocate): Likewise.
2211 * elf64-ia64-vms.c (elf64_ia64_relax_section): Likewise.
2212 (elf64_ia64_choose_gp, elf64_ia64_relocate_section): Likewise.
2213 (elf64_vms_link_add_object_symbols): Likewise.
2214 * elf64-mmix.c (mmix_elf_perform_relocation): Likewise.
2215 (mmix_final_link_relocate): Likewise.
2216 * elf64-s390.c (invalid_tls_insn): Likewise.
2217 (elf_s390_relocate_section): Likewise.
2218 * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
2219 * elf64-x86-64.c (elf_x86_64_tls_transition): Likewise.
2220 (elf_x86_64_relocate_section): Likewise.
2221 * elfcode.h (elf_slurp_symbol_table): Likewise.
2222 * elfcore.h (elf_core_file_p): Likewise.
2223 * elflink.c (elf_link_read_relocs_from_section): Likewise.
2224 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Likewise.
2225 (elfNN_aarch64_relocate_section): Likewise.
2226 * elfnn-ia64.c (elfNN_ia64_relax_section): Likewise.
2227 (elfNN_ia64_choose_gp, elfNN_ia64_relocate_section): Likewise.
2228 * elfnn-riscv.c (riscv_elf_relocate_section): Likewise.
2229 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
2230 (_bfd_mips_elf_relocate_section): Likewise.
2231 (_bfd_mips_elf_finish_dynamic_symbol, mips_finish_exec_plt): Likewise.
2232 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.
2233 * elfxx-tilegx.c (tilegx_elf_relocate_section): Likewise.
2234 * ieee.c (ieee_slurp_external_symbols): Likewise.
2235 * ihex.c (ihex_write_object_content): Likewise.
2236 * mach-o.c (bfd_mach_o_build_exec_seg_command): Likewise.
2237 * merge.c (_bfd_merged_section_offset): Likewise.
2238 * mmo.c (mmo_write_loc_chunk): Likewise.
2239 (mmo_write_object_contents): Likewise.
2240 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Likewise.
2241 * stabs.c (_bfd_link_section_stabs): Likewise.
2242 * xcofflink.c (xcoff_link_add_symbols, xcoff_find_tc0): Likewise.
2244 2017-07-11 Alan Modra <amodra@gmail.com>
2246 * elf32-ppc.c (ppc_elf_relocate_section): Fix typo.
2248 2017-07-11 Alan Modra <amodra@gmail.com>
2250 * elf32-ppc.c (ppc_elf_relocate_section): Emit "unexpected
2251 instruction" error using _bfd_error_handler, not einfo.
2253 2017-07-10 Nick Clifton <nickc@redhat.com>
2255 * coffcode.h (coff_slurp_symbol_table): Do not include an entry
2256 for C_AIX_WEAKEXT if it has the same value as C_WEAKEXT.
2258 2017-07-07 John Baldwin <jhb@FreeBSD.org>
2260 * elf.c (elfcore_grok_freebsd_note): Handle NT_FREEBSD_PTLWPINFO.
2262 2017-07-07 Alan Modra <amodra@gmail.com>
2264 * coffcode.h (coff_slurp_symbol_table): Handle C_AIX_WEAKEXT.
2266 2017-07-07 Alan Modra <amodra@gmail.com>
2268 * bfd.c (_doprnt): Replace "L" with "ll" when printing bfd_vma
2269 as long long. Move code replacing "ll" with "I64", and simplify.
2271 2017-07-06 H.J. Lu <hongjiu.lu@intel.com>
2273 * bfd.c (_doprnt): Convert 'L' to 'l' when setting wide_width
2276 2017-07-05 H.J. Lu <hongjiu.lu@intel.com>
2278 * dwarf2.c (line_info_add_include_dir_stub): Replace time with
2280 (line_info_add_file_name): Likewise.
2281 (decode_line_info): Likewise.
2283 2017-07-04 Tristan Gingold <gingold@adacore.com>
2285 * version.m4: Bump version to 2.29.51
2286 * configure: Regenerate.
2288 2017-07-04 Jiong Wang <jiong.wang@arm.com>
2290 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Remove the
2291 sanity check at the head of this function.
2293 2017-07-04 Jan Kratochvil <jan.kratochvil@redhat.com>
2295 * dwarf2.c (struct dwarf2_debug): Add fields dwarf_line_str_buffer and
2296 dwarf_line_str_size.
2297 (struct attr_abbrev): Add field implicit_const.
2298 (dwarf_debug_sections): Add .debug_line_str.
2299 (enum dwarf_debug_section_enum): Add debug_line_str and debug_max.
2300 (dwarf_debug_section_assert): Add static assertion.
2301 (read_indirect_line_string): New.
2302 (read_abbrevs): Support DW_FORM_implicit_const.
2303 (is_str_attr): Support DW_FORM_line_strp.
2304 (read_attribute_value): Support DW_FORM_line_strp and
2305 DW_FORM_implicit_const.
2306 (read_attribute): Support DW_FORM_implicit_const.
2307 (line_info_add_include_dir, line_info_add_include_dir_stub):
2308 (line_info_add_file_name, read_formatted_entries): New.
2309 (decode_line_info, parse_comp_unit): Support DWARF 5.
2310 (_bfd_dwarf2_cleanup_debug_info): Free dwarf_line_str_buffer.
2312 2017-07-03 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2314 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Remove the
2315 abort statement that was put for symbols that are not dynamic.
2317 2017-07-03 Tristan Gingold <gingold@adacore.com>
2319 * po/bfd.pot: Regenerate
2321 2017-07-03 Alan Modra <amodra@gmail.com>
2323 * bfd.c (_doprnt): Rewrite "ll" and "L" modifiers to "I64" for
2324 __MSVCRT__. Support "L" modifier for bfd_vma. Formatting.
2325 * elf.c (setup_group): Use "Lx" to print sh_size.
2326 (_bfd_elf_setup_sections): Remove unnecessary cast and print
2327 unknown section type in hex.
2328 (copy_special_section_fields): Style fix.
2329 (bfd_section_from_shdr): Correct format for sh_link. Use a
2330 common error message for all the variants of unrecognized
2332 (assign_file_positions_for_load_sections): Use "Lx" for lma
2333 adjust error message.
2334 (assign_file_positions_for_non_load_sections): Formatting.
2335 (rewrite_elf_program_header): Formatting. Use "Lx" for
2336 bfd_vma values in error messages.
2337 * elfcode.h (elf_slurp_reloc_table_from_section): Cast
2338 ELF_R_SYM value to type expected by format.
2339 * elflink.c (elf_link_read_relocs_from_section): Use "Lx"
2341 (elf_link_add_object_symbols): Use "Lu" for symbol sizes.
2342 (elf_link_input_bfd): Use "Lx" for r_info.
2343 (bfd_elf_gc_record_vtinherit): Use "Lx" for offset.
2345 2017-07-03 Alan Modra <amodra@gmail.com>
2347 * bfd.c (bfd_scan_vma): Don't use long long unless HAVE_LONG_LONG.
2348 * coff-rs6000.c (FMT20): Handle hosts with 64-bit long and
2349 Microsoft C library variant of long long format specifier.
2350 (PRINT20): Cast value to bfd_uint64_t not long long.
2351 * coffcode.h (coff_print_aux): Use BFD_VMA_FMT.
2352 * coff-x86_64.c (coff_amd64_reloc): Use bfd_uint64_t rather than
2353 long long. Don't cast to bfd_vma.
2354 * elf32-score.c (score3_bfd_getl48): Likewise.
2355 * vms-alpha.c (_bfd_vms_slurp_eisd): Likewise.
2357 2017-07-03 Alan Modra <amodra@gmail.com>
2359 * elf.c (_bfd_elf_print_private_bfd_data): Use BFD_VMA_FMT to
2361 (bfd_elf_print_symbol): Don't cast symbol->flags.
2362 (_bfd_elf_symbol_from_bfd_symbol): Likewise.
2363 * elf32-ppc.c (ppc_elf_begin_write_processing): Correct
2364 _bfd_error_handler argument order.
2365 (ppc_elf_merge_private_bfd_data): Don't cast flags.
2367 2017-07-03 Alan Modra <amodra@gmail.com>
2369 * configure.ac: Invoke AC_CHECK_TYPES for long long. Invoke
2370 AC_TYPE_LONG_DOUBLE.
2371 * configure: Regenerate.
2372 * config.in: Regenerate.
2374 2017-06-29 Andrew Waterman <andrew@sifive.com>
2376 * elfnn-riscv.c (riscv_elf_adjust_dynamic_symbol): Fix TLS copy
2379 2017-06-29 Egeyar Bagcioglu <egeyar.bagcioglu@oracle.com>
2381 * elfxx-sparc.c (allocate_dynrelocs): Don't make a symbol dynamic
2382 unless it is undefined weak.
2383 * elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Set the flag
2384 relative_reloc to direct non-dynamic symbols to R_SPARC_RELATIVE
2386 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): If symbol
2387 is not dynamic in PIC, abort.
2389 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2392 * elfnn-aarch64.c (elfNN_aarch64_allocate_dynrelocs): Only make
2393 undefined weak symbols into dynamic.
2394 (elfNN_aarch64_final_link_relocate): Generate runtime RELATIVE
2395 relocation for non-dynamic symbols.
2396 (elfNN_aarch64_finish_dynamic_symbol): Add sanity check.
2398 2017-06-29 Jiong Wang <jiong.wang@arm.com>
2400 * elfnn-aarch64.c (aarch64_relocation_aginst_gp_p): New function.
2401 (elfNN_aarch64_final_link_relocate): Delete duplicated code for
2402 BFD_RELOC_AARCH64_LD64_GOTOFF_LO15, BFD_RELOC_AARCH64_MOVW_GOTOFF_G0_NC,
2403 BFD_RELOC_AARCH64_MOVW_GOTOFF_G1.
2404 * elfxx-aarch64.c (_bfd_aarch64_elf_resolve_relocation): Optimize the
2407 2017-06-29 Andreas Arnez <arnez@linux.vnet.ibm.com>
2409 * elf-bfd.h (elfcore_write_s390_gs_cb): Add prototype.
2410 (elfcore_write_s390_gs_bc): Likewise.
2411 * elf.c (elfcore_grok_s390_gs_cb): New function.
2412 (elfcore_grok_s390_gs_bc): New function.
2413 (elfcore_grok_note): Call them.
2414 (elfcore_write_s390_gs_cb): New function.
2415 (elfcore_write_s390_gs_bc): New function.
2416 (elfcore_write_register_note): Call them.
2418 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2420 * libbfd.c (_bfd_generic_get_section_contents): Don't call
2421 bfd_get_file_size. Check archive element size.
2422 (_bfd_generic_get_section_contents_in_window): Likewise.
2424 2017-06-28 H.J. Lu <hongjiu.lu@intel.com>
2426 * bfd-in2.h: Regenerated.
2427 * bfdio.c (bfd_get_size): Change return type to ufile_ptr.
2428 (bfd_get_file_size): Likewise.
2430 2017-06-28 Maciej W. Rozycki <macro@imgtec.com>
2431 Matthew Fortune <matthew.fortune@imgtec.com>
2433 * archures.c (bfd_mach_mips_interaptiv_mr2): New macro.
2434 * cpu-mips.c (I_interaptiv_mr2): New enum value.
2435 (arch_info_struct): Add "mips:interaptiv-mr2" entry.
2436 * elfxx-mips.c (_bfd_elf_mips_mach) <E_MIPS_MACH_IAMR2>: New
2438 (mips_set_isa_flags) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2439 (bfd_mips_isa_ext) <bfd_mach_mips_interaptiv_mr2>: Likewise.
2440 (print_mips_isa_ext) <AFL_EXT_INTERAPTIV_MR2>: Likewise.
2441 (mips_mach_extensions): Add `bfd_mach_mipsisa32r3' and
2442 `bfd_mach_mips_interaptiv_mr2' entries.
2443 * bfd-in2.h: Regenerate.
2445 2017-06-27 Nick Clifton <nickc@redhat.com>
2447 * tekhex.c (pass_over): Revert accidental conversion of a local
2448 array to a static array.
2450 2017-06-27 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
2453 * elf32-avr.c (elf32_avr_adjust_diff_reloc_value): Adjust
2454 reloc addend if necessary. Adjust diff only if
2455 shrinked_insn_address < end_address.
2457 2017-06-27 Alan Modra <amodra@gmail.com>
2460 * libbfd.c (_bfd_generic_get_section_contents): Warning fix.
2461 (_bfd_generic_get_section_contents_in_window): Likewise.
2463 2017-06-26 Kuan-Lin Chen <rufus@andestech.com>
2465 * elfnn-riscv.c (perform_relocation): Support the new
2466 R_RISCV_32_PCREL relocation.
2467 (riscv_elf_relocate_section): Likewise.
2468 * elfxx-riscv.c (howto_table): Likewise.
2469 (riscv_reloc_map): Likewise.
2470 * bfd-in2.h (BFD_RELOC_RISCV_32_PCREL): New relocation.
2471 * libbfd.h: Regenerate.
2473 2017-06-27 Alan Modra <amodra@gmail.com>
2476 * libbfd.c (_bfd_generic_get_section_contents): Delete abort.
2477 Use unsigned file pointer type, and remove cast.
2478 * libbfd.c (_bfd_generic_get_section_contents_in_window): Likewise.
2479 Add "count", not "sz".
2481 2017-06-26 Pedro Alves <palves@redhat.com>
2484 * libbfd.c (_bfd_generic_get_section_contents): Add "count", not
2487 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2490 * libbfd.c (_bfd_generic_get_section_contents_in_window): Add
2493 2017-06-26 Maciej W. Rozycki <macro@imgtec.com>
2495 * cpu-mips.c (arch_info_struct): Mark the 4010 32-bit.
2496 * elfxx-mips.c (mips_set_isa_flags) <bfd_mach_mips4010>: Set
2497 E_MIPS_ARCH_2 rather than E_MIPS_ARCH_3 in `e_flags'.
2498 (mips_mach_extensions): Mark `bfd_mach_mips4010' as extending
2499 `bfd_mach_mips6000' rather than `bfd_mach_mips4000'.
2501 2017-06-26 H.J. Lu <hongjiu.lu@intel.com>
2504 * compress.c (bfd_get_full_section_contents): Don't check the
2506 * libbfd.c (_bfd_generic_get_section_contents): Check for and
2507 reject a section whose size + offset is greater than the size
2509 (_bfd_generic_get_section_contents_in_window): Likewise.
2511 2017-06-26 Nick Clifton <nickc@redhat.com>
2514 * tekhex.c (getvalue): Check for the source pointer exceeding the
2515 end pointer before the first byte is read.
2517 2017-06-26 Nick Clifton <nickc@redhat.com>
2520 * opncls.c (get_build_id): Check that the section is big enough
2521 to contain the whole note.
2522 * compress.c (bfd_get_full_section_contents): Check for and reject
2523 a section whose size is greater than the size of the entire file.
2524 * elf32-v850.c (v850_elf_copy_notes): Allow for the ouput to not
2525 contain a notes section.
2527 2017-06-26 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2529 * elf64-s390.c (elf_s390_additional_program_headers): Add NULL
2531 (elf_s390_modify_segment_map): Likewise.
2532 (bfd_elf_s390_set_options): Lisewise.
2534 2017-06-26 Alan Modra <amodra@gmail.com>
2536 * elflink.c (_bfd_elf_link_create_dynstrtab): Don't make dynobj
2538 (_bfd_elf_size_group_sections): Skip --just-syms bfds.
2539 (bfd_elf_size_dynamic_sections): Ignore .note.GNU-stack and
2540 .preinit_array on --just-syms bfds.
2541 (_bfd_elf_gc_mark_extra_sections): Skip --just-syms bfds.
2542 (elf_gc_sweep, bfd_elf_parse_eh_frame_entries): Likewise.
2543 (bfd_elf_gc_sections, bfd_elf_discard_info): Likewise.
2545 2017-06-25 Sergei Trofimovich <slyfox@gentoo.org>
2547 * elf.c (find_link): Bounds check "hint".
2549 2017-06-24 Thomas Preud'homme <thomas.preudhomme@arm.com>
2551 * elf32-arm.c (using_thumb_only): Update list of architectures in
2552 BFD_ASSERT for which the logic is valid.
2553 (using_thumb2_bl): Likewise.
2554 (using_thumb2): Likewise and return true for ARMv8-R.
2555 (arch_has_arm_nop): Likewise.
2556 (tag_cpu_arch_combine): New v8r table for ARMv8-R Tag_CPU_arch
2557 merging logic. Update commentis for value 15 of v8m_baseline,
2558 v8m_mainline and v4t_plus_v6_m arrays. Use v8r array to decide
2559 merging of value 15 of Tag_CPU_arch.
2561 2017-06-23 Jiong Wang <jiong.wang@arm.com>
2563 * reloc.c (BFD_RELOC_AARCH64_ADR_GOTPAGE): Rename to
2564 BFD_RELOC_AARCH64_ADR_GOT_PAGE
2565 * bfd-in2.h: Regenerate.
2567 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2569 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Move
2570 the error_alignment label forward. Properly align program
2571 property note section.
2573 2017-06-22 Eric Christopher <echristo@gmail.com>
2575 * elf32-arm.c (elf32_arm_final_link_relocate): Use labs rather than
2576 abs to fix a truncation warning.
2578 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2580 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Resolve
2581 local undefined weak symbol to 0.
2582 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Likewise.
2584 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2586 * elf32-i386.c (elf_i386_merge_gnu_properties): If info->shstk
2587 is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2588 (elf_i386_link_setup_gnu_properties): If info->shstk is set,
2589 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2590 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): If
2591 info->shstk is set, turn on GNU_PROPERTY_X86_FEATURE_1_SHSTK.
2592 (elf_x86_64_link_setup_gnu_properties): If info->shstk is set,
2593 turn on GNU_PROPERTY_X86_FEATURE_1_IBT.
2595 2017-06-22 H.J. Lu <hongjiu.lu@intel.com>
2597 * elf32-i386.c (elf_i386_lazy_ibt_plt0_entry): New.
2598 (elf_i386_lazy_ibt_plt_entry): Likewise.
2599 (elf_i386_pic_lazy_ibt_plt0_entry): Likewise.
2600 (elf_i386_non_lazy_ibt_plt_entry): Likewise.
2601 (elf_i386_pic_non_lazy_ibt_plt_entry): Likewise.
2602 (elf_i386_eh_frame_lazy_ibt_plt): Likewise.
2603 (elf_i386_lazy_plt_layout): Likewise.
2604 (elf_i386_non_lazy_plt_layout): Likewise.
2605 (elf_i386_link_hash_entry): Add plt_second.
2606 (elf_i386_link_hash_table): Add plt_second and
2607 plt_second_eh_frame.
2608 (elf_i386_allocate_dynrelocs): Use the second PLT if needed.
2609 (elf_i386_size_dynamic_sections): Use .plt.got unwind info for
2610 the second PLT. Check the second PLT.
2611 (elf_i386_relocate_section): Use the second PLT to resolve
2612 PLT reference if needed.
2613 (elf_i386_finish_dynamic_symbol): Fill and use the second PLT if
2615 (elf_i386_finish_dynamic_sections): Set sh_entsize on the
2616 second PLT. Generate unwind info for the second PLT.
2617 (elf_i386_plt_type): Add plt_second.
2618 (elf_i386_get_synthetic_symtab): Support the second PLT.
2619 (elf_i386_parse_gnu_properties): Support
2620 GNU_PROPERTY_X86_FEATURE_1_AND.
2621 (elf_i386_merge_gnu_properties): Support
2622 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2623 on GNU_PROPERTY_X86_FEATURE_1_IBT
2624 (elf_i386_link_setup_gnu_properties): If info->ibt is set,
2625 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2626 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2627 is set on all relocatable inputs.
2628 * elf64-x86-64.c (elf_x86_64_lazy_ibt_plt_entry): New.
2629 (elf_x32_lazy_ibt_plt_entry): Likewise.
2630 (elf_x86_64_non_lazy_ibt_plt_entry): Likewise.
2631 (elf_x32_non_lazy_ibt_plt_entry): Likewise.
2632 (elf_x86_64_eh_frame_lazy_ibt_plt): Likewise.
2633 (elf_x32_eh_frame_lazy_ibt_plt): Likewise.
2634 (elf_x86_64_lazy_ibt_plt): Likewise.
2635 (elf_x32_lazy_ibt_plt): Likewise.
2636 (elf_x86_64_non_lazy_ibt_plt): Likewise.
2637 (elf_x32_non_lazy_ibt_plt): Likewise.
2638 (elf_x86_64_get_synthetic_symtab): Support the second PLT.
2639 (elf_x86_64_parse_gnu_properties): Support
2640 GNU_PROPERTY_X86_FEATURE_1_AND.
2641 (elf_x86_64_merge_gnu_properties): Support
2642 GNU_PROPERTY_X86_FEATURE_1_AND. If info->ibt is set, turn
2643 on GNU_PROPERTY_X86_FEATURE_1_IBT
2644 (elf_x86_64_link_setup_gnu_properties): If info->ibt is set,
2645 turn on GNU_PROPERTY_X86_FEATURE_1_IBT. Use IBT-enabled PLT
2646 for info->ibtplt, info->ibt or GNU_PROPERTY_X86_FEATURE_1_IBT
2647 is set on all relocatable inputs.
2649 2017-06-22 Nick Clifton <nickc@redhat.com>
2652 * som.c (setup_sections): NUL terminate the space_strings buffer.
2653 Check that the space.name field does not index beyond the end of
2654 the space_strings buffer.
2656 2017-06-21 Nick Clifton <nickc@redhat.com>
2659 * coff-sh.c (sh_reloc): Check for an out of range reloc.
2661 2017-06-21 Nick Clifton <nickc@redhat.com>
2664 * vms-misc.c (_bfd_vms_save_sized_string): Use unsigned int as
2665 type of the size parameter.
2666 (_bfd_vms_save_counted_string): Add second parameter - the maximum
2667 length of the counted string.
2668 * vms.h (_bfd_vms_save_sized_string): Update prototype.
2669 (_bfd_vms_save_counted_string): Likewise.
2670 * vms-alpha.c (_bfd_vms_slurp_eisd): Update calls to
2671 _bfd_vms_save_counted_string.
2672 (_bfd_vms_slurp_ehdr): Likewise.
2673 (_bfd_vms_slurp_egsd): Likewise.
2674 (Parse_module): Likewise.
2676 2017-06-21 Alan Modra <amodra@gmail.com>
2678 * elf64-ppc.c (ppc64_elf_size_stubs): Test for localentry:0 plt
2679 calls before tocsave calls.
2680 (ppc64_elf_relocate_section): Allow localentry:0 plt calls without
2683 2017-06-21 Nick Clifton <nickc@redhat.com>
2686 * reloc.c (bfd_generic_get_relocated_section_contents): Fail if
2687 bfd_get_full_section_contents returns no contents.
2689 2017-06-21 Nick Clifton <nickc@redhat.com>
2692 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an undersized
2695 2017-06-21 Nick Clifton <nickc@redhat.com>
2698 * vms-alpha.c (_bfd_vms_slurp_egsd): Check for an empty section
2700 (image_set_ptr): Likewise.
2701 (alpha_vms_fix_sec_rel): Likewise.
2702 (alpha_vms_slurp_relocs): Likewise.
2704 2017-06-21 Nick Clifton <nickc@redhat.com>
2707 * ieee.c (ieee_slurp_sections): Check for a NULL return from
2709 (ieee_archive_p): Likewise.
2710 (ieee_object_p): Likewise.
2712 2017-06-21 Nick Clifton <nickc@redhat.com>
2715 * elf.c (setup_group): Zero the group section pointer list after
2716 allocation so that loops can be caught. Check for NULL pointers
2717 when processing a group list.
2719 2017-06-20 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
2721 * elf-s390.h: New file.
2722 * elf64-s390.c (struct elf_s390_link_hash_table): Add params
2724 (elf_s390_additional_program_headers): New function.
2725 (elf_s390_modify_segment_map): New function.
2726 (bfd_elf_s390_set_options): New function.
2727 (elf_backend_additional_program_headers)
2728 (elf_backend_modify_segment_map): Add macro definitions.
2730 2017-06-19 H.J. Lu <hongjiu.lu@intel.com>
2733 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Check
2734 the DYNAMIC bit instead of bfd_count_sections.
2736 2017-06-19 Nick Clifton <nickc@redhat.com>
2739 * vms-alpha.c (evax_bfd_print_emh): Check for insufficient record
2741 (evax_bfd_print_eeom): Likewise.
2742 (evax_bfd_print_egsd): Check for an overlarge record length.
2743 (evax_bfd_print_etir): Likewise.
2745 2017-06-19 Nick Clifton <nickc@redhat.com>
2748 * libieee.h (struct common_header_type): Add end_p field.
2749 * ieee.c (this_byte_and_next): Do not advance input_p beyond
2751 (read_id): Check for a length that exceeds the remaining bytes in
2753 (ieee_seek): Initialise end_p.
2754 (ieee_archive_p): Likewise.
2755 (ieee_object_p): Likewise.
2757 2017-06-19 Nick Clifton <nickc@redhat.com>
2760 * vms-alpha.c (_bfd_vms_slurp_eihs): Check for invalid offset
2761 before reading the EIHS structure entries.
2763 2017-06-19 Nick Clifton <nickc@redhat.com>
2766 * vms-alpha.c (_bfd_vms_slurp_egsd): Use unsigned int for
2767 gsd_size. Check that there are enough bytes remaining to read the
2768 type and size of the next egsd. Check that the size of the egsd
2769 does not exceed the size of the record.
2771 2017-06-19 Alan Modra <amodra@gmail.com>
2773 * config.bfd: Correct targ_underscore for cris.
2775 2017-06-18 Alan Modra <amodra@gmail.com>
2777 * config.bfd: Correct targ_underscore for epiphany, ip2k,
2778 m32c, mn10200, pru, rl78, rx, crisv32 and v850.
2780 2017-06-16 Nick Clifton <nickc@redhat.com>
2782 * elflink.c (bfd_elf_size_dynsym_hash_dynstr): Do not fail if the
2783 bucketlist is empty because there are no symbols to add to the
2786 2017-06-16 Alan Modra <amodra@gmail.com>
2792 * targets.c (struct bfd_target): Add _bfd_define_start_stop.
2793 (BFD_JUMP_TABLE_LINK): Likewise.
2794 * elf-bfd.h (bfd_elf_define_start_stop): Declare.
2795 * elflink.c (_bfd_elf_gc_mark_rsec): Update comment.
2796 (bfd_elf_define_start_stop): New function.
2797 * linker.c (bfd_generic_define_start_stop): New function.
2798 * coff64-rs6000.c (rs6000_xcoff64_vec, rs6000_xcoff64_aix_vec): Init
2800 * aout-adobe.c (aout_32_bfd_define_start_stop): Define.
2801 * aout-target.h (MY_bfd_define_start_stop): Define.
2802 * aout-tic30.c (MY_bfd_define_start_stop): Define.
2803 * binary.c (binary_bfd_define_start_stop): Define.
2804 * bout.c (b_out_bfd_define_start_stop): Define.
2805 * coff-alpha.c (_bfd_ecoff_bfd_define_start_stop): Define.
2806 * coff-mips.c (_bfd_ecoff_bfd_define_start_stop): Define.
2807 * coff-rs6000.c (_bfd_xcoff_bfd_define_start_stop): Define.
2808 * coffcode.h (coff_bfd_define_start_stop): Define.
2809 * elfxx-target.h (bfd_elfNN_bfd_define_start_stop): Define.
2810 * i386msdos.c (msdos_bfd_define_start_stop): Define.
2811 * i386os9k.c (os9k_bfd_define_start_stop): Define.
2812 * ieee.c (ieee_bfd_define_start_stop): Define.
2813 * ihex.c (ihex_bfd_define_start_stop): Define.
2814 * libbfd-in.h (_bfd_nolink_bfd_define_start_stop): Define.
2815 * mach-o-target.c (bfd_mach_o_bfd_define_start_stop): Define.
2816 * mmo.c (mmo_bfd_define_start_stop): Define.
2817 * nlm-target.h (nlm_bfd_define_start_stop): Define.
2818 * oasys.c (oasys_bfd_define_start_stop): Define.
2819 * pef.c (bfd_pef_bfd_define_start_stop): Define.
2820 * plugin.c (bfd_plugin_bfd_define_start_stop): Define.
2821 * ppcboot.c (ppcboot_bfd_define_start_stop): Define.
2822 * som.c (som_bfd_define_start_stop): Define.
2823 * srec.c (srec_bfd_define_start_stop): Define.
2824 * tekhex.c (tekhex_bfd_define_start_stop): Define.
2825 * versados.c (versados_bfd_define_start_stop): Define.
2826 * vms-alpha.c (vms_bfd_define_start_stop): Define.
2827 (alpha_vms_bfd_define_start_stop): Define.
2828 * xsym.c (bfd_sym_bfd_define_start_stop): Define.
2829 * bfd-in2.h: Regenerate.
2830 * libbfd.h: Regenerate.
2832 2017-06-16 Jiong Wang <jiong.wang@arm.com>
2834 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Use
2835 SYMBOL_REFERENCES_LOCAL.
2837 2017-06-15 Jiong Wang <jiong.wang@arm.com>
2840 * elfnn-aarch64.c (ELIMINATE_COPY_RELOCS): Set to 1.
2841 (elfNN_aarch64_final_link_relocate): Also propagate relocations to
2842 runtime for if there needs copy relocation elimination.
2843 (need_copy_relocation_p): New function. Return true for symbol with
2844 pc-relative references and if it's against read-only sections.
2845 (elfNN_aarch64_adjust_dynamic_symbol): Use need_copy_relocation_p.
2846 (elfNN_aarch64_check_relocs): Allocate dynrelocs for relocation types
2847 that are related with accessing external objects.
2848 (elfNN_aarch64_gc_sweep_hook): Sync the relocation types with the change
2849 in elfNN_aarch64_check_relocs.
2851 2017-06-15 Nick Clifton <nickc@redhat.com>
2854 * ieee.c (ieee_object_p): Use a static buffer to avoid compiler
2857 (ieee_archive_p): Likewise.
2859 2017-06-15 Nick Clifton <nickc@redhat.com>
2862 * vms-alpha.c (_bfd_vms_slurp_etir): Extend check of cmd_length.
2864 2017-06-14 Max Filippov <jcmvbkbc@gmail.com>
2866 * elf32-xtensa.c (elf_xtensa_be_plt_entry,
2867 elf_xtensa_le_plt_entry): Add dimension for the ABI to arrays,
2868 keep both windowed and call0 ABI PLT definitions.
2869 (elf_xtensa_create_plt_entry): Use selected ABI to choose upper
2870 elf_xtensa_*_plt_entry endex.
2871 (ELF_MAXPAGESIZE): Fix at minimal supported MMU page size.
2873 2017-06-14 Nick Clifton <nickc@redhat.com>
2876 * elf32-sh.c (sh_elf_set_mach_from_flags): Fix check for invalid
2879 2017-06-14 Nick Clifton <nickc@redhat.com>
2882 * vms-alpha.c (_bfd_vms_get_value): Add an extra parameter - the
2883 maximum value for the ascic pointer. Check that name processing
2884 does not read beyond this value.
2885 (_bfd_vms_slurp_etir): Add checks for attempts to read beyond the
2888 2017-06-14 Nick Clifton <nickc@redhat.com>
2891 * versados.c (versados_mkobject): Zero the allocated tdata structure.
2892 (process_otr): Check for an invalid offset in the otr structure.
2894 2017-06-14 Sebastian Huber <sebastian.huber@embedded-brains.de>
2896 * config.bfd (epiphany-*-elf): Accept epiphany-*-*.
2898 2017-06-13 H.J. Lu <hongjiu.lu@intel.com>
2904 * elf-bfd.h (elf_link_hash_entry): Add start_stop. Change the
2905 vtable field to a union.
2906 (_bfd_elf_is_start_stop): Removed.
2907 * elf32-i386.c (elf_i386_convert_load_reloc): Also check for
2908 __start_SECNAME and __stop_SECNAME symbols.
2909 * elf64-x86-64.c (elf_x86_64_convert_load_reloc): Likewise.
2910 * elflink.c (_bfd_elf_is_start_stop): Removed.
2911 (_bfd_elf_gc_mark_rsec): Check start_stop instead of calling
2912 _bfd_elf_is_start_stop.
2913 (elf_gc_propagate_vtable_entries_used): Skip __start_SECNAME and
2914 __stop_SECNAME symbols. Updated.
2915 (elf_gc_smash_unused_vtentry_relocs): Likewise.
2916 (bfd_elf_gc_record_vtinherit): Likewise.
2917 (bfd_elf_gc_record_vtentry): Likewise.
2919 2017-06-13 Nick Clifton <nickc@redhat.com>
2922 * elflink.c (elf_link_adjust_relocs): Generate an error when
2923 encountering a reloc against a symbol removed by garbage
2926 2017-06-12 H.J. Lu <hongjiu.lu@intel.com>
2928 * elf-bfd.h (elf_backend_data): Add struct bfd_link_info *
2929 to merge_gnu_properties.
2930 * elf-properties.c (elf_merge_gnu_properties): Add struct
2931 bfd_link_info * and pass it to merge_gnu_properties.
2932 (elf_merge_gnu_property_list): Add struct bfd_link_info *
2933 and pass it to elf_merge_gnu_properties.
2934 (_bfd_elf_link_setup_gnu_properties): Pass info to
2935 elf_merge_gnu_property_list.
2936 * elf32-i386.c (elf_i386_merge_gnu_properties): Add struct
2938 * elf64-x86-64.c (elf_x86_64_merge_gnu_properties): Likewise.
2940 2017-06-11 Joe Zbiciak <joe.zbiciak@leftturnonly.info>
2943 * binary.c (binary_set_section_contents): Scale lma by octets
2944 per byte to set filepos.
2946 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2948 * elf32-arc.c (elf_arc_check_relocs): Fixed conditions to generate
2951 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2953 * elf32-arc.c (elf_arc_size_dynamic_sections): Changed condition to
2956 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2958 * arc-got.h (relocate_fix_got_relocs_for_got_info): Added TCB_SIZE to
2959 patched section contents for TLS IE reloc.
2960 * elf32-arc.c: Remove TCB_SIZE preprocessor macro.
2962 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2964 * elf32-arc.c (elf_arc_relocate_section): Added "call" to
2965 RELOC_FOR_GLOBAL_SYMBOL macro.
2967 2018-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2969 * elf32-arc.c (elf_arc_relocate_section): Small refactor and condition
2972 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2974 * config/tc-arc.c (md_undefined_symbol): Changed.
2975 * config/tc-arc.h (DYNAMIC_STRUCT_NAME): Removed.
2977 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2979 * elf32-arc.c (elf_arc_relocate_section): Fixed reassign of indirect
2982 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2984 * elf32-arc.c (elf_arc_check_relocs): Added condition to disable
2985 warning and "Bad value" for local symbols ARC_32 or ARC_32_ME relocs.
2987 2017-06-08 Cupertino Miranda <cmiranda@synopsys.com>
2989 * elf32-arc.c (ADD_RELA): Changed to only work when dynamic
2992 2017-06-08 Richard Earnshaw <rearnsha@arm.com>
2994 * elf32-arm.c (elf32_arm_merge_eabi_attributes): Remove assertion
2995 that the input bfd has Tag_FP_ARCH non-zero if Tag_ABI_HardFP_use
2996 is non-zero. Add clarifying comments.
2998 2017-06-08 H.J. Lu <hongjiu.lu@intel.com>
3000 * elf32-i386.c (elf_i386_check_relocs): Set local IFUNC symbol
3001 name. Use local IFUNC symbol name string to report unsupported
3002 non-PIC call to IFUNC function.
3003 (elf_i386_relocate_section): Dump local IFUNC name with minfo
3004 when generating R_386_IRELATIVE relocation.
3005 (elf_i386_finish_dynamic_symbol): Likewise.
3006 * elf_x86_64_check_relocs (elf_x86_64_check_relocs): Set local
3008 (elf_x86_64_relocate_section): Dump local IFUNC name with minfo
3009 when generating R_X86_64_IRELATIVE relocation.
3010 (elf_x86_64_finish_dynamic_symbol): Likewise.
3012 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3014 * elf.c (setup_group): Make sure BFD sections are created for all
3015 group sections in the input file when processing SHF_GROUP
3017 (bfd_section_from_shdr): Avoid duplicating logic already
3018 implemented in `setup_group'.
3020 2017-06-06 Daniel Bonniot de Ruisselet <bonniot@gmail.com>
3023 * peXXigen.c (pe_print_idata): Use the address of the first thunk
3024 if the hint address is zero.
3026 2017-06-06 James Clarke <jrtc27@jrtc27.com>
3029 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Check
3030 ELF_COMMON_DEF_P for common symbols.
3032 2017-06-06 Andrew Burgess <andrew.burgess@embecosm.com>
3034 * elf.c (_bfd_elf_make_section_from_shdr): Don't initially mark
3035 SEC_GROUP sections as SEC_EXCLUDE.
3036 (bfd_elf_set_group_contents): Replace use of abort with an assert.
3037 (assign_section_numbers): Use resolve_section_groups flag instead
3038 of relocatable link type.
3039 (_bfd_elf_init_private_section_data): Use resolve_section_groups
3040 flag instead of checking the final_link flag for part of the
3041 checks in here. Fix white space as a result.
3042 * elflink.c (elf_link_input_bfd): Use resolve_section_groups flag
3043 instead of relocatable link type.
3044 (bfd_elf_final_link): Likewise.
3046 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3048 * elfxx-mips.c (_bfd_mips_elf_relocate_section): Remove unused
3050 * elf32-score.c (score_elf_final_link_relocate): Likewise.
3051 (s3_bfd_score_elf_check_relocs): Likewise.
3052 * elf32-score7.c (s7_bfd_score_elf_relocate_section): Likewise.
3053 (score_elf_final_link_relocate): Likewise.
3054 (s7_bfd_score_elf_check_relocs): Likewise.
3056 2017-06-06 Jose E. Marchesi <jose.marchesi@oracle.com>
3058 * elflink.c (init_reloc_cookie_rels): Remove unused variable
3061 2017-06-06 Maciej W. Rozycki <macro@imgtec.com>
3063 * elf-bfd.h (RELOC_AGAINST_DISCARDED_SECTION): Subtract `count'
3064 from `reloc_count' rather than decrementing it.
3065 * elf.c (bfd_section_from_shdr): Multiply the adjustment to
3066 `reloc_count' by `int_rels_per_ext_rel'.
3067 * elf32-score.c (score_elf_final_link_relocate): Do not multiply
3068 `reloc_count' by `int_rels_per_ext_rel' for last relocation
3069 entry determination.
3070 (s3_bfd_score_elf_check_relocs): Likewise.
3071 * elf32-score7.c (score_elf_final_link_relocate): Likewise.
3072 (s7_bfd_score_elf_relocate_section): Likewise.
3073 (s7_bfd_score_elf_check_relocs): Likewise.
3074 * elf64-mips.c (mips_elf64_get_reloc_upper_bound): Remove
3075 prototype and function.
3076 (mips_elf64_slurp_one_reloc_table): Do not update `reloc_count'.
3077 (mips_elf64_slurp_reloc_table): Assert that `reloc_count' is
3078 triple rather than once the sum of REL and RELA relocation entry
3080 (bfd_elf64_get_reloc_upper_bound): Remove macro.
3081 * elflink.c (_bfd_elf_link_read_relocs): Do not multiply
3082 `reloc_count' by `int_rels_per_ext_rel' for internal relocation
3083 storage allocation size determination.
3084 (elf_link_input_bfd): Multiply `.ctors' and `.dtors' section's
3085 size by `int_rels_per_ext_rel'. Do not multiply `reloc_count'
3086 by `int_rels_per_ext_rel' for last relocation entry
3088 (bfd_elf_final_link): Do not multiply `reloc_count' by
3089 `int_rels_per_ext_rel' for internal relocation storage
3090 allocation size determination.
3091 (init_reloc_cookie_rels): Do not multiply `reloc_count' by
3092 `int_rels_per_ext_rel' for last relocation entry determination.
3093 (elf_gc_smash_unused_vtentry_relocs): Likewise.
3094 * elfxx-mips.c (_bfd_mips_elf_check_relocs): Likewise.
3095 (_bfd_mips_elf_relocate_section): Likewise.
3097 2017-06-05 Alan Modra <amodra@gmail.com>
3100 * linker.c (_bfd_generic_link_output_symbols): Handle BSF_GNU_UNIQUE.
3102 2017-06-01 John Baldwin <jhb@FreeBSD.org>
3104 * elf.c (elfcore_grok_freebsd_psinfo): Use ELF header class to
3105 determine structure sizes.
3106 (elfcore_grok_freebsd_prstatus): Likewise.
3108 2017-06-01 Alan Modra <amodra@gmail.com>
3110 * elf64-ppc.c (struct ppc_link_hash_table): Add has_plt_localentry0.
3111 (ppc64_elf_merge_symbol_attribute): Merge localentry bits from
3113 (is_elfv2_localentry0): New function.
3114 (ppc64_elf_tls_setup): Default params->plt_localentry0.
3115 (plt_stub_size): Adjust size for tls_get_addr_opt stub.
3116 (build_tls_get_addr_stub): Use a simpler stub when r2 is not saved.
3117 (ppc64_elf_size_stubs): Leave stub_type as ppc_stub_plt_call for
3118 optimized localentry:0 stubs.
3119 (ppc64_elf_build_stubs): Save r2 in ELFv2 __glink_PLTresolve.
3120 (ppc64_elf_relocate_section): Leave nop unchanged for optimized
3122 (ppc64_elf_finish_dynamic_sections): Set PPC64_OPT_LOCALENTRY in
3124 * elf64-ppc.h (struct ppc64_elf_params): Add plt_localentry0.
3126 2017-05-30 Casey Smith <clegg89@gmail.com>
3129 * elf32-arm.c (elf32_arm_final_link_relocate): Install an absolute
3130 value when processing the R_ARM_THM_ALU_PREL_11_0 reloc.
3132 2017-05-30 Anton Kolesov Anton.Kolesov@synopsys.com
3134 * cpu-arc.c (arc_compatible): New function.
3136 2017-05-30 Anton Kolesov <anton.kolesov@synopsys.com>
3138 * cpu-arc.c (arch_info_struct): Remove duplicate ARC600 entry.
3140 2017-05-30 H.J. Lu <hongjiu.lu@intel.com>
3143 * bfdio.c (bfd_get_file_size): New function.
3144 * bfd-in2.h: Regenerated.
3146 2017-05-23 Dilian Palauzov <git-dpa@aegee.org>
3148 * elf32-arc.c (arc_elf_merge_attributes): Add fall through
3151 2017-05-22 H.J. Lu <hongjiu.lu@intel.com>
3153 * elf64-x86-64.c (elf_x86_64_link_setup_gnu_properties): Use
3154 dynobj instead of htab->elf.dynobj.
3156 2017-05-19 Maciej W. Rozycki <macro@imgtec.com>
3158 * elf64-mips.c (mips_elf64_canonicalize_reloc): Remove prototype
3160 (mips_elf64_canonicalize_dynamic_reloc): Likewise.
3161 (mips_elf64_slurp_one_reloc_table): Set `reloc_count' to the
3162 actual number of internal relocations retrieved. Adjust
3163 function description.
3164 (bfd_elf64_canonicalize_reloc): Remove macro.
3165 (bfd_elf64_canonicalize_dynamic_reloc): Likewise.
3167 2017-05-19 Jose E. Marchesi <jose.marchesi@oracle.com>
3169 * archures.c (bfd_mach_sparc_v9m8): Define.
3170 (bfd_mach_sparc_v8plusm8): Likewise.
3171 (bfd_mach_sparc_v9_p): Adjust to M8.
3172 (bfd_mach_sparc_64bit_p): Likewise.
3173 * aoutx.h (machine_type): Handle bfd_mach_sparc_v9m8 and
3174 bfd_mach_sparc_v8plusm8.
3175 * bfd-in2.h: Regenerated.
3176 * cpu-sparc.c (arch_info_struct): Entries for sparc:v9m8 and
3178 * elfxx-sparc.c (_bfd_sparc_elf_object_p): Handle
3179 bfd_mach_sparc_v8plusm8 and bfd_mach_sparc_v9m8 using the new hw
3180 capabilities ONADDSUB, ONMUL, ONDIV, DICTUNP, FPCPSHL, RLE and
3182 * elf32-sparc.c (elf32_sparc_final_write_processing): Handle
3183 bfd_mach_sparc_v8plusm8.
3185 2017-05-19 Alan Modra <amodra@gmail.com>
3187 * elflink.c (_bfd_elf_gc_mark_extra_sections): Don't keep
3188 debug and special sections when no non-note alloc sections in an
3191 2017-05-18 Alan Modra <amodra@gmail.com>
3193 * arc-got.h: Don't compare boolean values against TRUE or FALSE.
3194 * elf-m10300.c: Likewise.
3196 * elf32-arc.c: Likewise.
3197 * elf32-bfin.c: Likewise.
3198 * elf32-m68k.c: Likewise.
3199 * elf32-nds32.c: Likewise.
3200 * elf32-tilepro.c: Likewise.
3201 * elflink.c: Likewise.
3202 * elfnn-aarch64.c: Likewise.
3203 * elfnn-riscv.c: Likewise.
3204 * elfxx-tilegx.c: Likewise.
3205 * mach-o.c: Likewise.
3206 * peXXigen.c: Likewise.
3207 * vms-alpha.c: Likewise.
3208 * vms-lib.c: Likewise.
3210 2017-05-17 H.J. Lu <hongjiu.lu@intel.com>
3213 * elflink.c (elf_gc_mark_debug_section): New function.
3214 (_bfd_elf_gc_mark_extra_sections): Mark any debug sections
3215 referenced by kept debug sections.
3217 2017-05-16 Alan Modra <amodra@gmail.com>
3219 * elf-m10300.c: Rename occurrences of non_ir_ref.
3220 * elf32-arm.c: Likewise.
3221 * elf32-bfin.c: Likewise.
3222 * elf32-cr16.c: Likewise.
3223 * elf32-cris.c: Likewise.
3224 * elf32-d10v.c: Likewise.
3225 * elf32-dlx.c: Likewise.
3226 * elf32-fr30.c: Likewise.
3227 * elf32-frv.c: Likewise.
3228 * elf32-hppa.c: Likewise.
3229 * elf32-i370.c: Likewise.
3230 * elf32-i386.c: Likewise.
3231 * elf32-iq2000.c: Likewise.
3232 * elf32-lm32.c: Likewise.
3233 * elf32-m32c.c: Likewise.
3234 * elf32-m32r.c: Likewise.
3235 * elf32-m68hc1x.c: Likewise.
3236 * elf32-m68k.c: Likewise.
3237 * elf32-mcore.c: Likewise.
3238 * elf32-metag.c: Likewise.
3239 * elf32-microblaze.c: Likewise.
3240 * elf32-moxie.c: Likewise.
3241 * elf32-msp430.c: Likewise.
3242 * elf32-mt.c: Likewise.
3243 * elf32-nios2.c: Likewise.
3244 * elf32-or1k.c: Likewise.
3245 * elf32-ppc.c: Likewise.
3246 * elf32-rl78.c: Likewise.
3247 * elf32-s390.c: Likewise.
3248 * elf32-score.c: Likewise.
3249 * elf32-score7.c: Likewise.
3250 * elf32-sh.c: Likewise.
3251 * elf32-tic6x.c: Likewise.
3252 * elf32-tilepro.c: Likewise.
3253 * elf32-v850.c: Likewise.
3254 * elf32-vax.c: Likewise.
3255 * elf32-xstormy16.c: Likewise.
3256 * elf32-xtensa.c: Likewise.
3257 * elf64-alpha.c: Likewise.
3258 * elf64-hppa.c: Likewise.
3259 * elf64-ia64-vms.c: Likewise.
3260 * elf64-mmix.c: Likewise.
3261 * elf64-ppc.c: Likewise.
3262 * elf64-s390.c: Likewise.
3263 * elf64-sh64.c: Likewise.
3264 * elf64-x86-64.c: Likewise.
3265 * elflink.c: Likewise.
3266 * elfnn-aarch64.c: Likewise.
3267 * elfnn-ia64.c: Likewise.
3268 * elfnn-riscv.c: Likewise.
3269 * elfxx-mips.c: Likewise.
3270 * elfxx-sparc.c: Likewise.
3271 * elfxx-tilegx.c: Likewise.
3272 * linker.c: Likewise.
3274 2017-05-16 Alan Modra <amodra@gmail.com>
3276 * elf64-ppc.c (add_symbol_adjust): Transfer non_ir_ref_dynamic.
3277 * elflink.c (elf_link_add_object_symbols): Update to use
3279 (elf_link_input_bfd): Test non_ir_ref_dynamic in addition to
3281 * linker.c (_bfd_generic_link_add_one_symbol): Likewise.
3283 2017-05-15 Maciej W. Rozycki <macro@imgtec.com>
3285 * elfxx-mips.c (print_mips_ases): Handle MIPS16e2 ASE.
3287 2017-05-12 H.J. Lu <hongjiu.lu@intel.com>
3289 * elf32-i386.c (elf_i386_parse_gnu_properties): Merge
3290 GNU_PROPERTY_X86_ISA_1_USED and GNU_PROPERTY_X86_ISA_1_NEEDED
3292 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3294 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3296 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Rename plt_bnd
3298 (elf_x86_64_link_hash_table): Rename plt_bnd/plt_bnd_eh_frame
3299 to plt_second/plt_second_eh_frame.
3300 (elf_x86_64_link_hash_newfunc): Updated.
3301 (elf_x86_64_allocate_dynrelocs): Likewise.
3302 (elf_x86_64_size_dynamic_sections): Likewise.
3303 (elf_x86_64_relocate_section): Likewise.
3304 (elf_x86_64_finish_dynamic_symbol): Likewise.
3305 (elf_x86_64_finish_dynamic_sections): Likewise.
3306 (elf_x86_64_plt_type): Rename plt_bnd to plt_second.
3307 (elf_x86_64_get_synthetic_symtab): Updated. Also scan the
3309 (elf_backend_setup_gnu_properties): Updated. Create the
3310 .plt.sec section instead of the .plt.sec section.
3312 2017-05-11 H.J. Lu <hongjiu.lu@intel.com>
3314 * elf32-i386.c (elf_i386_allocate_dynrelocs): Partially revert
3315 commit 25070364b0ce33eed46aa5d78ebebbec6accec7e.
3316 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewse.
3318 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3320 * elf64-sparc.c (elf64_sparc_set_reloc): New function.
3321 (bfd_elf64_set_reloc): Define.
3322 (elf64_sparc_write_relocs): Use `canon_reloc_count'.
3324 2017-05-10 Jose E. Marchesi <jose.marchesi@oracle.com>
3326 * targets.c (BFD_JUMP_TABLE_RELOCS): Add NAME##_set_reloc.
3327 (struct bfd_target): New field _bfd_set_reloc.
3328 * bfd.c (bfd_set_reloc): Call backend _set_bfd.
3329 * reloc.c (_bfd_generic_set_reloc): New function.
3330 * coffcode.h (coff_set_reloc): Define to _bfd_generic_set_reloc.
3331 * nlm-target.h (nlm_set_reloc): Likewise.
3332 * coff-rs6000.c (_bfd_xcoff_set_reloc): Likewise.
3333 * aout-tic30.c (MY_set_reloc): Likewise.
3334 * aout-target.h (MY_set_reloc): Likewise.
3335 * elfxx-target.h (bfd_elfNN_set_reloc): Likewise.
3336 * coff-alpha.c (_bfd_ecoff_set_reloc): Likewise.
3337 * mach-o-target.c (bfd_mach_o_set_reloc): Likewise.
3338 * vms-alpha.c (alpha_vms_set_reloc): Likewise.
3339 * aout-adobe.c (aout_32_set_reloc): Likewise.
3340 * bout.c (b_out_set_reloc): Likewise.
3341 * coff-mips.c (_bfd_ecoff_set_reloc): Likewise.
3342 * i386os9k.c (aout_32_set_reloc): Likewise.
3343 * ieee.c (ieee_set_reloc): Likewise.
3344 * oasys.c (oasys_set_reloc): Likewise.
3345 * som.c (som_set_reloc): Likewise.
3346 * versados.c (versados_set_reloc): Likewise.
3347 * coff64-rs6000.c (rs6000_xcoff64_vec): Add
3348 _bfd_generic_set_reloc.
3349 (rs6000_xcoff64_aix_vec): LIkewise.
3350 * libbfd.c (_bfd_norelocs_set_reloc): New function.
3351 * libbfd-in.h: Prototype for _bfd_norelocs_set_reloc.
3352 * i386msdos.c (msdos_set_reloc): Define to
3353 _bfd_norelocs_set_reloc.
3354 * elfcode.h (elf_set_reloc): Define.
3355 * bfd-in2.h: Regenerated.
3357 2017-05-10 H.J. Lu <hongjiu.lu@intel.com>
3360 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Use .plt.bnd
3361 for IFUNC function address.
3363 2017-05-10 Claudiu Zissulescu <claziss@synopsys.com>
3365 * elf32-arc.c (FEATURE_LIST_NAME): Define.
3366 (CONFLICT_LIST): Likewise.
3367 (opcode/arc-attrs.h): Include.
3368 (arc_elf_print_private_bfd_data): Print OSABI v4 flag.
3369 (arc_extract_features): New file.
3370 (arc_stralloc): Likewise.
3371 (arc_elf_merge_attributes): Likewise.
3372 (arc_elf_merge_private_bfd_data): Use object attributes.
3373 (bfd_arc_get_mach_from_attributes): New function.
3374 (arc_elf_object_p): Use object attributes.
3375 (arc_elf_final_write_processing): Likewise.
3376 (elf32_arc_obj_attrs_arg_type): New function.
3377 (elf32_arc_obj_attrs_handle_unknown): Likewise.
3378 (elf32_arc_section_from_shdr): Likewise.
3379 (elf_backend_obj_attrs_vendor): Define.
3380 (elf_backend_obj_attrs_section): Likewise.
3381 (elf_backend_obj_attrs_arg_type): Likewise.
3382 (elf_backend_obj_attrs_section_type): Likewise.
3383 (elf_backend_obj_attrs_handle_unknown): Likewise.
3384 (elf_backend_section_from_shdr): Likewise.
3386 2017-05-09 Andrew Goedhart <Andrewgoedhart@simplepowersolutions.co.za>
3389 * elf32-arm.c (elf32_arm_final_link_relocate): Set the bottom bit
3390 of the value when resolving a R_ARM_THM_ALU_PREL_11_0 relocation
3391 and the destination is a Thumb symbol.
3393 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3395 * elf32-i386.c (elf_i386_get_synthetic_symtab): Add missing
3396 initializer to silence GCC 4.2.
3397 * lf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Likewise.
3399 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3401 * elf64-x86-64.c (PLT_ENTRY_SIZE): Renamed to ...
3402 (LAZY_PLT_ENTRY_SIZE): This.
3403 (NON_LAZY_PLT_ENTRY_SIZE): New.
3404 (elf_x86_64_plt0_entry): Renamed to ...
3405 (elf_x86_64_lazy_plt0_entry): This.
3406 (elf_x86_64_plt_entry): Renamed to ...
3407 (elf_x86_64_lazy_plt_entry): This.
3408 (elf_x86_64_bnd_plt0_entry): Renamed to ...
3409 (elf_x86_64_lazy_bnd_plt0_entry): This.
3410 (elf_x86_64_legacy_plt_entry): Removed.
3411 (elf_x86_64_bnd_plt_entry): Renamed to ...
3412 (elf_x86_64_lazy_bnd_plt_entry): This.
3413 (elf_x86_64_legacy_plt2_entry): Renamed to ...
3414 (elf_x86_64_non_lazy_plt_entry): This.
3415 (elf_x86_64_bnd_plt2_entry): Renamed to ...
3416 (elf_x86_64_non_lazy_bnd_plt_entry): This.
3417 (elf_x86_64_eh_frame_plt): Renamed to ...
3418 (elf_x86_64_eh_frame_lazy_plt): This.
3419 (elf_x86_64_eh_frame_bnd_plt): Renamed to ...
3420 (elf_x86_64_eh_frame_lazy_bnd_plt): This.
3421 (elf_x86_64_eh_frame_plt_got): Renamed to ...
3422 (elf_x86_64_eh_frame_non_lazy_plt): This.
3423 (elf_x86_64_lazy_plt_layout): New.
3424 (elf_x86_64_non_lazy_plt_layout): Likewise.
3425 (elf_x86_64_plt_layout): Likewise.
3426 (elf_x86_64_backend_data): Remove PLT layout information. Add
3427 os for target system.
3428 (GET_PLT_ENTRY_SIZE): Removed.
3429 (elf_x86_64_lazy_plt): New.
3430 (elf_x86_64_non_lazy_plt): Likewise.
3431 (elf_x86_64_lazy_bnd_plt): Likewise.
3432 (elf_x86_64_non_lazy_bnd_plt): Likewise.
3433 (elf_x86-64_arch_bed): Updated.
3434 (elf_x86_64_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3435 (elf_x86_64_create_dynamic_sections): Removed.
3436 (elf_x86_64_check_relocs): Don't check elf.dynobj. Don't call
3437 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3438 (elf_x86-64_adjust_dynamic_symbol): Updated.
3439 (elf_x86_64_allocate_dynrelocs): Updated. Pass 0 as PLT header
3440 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3441 size for PLT0 if there is no PLT0. Get plt_entry_size from
3442 non_lazy_plt for non-lazy PLT entries.
3443 (elf_x86_64_size_dynamic_sections): Updated. Get plt_entry_size
3444 from non_lazy_plt for non-lazy PLT entries.
3445 (elf_x86-64_relocate_section): Updated. Properly get PLT index
3446 if there is no PLT0.
3447 (elf_x86_64_finish_dynamic_symbol): Updated. Fill the first slot
3448 in the PLT entry with generic PLT layout. Fill the non-lazy PLT
3449 entries with non-lazy PLT layout. Don't fill the second and third
3450 slots in the PLT entry if there is no PLT0.
3451 (elf_x86_64_finish_dynamic_sections): Updated. Don't fill PLT0
3452 if there is no PLT0. Set sh_entsize on the .plt.got section.
3453 (compare_relocs): New.
3454 (elf_x86_64_plt_type): Likewise.
3455 (elf_x86_64_plt): Likewise.
3456 (elf_x86_64_nacl_plt): New. Forward declaration.
3457 (elf_x86_64_get_plt_sym_val): Removed.
3458 (elf_x86_64_get_synthetic_symtab): Rewrite to check PLT sections
3459 against all dynamic relocations.
3460 (elf_x86_64_link_setup_gnu_properties): New function.
3461 (elf_backend_create_dynamic_sections): Updated.
3462 (elf_backend_setup_gnu_properties): New.
3463 (elf_x86_64_nacl_plt): New.
3464 (elf_x86_64_nacl_arch_bed): Updated.
3466 2017-05-08 H.J. Lu <hongjiu.lu@intel.com>
3468 * elf32-i386.c (PLT_ENTRY_SIZE): Renamed to ...
3469 (LAZY_PLT_ENTRY_SIZE): This.
3470 (NON_LAZY_PLT_ENTRY_SIZE): New.
3471 (elf_i386_plt0_entry): Renamed to ...
3472 (elf_i386_lazy_plt0_entry): This.
3473 (elf_i386_plt_entry): Renamed to ...
3474 (elf_i386_lazy_plt_entry): This.
3475 (elf_i386_pic_plt0_entry): Renamed to ...
3476 (elf_i386_pic_lazy_plt0_entry): This.
3477 (elf_i386_pic_plt_entry): Renamed to ...
3478 (elf_i386_pic_lazy_plt_entry): This.
3479 (elf_i386_got_plt_entry): Renamed to ...
3480 (elf_i386_non_lazy_plt_entry): This.
3481 (elf_i386_pic_got_plt_entry): Renamed to ...
3482 (elf_i386_pic_non_lazy_plt_entry): This.
3483 (elf_i386_eh_frame_plt): Renamed to ...
3484 (elf_i386_eh_frame_lazy_plt): This.
3485 (elf_i386_eh_frame_plt_got): Renamed to ...
3486 (elf_i386_eh_frame_non_lazy_plt): This.
3487 (elf_i386_plt_layout): Renamed to ...
3488 (elf_i386_lazy_plt_layout): This. Remove eh_frame_plt_got and
3489 eh_frame_plt_got_size.
3490 (elf_i386_non_lazy_plt_layout): New.
3491 (elf_i386_plt_layout): Likewise.
3492 (elf_i386_non_lazy_plt): Likewise.
3493 (GET_PLT_ENTRY_SIZE): Removed.
3494 (elf_i386_plt): Renamed to ...
3495 (elf_i386_lazy_plt): This.
3496 (elf_i386_backend_data): Remove plt. Rename is_vxworks to os.
3497 (elf_i386_arch_bed): Updated.
3498 (elf_i386_link_hash_table): Add plt, lazy_plt and non_lazy_plt.
3499 (elf_i386_create_dynamic_sections): Removed.
3500 (elf_i386_check_relocs): Don't check elf.dynobj. Don't call
3501 _bfd_elf_create_ifunc_sections nor _bfd_elf_create_got_section.
3502 (elf_i386_adjust_dynamic_symbol): Updated.
3503 (elf_i386_allocate_dynrelocs): Updated. Pass 0 as PLT header
3504 size to _bfd_elf_allocate_ifunc_dyn_relocs and don't allocate
3505 size for PLT0 if there is no PLT0.
3506 (elf_i386_size_dynamic_sections): Updated. Check whether GOT
3507 output section is discarded only if GOT isn't empty.
3508 (elf_i386_relocate_section): Updated. Properly get PLT index
3509 if there is no PLT0.
3510 (elf_i386_finish_dynamic_symbol): Updated. Don't fill the
3511 second and third slots in the PLT entry if there is no PLT0.
3512 (elf_i386_finish_dynamic_sections): Updated. Don't fill PLT0
3513 if there is no PLT0. Set sh_entsize on the .plt.got section.
3514 (elf_i386_nacl_plt): Forward declaration.
3515 (elf_i386_get_plt_sym_val): Removed.
3516 (elf_i386_get_synthetic_symtab): Rewrite to check PLT sections
3517 against all dynamic relocations.
3518 (elf_i386_link_setup_gnu_properties): New function.
3519 (elf_backend_create_dynamic_sections): Updated.
3520 (elf_backend_setup_gnu_properties): New.
3521 (elf_i386_nacl_plt): Updated.
3522 (elf_i386_nacl_arch_bed): Likewise.
3523 (elf_i386_vxworks_arch_bed): Likewise.
3525 2017-05-08 Thomas Preud'homme <thomas.preudhomme@arm.com>
3527 * elflink.c (elf_output_implib): Remove executable flag from import
3529 * elf32-arm.c (elf32_arm_filter_implib_symbols): Assert that the import
3530 library is a relocatable object file.
3532 2017-05-01 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
3535 * elf32-avr.c (avr_should_move_sym): New function.
3536 (avr_should_reduce_sym_size): Likewise.
3537 (avr_should_increase_sym_size): Likewise.
3538 (elf32_avr_relax_delete_bytes): Adjust symbol values
3539 and sizes by calling new functions.
3541 2017-05-01 Palmer Dabbelt <palmer@dabbelt.com>
3543 * config.bfd (riscv32-*): Enable rv64.
3545 2017-05-02 Alan Modra <amodra@gmail.com>
3548 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Test h->non_elf
3549 rather than h->root.type == bfd_link_hash_new.
3550 (bfd_elf_record_link_assignment): Similarly, call
3551 bfd_elf_link_mark_dynamic_symbol when h->non_elf.
3553 2017-04-29 Alan Modra <amodra@gmail.com>
3556 * reloc.c (reloc_offset_in_range): New function.
3557 (bfd_perform_relocation, bfd_install_relocation): Use it.
3558 (_bfd_final_link_relocate): Likewise.
3560 2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
3562 * elf32-i386.c (elf_i386_allocate_dynrelocs): Check plt_got
3563 before using .plt.got.
3564 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
3566 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3568 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Use "="
3569 instead of "+=" to update 0.
3571 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3573 * elf32-i386.c (elf_i386_create_dynamic_sections): Create the
3574 .plt.got section here.
3575 (elf_i386_check_relocs): Don't create the .plt.got section.
3576 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Create
3577 the .plt.got and .plt.bnd sections here.
3578 (elf_x86_64_check_relocs): Don't create the .plt.got nor
3581 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3583 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Remove
3585 (elf_x86_64_link_hash_newfunc): Don't clear has_bnd_reloc.
3586 (elf_x86_64_copy_indirect_symbol): Don't copy has_bnd_reloc.
3587 (elf_x86_64_check_relocs): Don't set has_bnd_reloc.
3588 (elf_x86_64_finish_dynamic_symbol): Check bndplt instead of
3591 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3593 * elf-bfd.h (elf_backend_data): Change setup_gnu_properties
3595 (_bfd_elf_link_setup_gnu_properties): Return bfd *.
3596 * elf-properties.c (_bfd_elf_link_setup_gnu_properties): Return
3597 the first relocatable ELF input with GNU properties.
3599 2017-04-27 H.J. Lu <hongjiu.lu@intel.com>
3601 * elf32-i386.c (elf_i386_finish_dynamic_sections): Simplify
3602 VxWorks for non-PIC.
3604 2017-04-27 Alan Modra <amodra@gmail.com>
3606 * elf-bfd.h (struct elf_backend_data): Make asection param of
3607 elf_backend_eh_frame_address_size const.
3608 (_bfd_elf_eh_frame_address_size): Likewise.
3609 * elf32-m32c.c (_bfd_m32c_elf_eh_frame_address_size): Likewise.
3610 * elf32-msp430.c (elf32_msp430_eh_frame_address_size): Likewise.
3611 * elfxx-mips.c (_bfd_mips_elf_eh_frame_address_size): Likewise.
3612 * elfxx-mips.h (_bfd_mips_elf_eh_frame_address_size): Likewise.
3613 * elf-eh-frame.c (_bfd_elf_eh_frame_address_size): Likewise.
3614 (next_cie_fde_offset): Constify params.
3615 (offset_adjust, adjust_eh_frame_local_symbols): Likewise.
3617 2017-04-27 Alan Modra <amodra@gmail.com>
3619 * elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
3620 (_bfd_elf_adjust_eh_frame_global_symbol): Declare.
3621 * elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
3623 (offset_adjust): New function.
3624 (_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
3625 (adjust_eh_frame_local_symbols): Likewise.
3626 (_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
3627 after changing anything. Return true if anything changed.
3628 * elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
3629 _bfd_elf_adjust_eh_frame_global_symbol for globals.
3631 2017-04-27 Alan Modra <amodra@gmail.com>
3633 * elflink.c (_bfd_elf_link_hash_hide_symbol): Clear dynstr_index
3636 2017-04-27 Alan Modra <amodra@gmail.com>
3638 * elf32-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3639 (ppc_elf_select_plt_layout, ppc_elf_tls_setup): Use it.
3640 (ppc_elf_adjust_dynamic_symbol, allocate_dynrelocs): Likewise.
3641 (ppc_elf_relocate_section): Likewise. Delete silly optimisation
3642 for undef and undefweak dyn_relocs.
3643 * elf64-ppc.c (UNDEFWEAK_NO_DYNAMIC_RELOC): Define.
3644 (ppc64_elf_adjust_dynamic_symbol, ppc64_elf_tls_setup): Use it.
3645 (allocate_got, allocate_dynrelocs): Likewise.
3646 (ppc64_elf_relocate_section): Likewise.
3648 2017-04-26 H.J. Lu <hongjiu.lu@intel.com>
3650 * elf32-i386.c (elf_i386_size_dynamic_sections): Alwasys add
3651 DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rel.plt section.
3652 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Alwasys
3653 add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL for .rela.plt section.
3655 2017-04-26 Nick Clifton <nickc@redhat.com>
3658 * reloc.c (bfd_perform_relocation): Check for a negative address
3661 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3664 * elf-bfd.h (elf_backend_data): Add `always_renumber_dynsyms'
3666 * elfxx-target.h [!elf_backend_always_renumber_dynsyms]
3667 (elf_backend_always_renumber_dynsyms): Define.
3668 (elfNN_bed): Initialize `always_renumber_dynsyms' member.
3669 * elfxx-mips.h (elf_backend_always_renumber_dynsyms): Define.
3670 * elflink.c (bfd_elf_size_dynamic_sections): Also call
3671 `_bfd_elf_link_renumber_dynsyms' if the backend has requested
3673 (bfd_elf_size_dynsym_hash_dynstr): Likewise.
3675 2017-04-26 Maciej W. Rozycki <macro@imgtec.com>
3677 * elflink.c (bfd_elf_size_dynamic_sections): Only call
3678 `_bfd_elf_link_renumber_dynsyms' after section GC if dynamic
3679 sections have been created.
3681 2017-04-26 Nick Clifton <nickc@redhat.com>
3684 * compress.c (bfd_init_section_compress_status): Check the return
3685 value from bfd_malloc.
3687 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3689 * elf64-x86-64.c (elf_x86_64_link_hash_entry): Add
3690 no_finish_dynamic_symbol.
3691 (elf_x86_64_link_hash_newfunc): Set no_finish_dynamic_symbol to
3693 (elf_x86_64_allocate_dynrelocs): If a symbol isn't undefined
3694 weak symbol, don't make it dynamic.
3695 (elf_x86_64_relocate_section): If a symbol isn't dynamic in PIC,
3696 set no_finish_dynamic_symbol and generate R_X86_64_RELATIVE
3697 relocation for GOT reference.
3698 (elf_x86_64_finish_dynamic_symbol): Abort if
3699 no_finish_dynamic_symbol isn't 0.
3701 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3704 * elf32-i386.c (elf_i386_allocate_dynrelocs): If a symbol isn't
3705 undefined weak symbol, don't make it dynamic.
3706 (elf_i386_relocate_section): If a symbol isn't dynamic in PIC,
3707 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3708 relocation for R_386_GOT32.
3710 2017-04-24 H.J. Lu <hongjiu.lu@intel.com>
3713 * elf32-i386.c (ELF_MAXPAGESIZE): Set to 0x1000 for VxWorks.
3715 2017-04-23 Alan Modra <amodra@gmail.com>
3718 * section.c (GLOBAL_SYM_INIT): Make available in bfd.h.
3719 * elf.c (lcomm_sym): New.
3720 (_bfd_elf_large_com_section): Use lcomm_sym section symbol.
3721 * bfd-in2.h: Regenerate.
3723 2017-04-23 Alan Modra <amodra@gmail.com>
3726 * elf-bfd.h (struct elf_backend_data <get_reloc_section>): Change
3727 parameters and comment.
3728 (_bfd_elf_get_reloc_section): Delete.
3729 (_bfd_elf_plt_get_reloc_section): Declare.
3730 * elf.c (_bfd_elf_plt_get_reloc_section, elf_get_reloc_section):
3731 New functions. Don't blindly skip over assumed .rel/.rela prefix.
3733 (_bfd_elf_get_reloc_section): ..here. Delete.
3734 (assign_section_numbers): Call elf_get_reloc_section.
3735 * elf64-ppc.c (elf_backend_get_reloc_section): Define.
3736 * elfxx-target.h (elf_backend_get_reloc_section): Update.
3738 2017-04-23 Alan Modra <amodra@gmail.com>
3741 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Don't segfault when
3744 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3747 * elf32-i386.c (elf_i386_link_hash_entry): Add
3748 no_finish_dynamic_symbol.
3749 (elf_i386_link_hash_newfunc): Set no_finish_dynamic_symbol to 0.
3750 (elf_i386_allocate_dynrelocs): If a symbol isn't undefined weak
3751 symbol, don't make it dynamic in PIE.
3752 (elf_i386_relocate_section): If a symbol isn't dynamic in PIE,
3753 set no_finish_dynamic_symbol and generate R_386_RELATIVE
3754 relocation for R_386_GOT32
3755 (elf_i386_finish_dynamic_symbol): Abort if no_finish_dynamic_symbol
3758 2017-04-21 H.J. Lu <hongjiu.lu@intel.com>
3762 * elflink.c (elf_link_add_object_symbols): Require
3763 --no-dynamic-linker with -E/--dynamic-list when creating
3766 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3768 * elflink.c (_bfd_elf_symbol_refs_local_p): Always return TRUE
3771 2017-04-20 Maciej W. Rozycki <macro@imgtec.com>
3773 * elfxx-mips.c (_bfd_mips_elf_final_link): Reorder comment about
3774 dynamic symbol sorting.
3776 2017-04-20 H.J. Lu <hongjiu.lu@intel.com>
3779 * elflink.c (elf_link_add_object_symbols): Preserve
3780 dynamic_ref_after_ir_def when restoring the symbol table for
3781 unneeded dynamic object.
3783 2017-04-19 H.J. Lu <hongjiu.lu@intel.com>
3786 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Don't abort
3787 on on undefined IFUNC symbol in the second PLT.
3789 2017-04-19 Wedson Almeida Filho <wedsonaf@gmail.com>
3791 * peXXigen.c (pe_print_reloc): Correct chunk_end.
3793 2017-04-19 Alan Modra <amodra@gmail.com>
3795 * elflink.c (_bfd_elf_adjust_dynamic_symbol): Hide undefweak
3796 or make dynamic for info->dynamic_undefined_weak 0 and 1.
3797 * elf32-ppc.c:Formatting.
3798 (ensure_undefweak_dynamic): Don't make dynamic when
3799 info->dynamic_undefined_weak is zero.
3800 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3801 info->dynamic_undefined_weak. Discard undef dyn_relocs when
3802 not default visibility. Discard undef and undefweak
3804 (ppc_elf_relocate_section): Adjust to suit.
3805 * elf64-ppc.c: Formatting.
3806 (ensure_undefweak_dynamic): Don't make dynamic when
3807 info->dynamic_undefined_weak is zero.
3808 (allocate_dynrelocs): Discard undefweak dyn_relocs for
3809 info->dynamic_undefined_weak. Discard them earlier.
3811 2017-04-17 H.J. Lu <hongjiu.lu@intel.com>
3814 * elflink.c (bfd_elf_size_dynamic_sections): Get soname index
3815 before generating the version definition section.
3817 2017-04-17 Alan Modra <amodra@gmail.com>
3819 * elflink.c (_bfd_elf_merge_symbol): Undo dynamic linking
3820 state when a regular object file defines a symbol with
3821 incompatible type to that defined by an earlier shared lib.
3823 2017-04-13 Alan Modra <amodra@gmail.com>
3825 * coffcode.h: Wrap some overly long _bfd_error_handler args.
3827 * elf32-arm.c: Likewise.
3828 * elf32-i386.c: Likewise.
3829 * elf32-mep.c: Likewise.
3830 * elf64-ia64-vms.c: Likewise.
3831 * elf64-x86-64.c: Likewise.
3832 * elflink.c: Likewise.
3833 * elfnn-ia64.c: Likewise.
3834 * elfxx-mips.c: Likewise.
3836 2017-04-13 Alan Modra <amodra@gmail.com>
3838 * aoutx.h: Use %B and %A in error messages throughout file.
3839 * aout-cris.c: Likewise.
3840 * archive.c: Likewise.
3841 * binary.c: Likewise.
3842 * coff-rs6000.c: Likewise.
3843 * coff-tic4x.c: Likewise.
3844 * coffcode.h: Likewise.
3845 * coffgen.c: Likewise.
3846 * cofflink.c: Likewise.
3847 * coffswap.h: Likewise.
3848 * cpu-arm.c: Likewise.
3849 * elf-eh-frame.c: Likewise.
3850 * elf-m10300.c: Likewise.
3852 * elf32-arc.c: Likewise.
3853 * elf32-arm.c: Likewise.
3854 * elf32-bfin.c: Likewise.
3855 * elf32-frv.c: Likewise.
3856 * elf32-iq2000.c: Likewise.
3857 * elf32-m32c.c: Likewise.
3858 * elf32-microblaze.c: Likewise.
3859 * elf32-nds32.c: Likewise.
3860 * elf32-rl78.c: Likewise.
3861 * elf32-rx.c: Likewise.
3862 * elf32-score.c: Likewise.
3863 * elf32-score7.c: Likewise.
3864 * elf32-sh64.c: Likewise.
3865 * elf32-v850.c: Likewise.
3866 * elf32-vax.c: Likewise.
3867 * elf32-visium.c: Likewise.
3868 * elf64-ia64-vms.c: Likewise.
3869 * elf64-mmix.c: Likewise.
3870 * elf64-sh64.c: Likewise.
3871 * elfcode.h: Likewise.
3872 * elfnn-aarch64.c: Likewise.
3873 * elfnn-ia64.c: Likewise.
3874 * elfxx-mips.c: Likewise.
3875 * hpux-core.c: Likewise.
3878 * linker.c: Likewise.
3879 * merge.c: Likewise.
3881 * oasys.c: Likewise.
3882 * pdp11.c: Likewise.
3883 * peXXigen.c: Likewise.
3884 * rs6000-core.c: Likewise.
3885 * vms-alpha.c: Likewise.
3886 * xcofflink.c: Likewise.
3888 2017-04-13 Alan Modra <amodra@gmail.com>
3890 * bfd.c (PRINT_TYPE): Define.
3891 (_doprnt): New function.
3892 (error_handler_internal): Use _doprnt.
3893 * coff-arm.c: Put %A and %B arguments to _bfd_error_handler
3894 calls in their natural order, throughout file.
3895 * coff-mcore.c: Likewise.
3896 * coff-ppc.c: Likewise.
3897 * coff-tic80.c: Likewise.
3898 * cofflink.c: Likewise.
3899 * elf-s390-common.c: Likewise.
3901 * elf32-arm.c: Likewise.
3902 * elf32-i386.c: Likewise.
3903 * elf32-m32r.c: Likewise.
3904 * elf32-msp430.c: Likewise.
3905 * elf32-spu.c: Likewise.
3906 * elf64-ia64-vms.c: Likewise.
3907 * elf64-sparc.c: Likewise.
3908 * elf64-x86-64.c: Likewise.
3909 * elflink.c: Likewise.
3910 * elfnn-aarch64.c: Likewise.
3911 * elfnn-ia64.c: Likewise.
3912 * elfxx-mips.c: Likewise.
3914 2017-04-13 Alan Modra <amodra@gmail.com>
3916 * elf32-arm.c (arm_type_of_stub): Supply missing args to "long
3917 branch veneers" error. Fix double space and format message.
3918 * elf32-avr.c (avr_add_stub): Do not pass NULL as %B arg.
3919 * elf64-ppc.c (tocsave_find): Supply missing %B arg.
3921 2017-04-13 Alan Modra <amodra@gmail.com>
3923 * bfd-in2.h: Regenerate.
3925 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3927 * elf-properties.c (_bfd_elf_parse_gnu_properties): Remove the
3928 extra `\n' in warning/error messages.
3929 * elf32-i386.c (elf_i386_parse_gnu_properties): Likewise.
3930 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
3932 2017-04-11 H.J. Lu <hongjiu.lu@intel.com>
3934 * elf-properties.c (_bfd_elf_parse_gnu_properties): Ignore
3935 processor-specific properties with generic ELF target vector.
3937 2017-04-10 Qing Zhao <qing.zhao@oracle.com>
3939 * elf32-sparc.c (elf_backend_fixup_symbol): New.
3940 * elf64-sparc.c (elf_backend_fixup_symbol): New.
3941 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
3942 (_bfd_sparc_elf_link_hash_entry): Add has_got_reloc and
3944 (link_hash_newfunc): Initialize has_got_reloc and
3946 (_bfd_sparc_elf_size_dynamic_sections): Set interp to .interp
3948 (_bfd_sparc_elf_copy_indirect_symbol): Copy has_got_reloc and
3950 (_bfd_sparc_elf_check_relocs): Set has_got_reloc and
3952 (_bfd_sparc_elf_fixup_symbol): New function.
3953 (allocate_dynrelocs): Don't allocate space for dynamic
3954 relocations and discard relocations against resolved undefined
3955 weak symbols in executable. Don't make resolved undefined weak
3956 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
3957 relocation against undefined weak symbols in PIE.
3958 (_bfd_sparc_elf_relocate_section): Don't generate dynamic
3959 relocations against resolved undefined weak symbols in PIE
3960 (_bfd_sparc_elf_finish_dynamic_symbol): Keep PLT/GOT entries
3961 without ynamic PLT/GOT relocations for resolved undefined weak
3963 Don't generate dynamic relocation against resolved undefined
3964 weak symbol in executable.
3965 (pie_finish_undefweak_symbol): New function.
3966 (_bfd_sparc_elf_finish_dynamic_sections): Call
3967 pie_finish_undefweak_symbol on all symbols in PIE.
3968 * elfxx-sparc.h (_bfd_sparc_elf_link_hash_table): Add interp.
3969 (_bfd_sparc_elf_fixup_symbol): New function.
3971 2017-04-10 Nick Clifton <nickc@redhat.com>
3973 * config.bfd: Remove ns32k from obsolete list.
3975 2017-04-10 Alan Modra <amodra@gmail.com>
3978 * elf.c (special_sections_f): Match .fini_array and .fini_array.*.
3979 (special_sections_i): Likewise for .init_array.
3980 (special_sections_p): Likewise for .preinit_array.
3982 2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
3986 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Check
3987 ELF_COMMON_DEF_P for common symbols.
3988 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
3989 * elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
3990 * elflink.c (_bfd_elf_merge_symbol): Revert commits
3991 202ac193bbbecc96a4978d1ac3d17148253f9b01 and
3992 07492f668d2173da7a2bda3707ff0985e0f460b6.
3994 2017-04-07 Pedro Alves <palves@redhat.com>
3996 * opncls.c (bfd_get_debug_link_info): Rename to...
3997 (bfd_get_debug_link_info_1): ... this. Change type of second
3998 parameter to void pointer. Adjust.
3999 (bfd_get_debug_link_info): Reimplement on top of
4000 bfd_get_debug_link_info_1.
4001 (separate_debug_file_exists, separate_alt_debug_file_exists):
4002 Change type of second parameter to void pointer. Adjust.
4003 (get_func_type, check_func_type): Change type of second parameter
4005 (find_separate_debug_file): Add 'func_data' parameter. Pass it to
4006 the callback functions instead of passing the address of a local.
4007 (bfd_follow_gnu_debuglink): Pass address of unsigned long local to
4008 find_separate_debug_file.
4009 (get_alt_debug_link_info_shim): Change type of second parameter to
4010 void pointer. Adjust.
4011 (bfd_follow_gnu_debugaltlink): Adjust to pass NULL to
4012 find_separate_debug_file.
4013 (get_build_id_name, bfd_boolean check_build_id_file): Change type
4014 of second parameter to void pointer. Adjust.
4015 (bfd_follow_build_id_debuglink): Pass address of bfd_build_id
4016 pointer local to find_separate_debug_file.
4018 2017-04-07 Tristan Gingold <gingold@gingold-Precision-7510>
4020 * coffgen.c (_bfd_coff_gc_mark_hook): Handle PE weak
4021 external symbols with a definition.
4022 (_bfd_coff_gc_mark_extra_sections): Fix typo.
4024 2017-04-07 Alan Modra <amodra@gmail.com>
4026 * po/SRC-POTFILES.in: Regenerate.
4028 2017-04-05 Alan Modra <amodra@gmail.com>
4030 * elf64-ppc.c (ppc64_elf_gc_sweep_hook): Support ELFv2 PLT
4033 2017-04-02 Jon Turney <jon.turney@dronecode.org.uk>
4035 (_bfd_XXi_swap_aouthdr_out): For clarity, use defines rather than
4036 numbers for DataDirectory entry indicies passed to
4039 2017-04-04 H.J. Lu <hongjiu.lu@intel.com>
4041 * elf.c (get_program_header_size): Add a GNU_MBIND segment for
4042 each GNU_MBIND section and align GNU_MBIND section to page size.
4043 (_bfd_elf_map_sections_to_segments): Create a GNU_MBIND
4044 segment for each GNU_MBIND section.
4045 (_bfd_elf_init_private_section_data): Copy sh_info from input
4046 for GNU_MBIND section.
4048 2017-04-03 Palmer Dabbelt <palmer@dabbelt.com>
4050 * elfnn-riscv.c (GP_NAME): Delete.
4051 (riscv_global_pointer_value): Change GP_NAME to RISCV_GP_SYMBOL.
4052 (_bfd_riscv_relax_lui): Likewise.
4054 2017-04-04 Nick Clifton <nickc@redhat.com>
4057 * elflink.c (_bfd_elf_define_linkage_sym): Prevent null pointer
4059 (bfd_elf_final_link): Only initialize the extended symbol index
4060 section if there are extended symbol tables to list.
4062 2017-04-03 H.J. Lu <hongjiu.lu@intel.com>
4064 * Makefile.am (BFD32_BACKENDS): Add elf-properties.lo.
4065 (BFD32_BACKENDS_CFILES): Add elf-properties.c.
4066 * configure.ac (elf): Add elf-properties.lo.
4067 * Makefile.in: Regenerated.
4068 * configure: Likewise.
4069 * elf-bfd.h (elf_property_kind): New.
4070 (elf_property): Likewise.
4071 (elf_property_list): Likewise.
4072 (elf_properties): Likewise.
4073 (_bfd_elf_parse_gnu_properties): Likewise.
4074 (_bfd_elf_get_property): Likewise.
4075 (_bfd_elf_link_setup_gnu_properties): Likewise.
4076 (elf_backend_data): Add parse_gnu_properties, merge_gnu_properties
4077 and setup_gnu_properties.
4078 (elf_obj_tdata): Add properties.
4079 * elf-properties.c: New file.
4080 * elf32-i386.c (elf_i386_parse_gnu_properties): New.
4081 (elf_i386_merge_gnu_properties): Likewise.
4082 (elf_backend_parse_gnu_properties): Likewise.
4083 (elf_backend_merge_gnu_properties): Likewise.
4084 * elf64-x86-64.c (elf_x86_64_parse_gnu_properties): Likewise.
4085 (elf_x86_64_merge_gnu_properties): Likewise.
4086 (elf_backend_parse_gnu_properties): Likewise.
4087 (elf_backend_merge_gnu_properties): Likewise.
4088 * elfxx-target.h (elf_backend_merge_gnu_properties): Likewise.
4089 (elf_backend_parse_gnu_properties): Likewise.
4090 (elf_backend_setup_gnu_properties): Likewise.
4091 (elfNN_bed): Add elf_backend_parse_gnu_properties,
4092 elf_backend_merge_gnu_properties and
4093 elf_backend_setup_gnu_properties.
4095 2017-03-30 Pip Cet <pipcet@gmail.com>
4097 * elf32-wasm32.c: Add relocation code, two relocs.
4098 * reloc.c: Add wasm32 relocations.
4099 * libbfd.h: Regenerate.
4100 * bfd-in2.h: Regenerate.
4101 * bfd/po/bfd.pot: Regenerate.
4103 2017-03-29 Nick Clifton <nickc@redhat.com>
4106 * coff-bfd.h (struct coff_section_data): Add new fields:
4107 saved_bias and bias.
4108 * coffgen.c (coff_find_nearest_line_with_names): Cache the bias
4109 computed for PE binaries.
4110 * dwarf2.c (scan_unit_for_symbols): Only warn once about each
4113 2017-03-28 Hans-Peter Nilsson <hp@axis.com>
4116 * elf32-cris.c (elf_cris_adjust_gotplt_to_got): Adjust BFD_ASSERT
4117 to handle a local symbol with a hash-symbol-entry; without PLT.
4118 Add BFD_ASSERT for an incidental case with GOT entry present.
4119 (cris_elf_check_relocs): Increment PLT refcount only if the symbol
4120 isn't forced-or-set local.
4122 2017-03-27 Pip Cet <pipcet@gmail.com>
4124 * wasm-module.c: New file to support WebAssembly modules.
4125 * wasm-module.h: New file to support WebAssembly modules.
4126 * doc/webassembly.texi: Start documenting wasm-module.c.
4127 * config.bfd: Add wasm_vec.
4128 * targets.c: Likewise.
4129 * configure.ac: Likewise.
4130 * Makefile.am: Add entries for wasm-module.c.
4131 * Makefile.in: Regenerate.
4132 * configure: Regenerate.
4133 * po/SRC-POTFILES.in: Regenerate.
4135 2017-03-27 Pip Cet <pipcet@gmail.com>
4137 * cpu-wasm32.c: New file to support wasm32 architecture.
4138 * elf32-wasm32.c: New file to support wasm32 architecture.
4139 * Makefile.am: Add wasm32 architecture.
4140 * archures.c: Likewise.
4141 * config.bfd: Likewise.
4142 * configure.ac: Likewise.
4143 * targets.c: Likewise.
4144 * Makefile.in: Regenerate.
4145 * bfd-in2.h: Regenerate.
4146 * configure: Regenerate.
4147 * po/SRC-POTFILES.in: Regenerate.
4149 2017-03-20 Alan Modra <amodra@gmail.com>
4152 * elf64-ppc.c (compare_symbols): Stabilize sort.
4154 2017-03-18 Alan Modra <amodra@gmail.com>
4156 * elf64-ppc.c (struct ppc_link_hash_table): Add
4157 local_ifunc_resolver and maybe_local_ifunc_resolver.
4158 (ppc_build_one_stub): Set flags on emitting dynamic
4159 relocation to ifunc.
4160 (ppc64_elf_relocate_section): Likewise.
4161 (ppc64_elf_finish_dynamic_symbol): Likewise.
4162 (ppc64_elf_finish_dynamic_sections): Error on DT_TEXTREL with
4163 local dynamic relocs to ifuncs.
4164 * elf32-ppc.c (struct ppc_elf_link_hash_table): Add
4165 local_ifunc_resolver and maybe_local_ifunc_resolver.
4166 (ppc_elf_relocate_section): Set flag on emitting dynamic
4167 relocation to ifuncs.
4168 (ppc_elf_finish_dynamic_symbol): Likewise.
4169 (ppc_elf_finish_dynamic_sections): Error on DT_TEXTREL with local
4170 dynamic relocs to ifuncs.
4172 2017-03-13 Nick Clifton <nickc@redhat.com>
4175 * reloc.c (BFD_RELOC_AARCH64_TLSDESC_LD64_LO12_NC): Rename to
4176 BFD_RELOC_AARCH64_TLSDESC_LD64_LO12.
4177 (BFD_RELOC_AARCH64_TLSDESC_ADD_LO12_NC): Rename to
4178 BFD_RELOC_AARCH64_TLSDESC_ADD_LO12.
4179 * bfd-in2.h: Regenerate.
4180 * libbfd.h: Regenerate.
4181 * elfnn-aarch64.c (IS_AARCH64_TLS_RELAX_RELOC): Update reloc
4183 (IS_AARCH64_TLSDESC_RELOC): Likewise.
4184 (elfNN_aarch64_howto_table): Likewise.
4185 (aarch64_tls_transition_without_check): Likewise.
4186 (aarch64_reloc_got_type): Likewise.
4187 (elfNN_aarch64_final_link_relocate): Likewise.
4188 (elfNN_aarch64_tls_relax): Likewise.
4189 (elfNN_aarch64_relocate_section): Likewise.
4190 (elfNN_aarch64_gc_sweep_hook): Likewise.
4191 (elfNN_aarch64_check_relocs): Likewise.
4192 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
4193 (_bfd_aarch64_elf_resolve_relocation): Likewise.
4195 2017-03-11 Alan Modra <amodra@gmail.com>
4197 * elf32-ppc.c: Remove ATTRIBUTE_UNUSED throughout when function
4198 parameter is in fact used. Whitespace fixes.
4199 * elf64-ppc.c: Likewise.
4201 2017-03-09 Sam Thursfield <sam.thursfield@codethink.co.uk>
4203 * rs6000-core.c (CORE_NEW): Simplify macro when
4204 AIX_CORE_DUMPX_CORE and BFD64 are true to avoid compile warning.
4206 2017-03-07 Alan Modra <amodra@gmail.com>
4210 * elf64-ppc.c (ppc64_elf_relocate_section): Add missing
4213 2017-03-05 Alan Modra <amodra@gmail.com>
4215 * elf-bfd.h (struct eh_cie_fde): Add u.cie.per_encoding_aligned8.
4216 * elf-eh-frame.c (size_of_output_cie_fde): Don't align here.
4217 (next_cie_fde_offset): New function.
4218 (_bfd_elf_parse_eh_frame): Set u.cie.per_encoding_aligned8.
4219 (_bfd_elf_discard_section_eh_frame): Align zero terminator to
4220 four bytes. Align CIEs to four or eight bytes depending on
4221 per_encoding_aligned8. Align FDEs according to their encoding.
4222 Pad last FDE to output section alignment.
4223 (_bfd_elf_write_section_eh_frame): Adjust to suit. Remove
4225 * elf64-ppc.c (glink_eh_frame_cie): Delete padding.
4226 (ppc64_elf_size_stubs): Pad glink eh_frame as per elf-eh-frame.c.
4227 (ppc64_elf_finish_dynamic_sections): Adjust to suit.
4229 2017-03-02 Martin Bickel <binutils@ineranves.de>
4232 * elf.c (rewrite_elf_program_header): Do not issue a warning for
4233 empty segments which have a zero filesz, but a non-zero memsz.
4235 2017-03-02 Alan Modra <amodra@gmail.com>
4237 * elf32-ppc.c (ppc_elf_vle_split16): Correct insn mask typo.
4239 2017-02-28 Alan Modra <amodra@gmail.com>
4241 * elf64-ppc.c (ppc64_elf_ha_reloc): Revert last change.
4242 (ppc64_elf_relocate_section): Likewise.
4244 2017-02-28 Alan Modra <amodra@gmail.com>
4247 * elf32-nios2.c (nios2_elf32_relocate_section): Use htab
4248 rather than elf32_nios2_hash_table or elf_hash_table.
4249 (create_got_section): Likewise.
4250 (nios2_elf32_finish_dynamic_symbol): Likewise.
4251 (nios2_elf32_adjust_dynamic_symbol): Likewise.
4252 (nios2_elf32_size_dynamic_sections): Likewise.
4253 (nios2_elf32_check_relocs): Delete dynobj, sgot, and srelgot
4254 vars. Use htab equivalents directly instead. Don't create
4255 all dynamic sections on needing just the GOT. Use a goto
4256 rather than a fall-through with reloc test. Ensure
4257 htab->dynobj is set when making dynamic sreloc section.
4258 (nios2_elf32_finish_dynamic_sections): Delete dynobj, use htab
4259 equivalent directly instead. Don't segfault on looking for
4260 .dynamic when dynamic sections have not been created. Don't
4261 segfault on .got.plt being discarded.
4262 (nios2_elf32_size_dynamic_sections): Delete plt and got vars.
4263 Don't set "relocs" on .rela.plt. Do handle .sbss. Delete
4264 fixme and another not so relevant comment.
4265 (nios2_elf_add_symbol_hook): Delete dynobj var. If not
4266 already set, set hash table dynobj on creating .sbss.
4268 2017-02-28 Alan Modra <amodra@gmail.com>
4270 * reloc.c (BFD_RELOC_PPC_16DX_HA): New.
4271 * elf64-ppc.c (ppc64_elf_howto_raw <R_PPC64_16DX_HA>): New howto.
4272 (ppc64_elf_reloc_type_lookup): Translate new bfd reloc.
4273 (ppc64_elf_ha_reloc): Correct overflow test on REL16DX_HA.
4274 (ppc64_elf_relocate_section): Likewise.
4275 * elf32-ppc.c (ppc_elf_howto_raw <R_PPC_16DX_HA>): New howto.
4276 (ppc_elf_reloc_type_lookup): Translate new bfd reloc.
4277 (ppc_elf_check_relocs): Handle R_PPC_16DX_HA to pacify gcc.
4278 * libbfd.h: Regenerate.
4279 * bfd-in2.h: Regenerate.
4281 2017-02-28 Alan Modra <amodra@gmail.com>
4283 * elflink.c (_bfd_elf_create_dynamic_sections): Don't make
4284 dynamic .data.rel.ro read-only.
4285 * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Compare section
4286 rather than section flags when deciding where copy reloc goes.
4287 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Likewise.
4288 * elf32-hppa.c (elf32_hppa_finish_dynamic_symbol): Likewise.
4289 * elf32-i386.c (elf_i386_finish_dynamic_symbol): Likewise.
4290 * elf32-metag.c (elf_metag_finish_dynamic_symbol): Likewise.
4291 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Likewise.
4292 * elf32-nios2.c (nios2_elf32_finish_dynamic_symbol): Likewise.
4293 * elf32-or1k.c (or1k_elf_finish_dynamic_symbol): Likewise.
4294 * elf32-ppc.c (ppc_elf_finish_dynamic_symbol): Likewise.
4295 * elf32-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4296 * elf32-tic6x.c (elf32_tic6x_finish_dynamic_symbol): Likewise.
4297 * elf32-tilepro.c (tilepro_elf_finish_dynamic_symbol): Likewise.
4298 * elf64-ppc.c (ppc64_elf_finish_dynamic_symbol): Likewise.
4299 * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
4300 * elf64-x86-64.c (elf_x86_64_finish_dynamic_symbol): Likewise.
4301 * elfnn-aarch64.c (elfNN_aarch64_finish_dynamic_symbol): Likewise.
4302 * elfnn-riscv.c (riscv_elf_finish_dynamic_symbol): Likewise.
4303 * elfxx-mips.c (_bfd_mips_vxworks_finish_dynamic_symbol): Likewise.
4304 * elfxx-sparc.c (_bfd_sparc_elf_finish_dynamic_symbol): Likewise.
4305 * elfxx-tilegx.c (tilegx_elf_finish_dynamic_symbol): Likewise.
4307 2017-02-28 Maciej W. Rozycki <macro@imgtec.com>
4309 * elfxx-mips.c (mips_elf_perform_relocation): Also handle the
4310 `jalr $0, $25' instruction encoding.
4312 2017-02-27 Nick Clifton <nickc@redhat.com>
4315 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol): Avoid
4316 generating a seg-fault when encountering a symbol that has been
4317 deleted by garbage collection.
4319 2017-02-25 Alan Modra <amodra@gmail.com>
4321 * elf32-arc.c (struct dynamic_sections): Delete.
4322 (enum dyn_section_types): Delete.
4323 (dyn_section_names): Delete.
4324 (arc_create_dynamic_sections): Delete.
4325 (elf_arc_finish_dynamic_sections): Don't call the above. Don't
4326 segfault on discarded .rela.plt section.
4327 (elf_arc_size_dynamic_sections): Formatting. Don't call
4328 arc_create_dynamic_sections. Don't allocate memory for sections
4329 handled by the generic linker. Correct code finding relocs in
4330 read-only sections. Set SEC_EXCLUDE on zero size .got,
4331 .got.plt, and .dynbss sections. Do set .interp for pies.
4333 2017-02-24 Andrew Waterman <andrew@sifive.com>
4335 * elfnn-riscv.c (GP_NAME): New macro.
4336 (riscv_global_pointer_value): Use it.
4337 (_bfd_riscv_relax_lui): If symbol and global pointer are in same
4338 output section, consider only that section's alignment.
4340 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4342 * elfxx-mips.h (_bfd_mips_relax_section): Remove prototype.
4343 * elfxx-mips.c (_bfd_mips_relax_section): Remove function.
4344 * elf64-mips.c (bfd_elf64_bfd_relax_section): Remove macro.
4345 * elfn32-mips.c (bfd_elf32_bfd_relax_section): Likewise.
4347 2017-02-23 Maciej W. Rozycki <macro@imgtec.com>
4349 * elfxx-mips.c (mips_elf_calculate_relocation) <R_MIPS_JALR>
4350 <R_MICROMIPS_JALR>: Discard relocation if `cross_mode_jump_p'
4353 2017-02-23 Alan Modra <amodra@gmail.com>
4356 * elf32-ppc.c (ppc_elf_howto_raw): Correct dst_mask on all VLE
4358 (ppc_elf_vle_split16): Correct field mask and shift for 16D relocs.
4359 (ppc_elf_relocate_section): Correct calculation for VLE SDAREL
4362 2017-02-22 Maciej W. Rozycki <macro@imgtec.com>
4365 * elflink.c (bfd_elf_size_dynamic_sections): Move symbol version
4366 processing ahead of the call to `elf_gc_sweep_symbol'.
4368 2017-02-22 Nick Clifton <nickc@redhat.com>
4371 * opncls.c (bfd_create_gnu_debuglink_section): Give the newly
4372 created section 4-byte alignment.
4374 2017-02-22 Alan Modra <amodra@gmail.com>
4376 * elf64-ppc.c (ppc64_elf_finish_dynamic_sections): Don't segfault
4377 on .got or .plt output section being discarded by script.
4378 * elf32-ppc.c (ppc_elf_finish_dynamic_sections): Likewise. Move
4381 2017-02-21 Alan Modra <amodra@gmail.com>
4383 * elf64-alpha.c (elf64_alpha_size_dynamic_sections): Only emit
4384 DT_RELA, DT_RELASZ, and DT_RELAENT when DT_RELASZ is non-zero.
4386 2017-02-20 Alan Modra <amodra@gmail.com>
4389 * elflink.c (bfd_elf_final_link): Make DT_REL/DT_RELA zero
4390 if DT_RELSZ/DT_RELASZ is zero.
4392 2017-02-17 Nick Clifton <nickc@redhat.com>
4394 * compress.c (bfd_get_full_section_contents): Remember to reduce
4395 compressed size by the sizeof the compression header when
4396 decompressing the contents.
4398 2017-02-17 Pedro Alves <palves@redhat.com>
4400 * srec.c (Chunk): Rename to ...
4401 (_bfd_srec_len): ... this.
4402 (S3Forced): Rename to ...
4403 (_bfd_srec_forceS3): ... this.
4404 * objcopy.c: Adjust all references.
4406 2017-02-17 Pedro Alves <palves@redhat.com>
4408 * archive.c (bsd_write_armap): Rename to ...
4409 (_bfd_bsd_write_armap): ... this.
4410 (coff_write_armap): Rename to ...
4411 (_bfd_coff_write_armap): ... this.
4412 * libbfd-in.h (bsd_write_armap): Rename to ...
4413 (_bfd_bsd_write_armap): ... this.
4414 (coff_write_armap): Rename to ...
4415 (_bfd_coff_write_armap): ... this.
4416 * aout-target.h, aout-tic30.c: Adjust all users.
4417 * libbfd.h: Regenerate.
4419 2017-02-17 Pedro Alves <palves@redhat.com>
4421 * bfd-in.h (bfd_read, bfd_write): Adjust to rename.
4422 (warn_deprecated): Rename to ...
4423 (_bfd_warn_deprecated): ... this.
4424 * libbfd.c (warn_deprecated): Rename to ...
4425 (_bfd_warn_deprecated): ... this.
4426 * bfd-in2.h: Regenerate.
4428 2017-02-17 Pedro Alves <palves@redhat.com>
4430 * bfdio.c (real_ftell): Rename to ...
4431 (_bfd_real_ftell): ... this.
4432 (real_fseek): Rename to ...
4433 (_bfd_real_fseek): ... this.
4434 (real_fopen): Rename to ...
4435 (_bfd_real_fopen): ... this.
4436 * libbfd-in.h (real_ftell): Rename to ...
4437 (_bfd_real_ftell): ... this.
4438 (real_fseek): Rename to ...
4439 (_bfd_real_fseek): ... this.
4440 (real_fopen): Rename to ...
4441 (_bfd_real_fopen): ... this.
4442 * cache.c, dwarf2.c, opncls.c: Adjust all callers.
4443 * libbfd.h: Regenerate.
4445 2017-02-17 Pedro Alves <palves@redhat.com>
4447 * dwarf2.c, elf-attrs.c, elf32-nds32.c: Adjust all callers.
4448 * libbfd.c (read_unsigned_leb128): Rename to ...
4449 (_bfd_read_unsigned_leb128): ... this.
4450 (read_signed_leb128): Rename to ...
4451 (_bfd_read_signed_leb128): ... this.
4452 (safe_read_leb128): Rename to ...
4453 (_bfd_safe_read_leb128): ... this.
4454 * libbfd-in.h (read_unsigned_leb128): Rename to ...
4455 (_bfd_read_unsigned_leb128): ... this.
4456 (read_signed_leb128): Rename to ...
4457 (_bfd_read_signed_leb128): ... this.
4458 (safe_read_leb128): Rename to ...
4459 (_bfd_safe_read_leb128): ... this.
4460 * libbfd.h: Renegerate.
4462 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4464 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Perform symbol lookup
4465 before trying to fine matching file and line information.
4467 2017-02-16 Andrew Burgess <andrew.burgess@embecosm.com>
4469 * dwarf2.c (struct dwarf2_debug): Add orig_bfd member.
4470 (_bfd_dwarf2_slurp_debug_info): If stashed debug information does
4471 not match current bfd, then reload debug information. Record bfd
4472 we're loading debug info for in the stash. If we have debug
4473 informatin in the cache then perform section placement before
4476 2017-02-16 Alan Modra <amodra@gmail.com>
4479 * elf-bfd.h (struct elf_backend_data): Add no_page_alias.
4480 * elfxx-target.h (elf_backend_no_page_alias): Define.
4481 (elfNN_bed): Init new field.
4482 * elf.c (assign_file_positions_for_load_sections): If no_page_alias
4483 ensure PT_LOAD segment starts on a new page.
4484 * elf32-hppa.c (elf_backend_no_page_alias): Define.
4486 2017-02-16 Alan Modra <amodra@gmail.com>
4489 * elf32-hppa.c (allocate_plt_static): Allocate space for relocs
4492 2017-02-16 Jiong Wang <jiong.wang@arm.com>
4494 * bfd.c (BFD_FLAGS_SAVED): Add BFD_LINKER_CREATED.
4495 * bfd-in2.h: Regenerated.
4497 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4500 * elf32-i386.c (elf_i386_relocate_section): Allow
4501 "lea foo@GOT, %reg" in PIC.
4503 2017-02-15 H.J. Lu <hongjiu.lu@intel.com>
4506 * elf32-i386.c (elf_i386_relocate_section): Properly get IFUNC
4507 symbol name when reporting R_386_GOT32/R_386_GOT32X relocation
4508 error against local IFUNC symbol without a base register for
4511 2017-02-15 Maciej W. Rozycki <macro@imgtec.com>
4513 * elf32-ppc.c (ppc_elf_check_relocs): Use `%H:' rather than
4514 `%P: %H:' with `info->callbacks->einfo'.
4515 (ppc_elf_relocate_section): Likewise.
4516 * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
4517 (ppc64_elf_edit_toc): Likewise.
4518 (ppc64_elf_relocate_section): Likewise.
4520 2017-02-14 Alan Modra <amodra@gmail.com>
4522 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
4523 --gc-keep-exported, and test versioned field of sym rather than
4524 looking for @ in name.
4526 2017-02-13 Palmer Dabbelt <palmer@dabbelt.com>
4528 * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
4531 2017-02-13 Nick Clifton <nickc@redhat.com>
4534 * dwarf2.c (_bfd_dwarf2_find_nearest_line): Check for an invalid
4537 2017-02-07 Andrew Waterman <andrew@sifive.com>
4539 * elfnn-riscv.c (riscv_elf_finish_dynamic_sections): Only write PLT
4540 entry size if PLT header is written.
4542 2017-02-06 Sheldon Lobo <sheldon.lobo@oracle.com>
4544 Fix sparc64 dynamic relocation processing to use the dynamic
4546 * elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Use 'dynamic'
4547 to determine if bfd_get_symcount() or bfd_get_dynamic_symcount()
4550 2017-02-03 Nick Clifton <nickc@redhat.com>
4553 * coffcode.h (coff_write_object_contents): Enlarge size of
4554 s_name_buf in order to avoid compile time warning about possible
4556 * elf32-nds32.c (nds32_elf_ex9_import_table): Mask off lower
4557 32-bits of insn value before printing into buffer.
4559 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4561 * elfxx-mips.c (mips_elf_hash_sort_data): Add
4562 `max_local_dynindx'.
4563 (mips_elf_sort_hash_table): Handle it.
4564 (mips_elf_sort_hash_table_f) <GGA_NONE>: For forced local
4565 symbols bump up `max_local_dynindx' rather than
4566 `max_non_got_dynindx'.
4568 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4570 * elfxx-mips.c (mips_elf_hash_sort_data): Convert the
4571 `min_got_dynindx', `max_unref_got_dynindx' and
4572 `max_non_got_dynindx' members to the `bfd_size_type' data type.
4573 (mips_elf_sort_hash_table): Adjust accordingly.
4575 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4577 * elfxx-mips.c (mips_elf_sort_hash_table): Use `htab' throughout
4578 to access the hash table.
4580 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4582 * elfxx-mips.c (mips_elf_sort_hash_table): Move assertion on
4583 non-NULL `htab' to the beginning.
4585 2017-02-02 Maciej W. Rozycki <macro@imgtec.com>
4587 * elflink.c (elf_gc_sweep): Wrap overlong line.
4589 2017-01-30 Maciej W. Rozycki <macro@imgtec.com>
4591 * elfxx-mips.h (_bfd_mips_elf_insn32): Rename prototype to...
4592 (_bfd_mips_elf_linker_flags): ... this. Add another parameter.
4593 * elfxx-mips.c (mips_elf_link_hash_table): Add
4594 `ignore_branch_isa' member.
4595 (mips_elf_perform_relocation): Do not treat an ISA mode mismatch
4596 in branch relocation calculation as an error if
4597 `ignore_branch_isa' has been set.
4598 (_bfd_mips_elf_insn32): Rename to...
4599 (_bfd_mips_elf_linker_flags): ... this. Rename the `on'
4600 parameter to `insn32' and add an `ignore_branch_isa' parameter.
4601 Handle the new parameter.
4603 2017-01-27 Hans-Peter Nilsson <hp@axis.com>
4605 * elf32-cris.c (elf_cris_finish_dynamic_symbol): Remove now unused
4606 local variable dynobj.
4609 * elf32-cris.c (elf_cris_size_dynamic_sections): Handle sdynrelro.
4610 (elf_cris_adjust_dynamic_symbol): Place variables copied into the
4611 executable from read-only sections into sdynrelro.
4612 (elf_cris_finish_dynamic_symbol): Select sreldynrelro for
4613 dynamic relocs in sdynrelro.
4614 (elf_backend_want_dynrelro): Define.
4616 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4618 * config.bfd (*-*-rtemsaout*): Mark as removed.
4620 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4622 * config.bfd (powerpcle-*-rtems*): Do not mark as removed.
4623 (arm-*-rtems*): Move to (arm*-*-eabi*).
4624 (i[3-7]86-*-rtems*): Move to (i[3-7]86-*-elf*).
4625 (m68-*-rtems*): Move to (m68*-*-elf*).
4627 2017-01-25 Sebastian Huber <sebastian.huber@embedded-brains.de>
4629 * config.bfd (*-*-rtemscoff*): Mark as removed.
4631 2017-01-24 Maciej W. Rozycki <macro@imgtec.com>
4634 * elflink.c (bfd_elf_record_link_assignment): Revert last
4635 change and don't ever clear `forced_local'. Set `mark'
4637 (elf_gc_sweep_symbol_info, elf_gc_sweep_symbol): Reorder within
4639 (elf_gc_sweep): Move the call to `elf_gc_sweep_symbol'...
4640 (bfd_elf_size_dynamic_sections): ... here.
4641 * elf32-ppc.c (ppc_elf_tls_setup): Don't clear `forced_local'
4642 and set `mark' instead in `__tls_get_addr_opt' processing.
4643 * elf64-ppc.c (ppc64_elf_tls_setup): Likewise.
4645 2017-01-24 Alan Modra <amodra@gmail.com>
4647 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Merge two cases
4648 where dynamic relocs are preferable. Allow ifunc too.
4649 (ensure_undefweak_dynamic): New function.
4650 (allocate_dynrelocs): Use it here. Move plt handling last and
4651 don't make symbols dynamic, simplifying loop. Only make undef
4652 weak symbols with GOT entries dynamic. Correct condition
4653 for GOT relocs. Handle dynamic relocs on ifuncs. Correct
4654 comments. Remove goto.
4655 (ppc_elf_relocate_section): Correct test for using dynamic
4656 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4657 to suit. Set up explicit tls_index entries and implicit GOT
4658 tls_index entries resolvable at link time for
4659 __tls_get_addr_opt. Simplify test to clear mem for prelink.
4660 * elf64-ppc.c (allocate_got): Correct condition for GOT relocs.
4661 (ensure_undefweak_dynamic): New function.
4662 (allocate_dynrelocs): Use it here. Only make undef weak symbols
4663 with GOT entries dynamic. Remove unnecessary test of
4664 WILL_CALL_FINISH_DYNAMIC_SYMBOL in PLT handling.
4665 (ppc64_elf_relocate_section): Correct test for using dynamic
4666 symbol on GOT relocs. Rearrange test for emitting GOT relocs
4667 to suit. Set up explicit tls_index entries and implicit GOT
4668 tls_index entries resolvable at link time for __tls_get_addr_opt.
4669 Simplify expression to clear mem for prelink.
4671 2017-01-23 Yury Norov <ynorov@caviumnetworks.com>
4673 * elfnn-aarch64.c: Fix relaxations for ILP32 mode.
4675 2017-01-20 Jiong Wang <jiong.wang@arm.com>
4677 * elfnn-aarch64.c (elf_aarch64_hash_symbol): New function.
4678 (elf_backend_hash_symbol): Define.
4680 2017-01-18 Maciej W. Rozycki <macro@imgtec.com>
4683 * elflink.c (bfd_elf_record_link_assignment): Clear any
4684 `forced_local' marking for DSO symbols that are not being
4687 2017-01-17 Kuan-Lin Chen <kuanlinchentw@gmail.com>
4689 * elfnn-riscv.c (riscv_elf_object_p): New function.
4691 2017-01-12 H.J. Lu <hongjiu.lu@intel.com>
4694 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
4696 (elf_x86_64_check_relocs): Create .eh_frame section for the
4698 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4699 .eh_frame section for the .plt.bnd section.
4700 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4701 for the .plt.bnd section.
4703 2017-01-12 Nick Clifton <nickc@redhat.com>
4706 * opncls.c (find_separate_debug_file): Add include_dirs
4707 parameter. Only include the directory part of the bfd's filename
4708 in search paths if include_dirs is true. Add a couple of extra
4709 locations for looking for debug files.
4710 ( bfd_follow_gnu_debuglink): Update invocation of
4711 find_separate_debug_file.
4712 (bfd_follow_gnu_debugaltlink): Likewise.
4713 (get_build_id): New function: Finds the build-id of the given bfd.
4714 (get_build_id_name): New function: Computes the name of the
4715 separate debug info file for a bfd, based upon its build-id.
4716 (check_build_id_file): New function: Checks to see if a separate
4717 debug info file exists at the given location, and that its
4718 build-id matches that of the original bfd.
4719 (bfd_follow_build_id_debuglink): New function: Finds a separate
4720 debug info file for a given bfd by using the build-id method.
4721 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Try using the build-id
4722 method of locating a separate debug info file before using the
4724 * bfd-in2.h: Regenerate.
4726 2017-01-11 H.J. Lu <hongjiu.lu@intel.com>
4729 * elf64-x86-64.c (elf_x86_64_eh_frame_bnd_plt): New.
4730 (elf_x86_64_bnd_arch_bed): Use elf_x86_64_eh_frame_bnd_plt and
4731 elf_x86_64_eh_frame_plt_got.
4732 (elf_x86_64_size_dynamic_sections): Get unwind info from
4733 elf_x86_64_bnd_arch_bed for the BND PLT.
4735 2017-01-11 Jeremy Soller <jackpot51@gmail.com>
4737 * config.bfd: Add entries for i686-redox and x86_64-redox.
4739 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4741 * elf32-i386.c (elf_i386_check_relocs): Align .eh_frame section
4743 * elf64-x86-64.c (elf_x86_64_create_dynamic_sections): Align
4744 .eh_frame section to 4 bytes for x32.
4745 (elf_x86_64_check_relocs): Likewise.
4747 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4750 * elf32-i386.c (elf_i386_eh_frame_plt_got): New.
4751 (PLT_GOT_FDE_LENGTH): Likewise.
4752 (elf_i386_plt_layout): Add eh_frame_plt_got and
4753 eh_frame_plt_got_size.
4754 (elf_i386_plt): Updated.
4755 (elf_i386_link_hash_table): Add plt_got_eh_frame.
4756 (elf_i386_check_relocs): Create .eh_frame section for .plt.got.
4757 (elf_i386_size_dynamic_sections): Allocate and initialize
4758 .eh_frame section for .plt.got.
4759 (elf_i386_finish_dynamic_sections): Adjust .eh_frame section for
4761 (elf_i386_nacl_plt): Add FIXME for eh_frame_plt_got and
4762 eh_frame_plt_got_size.
4763 * elf64-x86-64.c (elf_x86_64_eh_frame_plt_got): New.
4764 (PLT_GOT_FDE_LENGTH): Likewise.
4765 (elf_x86_64_backend_data): Add eh_frame_plt_got and
4766 eh_frame_plt_got_size.
4767 (elf_x86_64_arch_bed): Updated.
4768 (elf_x86_64_bnd_arch_bed): Add FIXME for eh_frame_plt_got and
4769 eh_frame_plt_got_size.
4770 (elf_x86_64_nacl_arch_bed): Likewise.
4771 (elf_x86_64_link_hash_table): Add plt_got_eh_frame.
4772 (elf_x86_64_check_relocs): Create .eh_frame section for .plt.got.
4773 (elf_x86_64_size_dynamic_sections): Allocate and initialize
4774 .eh_frame section for .plt.got.
4775 (elf_x86_64_finish_dynamic_sections): Adjust .eh_frame section
4778 2017-01-10 H.J. Lu <hongjiu.lu@intel.com>
4780 * elf32-i386.c (elf_i386_size_dynamic_sections): Set
4781 plt_eh_frame->size to eh_frame_plt_size and use eh_frame_plt.
4783 2017-01-09 Nick Clifton <nickc@redhat.com>
4785 * dwarf2.c (lookup_address_in_function_table): Return early if
4786 there are no functions in the given comp unit, or if the high
4787 address of the last function in the comp unit is less than the
4790 2017-01-09 Nick Clifton <nickc@redhat.com>
4793 * coffgen.c (_bfd_coff_get_external_symbols): Generate an error
4794 message if there are too many symbols to load.
4796 2017-01-04 James Clarke <jrtc27@jrtc27.com>
4798 * elf64-alpha.c (elf64_alpha_relax_opt_call): Don't set tsec_free
4799 if relocs are cached.
4801 2017-01-03 Rich Felker <bugdal@aerifal.cx>
4804 * elf32-microblaze.c (microblaze_elf_check_relocs): Add an entry
4805 for R_MICROBLAZE_GOTOFF_64.
4807 2017-01-03 Nick Clifton <nickc@redhat.com>
4809 * mach-o.c (bfd_mach_o_lookup_uuid_command): Fix compile time
4810 warning about using a possibly uninitialised variable.
4812 2017-01-02 Alan Modra <amodra@gmail.com>
4814 * elf32-hppa.c (ensure_undef_weak_dynamic): New function.
4815 (allocate_plt_static, allocate_dynrelocs): Use it.
4817 2017-01-02 Alan Modra <amodra@gmail.com>
4819 * elf-hppa.h (elf_hppa_fake_sections): Set SHF_INFO_LINK for
4820 .PARISC.unwind section.
4822 2017-01-02 Alan Modra <amodra@gmail.com>
4825 * elfxx-sparc.c (gdop_relative_offset_ok): New function.
4826 (_bfd_sparc_elf_relocate_section): Use it to validate GOT
4827 indirect to GOT pointer relative code edit.
4829 2017-01-02 Alan Modra <amodra@gmail.com>
4831 Update year range in copyright notice of all files.
4833 For older changes see ChangeLog-2016
4835 Copyright (C) 2017 Free Software Foundation, Inc.
4837 Copying and distribution of this file, with or without modification,
4838 are permitted in any medium without royalty provided the copyright
4839 notice and this notice are preserved.
4845 version-control: never