1 2018-02-15 Jim Wilson <jimw@sifive.com>
3 * elfnn-riscv.c (riscv_elf_relocate_section): Use bfd_reloc_dangerous
4 when pcrel_lo reloc has an addend. Use reloc_dangerous callback for
5 bfd_reloc_dangerous. Use einfo instead of warning callback for errors.
6 Add %X%P to error messages.
8 2018-02-15 Eric Botcazou <ebotcazou@adacore.com>
11 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
12 Pass FALSE instead of TRUE as 'create' argument to bfd_link_hash_lookup
13 and assert that the result of the call is not NULL.
15 2018-02-14 Nick Clifton <nickc@redhat.com>
18 Revert previous delta. Add extra casts to avoid compile time
20 * libbfd-in.h (_bfd_generic_bfd_copy_private_bfd_data): Add extra
21 cast to avoid warning from gcc v8 compiler.
22 (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
23 (_bfd_generic_bfd_set_private_flags): Likewise.
24 (_bfd_generic_bfd_copy_private_section_data): Likewise.
25 (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
26 (_bfd_generic_bfd_copy_private_header_data): Likewise.
27 (_bfd_generic_bfd_print_private_bfd_data): Likewise.
28 (_bfd_noarchive_construct_extended_name_table): Likewise.
29 (_bfd_noarchive_truncate_arname): Likewise.
30 (_bfd_noarchive_write_ar_hdr): Likewise.
31 (_bfd_noarchive_get_elt_at_index): Likewise.
32 (_bfd_nosymbols_canonicalize_symtab): Likewise.
33 (_bfd_nosymbols_print_symbol): Likewise.
34 (_bfd_nosymbols_get_symbol_info): Likewise.
35 (_bfd_nosymbols_get_symbol_version_string): Likewise.
36 (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
37 (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
38 (_bfd_nosymbols_get_lineno): Likewise.
39 (_bfd_nosymbols_find_nearest_line): Likewise.
40 (_bfd_nosymbols_find_line): Likewise.
41 (_bfd_nosymbols_find_inliner_info): Likewise.
42 (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
43 (_bfd_nosymbols_read_minisymbols): Likewise.
44 (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
45 (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
46 (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
47 (_bfd_nowrite_set_arch_mach): Likewise.
48 (_bfd_nowrite_set_section_contents): Likewise.
49 (_bfd_nolink_sizeof_headers): Likewise.
50 (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
51 (_bfd_nolink_bfd_relax_section): Likewise.
52 (_bfd_nolink_bfd_gc_sections): Likewise.
53 (_bfd_nolink_bfd_lookup_section_flags): Likewise.
54 (_bfd_nolink_bfd_merge_sections): Likewise.
55 (_bfd_nolink_bfd_is_group_section): Likewise.
56 (_bfd_nolink_bfd_discard_group): Likewise.
57 (_bfd_nolink_bfd_link_hash_table_create): Likewise.
58 (_bfd_nolink_bfd_link_add_symbols): Likewise.
59 (_bfd_nolink_bfd_link_just_syms): Likewise.
60 (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
61 (_bfd_nolink_bfd_final_link): Likewise.
62 (_bfd_nolink_bfd_link_split_section): Likewise.
63 (_bfd_nolink_section_already_linked): Likewise.
64 (_bfd_nolink_bfd_define_common_symbol): Likewise.
65 (_bfd_nolink_bfd_define_start_stop): Likewise.
66 (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
67 (_bfd_nodynamic_get_synthetic_symtab): Likewise.
68 (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
69 (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
70 * libbfd.c (bfd_false_any): Delete.
71 (bfd_true_any, bfd_nullvoidptr_any, bfd_0_any): Delete.
72 (bfd_0u_any, bfd_0l_any, _bfd_n1_any, bfd_void_any): Delete.
73 * libbfd.h (extern): Regenerate
74 * aout-target.h (MY_bfd_is_target_special_symbol): Add extra
75 cast to avoid warning from gcc v8 compiler.
76 * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
77 * binary.c (binary_get_symbol_info): Likewise.
78 * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
79 * coff-mips.c (mips_ecoff_backend_data): Likewise.
80 * coffcode.h (coff_set_alignment_hook): Likewise.
81 (symname_in_debug_hook): Likewise.
82 (bfd_coff_backend_data bigobj_swap_table): Likewise.
83 * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
84 * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
85 * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
86 * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
87 * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
88 * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
89 * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
90 * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
91 * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
92 * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
93 * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
94 * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
95 * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
96 * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
97 * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
98 * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
99 (bfd_elfNN_bfd_make_debug_symbol): Likewise.
100 (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
101 (bfd_elfNN_bfd_set_private_flags): Likewise.
102 (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
103 (elf_backend_init_index_section): Likewise.
104 (elf_backend_allow_non_load_phdr): Likewise.
105 * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
106 * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
107 * ieee.c (ieee_construct_extended_name_table): Likewise.
108 (ieee_write_armap): Likewise.
109 (ieee_write_ar_hdr): Likewise.
110 (ieee_bfd_is_target_special_symbol): Likewise.
111 * ihex.c (ihex_canonicalize_symtab): Likewise.
112 (ihex_bfd_is_target_special_symbol): Likewise.
113 * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
114 * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
115 (_bfd_ecoff_set_alignment_hook): Likewise.
116 * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
117 * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
118 * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
119 * oasys.c (oasys_construct_extended_name_table): Likewise.
120 (oasys_write_armap): Likewise.
121 (oasys_write_ar_hdr): Likewise.
122 (oasys_bfd_is_target_special_symbol): Likewise.
123 * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
124 * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
125 * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
126 * som.c (som_bfd_is_target_special_symbol): Likewise.
127 * srec.c (srec_bfd_is_target_special_symbol): Likewise.
128 * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
129 * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
130 * versados.c (versados_bfd_is_target_special_symbol): Likewise.
131 (versados_bfd_reloc_name_lookup): Likewise.
132 * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
133 (vms_bfd_define_start_stop): Likewise.
134 (alpha_vms_bfd_is_target_special_symbol): Likewise.
135 * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
136 * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
138 2018-02-14 H.J. Lu <hongjiu.lu@intel.com>
141 * elf32-i386.c (elf_i386_check_relocs): Pass FALSE for non
142 PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
143 * elf64-x86-64.c (elf_x86_64_check_relocs): Create PLT for
144 R_X86_64_PC32 reloc against dynamic function in data section.
145 Pass TRUE for PC-relative PLT to NEED_DYNAMIC_RELOCATION_P.
146 (elf_x86_64_relocate_section): Use PLT for R_X86_64_PC32 reloc
147 against dynamic function in data section.
148 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Use PLT in PIE as
149 function address only if pcrel_plt is true.
150 (_bfd_x86_elf_link_hash_table_create): Set pcrel_plt.
151 * elfxx-x86.h (NEED_DYNAMIC_RELOCATION_P): Add PCREL_PLT for
152 PC-relative PLT. If PLT is PC-relative, don't generate dynamic
153 PC-relative relocation against a function definition in data
154 secton in PIE. Remove the obsolete comments.
155 (elf_x86_link_hash_table): Add pcrel_plt.
157 2018-02-13 H.J. Lu <hongjiu.lu@intel.com>
159 * elfxx-x86.c (elf_x86_allocate_dynrelocs): Check bfd_link_dll,
160 instead of bfd_link_pic, for building shared library.
162 2018-02-13 H.J. Lu <hongjiu.lu@intel.com>
165 * elf64-x86-64.c (is_32bit_relative_branch): Removed.
166 (elf_x86_64_relocate_section): Check PIC relocations in PIE.
167 Remove is_32bit_relative_branch usage. Disallow PC32 reloc
168 against protected function in shared object.
170 2018-02-13 Sergei Trofimovich <slyfox@inbox.ru>
173 * po/ru.po: Fix typo in Russian translation.
175 2018-02-13 Maciej W. Rozycki <macro@mips.com>
177 * wasm-module.c (wasm_scan_name_function_section): Rename
178 `index' local variable to `idx'.
180 2018-02-13 Nick Clifton <nickc@redhat.com>
183 Fix compile time warnings generated by gcc version 8.
184 * libbfd-in.h: Remove extraneous text from prototypes.
185 Add prototypes for bfd_false_any, bfd_true_any,
186 bfd_nullvoidptr_any, bfd_0_any, bfd_0u_any, bfd_0l_any,
187 bfd_n1_any, bfd_void_any.
188 (_bfd_generic_bfd_copy_private_bfd_data): Use vararg based dummy
190 (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
191 (_bfd_generic_bfd_set_private_flags): Likewise.
192 (_bfd_generic_bfd_copy_private_section_data): Likewise.
193 (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
194 (_bfd_generic_bfd_copy_private_header_data): Likewise.
195 (_bfd_generic_bfd_print_private_bfd_data): Likewise.
196 (_bfd_noarchive_construct_extended_name_table): Likewise.
197 (_bfd_noarchive_truncate_arname): Likewise.
198 (_bfd_noarchive_write_ar_hdr): Likewise.
199 (_bfd_noarchive_get_elt_at_index): Likewise.
200 (_bfd_nosymbols_canonicalize_symtab): Likewise.
201 (_bfd_nosymbols_print_symbol): Likewise.
202 (_bfd_nosymbols_get_symbol_info): Likewise.
203 (_bfd_nosymbols_get_symbol_version_string): Likewise.
204 (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
205 (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
206 (_bfd_nosymbols_get_lineno): Likewise.
207 (_bfd_nosymbols_find_nearest_line): Likewise.
208 (_bfd_nosymbols_find_line): Likewise.
209 (_bfd_nosymbols_find_inliner_info): Likewise.
210 (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
211 (_bfd_nosymbols_read_minisymbols): Likewise.
212 (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
213 (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
214 (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
215 (_bfd_nowrite_set_arch_mach): Likewise.
216 (_bfd_nowrite_set_section_contents): Likewise.
217 (_bfd_nolink_sizeof_headers): Likewise.
218 (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
219 (_bfd_nolink_bfd_relax_section): Likewise.
220 (_bfd_nolink_bfd_gc_sections): Likewise.
221 (_bfd_nolink_bfd_lookup_section_flags): Likewise.
222 (_bfd_nolink_bfd_merge_sections): Likewise.
223 (_bfd_nolink_bfd_is_group_section): Likewise.
224 (_bfd_nolink_bfd_discard_group): Likewise.
225 (_bfd_nolink_bfd_link_hash_table_create): Likewise.
226 (_bfd_nolink_bfd_link_add_symbols): Likewise.
227 (_bfd_nolink_bfd_link_just_syms): Likewise.
228 (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
229 (_bfd_nolink_bfd_final_link): Likewise.
230 (_bfd_nolink_bfd_link_split_section): Likewise.
231 (_bfd_nolink_section_already_linked): Likewise.
232 (_bfd_nolink_bfd_define_common_symbol): Likewise.
233 (_bfd_nolink_bfd_define_start_stop): Likewise.
234 (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
235 (_bfd_nodynamic_get_synthetic_symtab): Likewise.
236 (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
237 (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
238 * libbfd.c (bfd_false_any): New function. Like bfd_false but
239 accepts one or more arguments.
240 (bfd_true_any): Likewise.
241 (bfd_nullvoidptr_any): Likewise.
242 (bfd_0_any): Likewise.
243 (bfd_0u_any): Likewise.
244 (bfd_0l_any): Likewise.
245 (_bfd_n1_any): Likewise.
246 (bfd_void_any): Likewise.
247 * libbfd.h (extern): Regenerate
248 * aout-target.h (MY_bfd_is_target_special_symbol): Use vararg
249 based dummy function.
250 * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
251 * binary.c (binary_get_symbol_info): Likewise.
252 * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
253 * coff-mips.c (mips_ecoff_backend_data): Likewise.
254 * coffcode.h (coff_set_alignment_hook): Likewise.
255 (symname_in_debug_hook): Likewise.
256 (bfd_coff_backend_data bigobj_swap_table): Likewise.
257 * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
258 * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
259 * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
260 * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
261 * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
262 * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
263 * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
264 * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
265 * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
266 * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
267 * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
268 * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
269 * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
270 * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
271 * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
272 * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
273 (bfd_elfNN_bfd_make_debug_symbol): Likewise.
274 (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
275 (bfd_elfNN_bfd_set_private_flags): Likewise.
276 (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
277 (elf_backend_init_index_section): Likewise.
278 (elf_backend_allow_non_load_phdr): Likewise.
279 * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
280 * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
281 * ieee.c (ieee_construct_extended_name_table): Likewise.
282 (ieee_write_armap): Likewise.
283 (ieee_write_ar_hdr): Likewise.
284 (ieee_bfd_is_target_special_symbol): Likewise.
285 * ihex.c (ihex_canonicalize_symtab): Likewise.
286 (ihex_bfd_is_target_special_symbol): Likewise.
287 * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
288 * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
289 (_bfd_ecoff_set_alignment_hook): Likewise.
290 * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
291 * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
292 * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
293 * oasys.c (oasys_construct_extended_name_table): Likewise.
294 (oasys_write_armap): Likewise.
295 (oasys_write_ar_hdr): Likewise.
296 (oasys_bfd_is_target_special_symbol): Likewise.
297 * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
298 * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
299 * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
300 * som.c (som_bfd_is_target_special_symbol): Likewise.
301 * srec.c (srec_bfd_is_target_special_symbol): Likewise.
302 * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
303 * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
304 * versados.c (versados_bfd_is_target_special_symbol): Likewise.
305 (versados_bfd_reloc_name_lookup): Likewise.
306 * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
307 (vms_bfd_define_start_stop): Likewise.
308 (alpha_vms_bfd_is_target_special_symbol): Likewise.
309 * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
310 * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
311 * elf32-arc.c (get_replace_function): Assign replacement function
313 * elf32-i370.c (i370_noop): Update prototype.
315 2018-02-13 Alan Modra <amodra@gmail.com>
318 * elf.c (_bfd_elf_fixup_group_sections): Account for removed
319 relocation sections. If size reduces to just the flag word,
320 remove that too and mark with SEC_EXCLUDE.
321 * elflink.c (bfd_elf_final_link): Strip empty group sections.
323 2018-02-13 Alan Modra <amodra@gmail.com>
326 * elf.c (assign_file_positions_for_non_load_sections): Rewrite
329 2018-02-12 Zebediah Figura <z.figura12@gmail.com>
331 * i386msdos.c (msdos_mkobject); New function.
332 (msdos_object_p): New function.
333 (i386_msdos_vec): Use msdos_object_p as the check_format
335 * peicode.h: Rename external_PEI_DOS_hdr, DOSMAGIC, and
336 NT_SIGNATURE to external_DOS_hdr, IMAGE_DOS_SIGNATURE, and
338 * peXXigen.c: Likewise.
339 * coff-ia64.c: Likewise.
341 2018-02-12 Nick Clifton <nickc@redhat.com>
343 * elf32-nds32.c (nds32_elf_relax_longjump3): Remove redundant
345 * elf32-arc.c (elf_arc_relocate_section): Likewise.
347 2018-02-09 Eric Botcazou <ebotcazou@adacore.com>
349 * elfxx-sparc.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Reorder conditions.
350 (sparc_elf_append_rela): Assert that there is enough room in section.
351 (_bfd_sparc_elf_copy_indirect_symbol): Fix formatting.
352 (_bfd_sparc_elf_adjust_dynamic_symbol): Minor tweak.
353 (allocate_dynrelocs): Remove outdated comments and reorder conditions.
354 For a symbol subject to a GOT relocation, reserve a slot in the
355 relocation section if the symbol isn't dynamic and we are in PIC mode.
356 (_bfd_sparc_elf_relocate_section) <R_SPARC_GOTDATA_OP>: If relocation
357 is relaxed and a slot was reserved, generate a R_SPARC_NONE relocation.
358 <R_SPARC_GOTDATA_OP_HIX22>: Adjust comments.
359 <R_SPARC_PC10>: Reorder conditions. Remove always-false assertion.
360 (_bfd_sparc_elf_finish_dynamic_symbol): Rename local_undefweak into
361 resolved_to_zero. Do not generate a dynamic GOT relocation for an
362 undefined weak symbol with non-default visibility. Remove superfluous
363 'else' and fix formatting.
365 2018-02-09 H.J. Lu <hongjiu.lu@intel.com>
367 * elf32-i386.c (elf_i386_get_synthetic_symtab): Also handle
369 (i386_elf32_sol2_vec): Don't declare.
370 (elf_i386_link_setup_gnu_properties): Also handle is_solaris.
371 Don't set need_global_offset_table.
372 (elf_i386_solaris_arch_bed): New.
373 (elf_backend_arch_data): Set to elf_i386_solaris_arch_bed for
375 * elf64-x86-64.c (elf_x86_64_get_synthetic_symtab): Check
376 target_os != is_nacl instead of target_os == is_normal.
377 (x86_64_elf64_sol2_vec): Don't declare.
378 (elf_x86_64_link_setup_gnu_properties): Check target_os !=
379 is_nacl instead of target_os == is_normal. Don't set
380 need_global_offset_table.
381 (elf_x86_64_solaris_arch_bed): New.
382 (elf_backend_arch_data): Set to elf_x86_64_solaris_arch_bed for
384 * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep
385 _GLOBAL_OFFSET_TABLE_ for Solaris.
386 (_bfd_x86_elf_link_setup_gnu_properties): Don't copy
387 need_global_offset_table.
388 * elfxx-x86.h (elf_x86_target_os): Add is_solaris.
389 (elf_x86_link_hash_table): Remove need_global_offset_table.
390 (elf_x86_init_table): Likewise.
392 2018-02-08 H.J. Lu <hongjiu.lu@intel.com>
394 * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
396 (i386_elf32_sol2_vec): Declared.
397 (elf_i386_link_setup_gnu_properties): Set
398 need_global_offset_table with info->output_bfd->xvec.
399 * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
401 (x86_64_elf64_sol2_vec): Declared.
402 (elf_x86_64_link_setup_gnu_properties): Set
403 need_global_offset_table with info->output_bfd->xvec.
405 2018-02-08 H.J. Lu <hongjiu.lu@intel.com>
407 * elf32-i386.c (elf32_i386_copy_solaris_special_section_fields):
409 (elf_i386_link_setup_gnu_properties): Set need_global_offset_table
411 * elf64-x86-64.c (elf64_x86_64_copy_solaris_special_section_fields):
413 (elf_x86_64_link_setup_gnu_properties): Set
414 need_global_offset_table for Solaris.
415 * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Keep the
416 unused _GLOBAL_OFFSET_TABLE_ for Solaris.
417 (_bfd_x86_elf_link_setup_gnu_properties): Copy
418 need_global_offset_table.
419 * elfxx-x86.h (elf_x86_link_hash_table): Add
420 need_global_offset_table.
421 (elf_x86_init_table): Likewise.
423 2018-02-08 Jim Wilson <jimw@sifive.com>
425 * elfnn-riscv.c (riscv_elf_relocate_section): Add comment for previous
428 2018-02-08 Nick Clifton <nickc@redhat.com>
431 * elf.c (elf_parse_notes): Reject notes with excessuively large
434 2018-02-07 Alan Modra <amodra@gmail.com>
436 Revert 2018-01-17 Alan Modra <amodra@gmail.com>
437 * elf32-ppc.c: Remove speculation barrier support.
438 * elf32-ppc.h: Likewise.
439 * elf64-ppc.c: Likewise.
440 * elf64-ppc.h: Likewise.
442 2018-02-06 Jim Wilson <jimw@sifive.com>
444 * elfnn-riscv.c (riscv_elf_relocate_section): Return TRUE if used
445 callback to report an error.
447 2018-02-06 Eric Botcazou <ebotcazou@adacore.com>
450 * elfxx-sparc.c (sparc_elf_tls_transition): Turn call to bfd_link_pic
451 into call to !bfd_link_executable and tidy up.
452 (_bfd_sparc_elf_check_relocs): Fix formatting and tidy up.
453 <R_SPARC_TLS_LE_HIX22>: Turn call to bfd_link_pic into call to
454 !bfd_link_executable.
455 <R_SPARC_TLS_IE_HI22>: Likewise.
456 <GOT relocations>: Remove useless code, tidy and merge related blocks.
457 <R_SPARC_TLS_GD_CALL>: Turn call to bfd_link_pic into call to
458 !bfd_link_executable.
459 <R_SPARC_WPLT30>: Tidy up.
460 (_bfd_sparc_elf_gc_mark_hook): Turn call to bfd_link_pic into call to
461 !bfd_link_executable.
462 (allocate_dynrelocs): Likewise.
463 (_bfd_sparc_elf_relocate_section): Fix formatting and tidy up.
464 <R_SPARC_TLS_GD_HI22>: Merge into...
465 <R_SPARC_TLS_GD_LO10>: ...this. Adjust 4th argument in call to
466 sparc_elf_tls_transition and remove redundant code.
467 <R_SPARC_TLS_LDM_HI22>: Turn call to bfd_link_pic into call to
468 !bfd_link_executable.
469 <R_SPARC_TLS_LDO_HIX22>: Likewise.
470 <R_SPARC_TLS_LE_HIX22>: Likewise. Tidy up.
471 <R_SPARC_TLS_LDM_CALL>: Likewise.
472 <R_SPARC_TLS_GD_CALL>: Likewise. Tidy up.
473 <R_SPARC_TLS_GD_ADD>: Likewise.
474 <R_SPARC_TLS_LDM_ADD>: Likewise.
475 <R_SPARC_TLS_LDO_ADD>: Likewise.
476 <R_SPARC_TLS_IE_LD>: Likewise.
478 2018-02-06 Miloš Stojanović <milos.stojanovic@rt-rk.com>
481 * elfxx-mips.c (_bfd_mips_elf_find_nearest_line): If the dwarf
482 functions failed to find the function name, try the generic elf
483 find function instead.
485 2018-02-06 Sergio Durigan Junior <sergiodj@redhat.com>
487 * coff-rs6000.c (xcoff_write_archive_contents_old): Use
488 'memcpy' instead of 'strncpy' when writing the magic number.
490 2018-02-06 Nick Clifton <nickc@redhat.com>
493 * opncls.c (bfd_get_debug_link_info_1): Check the size of the
494 section before attempting to read it in.
495 (bfd_get_alt_debug_link_info): Likewise.
497 2018-02-06 Paul Carroll <pcarroll@codesourcery.com>
499 * bfd/dwarf2.c (find_abstract_name): Modified to return file and
500 line information in addition to name, if they can be found.
502 2018-02-05 Renlin Li <renlin.li@arm.com>
505 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Relax the
506 R_AARCH64_ABS32 and R_AARCH64_ABS16 for absolute symbol. Apply the
507 check for writeable section as well.
509 2018-02-05 H.J. Lu <hongjiu.lu@intel.com>
512 * elf32-i386.c (elf_i386_check_relocs): Set got_referenced if
513 _GLOBAL_OFFSET_TABLE_ is referenced or GOT is needed to resolve
514 undefined weak symbol to 0.
515 * elf64-x86-64.c (elf_x86_64_check_relocs): Set got_referenced
516 if _GLOBAL_OFFSET_TABLE_ is referenced.
517 * elfxx-x86.c (_bfd_x86_elf_size_dynamic_sections): Check
518 got_referenced instead of ref_regular_nonweak. Remove the
519 unused _GLOBAL_OFFSET_TABLE_ from symbol table.
520 * elfxx-x86.h (elf_x86_link_hash_table): Add got_referenced.
522 2018-02-05 Maciej W. Rozycki <macro@mips.com>
524 * elfnn-riscv.c (_bfd_riscv_relax_pc): Use `memset' to
525 initialize `hi_reloc'.
527 2018-02-05 Maciej W. Rozycki <macro@mips.com>
529 * elfxx-mips.c (_bfd_mips_elf_section_processing): For
530 SHT_MIPS_REGINFO sections don't assert the correct size and
531 report an error instead.
533 2018-02-05 Maciej W. Rozycki <macro@mips.com>
535 * elf.c (_bfd_elf_write_object_contents): Propagate a failure
536 status from `->elf_backend_section_processing'.
538 2018-02-02 Jim Wilson <jimw@sifive.com>
541 * elfnn-riscv.c (riscv_relax_delete_bytes): New parameter link_info.
542 If link_info->wrap_hash, check for a duplicate symbol and ignore.
543 (_bfd_riscv_relax_call, bfd_riscv_relax_lui, _bfd_riscv_relax_tls_le):
544 Pass new argument to riscv_relax_delete_bytes.
545 (_bfd_riscv_relax_align, _bfd_riscv_relax_delete): Likewise. Remove
546 ATTRIBUTE_UNUSED from link_info parameter.
548 2018-02-02 Alan Modra <amodra@gmail.com>
550 * elf64-ppc.c (ppc64_elf_relocate_section): Don't relocate nops
551 emitted for toc sequence optimization. Set and use "howto" later.
553 2018-02-01 Simon Marchi <simon.marchi@ericsson.com>
555 * elf64-ppc.c (ppc64_elf_archive_symbol_lookup): Avoid pointer
556 arithmetic on NULL pointer.
557 * elflink.c (_bfd_elf_archive_symbol_lookup,
558 elf_link_add_archive_symbols): Likewise.
560 2018-01-31 Michael Matz <matz@suse.de>
562 * elflink.c (bfd_elf_define_start_stop): Fix check of
565 2018-01-31 H.J. Lu <hongjiu.lu@intel.com>
568 * elflink.c (bfd_elf_define_start_stop): Check if __start and
569 __stop symbols are referenced by shared objects.
571 2018-01-30 Alan Modra <amodra@gmail.com>
574 * elf.c (_bfd_elf_map_sections_to_segments): Don't start a new
575 segment when demand paged with lma on the same page. Test this
576 before load/non-load, executable/non-executable,
577 writable/non-writable tests and simplify. Delete bogus relro
578 condition in writable/non-writable test. Delete outdated
581 2018-01-30 Alan Modra <amodra@gmail.com>
583 * elflink.c (bfd_elf_define_start_stop): Make __start and __stop
586 2018-01-29 Alan Modra <amodra@gmail.com>
589 * coffgen.c (coff_pointerize_aux): Ensure auxent tagndx is in
590 range before converting to a symbol table pointer.
592 2018-01-27 Nick Clifton <nickc@redhat.com>
594 * po/ru.po: Updated Russian translation.
596 2018-01-26 Alan Modra <amodra@gmail.com>
598 * elflink.c (bfd_elf_define_start_stop): Override symbols when
599 they are defined dynamically.
601 2018-01-26 Alan Modra <amodra@gmail.com>
603 * elf64-ppc.c (ppc64_elf_size_stubs): Iterate sizing when
604 .branch_lt changes size.
606 2018-01-25 Alan Modra <amodra@gmail.com>
609 * elfcode.h (elf_object_p): Avoid integer overflow.
611 2018-01-25 Eric Botcazou <ebotcazou@adacore.com>
614 * elfxx-sparc.c (_bfd_sparc_elf_check_relocs) <R_SPARC_TLS_GD_CALL>:
615 Do a mere lookup of the __tls_get_addr symbol instead of adding it.
618 2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
621 * elfxx-sparc.c (sparc_elf_tls_transition): Replace
622 bfd_link_pic with !bfd_link_executable, !bfd_link_pic with
623 bfd_link_executable for TLS check.
624 (_bfd_sparc_elf_check_relocs): Likewise.
625 (allocate_dynrelocs): Likewise.
626 (_bfd_sparc_elf_relocate_section): Likewise.
628 2018-01-24 Renlin Li <renlin.li@arm.com>
630 * elfnn-aarch64.c (elfNN_aarch64_final_link_relocate): Add support for
631 BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
632 BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
633 BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
634 BFD_RELOC_AARCH64_MOVW_PREL_G3.
635 * elfxx-aarch64.c (_bfd_aarch64_elf_put_addend): Likewise.
636 (_bfd_aarch64_elf_resolve_relocation): Likewise.
638 2018-01-24 Renlin Li <renlin.li@arm.com>
640 * reloc.c: Add BFD_RELOC_AARCH64_MOVW_PREL_G0,
641 BFD_RELOC_AARCH64_MOVW_PREL_G0_NC, BFD_RELOC_AARCH64_MOVW_PREL_G1,
642 BFD_RELOC_AARCH64_MOVW_PREL_G1_NC, BFD_RELOC_AARCH64_MOVW_PREL_G2,
643 BFD_RELOC_AARCH64_MOVW_PREL_G2_NC, BFD_RELOC_AARCH64_MOVW_PREL_G3.
644 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Add entries for
645 BFD_RELOC_AARCH64_MOVW_PREL_G0, BFD_RELOC_AARCH64_MOVW_PREL_G0_NC,
646 BFD_RELOC_AARCH64_MOVW_PREL_G1, BFD_RELOC_AARCH64_MOVW_PREL_G1_NC,
647 BFD_RELOC_AARCH64_MOVW_PREL_G2, BFD_RELOC_AARCH64_MOVW_PREL_G2_NC,
648 BFD_RELOC_AARCH64_MOVW_PREL_G3.
649 * bfd-in2.h: Regenerate.
650 * libbfd.h: Regenerate.
652 2018-01-23 Maciej W. Rozycki <macro@mips.com>
654 * elfxx-mips.c (_bfd_mips_elf_final_link): Update a stale
655 `mips_elf32_section_processing' comment reference.
657 2018-01-20 H.J. Lu <hongjiu.lu@intel.com>
660 * elfxx-x86.c (_bfd_x86_elf_link_check_relocs): Check the
661 versioned __tls_get_addr symbol.
663 2018-01-19 Nick Clifton <nickc@redhat.com>
665 * po/fr.po: Updated French translation.
667 2018-01-18 Alan Modra <amodra@gmail.com>
669 * elf32-ppc.c (ppc_elf_create_glink): Correct alignment of .glink.
670 * elf64-ppc.c (ppc64_elf_size_stubs): Handle negative plt_stub_align.
671 (ppc64_elf_build_stubs): Likewise.
673 2018-01-17 Nick Clifton <nickc@redhat.com>
675 * po/ru.po: Updated Russian translation.
676 * po/uk/po: Updated Ukranian translation.
678 2018-01-17 Alan Modra <amodra@gmail.com>
680 * elf64-ppc.c (ppc64_elf_build_stubs): Silence gcc warning.
682 2018-01-17 Alan Modra <amodra@gmail.com>
684 * elf32-ppc.c (GLINK_ENTRY_SIZE): Handle speculation barrier.
685 (CRSETEQ, BEQCTRM): Define.
686 (is_nonpic_glink_stub): Don't check bctr.
687 (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
688 (ppc_elf_relax_section): Size speculation barrier.
689 (output_bctr): New function.
690 (write_glink_stub): Use output_bctr.
691 (ppc_elf_relocate_section): Use output_bctr for long branch stub.
692 (ppc_elf_finish_dynamic_symbol): Likewise.
693 (ppc_elf_finish_dynamic_sections): Use output_bctr.
694 * elf32-ppc.h (struct ppc_elf_params): Add speculate_indirect_jumps.
695 * elf64-ppc.c (CRSETEQ, BEQCTRM, BEQCTRLM): Define.
696 (GLINK_PLTRESOLVE_SIZE): Size speculation barrier.
697 (size_global_entry_stubs): Handle speculation barrier sizing.
698 (plt_stub_size): Likewise.
699 (output_bctr): New function.
700 (build_plt_stub, build_tls_get_addr_stub): Output speculation
702 (ppc_build_one_stub): Likewise for ppc_stub_plt_branch.
703 (ppc_size_one_stub): Size speculation barrier in ppc_stub_plt_branch.
704 (build_global_entry_stubs): Output speculation barrier.
705 (ppc64_elf_build_stubs): Likewise in __glink_PLTresolve stub.
706 * elf64-ppc.h (struct ppc64_elf_params): Add speculate_indirect_jumps.
708 2018-01-17 Alan Modra <amodra@gmail.com>
710 * elf32-ppc.c (GLINK_ENTRY_SIZE): Add parameters, handle
711 __tls_get_addr_opt, and alignment sizing.
712 (TLS_GET_ADDR_GLINK_SIZE): Delete.
713 (is_nonpic_glink_stub): Don't use GLINK_ENTRY_SIZE.
714 (ppc_elf_get_synthetic_symtab): Recognize stubs spaced at 4, 6,
716 (ppc_elf_link_hash_table_create): Init new ppc_elf_params field.
717 (allocate_dynrelocs): Use new GLINK_ENTRY_SIZE.
718 (ppc_elf_size_dynamic_sections): Likewise. Size branch table
720 (write_glink_stub): Handle __tls_get_addr_opt stub.
721 Pad out to size given by GLINK_ENTRY_SIZE.
722 (ppc_elf_relocate_section): Adjust write_glink_stub call.
723 (ppc_elf_finish_dynamic_symbol): Likewise.
724 (ppc_elf_finish_dynamic_sections): Write PLTresolve without using
725 insn array since so many need rewriting.
726 * elf32-ppc.h (struct ppc_elf_params): Add plt_stub_align.
727 * elf64-ppc.c (GLINK_PLTRESOLVE_SIZE): Rename from
728 GLINK_CALL_STUB_SIZE. Add htab param and evaluate to size without
729 nops. Adjust all uses.
730 (ppc64_elf_get_synthetic_symtab): Don't use GLINK_CALL_STUB_SIZE
731 in glink_vma calculation.
732 (struct ppc_link_hash_table): Add global_entry section pointer.
733 (create_linkage_sections): Create separate section for global
735 (PPC_LO, PPC_HI, PPC_HA): Move earlier.
736 (size_global_entry_stubs): Handle sizing for aligned stubs.
737 (ppc64_elf_size_dynamic_sections): Handle global_entry alloc,
738 and don't stash end of glink branch table in rawsize.
739 (ppc_build_one_stub): Rewrite stub size calculations.
740 (build_global_entry_stubs): Use new section.
741 (ppc64_elf_build_stubs): Don't pad __glink_PLTresolve with nops.
742 Build lazy link stubs out to end of section. Build global entry
743 stubs in new section.
745 2018-01-15 Nick Clifton <nickc@redhat.com>
747 * po/uk.po: Updated Ukranian translation.
749 2018-01-13 Nick Clifton <nickc@redhat.com>
751 * po/bfd.pot: Regenerated.
753 2018-01-13 Nick Clifton <nickc@redhat.com>
755 * version.m4: Bump version to 2.30.51
756 * configure: Regenerate.
758 2018-01-13 Nick Clifton <nickc@redhat.com>
762 2018-01-12 Jens Widell <jl@opera.com>
764 * elf.c (setup_group): Optimize search for group by remembering
765 last found group and restarting search at that index.
766 * elf-bfd.h (struct elf_obj_tdata): Add group_search_offset field.
768 2018-01-12 Gunther Nikl <gnikl@users.sourceforge.net>
770 * aoutx.h (aout_link_check_ar_symbols): Remove default and handle
771 bfd_link_common_skip_none in switch.
773 2018-01-12 Alan Modra <amodra@gmail.com>
776 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Ignore dynamic
777 references on forced local symbols.
779 2018-01-12 Vlad Ivanov <vlad@ivanov.email>
781 * elfxx-mips.c (_bfd_mips_elf_final_link): Notify user when
782 .reginfo section has wrong size.
784 2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
787 * elf.c (_bfd_elf_map_sections_to_segments): When generating
788 separate code and read-only data LOAD segments, create a new
789 LOAD segment if the previous section contains text and the
790 current section doesn't or vice versa. Don't put a writable
791 section in a read-only segment if there is a RELRO segment.
793 2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
796 * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Ignore dynamic
797 references on forced local symbols.
799 2018-01-11 H.J. Lu <hongjiu.lu@intel.com>
802 * elflink.c (bfd_elf_gc_sections): Keep all PREINIT_ARRAY,
803 INIT_ARRAY as well as FINI_ARRAY sections for ld -r --gc-section.
805 2017-09-27 Kuan-Lin Chen <kuanlinchentw@gmail.com>
808 * elf32-nds32.c (nds32_elf_relax_loadstore): Fix a typographical error.
810 2018-01-03 John Baldwin <jhb@FreeBSD.org>
812 * elf.c (elfcore_grok_freebsd_note): Handle
813 NT_FREEBSD_PROCSTAT_PROC, NT_FREEBSD_PROCSTAT_FILES, and
814 NT_FREEBSD_PROCSTAT_VMMAP.
816 2018-01-03 Alan Modra <amodra@gmail.com>
818 Update year range in copyright notice of all files.
820 For older changes see ChangeLog-2017
822 Copyright (C) 2018 Free Software Foundation, Inc.
824 Copying and distribution of this file, with or without modification,
825 are permitted in any medium without royalty provided the copyright
826 notice and this notice are preserved.
832 version-control: never