aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2015-07-16[AArch64][2/3] GAS support BFD_RELOC_AARCH64_TLSLD_ADR_PREL21Jiong Wang5-0/+30
2015-07-16Automatic date update in version.inGDB Administrator1-1/+1
2015-07-15Automatic date update in version.inGDB Administrator1-1/+1
2015-07-14Automatic date update in version.inGDB Administrator1-1/+1
2015-07-13Automatic date update in version.inGDB Administrator1-1/+1
2015-07-12Automatic date update in version.inGDB Administrator1-1/+1
2015-07-11Automatic date update in version.inGDB Administrator1-1/+1
2015-07-10Properly convert objects between different ELF classesH.J. Lu3-0/+168
The output SHF_COMPRESSED section size is different from input if ELF classes of input and output aren't the same. We must adjust the section sizes as well as the compression headers in SHF_COMPRESSED sections when converting objects between different ELF classes. bfd/ PR binutils/18656 * bfd.c (bfd_convert_section_size): New function. (bfd_convert_section_contents): Likewise. * bfd-in2.h: Regenerated. binutils/ 2015-07-10 H.J. Lu <hongjiu.lu@intel.com> PR binutils/18656 * objcopy.c (setup_section): Call bfd_convert_section_size to get the output section size. (copy_section): Get the section size from the output section and call bfd_get_full_section_contents to convert section contents for output. binutils/testsuite/ PR binutils/18656 * binutils-all/compress.exp (convert_test): New proc. Run conversion tests between x86-64 and x32.
2015-07-10Automatic date update in version.inGDB Administrator1-1/+1
2015-07-092015-07-09 Catherine Moore <clm@codesourcery.com>Catherine Moore2-3/+9
* elflink.c (bfd_elf_size_dynamic_sections): Call to _bfd_elf_maybe_strip_eh_frame_hdr should be before bed->elf_backend_size_dynamic_sections.
2015-07-09Automatic date update in version.inGDB Administrator1-1/+1
2015-07-08Define DIFF_EXPR_OK for avr target to allow PC relative difference relocation.Denis Chertykov2-2/+22
When generating relocation (tc_gen_reloc) 32 bit relocation fixup is changed to new 32 bit PC relative relocation if the fixup has pc-relative flag set. bfd/ChangeLog 2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com> * elf32-avr.c: Add 32 bit PC relative relocation for AVR target. gas/ChangeLog 2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com> * config/tc-avr.c (tc_gen_reloc): Change 32 bit relocation to 32 bit PC relative and update offset if the fixup is pc-relative. * config/tc-avr.h (DIFF_EXPR_OK): Define to enable PC relative diff relocs. gas/testsuite/ChangeLog 2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com> * gas/avr/pc-relative-reloc.d: New test for 32 bit pc relative reloc. * gas/avr/per-function-debugline.s: New test source. include/ChangeLog 2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com> * elf/avr.h: Add new 32 bit PC relative relocation. ld/testsuite/ChangeLog 2015-07-06 Pitchumani Sivanupandi <pitchumani.s@atmel.com> * ld-avr/gc-section-debugline.d: New test. * ld-avr/per-function-debugline.s: Source for new test.
2015-07-08Automatic date update in version.inGDB Administrator1-1/+1
2015-07-07Automatic date update in version.inGDB Administrator1-1/+1
2015-07-06Remove the merge conflict introduced byH.J. Lu1-71/+0
commit 2f0c68f23bb3132cd5ac466ca8775c0d9e4960cd Author: Catherine Moore <clm@codesourcery.com> Date: Thu May 28 14:50:36 2015 -0700 Compact EH Support
2015-07-06Automatic date update in version.inGDB Administrator1-1/+1
2015-07-05Fix an opd->append index in elf64-ppc.cRichard Sandiford2-1/+7
bfd/ * elf64-ppc.c (toc_adjusting_stub_needed): Use the symbol value plus addend rather than the original st_value when looking up entries in opd->adjust. ld/testsuite/ * ld-powerpc/tocopt6-inc.s, ld-powerpc/tocopt6a.s, ld-powerpc/tocopt6b.s, ld-powerpc/tocopt6c.s, ld-powerpc/tocopt6.d: New test. * ld-powerpc/powerpc.exp (ppc64elftests): Add it.
2015-07-05Automatic date update in version.inGDB Administrator1-1/+1
2015-07-04Automatic date update in version.inGDB Administrator1-1/+1
2015-07-03Add experimental support for --gc-sections with COFF and PE based targets.Kai Tietz5-1/+490
PR ld/11539 bfd * coffcode.h (coff_bfd_gc_sections): Define default to bfd_coff_gc_sections function. * cofflink.c (init_reloc_cookie): Copy and adjust coff related code about gc-sections from elflink.c to here. (fini_reloc_cookie): Likewise. (init_reloc_cookie_rels): Likewise. (fini_reloc_cookie_rels): Likewise. (init_reloc_cookie_for_section): Likewise. (fini_reloc_cookie_for_section): Likewise. (_bfd_coff_gc_mark_hook): Likewise. (_bfd_coff_gc_mark_rsec): Likewise. (_bfd_coff_gc_mark_reloc): Likewise. (_bfd_coff_gc_mark): Likewise. (_bfd_coff_gc_mark_extra_sections): Likewise. (coff_gc_sweep_symbol_info): Likewise. (coff_gc_sweep_symbol): Likewise. (gc_sweep_hook_fn): Likewise. (coff_gc_sweep): Likewise. (bfd_coff_gc_sections): Likewise. (_bfd_coff_gc_keep): Likewise. * libcoff.h (coff_reloc_cookie): New struct. (bfd_coff_gc_sections): New prototype. (coff_gc_mark_hook_fn): New type. ld * scripttempl/pep.sc: Mark .idata*, .CRT*, .tls*, .rsrc*, .init, .ctor*, .dtor*, .fini, .jcr, .eh_frame, .pdata. .xdata, and .gcc_except_table sections as KEEP. * scripttempl/pe.sc: Likewise.
2015-07-03Automatic date update in version.inGDB Administrator1-1/+1
2015-07-02Automatic date update in version.inGDB Administrator1-1/+1
2015-07-01Relocations for Nios II R2Sandra Loosemore5-25/+998
2015-07-01 Sandra Loosemore <sandra@codesourcery.com> Cesar Philippidis <cesar@codesourcery.com> bfd/ * bfd-in2.h: Regenerated. * elf32-nios2.c (elf_nios2_howto_table_rel): Rename to... (elf_nios2_r1_howto_table_rel): This. (elf_nios2_r2_howto_table_rel): New. (BFD_IS_R2): New. (lookup_howto): Add ABFD parameter. Adjust to look up in either the R1 or R2 relocation table, as determined by ABFD. (nios2_reloc_map): Add R2 relocations. (nios2_elf32_bfd_reloc_type_lookup): Do lookup using lookup_howto. Pass it the ABFD parameter. (nios2_elf32_bfd_reloc_name_lookup): Use ABFD to decide whether to return an R1 or R2 relocation. (nios2_elf32_info_to_howto): Do lookup using lookup_howto. Pass it the ABFD parameter. (nios2_elf32_do_call26_relocate): Check for alignment on a 4-byte boundary. (nios2_elf32_relocate_section): Adjust call to lookup_howto. * libbfd.h: Regenerated. * reloc.c (BFD_RELOC_NIOS2_R2_S12): New. (BFD_RELOC_NIOS2_R2_I10_1_PCREL): New. (BFD_RELOC_NIOS2_R2_T1I7_1_PCREL): New. (BFD_RELOC_NIOS2_R2_T1I7_2): New. (BFD_RELOC_NIOS2_R2_T2I4): New. (BFD_RELOC_NIOS2_R2_T2I4_1): New. (BFD_RELOC_NIOS2_R2_T2I4_2): New. (BFD_RELOC_NIOS2_R2_X1I7_2): New. (BFD_RELOC_NIOS2_R2_X2L5): New. (BFD_RELOC_NIOS2_R2_F1I5_2): New. (BFD_RELOC_NIOS2_R2_L5I4X1): New. (BFD_RELOC_NIOS2_R2_T1X1I6): New. (BFD_RELOC_NIOS2_R2_T1X1I6_2): New. include/elf/ * nios2.h (R_NIOS2_R2_S12): New. (R_NIOS2_R2_I10_1_PCREL): New. (R_NIOS2_R2_T1I7_1_PCREL): New. (R_NIOS2_R2_T1I7_2): New. (R_NIOS2_R2_T2I4): New. (R_NIOS2_R2_T2I4_1): New. (R_NIOS2_R2_T2I4_2): New. (R_NIOS2_R2_X1I7_2): New. (R_NIOS2_R2_X2L5): New. (R_NIOS2_R2_F1I5_2): New. (R_NIOS2_R2_L5I4X1): New. (R_NIOS2_R2_T1X1I6): New. (R_NIOS2_R2_T1X1I6_2): New. (R_NIOS2_ILLEGAL): Renumber.
2015-07-01Add Nios II arch flags and compatibility testsSandra Loosemore5-6/+149
2015-07-01 Sandra Loosemore <sandra@codesourcery.com> Cesar Philippidis <cesar@codesourcery.com> bfd/ * archures.c (bfd_mach_nios2r1, bfd_mach_nios2r2): New. * bfd-in2.h: Regenerated. * cpu-nios2.c (nios2_compatible): New. (N): Use nios2_compatible instead of bfd_default_compatible. (NIOS2R1_NEXT, NIOS2R2_NEXT): Define. (arch_info_struct): New. (bfd_nios2_arch): Chain to NIOS2R1_NEXT. * elf32-nios2.c (is_nios2_elf): New. (nios2_elf32_merge_private_bfd_data): New. (nios2_elf32_object_p): New. (bfd_elf32_bfd_merge_private_bfd_data): Define. (elf_backend_object_p): Define. gas/ * config/tc-nios2.c: Adjust includes. (OPTION_MARCH): Define. (md_longopts): Add -march option. (nios2_architecture): New. (nios2_use_arch): New. (md_parse_option): Handle OPTION_MARCH. (md_show_usage): Document -march. (md_begin): Set arch in BFD. (nios2_elf_final_processing): New. * config/tc-nios2.h (elf_tc_final_processing): Define. (nios2_elf_final_processing): New. * doc/c-nios2.texi (-march): Add documentation. include/elf/ * nios2.h (EF_NIOS2_ARCH_R1, EF_NIOS2_ARCH_R2): Define. ld/testsuite/ * ld-nios2/mixed1a.d: New. * ld-nios2/mixed1a.s: New. * ld-nios2/mixed1b.d: New. * ld-nios2/mixed1b.s: New. * ld-nios2/nios2.exp: Build the new compatibility tests.
2015-07-01Refactor elf_x86_64_convert_mov_to_leaH.J. Lu2-4/+13
* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Refactor.
2015-07-01Automatic date update in version.inGDB Administrator1-1/+1
2015-06-30This fixes parsing a file containing ELF attributes with very large tag values.Nick Clifton3-19/+37
PR binutils/18570 * elf-attrs.c (obj_attr_size): Use an unsigned int type for the tag. (write_obj_attribute): Likewise. (elf_new_obj_attr): Likewise. (bfd_elf_get_obj_attr_int): Likewise. (bfd_elf_add_obj_attr_int): Likewise. (bfd_elf_add_obj_attr_string): Likewise. (bfd_elf_add_obj_attr_int_string): Likewise. (gnu_obj_attrs_arg_type): Likewise. (_bfd_elf_obj_attrs_arg_type): Likewise. (_bfd_elf_parse_attributes): Likewise. (_bfd_elf_merge_unknown_attribute_list): Likewise. * elf-bfd.h (struct obj_attribute_list): Likewise. Update prototypes.
2015-06-30Add support for SADDR addressing to the RL78 port.Nick Clifton4-1/+6
gas * config/rl78-parse.y: Tag all saddr expressions throughout. (SET_SA): New. (expr_is_saddr): Allow symbolic expressions. * config/tc-rl78.c (md_apply_fix): Handle SADDR. bfd * elf32-rl78.c (rl78_elf_howto_table): Add RH_SADDR. (rl78_reloc_map): Add R_RL78_RH_SADDR. * reloc.c: Add BFD_RELOC_RL78_SADDR. * libbfd.h: Regenerate. * bfd-in2.h: Regenerate.
2015-06-30Automatic date update in version.inGDB Administrator1-1/+1
2015-06-29Automatic date update in version.inGDB Administrator1-1/+1
2015-06-28Remove COMPRESS_DEBUG_ZLIBH.J. Lu3-6/+10
COMPRESS_DEBUG_ZLIB isn't needed. This patch removes COMPRESS_DEBUG_ZLIB and replace COMPRESS_DEBUG_ZLIB with COMPRESS_DEBUG_GNU_ZLIB. bfd/ * bfd-in.h (compressed_debug_section_type): Remove COMPRESS_DEBUG_ZLIB. * bfd-in2.h : Regenerated. gas/ * as.c (parse_args): Replace COMPRESS_DEBUG_ZLIB with COMPRESS_DEBUG_GNU_ZLIB. * config/tc-i386.c (flag_compress_debug): Likewise. ld/ * emultempl/elf32.em (gld${EMULATION_NAME}_handle_option): Replace COMPRESS_DEBUG_ZLIB with COMPRESS_DEBUG_GNU_ZLIB.
2015-06-28Automatic date update in version.inGDB Administrator1-1/+1
2015-06-27Automatic date update in version.inGDB Administrator1-1/+1
2015-06-26Add support for DT_MIPS_RLD_MAP_REL.Matthew Fortune2-3/+43
This tag makes it possible to access the debug map when debugging position independent executables. bfd/ * elfxx-mips.c (_bfd_mips_elf_create_dynamic_sections): Use executable instead of !shared to indicate an application vs shared library. (_bfd_mips_elf_size_dynamic_sections): Likewise. (_bfd_mips_elf_finish_dynamic_sections): Handle DT_MIPS_RLD_MAP_REL. (_bfd_mips_elf_get_target_dtag): Likewise. binutils/ * readelf.c (get_mips_dynamic_type): Handle DT_MIPS_RLD_MAP_REL. include/ * elf/mips.h (DT_MIPS_RLD_MAP_REL): New macro. ld/testsuite/ * ld-mips-elf/pic-and-nonpic-3b.ad: Adjust for extra dynamic tag. * ld-mips-elf/pic-and-nonpic-4b.ad: Likewise. * ld-mips-elf/pic-and-nonpic-5b.ad: Likewise. * ld-mips-elf/pic-and-nonpic-6-n32.ad: Likewise. * ld-mips-elf/pic-and-nonpic-6-n64.ad: Likewise. * ld-mips-elf/pic-and-nonpic-6-o32.ad: Likewise. * ld-mips-elf/tlsdyn-o32-1.d: Likewise. * ld-mips-elf/tlsdyn-o32-1.got: Likewise. * ld-mips-elf/tlsdyn-o32-2.d: Likewise. * ld-mips-elf/tlsdyn-o32-2.got: Likewise. * ld-mips-elf/tlsdyn-o32-3.d: Likewise. * ld-mips-elf/tlsdyn-o32-3.got: Likewise. * ld-mips-elf/tlsdyn-o32.d: Likewise. * ld-mips-elf/tlsdyn-o32.got: Likewise. * ld-mips-elf/pie-n32.d: New file. * ld-mips-elf/pie-n64.d: Likewise. * ld-mips-elf/pie-o32.d: Likewise. * ld-mips-elf/pie.s: Likewise. * ld-mips-elf/mips-elf.exp: Add new tests.
2015-06-26Automatic date update in version.inGDB Administrator1-1/+1
2015-06-25Fix REL handling for MSP430DJ Delorie2-17/+28
* elf32-msp430.c (msp430_final_link_relocate): Fix comments. Fix REL loads to match RELA stores.
2015-06-25Don't set sh_size for .shstrtab twiceH.J. Lu2-1/+6
_bfd_elf_assign_file_positions_for_non_load will set the sh_size field for .shstrtab section. There is need to initialize it in _bfd_elf_compute_section_file_positions. * elf.c (_bfd_elf_compute_section_file_positions): Don't initialize sh_size for .shstrtab here.
2015-06-25Use strtab with GC and suffix merging for .strtabH.J. Lu4-174/+279
This patch uses ELF strtab with GC and suffix merging support to create ELF .strtab section. There is some small memory overhead to use ELF strtab: ==14928== HEAP SUMMARY: ==14928== in use at exit: 3,276,318 bytes in 679 blocks ==14928== total heap usage: 1,544 allocs, 865 frees, 15,259,146 bytes allocated vs. ==14936== HEAP SUMMARY: ==14936== in use at exit: 3,276,318 bytes in 679 blocks ==14936== total heap usage: 1,532 allocs, 853 frees, 15,026,402 bytes allocated when running: ./ld-new -m elf_x86_64 -o tmpdir/ld-partial.o -r ldgram.o ldlex-wrapper.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o plugin.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldfile.o ldcref.o eelf_x86_64.o eelf32_x86_64.o eelf_i386.o eelf_iamcu.o ei386linux.o eelf_l1om.o eelf_k1om.o ldbuildid.o The results are [32] .strtab STRTAB 0+ 3beff8 00407a 00 0 0 1 vs [32] .strtab STRTAB 0+ 3beff8 0041d8 00 0 0 1 It reduces the .strtab size by 350 bytes, about 2% Saving on libc.so from glibc is much more since libc.so has many alias symbols with the same suffix. For x32 glibc, [82] .strtab STRTAB 0+ 81b348 0159e7 00 0 0 1 vs [82] .strtab STRTAB 0+ 81b8bc 019e72 00 0 0 1 It reduces the .strtab size by 17547 bytes, about 16%. bfd/ PR gas/18451 * elf-bfd.h (elf_sym_strtab): New. (elf_link_hash_table): Add strtabcount, strtabsize and strtab. (_bfd_elf_stringtab_init): Removed. * elf.c (_bfd_elf_stringtab_init): Removed. (_bfd_elf_compute_section_file_positions): Replace bfd_strtab_hash/_bfd_elf_stringtab_init/_bfd_stringtab_free/ _bfd_stringtab_size with elf_strtab_hash/_bfd_elf_strtab_init/_bfd_elf_strtab_free/ _bfd_elf_strtab_size. Use _bfd_elf_strtab_add, _bfd_elf_strtab_finalize and _bfd_elf_strtab_offset to get st_name. (swap_out_syms): Likewise. * elflink.c (elf_final_link_info): Replace bfd_strtab_hash with elf_strtab_hash. Remove symbuf, symbuf_count, symbuf_size and shndxbuf_size. (elf_link_flush_output_syms): Removed. (elf_link_output_sym): Renamed to ... (elf_link_output_symstrtab): This. Replace _bfd_stringtab_add with _bfd_elf_strtab_add. Don't flush symbols to the file nor swap out symbols. (elf_link_swap_symbols_out): New. (elf_link_output_extsym): Replace elf_link_output_sym with elf_link_output_symstrtab. (elf_link_input_bfd): Likewise. (elf_final_link_free): Replace _bfd_stringtab_free with _bfd_elf_strtab_free. Remove symbuf. (bfd_elf_final_link): Replace _bfd_elf_stringtab_init with _bfd_elf_strtab_init. Don't set symbuf, symbuf_count, symbuf_size nor shndxbuf_size. Initialize strtabsize and strtab. Initialize symshndxbuf to -1 when number of sections >= 64K. Replace elf_link_output_sym/elf_link_output_sym with elf_link_output_symstrtab/elf_link_output_symstrtab. Don't call elf_link_flush_output_syms. Call _bfd_elf_strtab_finalize and elf_link_swap_symbols_out. Replace _bfd_stringtab_size and _bfd_stringtab_emit with _bfd_elf_strtab_size and _bfd_elf_strtab_emit. gas/testsuite/ PR gas/18451 * gas/elf/elf.exp: Run strtab. * gas/elf/strtab.d: New file. * gas/elf/strtab.s: Likewise. ld/testsuite/ PR gas/18451 * ld-elf/strtab.d: New file. * ld-elf/strtab.s: Likewise.
2015-06-25Automatic date update in version.inGDB Administrator1-1/+1
2015-06-24Silence older GCC warningH.J. Lu2-0/+8
* elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Silence older GCC warning.
2015-06-24Keep .plt section and DT_PLTGOT for prelinkH.J. Lu3-19/+48
Since the .plt section and DT_PLTGOT are used by prelink to undo prelinking for dynamic relocations, we must keep them even if there is no PLT relocation. This patch reverted commit a3747075a. bfd/ * elf32-i386.c (elf_i386_allocate_dynrelocs): Always allocate space for the first .plt entry. (elf_i386_size_dynamic_sections): Always add DT_PLTGOT for .plt section. Add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL only if there are PLT relocations. * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Always allocate space for the first .plt entry. (elf_x86_64_size_dynamic_sections): Always add DT_PLTGOT for .plt section. Add DT_PLTRELSZ, DT_PLTREL and DT_JMPREL only if there are PLT relocations. ld/testsuite/ * ld-i386/i386.exp: Run pltgot-2 for Linux targets. * ld-x86-64/x86-64.exp: Likewise. * ld-i386/pltgot-1.d: Updated. * ld-x86-64/pltgot-1.d: Likewise. * ld-i386/pltgot-2.d: New file. * ld-x86-64/pltgot-2.d: Likewise.
2015-06-24Don't convert R_X86_64_GOTPCREL if it will overflowH.J. Lu2-31/+151
When converting "mov foo@GOTPCREL(%rip), %reg" to "lea foo(%rip), %reg" with R_X86_64_PC32 relocation, it may overflow if the target section is more than 2GB away. This patch estimates distance between mov instruction and the target section. We convert R_X86_64_GOTPCREL to R_X86_64_PC32 only if their distance is less than 2GB. PR ld/18591 * elf64-x86-64.c (elf_x86_64_convert_mov_to_lea): Don't convert R_X86_64_GOTPCREL to R_X86_64_PC32 if it will cause relocation overflow.
2015-06-24Automatic date update in version.inGDB Administrator1-1/+1
2015-06-23[AArch64] Generate DT_TEXTREL for relocation against read-only sectionJiong Wang2-0/+36
2015-06-23 Jiong Wang <jiong.wang@arm.com> bfd/ * elfnn-aarch64.c (aarch64_readonly_dynrelocs): New function. (elfNN_aarch64_size_dynamic_sections): Traverse hash table to check relocations against read-only sections. ld/testsuite/ * ld-aarch64/dt_textrel.s: New testcase. * ld-aarch64/dt_textrel.d: New expectation file. * ld-aarch64/aarch64-elf.exp: Run new testcase.
2015-06-23Automatic date update in version.inGDB Administrator1-1/+1
2015-06-22Automatic date update in version.inGDB Administrator1-1/+1
2015-06-21Don't use $< in MakefilesAlan Modra3-44/+49
$< is a GNU make feature. * Makefile.am: Expand $<. * Makefile.in: Regenerate.
2015-06-21Automatic date update in version.inGDB Administrator1-1/+1
2015-06-20Automatic date update in version.inGDB Administrator1-1/+1
2015-06-19Automatic date update in version.inGDB Administrator1-1/+1