1 2016-05-06 H.J. Lu <hongjiu.lu@intel.com>
4 * elf-bfd.h (elf_link_hash_entry): Update comments for indx,
5 documenting that indx == -3 if symbol is defined in a discarded
7 * elflink.c (elf_link_add_object_symbols): Set indx to -3 if
8 symbol is defined in a discarded section.
9 (elf_link_output_extsym): Strip a global symbol defined in a
12 2016-05-06 H.J. Lu <hongjiu.lu@intel.com>
14 * elf32-i386.c (elf_backend_add_symbol_hook): Defined for Intel
17 2016-05-05 H.J. Lu <hongjiu.lu@intel.com>
19 * elf32-i386.c (elf_i386_convert_load): Extract the GOT load
21 (elf_i386_convert_load_reloc): This. New function.
22 * elf64-x86-64.c (elf_x86_64_convert_load): Extract the GOT load
24 (elf_x86_64_convert_load_reloc): This. New function.
26 2016-05-05 H.J. Lu <hongjiu.lu@intel.com>
28 * elf32-i386.c (elf_i386_check_tls_transition): Remove abfd.
29 Don't check if contents == NULL.
30 (elf_i386_tls_transition): Add from_relocate_section. Check
31 from_relocate_section instead of contents != NULL. Update
32 elf_i386_check_tls_transition call.
33 (elf_i386_check_relocs): Cache the section contents if
34 keep_memory is FALSE. Pass FALSE as from_relocate_section to
35 elf_i386_tls_transition.
36 (elf_i386_relocate_section): Pass TRUE as from_relocate_section
37 to elf_i386_tls_transition.
38 (elf_backend_caches_rawsize): New.
39 * elf64-x86-64.c (elf_x86_64_check_tls_transition): Don't check
41 (elf_x86_64_tls_transition): Add from_relocate_section. Check
42 from_relocate_section instead of contents != NULL.
43 (elf_x86_64_check_relocs): Cache the section contents if
44 keep_memory is FALSE. Pass FALSE as from_relocate_section to
45 elf_x86_64_tls_transition.
46 (elf_x86_64_relocate_section): Pass TRUE as from_relocate_section
47 to elf_x86_64_tls_transition.
48 (elf_backend_caches_rawsize): New.
50 2016-05-03 Maciej W. Rozycki <macro@imgtec.com>
53 * elfxx-mips.c (_bfd_mips_elf_add_symbol_hook): Handle
56 2016-05-03 Jiong Wang <jiong.wang@arm.com>
58 * bfd-in.h (bfd_elf64_aarch64_set_options): Update prototype.
59 * bfd-in2.h (bfd_elf64_aarch64_set_options): Likewise.
60 * elfnn-aarch64.c (bfd_elfNN_aarch64_set_options): Initialize
61 no_apply_dynamic_relocs.
62 (elfNN_aarch64_final_link_relocate): Apply absolute relocations even though
63 dynamic relocations generated.
65 2016-04-29 H.J. Lu <hongjiu.lu@intel.com>
67 * elf32-i386.c (elf_i386_size_dynamic_sections): Move interp
69 (elf_i386_create_dynamic_sections): Here.
70 * elf64-x86-64.c (elf_x86_64_size_dynamic_sections): Move
72 (elf_x86_64_create_dynamic_sections): Here.
74 2016-04-29 H.J. Lu <hongjiu.lu@intel.com>
76 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Take GOT_RELOC
77 and replace (EH)->has_got_reloc with GOT_RELOC.
78 (elf_i386_fixup_symbol): Pass has_got_reloc to
79 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
80 (elf_i386_allocate_dynrelocs): Likewise.
81 (elf_i386_relocate_section): Likewise.
82 (elf_i386_finish_dynamic_symbol): Likewise.
83 (elf_i386_convert_load): Pass TRUE to
84 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
85 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): Take
86 GOT_RELOC and replace (EH)->has_got_reloc with GOT_RELOC.
87 (elf_x86_64_fixup_symbol): Pass has_got_reloc to
88 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
89 (elf_x86_64_allocate_dynrelocs): Likewise.
90 (elf_x86_64_relocate_section): Likewise.
91 (elf_x86_64_finish_dynamic_symbol): Likewise.
92 (elf_x86_64_convert_load): Pass TRUE to
93 UNDEFINED_WEAK_RESOLVED_TO_ZERO.
95 2016-04-29 H.J. Lu <hongjiu.lu@intel.com>
97 * elf32-i386.c (check_relocs_failed): New.
98 (elf_i386_check_relocs): Set check_relocs_failed on error.
99 (elf_i386_relocate_section): Skip if check_relocs failed.
101 2016-04-29 H.J. Lu <hongjiu.lu@intel.com>
103 * elf64-x86-64.c (elf_x86_64_check_relocs): Set
104 check_relocs_failed on error.
106 2016-04-29 Nick Clifton <nickc@redhat.com>
109 * elf-bfd.h (struct elf_backend_data): Rename
110 elf_backend_set_special_section_info_and_link to
111 elf_backend_copy_special_section_fields.
112 * elfxx-target.h: Likewise.
113 * elf.c (section_match): Ignore the SHF_INFO_LINK flag when
114 comparing section flags.
115 (copy_special_section_fields): New function.
116 (_bfd_elf_copy_private_bfd_data): Copy the EI_ABIVERSION field.
117 Perform two scans over special sections. The first one looks for
118 a direct mapping between the output section and an input section.
119 The second scan looks for a possible match based upon section
121 * elf32-arm.c (elf32_arm_copy_special_section_fields): New
122 function. Handle setting the sh_link field of SHT_ARM_EXIDX
124 * elf32-i386.c (elf32_i386_set_special_info_link): Rename to
125 elf32_i386_copy_solaris_special_section_fields.
126 * elf32-sparc.c (elf32_sparc_set_special_section_info_link):
127 Rename to elf32_sparc_copy_solaris_special_section_fields.
128 * elf64-x86-64.c (elf64_x86_64_set_special_info_link): Rename to
129 elf64_x86_64_copy_solaris_special_section_fields.
131 2016-04-28 Nick Clifton <nickc@redhat.com>
133 * po/zh_CN.po: Updated Chinese (simplified) translation.
135 2016-04-27 H.J. Lu <hongjiu.lu@intel.com>
138 * elf64-x86-64.c (elf_x86_64_convert_load): Skip debug sections
139 when estimating distances between output sections.
141 2016-04-27 Alan Modra <amodra@gmail.com>
143 * elflink.c (_bfd_elf_is_start_stop): New function.
144 (_bfd_elf_gc_mark_rsec): Use it.
145 * elf-bfd.h (_bfd_elf_is_start_stop): Declare.
147 2016-04-26 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
149 * elf32-rx.c (rx_set_section_contents): Avoid arithmetic on void *.
150 * mmo.c (mmo_get_section_contents): Likewise.
151 (mmo_set_section_contents): Likewise.
153 2016-04-26 H.J. Lu <hongjiu.lu@intel.com>
155 * elf-bfd.h (elf_link_hash_table): Update comments for
157 * elflink.c (_bfd_elf_link_renumber_dynsyms): Always count for
158 the unused NULL entry at the head of dynamic symbol table.
159 (bfd_elf_size_dynsym_hash_dynstr): Remove dynsymcount != 0
162 2016-04-21 H.J. Lu <hongjiu.lu@intel.com>
164 * elflink.c (_bfd_elf_link_create_dynstrtab): Exclude linker
165 created file from dynobj.
167 2016-04-21 H.J. Lu <hongjiu.lu@intel.com>
169 * elflink.c (_bfd_elf_link_create_dynstrtab): Set dynobj to a
170 normal input file if possible.
172 2016-04-21 Nick Clifton <nickc@redhat.com>
174 * aout-adobe.c: Use _bfd_generic_link_check_relocs.
175 * aout-target.h: Likewise.
176 * aout-tic30.c: Likewise.
177 * binary.c: Likewise.
179 * coff-alpha.c: Likewise.
180 * coff-rs6000.c: Likewise.
181 * coff64-rs6000.c: Likewise.
182 * coffcode.h: Likewise.
183 * i386msdos.c: Likewise.
184 * i386os9k.c: Likewise.
187 * libbfd-in.h: Likewise.
188 * libecoff.h: Likewise.
189 * mach-o-target.c: Likewise.
191 * nlm-target.h: Likewise.
194 * plugin.c: Likewise.
195 * ppcboot.c: Likewise.
198 * tekhex.c: Likewise.
199 * versados.c: Likewise.
200 * vms-alpha.c: Likewise.
202 * elfxx-target.h: Use _bfd_elf_link_check_relocs.
203 * linker.c (bfd_link_check_relocs): New function.
204 (_bfd_generic_link_check_relocs): New function.
205 * targets.c (BFD_JUMP_TABLE_LINK): Add initialization of
206 _bfd_link_check_relocs field.
207 (struct bfd_target)L Add _bfd_link_check_relocs field.
208 * bfd-in2.h: Regenerate.
209 * libbfd.h: Regenerate.
211 2016-04-20 H.J. Lu <hongjiu.lu@intel.com>
213 * elf32-i386.c (elf_i386_gc_sweep_hook): Removed.
214 (elf_backend_gc_sweep_hook): Likewise.
215 * elf64-x86-64.c (elf_x86_64_gc_sweep_hook): Likewise.
216 (elf_backend_gc_sweep_hook): Likewise.
218 2016-04-20 H.J. Lu <hongjiu.lu@intel.com>
220 * elflink.c (_bfd_elf_link_check_relocs): Don't check relocations
223 2016-04-20 H.J. Lu <hongjiu.lu@intel.com>
226 * elf64-x86-64.c (check_relocs_failed): New.
227 (elf_x86_64_need_pic): Moved before elf_x86_64_check_relocs.
228 Support relocation agaist local symbol. Set check_relocs_failed.
229 (elf_x86_64_check_relocs): Use elf_x86_64_need_pic. Check
230 R_X86_64_32 relocation overflow.
231 (elf_x86_64_relocate_section): Skip if check_relocs failed.
232 Update one elf_x86_64_need_pic and remove one elf_x86_64_need_pic.
234 2016-04-20 H.J. Lu <hongjiu.lu@intel.com>
236 * elf32-i386.c (elf_i386_check_relocs): Call
237 _bfd_elf_create_ifunc_sections only for STT_GNU_IFUNC symbol.
238 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
240 2016-04-20 H.J. Lu <hongjiu.lu@intel.com>
242 * elf-bfd.h (_bfd_elf_link_check_relocs): New.
243 * elflink.c (_bfd_elf_link_check_relocs): New function.
244 (elf_link_add_object_symbols): Call _bfd_elf_link_check_relocs
245 if check_relocs_after_open_input is FALSE.
247 2016-04-20 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
249 * cache.c: Update old style function definitions.
250 * elf32-m68k.c: Likewise.
251 * elf64-mmix.c: Likewise.
252 * stab-syms.c: Likewise.
254 2016-04-20 Trevor Saunders <tbsaunde+binutils@tbsaunde.org>
256 * elf32-arm.c (put_thumb2_insn): Change argument type to bfd_byte *.
258 2016-04-15 H.J. Lu <hongjiu.lu@intel.com>
260 * Makefile.in: Regenerated with automake 1.11.6.
261 * aclocal.m4: Likewise.
262 * doc/Makefile.in: Likewise.
264 2016-04-14 Andrew Burgess <andrew.burgess@embecosm.com>
266 * reloc.c: Add BFD_RELOC_ARC_NPS_CMEM16 entry.
267 * bfd-in2.h: Regenerate.
268 * libbfd.h: Regenerate.
269 * elf32-arc.c: Add 'opcode/arc.h' include.
270 (struct arc_relocation_data): Add symbol_name.
271 (arc_special_overflow_checks): New function.
272 (arc_do_relocation): Use arc_special_overflow_checks, reindent as
273 required, add an extra comment.
274 (elf_arc_relocate_section): Setup symbol_name in reloc_data.
276 2016-04-14 Andrew Burgess <andrew.burgess@embecosm.com>
278 * elf32-arc.c (tls_got_entries): Add 'TLS_GOT_' prefix to all
280 (elf_arc_relocate_section): Update enum uses.
281 (elf_arc_check_relocs): Likewise.
282 (elf_arc_finish_dynamic_symbol): Likewise.
284 2016-04-14 H.J. Lu <hongjiu.lu@intel.com>
286 * elf.c (_bfd_elf_copy_private_bfd_data): Replace "link" with
289 2016-04-14 Nick Clifton <nickc@redhat.com>
292 * elf-bbfd.h (struct elf_backend_data): New field:
294 New field: elf_backend_set_special_section_info_and_link
295 * elfxx-target.h (elf_backend_strtab_flags): Define if not already
297 (elf_backend_set_special_section_info_and_link): Define if not
299 (elfNN_bed): Use elf_backend_set_special_section_info_and_link and
300 elf_backend_strtab_flags macros to initialise fields in structure.
301 * elf.c (_bfd_elf_make_section_from_shdr): Check for SHF_STRINGS
302 being set even if SHF_MERGE is not set.
303 (elf_fake_sections): Likewise.
304 (section_match): New function. Matches two ELF sections based
305 upon fixed characteristics.
306 (find_link): New function. Locates a section in a BFD that
307 matches a section in a different BFD.
308 (_bfd_elf_copy_private_bfd_data): Copy the sh_info and sh_link
309 fields of reserved sections.
310 (bfd_elf_compute_section_file_positions): Set the flags for the
311 .shstrtab section based upon the elf_strtab_flags field in the
312 elf_backend_data structure.
313 (swap_out_syms): Likewise for the .strtab section.
314 * elflink.c (bfd_elf_final_link): Set the flags for the
315 .strtab section based upon the elf_strtab_flags field in the
316 elf_backend_data structure.
317 * elf32-i386.c (elf32_i386_set_special_info_link): New function.
318 (elf_backend_strtab_flags): Set to SHF_STRINGS for Solaris
320 (elf_backend_set_special_section_info_and_link): Define for
322 * elf32-sparc.c: Likewise.
323 * elf64-x86-64.c: Likewise.
325 2016-04-11 H.J. Lu <hongjiu.lu@intel.com>
328 * elf-bfd.h (_bfd_elf_allocate_ifunc_dyn_relocs): Add a pointer
330 * elf-ifunc.c (_bfd_elf_allocate_ifunc_dyn_relocs): Updated.
331 Set *readonly_dynrelocs_against_ifunc_p to TRUE if dynamic reloc
332 applies to read-only section.
333 * elf32-i386.c (elf_i386_link_hash_table): Add
334 readonly_dynrelocs_against_ifunc.
335 (elf_i386_allocate_dynrelocs): Updated.
336 (elf_i386_size_dynamic_sections): Issue an error for read-only
337 segment with dynamic IFUNC relocations only if
338 readonly_dynrelocs_against_ifunc is TRUE.
339 * elf64-x86-64.c (elf_x86_64_link_hash_table): Add
340 readonly_dynrelocs_against_ifunc.
341 (elf_x86_64_allocate_dynrelocs): Updated.
342 (elf_x86_64_size_dynamic_sections): Issue an error for read-only
343 segment with dynamic IFUNC relocations only if
344 readonly_dynrelocs_against_ifunc is TRUE.
345 * elfnn-aarch64.c (elfNN_aarch64_allocate_ifunc_dynrelocs):
348 2016-04-06 Thomas Preud'homme <thomas.preudhomme@arm.com>
350 * elf32-arm.c (elf32_arm_size_stubs): Move error_ret_free_local to be
351 a fall through from error_ret_free_internal. Free local_syms in
352 error_ret_free_local if allocated from bfd_elf_get_elf_syms ().
354 2016-04-05 Cupertino Miranda <cmiranda@synopsys.com>
356 * elf32-arc.c (plt_do_relocs_for_symbol): Changed.
357 (relocate_plt_for_entry): Likewise.
359 2016-04-05 Cupertino Miranda <cmiranda@synopsys.com>
361 * elf32-arc.c (elf_arc_check_relocs): Changed
363 2016-04-05 Cupertino Miranda <cmiranda@synopsys.com>
365 * elf32-arc.c (name_for_global_symbol): Changed assert.
366 (get_replace_function): Created.:
367 (struct arc_relocation_data): Changed to signed types.
368 (defines S, L, P, PDATA): Casted to signed type.
369 (defines SECTSTART, _SDA_BASE_, TLS_REL): Likewise.
370 (PRINT_DEBUG_RELOC_INFO_BEFORE): Changed.
371 (arc_do_relocation): Changed.
373 2016-04-05 Cupertino Miranda <cmiranda@synopsys.com>
375 * elf32-arc.c (name_for_global_symbol): Added assert to check for
377 (elf_arc_relocate_section): Added and changed asserts, validating
378 the synamic symbol index.
379 (elf_arc_finish_dynamic_symbol): Do not fill the dynamic
380 relocation if symbol has dynindx set to -1.
382 2016-04-05 Maciej W. Rozycki <macro@imgtec.com>
384 * elflink.c (elf_link_add_object_symbols): Always turn hidden
385 and internal symbols which have a dynamic index into local
388 2016-04-04 Nick Clifton <nickc@redhat.com>
391 * dwarf2.c (parse_comp_unit): Skip warning about unrecognised
392 version number if the version is zero.
394 2016-04-01 Alan Modra <amodra@gmail.com>
397 * elflink.c (on_needed_list): Recursively check needed status.
398 (elf_link_add_object_symbols): Adjust.
400 2016-03-30 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
402 * elf32-avr.c (avr_elf32_load_records_from_section): Free
403 internal_relocs only if they aren't cached.
405 2016-03-29 Nick Clifton <nickc@redhat.com>
408 * elf32-bfin.c (elf32_bfinfdpic_finish_dynamic_sections): Relax
409 assertion on the size of the got section to allow it to be bigger
410 than the number of relocs.
412 2016-03-29 Toni Spets <toni.spets@iki.fi>
415 * coffcode.h (coff_write_object_contents): Revert accidental
418 2016-03-22 Alan Modra <amodra@gmail.com>
421 * dwarf2.c (read_attribute_value): Skip info_ptr check for
422 DW_FORM_flag_present.
424 2016-03-22 Nick Clifton <nickc@redhat.com>
426 * cpu-v850_rh850.c (arch_info_struct): Restore v850-rh850 as an
427 architecture name for backwards compatibility.
429 * peXXigen.c (_bfd_XXi_write_codeview_record): Fix possible
432 * warning.m4 (GCC_WARN_CFLAGS): Only add -Wstack-usage if using a
433 sufficiently recent version of GCC.
434 * configure: Regenerate.
436 2016-03-22 Alan Modra <amodra@gmail.com>
439 * plugin.c (try_load_plugin): Avoid -Wstack-usage warning.
441 2016-03-21 Andrew Burgess <andrew.burgess@embecosm.com>
443 * archures.c (bfd_mach_arc_nps400): Define.
444 * bfd-in2.h: Regenerate.
445 * cpu-arc.c (arch_info_struct): New entry for nps400, renumber
446 some existing entries to make space.
447 * elf32-arc.c (arc_elf_object_p): Add nps400 case.
448 (arc_elf_final_write_processing): Likewise.
450 2016-03-21 Andrew Burgess <andrew.burgess@embecosm.com>
452 * elf32-arc.c (arc_elf_print_private_bfd_data): Remove use of
454 (arc_elf_final_write_processing): Don't bother setting cpu field
455 in e_flags, this will have been set elsewhere.
457 2016-03-21 Andrew Burgess <andrew.burgess@embecosm.com>
459 * elf32-arc.c (arc_elf_final_write_processing): Switch to using
462 2016-03-21 Nick Clifton <nickc@redhat.com>
464 * warning.m4 (GCC_WARN_CFLAGS): Add -Wstack-usage=262144
465 * configure: Regenerate.
466 * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Replace use of
467 alloca with call to xmalloc.
468 * elf32-nds32.c: Likewise.
469 * elf64-hppa.c: Likewise.
470 * elfxx-mips.c: Likewise.
472 * pei-x86_64.c: Likewise.
476 2016-03-15 H.J. Lu <hongjiu.lu@intel.com>
479 * elf32-i386.c (elf_i386_check_relocs): Bind defined symbol
481 (elf_i386_relocate_section): Likewise.
482 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
483 (elf_x86_64_relocate_section): Likewise.
485 2016-03-15 H.J. Lu <hongjiu.lu@intel.com>
488 * elf64-x86-64.c (elf_x86_64_relocate_section): Check
489 no_reloc_overflow_check to diable R_X86_64_32/R_X86_64_32S
490 relocation overflow check.
492 2016-03-14 H.J. Lu <hongjiu.lu@intel.com>
494 * bfd-in2.h: Regenerated.
496 2016-03-11 Dan Gissel <dgisselq@ieee.org>
499 * elf.c (_bfd_elf_section_offset): Ensure that the returned offset
500 uses bytes not octets.
501 * elflink.c (resolve_section): Likewise.
503 (eval_section): Pass the input_bfd to resolve_section.
504 (bfd_elf_perform_complex_relocation): Convert byte offset to
505 octets before read and writing values.
506 (elf_link_input_bfd): Add byte to octet conversions.
507 (elf_reloc_link_order): Likewise.
508 (elf_fixup_link_order): Likewise.
509 (bfd_elf_final_link): Likewise.
510 * reloc.c (_bfd_final_link_relocate): Likewise.
511 * syms.c (_bfd_stab_section_find_nearest_line): Likewise.
513 2016-03-10 Nick Clifton <nickc@redhat.com>
515 * config.bfd: Mark the i370 target as obsolete.
517 2016-03-09 Pedro Alves <palves@redhat.com>
519 * cpu-v850.c (N): Append ":old-gcc-abi" instead of " (using old
520 gcc ABI)" to printable name.
521 * cpu-v850_rh850.c (bfd_v850_rh850_arch): Use "v850:rh850" instead
522 of "v850-rh850" as printable name.
524 2016-03-09 Leon Winter <winter-gcc@bfw-online.de>
527 * cofflink.c (_bfd_coff_generic_relocate_section): Do not apply
528 relocations against absolute symbols.
530 2016-03-09 Alan Modra <amodra@gmail.com>
533 * coff-alpha.c (alpha_ecoff_openr_next_archived_file): Allow zero
534 length elements in the archive.
536 2016-03-08 H.J. Lu <hongjiu.lu@intel.com>
539 * elflink.c (elf_link_add_object_symbols): Create dynamic sections
540 for -E/--dynamic-list only when not relocatable.
542 2016-03-08 H.J. Lu <hongjiu.lu@intel.com>
545 * elf32-i386.c (elf_i386_check_relocs): Increment PLT reference
546 count for locally defined local IFUNC symbols in shared object.
547 * elf64-x86-64.c (elf_x86_64_check_relocs): Likewise.
549 2016-03-08 H.J. Lu <hongjiu.lu@intel.com>
552 * elflink.c (_bfd_elf_merge_symbol): Group common symbol checking
555 2016-03-08 Cupertino Miranda <Cupertino.Miranda@synopsys.com>
556 Andrew Burgess <andrew.burgess@embecosm.com>
558 * elf32-arc.c (arc_bfd_get_32): Becomes an alias for bfd_get_32.
559 (arc_bfd_put_32): Becomes an alias for bfd_put_32.
560 (arc_elf_howto_init): Added assert to validate relocations.
561 (get_middle_endian_relocation): Delete.
562 (middle_endian_convert): New function.
563 (ME): Redefine, now does nothing.
565 (arc_do_relocation): Extend the attached 'ARC_RELOC_HOWTO'
566 definition to call middle_endian_convert. Add a new local
567 variable and make use of this throughout. Added call to
568 arc_bfd_get_8 and arc_bfd_put_8 for 8 bit relocations.
570 2016-03-07 Nick Clifton <nickc@redhat.com>
573 * archive.c (bfd_generic_openr_next_archived_file): Allow zero
574 length elements in the archive.
576 2016-03-07 Jiong Wang <jiong.wang@arm.com>
578 * elfnn-aarch64.c (elfNN_aarch64_check_relocs): Always create .got
579 section if the symbol "_GLOBAL_OFFSET_TABLE_" is referenced.
581 2016-03-04 H.J. Lu <hongjiu.lu@intel.com>
584 * elflink.c (_bfd_elf_merge_symbol): Treat common symbol in
585 executable as definition if the new definition comes from a
588 2016-03-02 Alan Modra <amodra@gmail.com>
590 * Makefile.in: Regenerate.
591 * po/SRC-POTFILES.in: Regenerate.
593 2016-02-29 Cupertino Miranda <cmiranda@synopsys.com>
595 * elf32-arc.c (elf_arc_relocate_section): Added rules to fix the
596 relocation addend when sections get merged.
598 2016-02-29 Cupertino Miranda <Cupertino.Miranda@synopsys.com>
600 * elf32-arc.c (arc_elf_final_write_processing): Add condition to
602 (elf_arc_relocate_section): Fixes and conditions to support PIE.
603 Assert for code sections dynamic relocs.
605 2016-02-26 Renlin Li <renlin.li@arm.com>
607 * elfnn-aarch64.c (elfNN_aarch64_howto_table): Fix signed overflow
608 check for MOVW_SABS_G0, MOVW_SABS_G1, MOVW_SABS_G2.
610 2016-02-26 H.J. Lu <hongjiu.lu@intel.com>
613 * elf32-i386.c (elf_i386_convert_load): Convert to R_386_32 for
614 load with locally bound symbols if PIC is false or there is no
615 base register. Optimize branch to 0 if PIC is false.
616 (elf_i386_relocate_section): Don't generate dynamic relocations
617 against undefined weak symbols if PIC is false.
618 * elf64-x86-64.c (elf_x86_64_convert_load): Disable optimization
619 if we can't estimate relocation overflow with --no-relax.
620 Convert to R_X86_64_32S/R_X86_64_32 for load with locally bound
621 symbols if PIC is false. Optimize branch to 0 if PIC is false.
622 (elf_x86_64_relocate_section): Don't generate dynamic relocations
623 against undefined weak symbols if PIC is false.
625 2016-02-26 H.J. Lu <hongjiu.lu@intel.com>
628 * bfd.c (bfd): Change flags to 20 bits.
629 (BFD_CONVERT_ELF_COMMON): New.
630 (BFD_USE_ELF_STT_COMMON): Likewise.
631 (BFD_FLAGS_SAVED): Add BFD_CONVERT_ELF_COMMON and
632 BFD_USE_ELF_STT_COMMON.
633 (BFD_FLAGS_FOR_BFD_USE_MASK): Likewise.
634 * configure.ac: Remove --enable-elf-stt-common.
635 * elf.c (swap_out_syms): Choose STT_COMMON or STT_OBJECT for
636 common symbol depending on BFD_CONVERT_ELF_COMMON and
637 BFD_USE_ELF_STT_COMMON.
638 * elfcode.h (elf_slurp_symbol_table): Set BSF_ELF_COMMON for
640 * elflink.c (bfd_elf_link_mark_dynamic_symbol): Also check
642 (elf_link_convert_common_type): New function.
643 (elf_link_output_extsym): Choose STT_COMMON or STT_OBJECT for
644 common symbol depending on BFD_CONVERT_ELF_COMMON and
645 BFD_USE_ELF_STT_COMMON. Set sym.st_info after sym.st_shndx.
646 * elfxx-target.h (TARGET_BIG_SYM): Add BFD_CONVERT_ELF_COMMON
647 and BFD_USE_ELF_STT_COMMON to object_flags.
648 (TARGET_LITTLE_SYM): Likewise.
649 * syms.c (BSF_KEEP_G): Renamed to ...
650 (BSF_ELF_COMMON): This.
651 * bfd-in2.h: Regenerated.
652 * config.in: Likewise.
653 * configure: Likewise.
655 2016-02-26 H.J. Lu <hongjiu.lu@intel.com>
660 * elf32-i386.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
661 (elf_i386_link_hash_entry): Add has_got_reloc and
663 (elf_i386_link_hash_table): Add interp.
664 (elf_i386_link_hash_newfunc): Initialize has_got_reloc and
666 (elf_i386_copy_indirect_symbol): Copy has_got_reloc and
668 (elf_i386_check_relocs): Set has_got_reloc and has_non_got_reloc.
669 (elf_i386_fixup_symbol): New function.
670 (elf_i386_pie_finish_undefweak_symbol): Likewise.
671 (elf_i386_allocate_dynrelocs): Don't allocate space for dynamic
672 relocations and discard relocations against resolved undefined
673 weak symbols in executable. Don't make resolved undefined weak
674 symbols in executable dynamic. Keep dynamic non-GOT/non-PLT
675 relocation against undefined weak symbols in PIE.
676 (elf_i386_size_dynamic_sections): Set interp to .interp section.
677 (elf_i386_relocate_section): Don't generate dynamic relocations
678 against resolved undefined weak symbols in PIE, except for
680 (elf_i386_finish_dynamic_symbol): Keep PLT/GOT entries without
681 dynamic PLT/GOT relocations for resolved undefined weak symbols.
682 Don't generate dynamic relocation against resolved undefined weak
683 symbol in executable.
684 (elf_i386_finish_dynamic_sections): Call
685 elf_i386_pie_finish_undefweak_symbol on all symbols in PIE.
686 (elf_backend_fixup_symbol): New.
687 * elf64-x86-64.c (UNDEFINED_WEAK_RESOLVED_TO_ZERO): New.
688 (elf_x86_64_link_hash_entry): Add has_got_reloc and
690 (elf_x86_64_link_hash_table): Add interp.
691 (elf_x86_64_link_hash_newfunc): Initialize has_got_reloc and
693 (elf_x86_64_copy_indirect_symbol): Copy has_got_reloc and
695 (elf_x86_64_check_relocs): Set has_got_reloc and
697 (elf_x86_64_fixup_symbol): New function.
698 (elf_x86_64_pie_finish_undefweak_symbol): Likewise.
699 (elf_x86_64_allocate_dynrelocs): Don't allocate space for dynamic
700 relocations and discard relocations against resolved undefined
701 weak symbols in executable. Don't make resolved undefined weak
702 symbols in executable dynamic.
703 (elf_x86_64_size_dynamic_sections): Set interp to .interp section.
704 (elf_x86_64_relocate_section): Check relocation overflow for
705 dynamic relocations against unresolved weak undefined symbols.
706 Don't generate dynamic relocations against resolved weak
707 undefined symbols in PIE.
708 (elf_x86_64_finish_dynamic_symbol): Keep PLT/GOT entries without
709 dynamic PLT/GOT relocations for resolved undefined weak symbols.
710 Don't generate dynamic relocation against resolved undefined weak
711 symbol in executable.
712 (elf_x86_64_finish_dynamic_sections): Call
713 elf_x86_64_pie_finish_undefweak_symbol on all symbols in PIE.
714 (elf_backend_fixup_symbol): New.
716 2016-02-26 Alan Modra <amodra@gmail.com>
718 * elf64-ppc.c (create_linkage_sections): Create sfpr when
719 save_restore_funcs, rest of sections when not relocatable.
720 (ppc64_elf_init_stub_bfd): Always call create_linkage_sections.
721 (sfpr_define): Define all symbols on emitted code.
722 (ppc64_elf_func_desc_adjust): Adjust for sfpr now being created
723 when relocatable. Move sfpr_define loop earlier.
725 2016-02-24 H.J. Lu <hongjiu.lu@intel.com>
727 * elf64-x86-64.c (elf_x86_64_need_pic): New function.
728 (elf_x86_64_relocate_section): Use it. Replace
729 x86_64_elf_howto_table[r_type] with howto.
731 2016-02-24 H.J. Lu <hongjiu.lu@intel.com>
734 * elflink.c (bfd_elf_record_link_assignment): Set versioned if
735 symbol version is unknown.
737 2016-02-24 H.J. Lu <hongjiu.lu@intel.com>
739 * elf32-i386.c (elf_i386_allocate_dynrelocs): Set plt_got.offset
740 to (bfd_vma) -1 when setting needs_plt to 0.
741 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
743 2016-02-23 H.J. Lu <hongjiu.lu@intel.com>
745 * elflink.c (bfd_elf_record_link_assignment): Check for shared
746 library, instead of PIC, and don't check PDE when making linker
747 assigned symbol dynamic.
749 2016-02-23 Faraz Shahbazker <faraz.shahbazker@imgtec.com>
751 * bfd/elfxx-mips.c (_bfd_mips_post_process_headers): Increment
752 ABIVERSION for non-executable stack.
754 2016-02-23 Rich Felker <bugdal@aerifal.cx>
757 * elf32-microblaze.c (microblaze_elf_finish_dynamic_symbol):
758 Always produce a RELATIVE reloc for a local symbol.
760 2016-02-23 Hans-Peter Nilsson <hp@axis.com>
762 Fix test-case ld-elf/pr19617b
763 * elf32-cris.c (elf_cris_discard_excess_program_dynamics): Don't
764 discard unused non-function symbols when --dynamic-list-data.
766 2016-02-22 H.J. Lu <hongjiu.lu@intel.com>
768 * elflink.c (_bfd_elf_link_renumber_dynsyms): Always create the
769 dynsym section, even if it is empty, with dynamic sections.
771 2016-02-22 H.J. Lu <hongjiu.lu@intel.com>
773 * syms.c: Remove BSF_COMMON from comments.
774 * bfd-in2.h: Regenerated.
776 2016-02-22 Jiong Wang <jiong.wang@arm.com>
778 * elfnn-aarch64. (aarch64_type_of_stub): Remove redundation calcuation
779 for destination. Remove useless function parameters.
780 (elfNN_aarch64_size_stubs): Update parameters for aarch64_type_of_stub.
782 2016-02-19 Nick Clifton <nickc@redhat.com>
785 * aoutx.h (aout_link_add_symbols): Check for out of range string
789 * reloc.c (bfd_generic_get_relocated_section_contents): Stop
790 processing if we encounter a reloc without an associated symbol.
792 2016-02-18 H.J. Lu <hongjiu.lu@intel.com>
795 * elflink.c (elf_link_add_object_symbols): Always create dynamic
796 sections for -E/--dynamic-list.
798 2016-02-17 H.J. Lu <hongjiu.lu@intel.com>
800 * elf64-x86-64.c (elf_backend_omit_section_dynsym): New. Defined
803 2016-02-16 Joseph Myers <joseph@codesourcery.com>
805 * plugin.c (plugin_vec): Set match priority to 255.
806 * format.c (bfd_check_format_matches) [BFD_SUPPORTS_PLUGINS]: When
807 matching against the plugin vector, take priority from there not
810 2016-02-15 Nick Clifton <nickc@redhat.com>
812 * elf-bfd.h (struct bfd_elf_special_section): Use unsigned values
813 for length and type fields. Use a signed value for the
816 2016-02-10 H.J. Lu <hongjiu.lu@intel.com>
819 * elf32-i386.c (elf_i386_relocate_section): Mask off the least
820 significant bit in GOT offset for R_386_GOT32X.
822 2016-02-10 Nick Clifton <nickc@redhat.com>
825 * elf32-nios2.c (nios2_elf32_install_imm16): Allow for signed
827 * elf-eh-frame.c (_bfd_elf_discard_section_eh_frame): Limit the
828 number of messages about FDE encoding preventing .eh_frame_hdr
831 2016-02-09 Nick Clifton <nickc@redhat.com>
833 * oasys.c (oasys_archive_p): Fix indentation.
834 * elf32-nds32.c (nds32_elf_relax_section): Use an unsigned
835 constant for left shifting.
837 * elfnn-aarch64.c (elfNN_aarch64_relocate_section): Add a more
838 helpful warning message to explain why certain AArch64 relocs
841 2016-02-05 Simon Marchi <simon.marchi@ericsson.com>
843 * pe-mips.c (coff_mips_reloc): Fix formatting.
845 2016-02-05 Cupertino Miranda <Cupertino.Miranda@synopsys.com>
847 * cpu-arc.c: Change default archure from bfd_mach_arc_arcv2
848 to bfd_mach_arc_arc600.
850 2016-02-04 Alan Modra <amodra@gmail.com>
852 * elf64-ppc.c (ppc64_elf_relocate_section): Adjust last patch
855 2016-02-02 H.J. Lu <hongjiu.lu@intel.com>
858 * elf64-x86-64.c (elf_x86_64_convert_load): Store the estimated
859 distances in the compressed_size field of the output section.
861 2016-02-02 Alan Modra <amodra@gmail.com>
863 * elf64-ppc.c (ppc64_elf_relocate_section): Further restrict
864 ELFv2 entry optimization.
866 2016-02-02 H.J. Lu <hongjiu.lu@intel.com>
869 * elf.c (assign_section_numbers): Clear HAS_RELOC if there are
870 no relocations in relocatable files.
872 2016-02-01 H.J. Lu <hongjiu.lu@intel.com>
875 * elflink.c (elf_link_add_object_symbols): Don't add DT_NEEDED
876 if a symbol from a library loaded via DT_NEEDED doesn't match
877 the symbol referenced by regular object.
879 2016-02-01 Nathaniel Smith <njs@pobox.com>
881 * peicode.h (pe_ILF_build_a_bfd): Create an import symbol for both
884 2016-02-01 Alan Modra <amodra@gmail.com>
886 * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Don't abort on
887 an out of range reloc_index.
888 * elf32-i386.c (elf_i386_get_plt_sym_val): Likewise.
890 2016-02-01 Kamil Rytarowski <n54@gmx.com>
892 * Makefile.am (OPTIONAL_BACKENDS): Add netbsd-core.lo.
893 (OPTIONAL_BACKENDS_CFILES): Add netbsd-core.c.
894 * Makefile.in: Regenerated.
896 2016-02-01 Jan Kratochvil <jan.kratochvil@redhat.com>
898 * elf64-s390.c (elf_s390_reloc_name_lookup): Fix indentation.
900 2016-01-31 John David Anglin <danglin@gcc.gnu.org>
903 * elf32-hppa.c (elf32_hppa_final_link): Don't sort non-regular output
905 * elf64-hppa.c (elf32_hppa_final_link): Likewise. Remove retval.
907 2016-01-30 H.J. Lu <hongjiu.lu@intel.com>
910 * elf32-i386.c (elf_i386_reloc_type_class): Check relocation
911 against STT_GNU_IFUNC symbol only with dynamic symbols.
912 * elf64-x86-64.c (elf_x86_64_reloc_type_class): Likewise.
914 2016-01-28 H.J. Lu <hongjiu.lu@intel.com>
917 * dwarf2.c (_bfd_dwarf2_slurp_debug_info): Set BFD_DECOMPRESS to
918 decompress debug sections.
920 2016-01-25 Maciej W. Rozycki <macro@imgtec.com>
922 * elf32-arc.c (elf_arc_finish_dynamic_symbol): Rename `index' to
925 2016-01-25 Nick Clifton <nickc@redhat.com>
928 * mach-o.c (bfd_mach_o_close_and_cleanup): Suppress code to free
929 dsym filename buffer.
931 2016-01-24 Maciej W. Rozycki <macro@imgtec.com>
933 * elfxx-mips.c (BZ16_REG_FIELD): Simplify calculation.
935 2016-01-24 Maciej W. Rozycki <macro@imgtec.com>
937 * elfxx-mips.c (BZ16_REG): Correct calculation.
939 2016-01-21 Nick Clifton <nickc@redhat.com>
941 * elf32-arc.c (ADD_RELA): Fix compile time warning errors by
942 changing the type of _loc to be bfd_byte *.
943 (elf_arc_finish_dynamic_symbol): Likewise.
945 2016-01-21 Nick Clifton <nickc@redhat.com>
948 * elf32-arm.c (elf32_arm_create_dynamic_sections): Set the ELF
949 class of the linker stub bfd.
950 (elf32_arm_check_relocs): Skip check for pic format after
951 processing a vxWorks R_ARM_ABS12 reloc.
952 * elflink.c (bfd_elf_final_link): Check for ELFCLASSNONE when
953 reporting a class mismatch.
955 2016-01-21 Jiong Wang <jiong.wang@arm.com>
957 * elfnn-aarch64.c (aarch64_type_of_stub): Allow insert long branch
958 veneer for sym_sec != input_sec.
959 (elfNN_aarch64_size_stub): Support STT_SECTION symbol.
960 (elfNN_aarch64_final_link_relocate): Take rela addend into account when
961 calculation destination.
963 2016-01-21 Alan Modra <amodra@gmail.com>
965 * elf-linux-core.h (swap_linux_prpsinfo32_out): New function.
966 (swap_linux_prpsinfo64_out): New function.
967 (LINUX_PRPSINFO32_SWAP_FIELDS): Delete.
968 (LINUX_PRPSINFO64_SWAP_FIELDS): Delete.
969 * elf.c (elfcore_write_linux_prpsinfo32): Adjust. Don't memset.
970 (elfcore_write_linux_prpsinfo64): Likewise.
971 * elf32-ppc.c (swap_ppc_linux_prpsinfo32_out): New function.
972 (PPC_LINUX_PRPSINFO32_SWAP_FIELDS): Delete.
973 (elfcore_write_ppc_linux_prpsinfo32): Adjust. Don't memset.
975 2016-01-21 Alan Modra <amodra@gmail.com>
977 * elf-linux-core.h: Rename from elf-linux-psinfo.h.
978 * elf.c: Adjust #include.
979 * elf32-ppc.c: Don't #include elf-linux-psinfo.h
980 * Makefile.am (SOURCE_HFILES): Update.
981 * Makefile.in: Regenerate.
982 * po/SRC-PORFILES.in: Regenerate.
984 2016-01-21 Alan Modra <amodra@gmail.com>
986 * configure.ac: Move corefile selection later in file. Move
987 tdefaults code immediately after other target vector code.
988 * configure: Regenerate.
990 2016-01-20 Mickael Guene <mickael.guene@st.com>
992 * elf32-arm.c (elf32_arm_special_sections): Remove catch of noread
993 section using '.text.noread' pattern.
995 2016-01-19 John Baldwin <jhb@FreeBSD.org>
997 * elf.c (elfcore_grok_note): Recognize NT_FREEBSD_THRMISC notes.
999 2016-01-18 Miranda Cupertino <Cupertino.Miranda@synopsys.com>
1000 Zissulescu Claudiu <Claudiu.Zissulescu@synopsys.com>
1002 * arc-plt.def: New file.
1003 * arc-plt.h: Likewise.
1004 * elf32-arc.c (elf_arc_abs_plt0_entry, elf_arc_abs_pltn_entry,
1005 elf_arcV2_abs_plt0_entry, elf_arcV2_abs_pltn_entry,
1006 elf_arc_pic_plt0_entry, elf_arc_pic_pltn_entry,
1007 elf_arcV2_pic_plt0_entry, elf_arcV2_pic_pltn_entry): Remove.
1008 (name_for_global_symbol): Added.
1009 (ADD_RELA): Helper to create dynamic relocs.
1010 (new_got_entry_to_list): Create a new got entry in linked list.
1011 (symbol_has_entry_of_type): Search for specific type of entry in
1013 (is_reloc_for_GOT): return FALSE for any TLS related relocs.
1014 (is_reloc_for_TLS, arc_elf_set_private_flags)
1015 (arc_elf_print_private_bfd_data, arc_elf_copy_private_bfd_data)
1016 (arc_elf_merge_private_bfd_data): New functions.
1017 (debug_arc_reloc): Cleaned debug info printing.
1018 (PDATA reloc): Changed not to perform address alignment.
1019 (reverse_me): Added. Fix for ARC_32 relocs.
1020 (arc_do_relocation): Return bfd_reloc_of when no relocation should
1022 (arc_get_local_got_ents): Renamed from arc_get_local_got_offsets.
1023 Changed function to access an array of list of GOT entries instead
1024 of just an array of offsets.
1025 (elf_arc_relocate_section): Added support for PIC and TLS related relocations.
1026 (elf_arc_check_relocs): Likewise.
1027 (elf_arc_adjust_dynamic_symbol, elf_arc_finish_dynamic_symbol,
1028 (elf_arc_finish_dynamic_sections): Likewise
1029 (arc_create_dynamic_sections): Modified conditions to create
1031 (ADD_SYMBOL_REF_SEC_AND_RELOC): New macro.
1032 (plt_do_relocs_for_symbol, relocate_plt_for_symbol)
1033 (relocate_plt_for_entry): Changed to support new way to define PLT
1035 (add_symbol_to_plt): Likewise.
1036 (arc_elf_link_hash_table_create): New function.
1038 2016-01-18 Nick Clifton <nickc@redhat.com>
1041 * coff-rs6000.c (_bfd_xcoff_swap_sym_in): Sign extend external
1042 section number into internal section number.
1043 * coff64-rs6000.c (_bfd_xcoff64_swap_sym_in): Likewise.
1044 * coffswap.h (coff_swap_sym_in): Likewise.
1045 * peXXigen.c (_bfd_XXi_swap_sym_in): Likewise.
1046 * coffcode.h (_coff_bigobj_swap_sym_in): Make sure that internal
1047 section number field is big enough to hold the external value.
1049 2016-01-17 Alan Modra <amodra@gmail.com>
1051 * configure: Regenerate.
1053 2016-01-12 Yury Usishchev <y.usishchev@samsung.com>
1055 * elf32-arm.c (elf32_arm_fix_exidx_coverage): Insert cantunwind
1056 when address in first unwind entry does not match start of
1059 2016-01-08 Richard Sandiford <richard.sandiford@arm.com>
1060 Jiong Wang <jiong.wang@arm.com>
1063 * elf32-arm.c (elf32_arm_reloc_type_class): Map R_ARM_IRELATIVE to
1066 2016-01-06 Andrew Burgess <andrew.burgess@embecosm.com>
1068 * elf32-arc.c (reloc_type_to_name): Change ARC_RELOC_HOWTO to
1069 place 'R_' before the reloc name returned.
1070 (elf_arc_howto_table): Change ARC_RELOC_HOWTO to place 'R_' before
1071 the relocation string.
1073 2016-01-04 Maciej W. Rozycki <macro@imgtec.com>
1075 * elfxx-mips.c (mips_elf_merge_obj_abiflags): New function,
1076 factored out from...
1077 (_bfd_mips_elf_merge_private_bfd_data): ... here.
1079 2016-01-04 Maciej W. Rozycki <macro@imgtec.com>
1081 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Move
1082 attribute check after ELF file header flag check.
1084 2016-01-04 Maciej W. Rozycki <macro@imgtec.com>
1086 * elfxx-mips.c (mips_elf_merge_obj_attributes): Propagate the
1087 return status from `_bfd_elf_merge_object_attributes'.
1089 2016-01-04 Maciej W. Rozycki <macro@imgtec.com>
1091 * elfxx-mips.c (mips_elf_merge_obj_e_flags): New function,
1092 factored out from...
1093 (_bfd_mips_elf_merge_private_bfd_data): ... here.
1095 2016-01-04 Maciej W. Rozycki <macro@imgtec.com>
1097 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Fold the
1098 handling of input MIPS ABI flags together.
1100 2016-01-04 Maciej W. Rozycki <macro@imgtec.com>
1102 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Suppress
1103 attribute checks for null input.
1105 2016-01-04 Maciej W. Rozycki <macro@imgtec.com>
1107 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Use local
1108 pointers to target data.
1110 2016-01-04 Maciej W. Rozycki <macro@imgtec.com>
1112 * elfxx-mips.c (_bfd_mips_elf_merge_private_bfd_data): Correct
1115 2016-01-01 Alan Modra <amodra@gmail.com>
1117 Update year range in copyright notice of all files.
1119 For older changes see ChangeLog-2015 and doc/ChangeLog-0415
1121 Copyright (C) 2016 Free Software Foundation, Inc.
1123 Copying and distribution of this file, with or without modification,
1124 are permitted in any medium without royalty provided the copyright
1125 notice and this notice are preserved.
1131 version-control: never