summaryrefslogtreecommitdiff
path: root/bfd
Commit message (Collapse)AuthorAgeFilesLines
* daily updateAlan Modra2014-04-151-1/+1
|
* ppc476 plt call stubsAlan Modra2014-04-142-5/+57
| | | | | | | | | | | | Fuss over bctr in call stubs. * elf32-ppc.c (BA): Define (ppc_elf_link_hash_table_create): Correct default_params. (write_glink_stub): Pad small plt call stub with "ba 0" rather than "nop" for ppc476_workaround. (ppc_elf_finish_dynamic_sections): Likewise for branch table and __glink_PLTresolve. Ensure plt call stub at end of page doesn't allow fall-thru prefetch.
* daily updateAlan Modra2014-04-141-1/+1
|
* daily updateAlan Modra2014-04-131-1/+1
|
* daily updateAlan Modra2014-04-121-1/+1
|
* PE32+ binaries that use addresses > 1^32 have a problem in that the linkerNick Clifton2014-04-112-0/+39
| | | | | | | | | | | | | | converts some address expressions into absolute values, but the PE format only stores absolutes as 32-bits. This is a partial solution which attempts to convert such absolute values back to section relative ones instead. It fails for symbols like __image_base and ImageBase__, but it is unclear as to whether these values are ever actually used by applications. PR ld/16821 * peXXigen.c (abs_finder): New function. (_bfd_XXi_swap_sym_out): For absolute symbols with values larger than 1^32 try to convert them into section relative values instead.
* Regenerate header files after this commit:Nick Clifton2014-04-113-0/+18
| | | | | | 2014-04-10 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> * reloc.c: Add BFD_RELOC_AVR_DIFF8/16/32 relocations
* Ignore non-stub sections for nios2 stub_bfd processing.Sandra Loosemore2014-04-102-10/+20
| | | | | | | | 2014-04-10 Cesar Philippidis <cesar@codesourcery.com> bfd/ * elf32-nios2.c (nios2_elf32_build_stubs): Ignore dynobjs when building function stubs.
* daily updateAlan Modra2014-04-111-1/+1
|
* bfd/ChangeLogDenis Chertykov2014-04-103-2/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * elf32-avr.c: Add DIFF relocations for AVR. (avr_final_link_relocate): Handle the DIFF relocs. (bfd_elf_avr_diff_reloc): New. (elf32_avr_is_diff_reloc): New. (elf32_avr_adjust_diff_reloc_value): Reduce difference value. (elf32_avr_relax_delete_bytes): Recompute difference after deleting bytes. * reloc.c: Add BFD_RELOC_AVR_DIFF8/16/32 relocations gas/ChangeLog * config/tc-avr.c: Add new flag mlink-relax. (md_show_usage): Add flag and help text. (md_parse_option): Record whether link relax is turned on. (relaxable_section): New. (avr_validate_fix_sub): New. (avr_force_relocation): New. (md_apply_fix): Generate DIFF reloc. (avr_allow_local_subtract): New. * config/tc-avr.h (TC_LINKRELAX_FIXUP): Define to 0. (TC_FORCE_RELOCATION): Define. (TC_FORCE_RELOCATION_SUB_SAME): Define. (TC_VALIDATE_FIX_SUB): Define. (avr_force_relocation): Declare. (avr_validate_fix_sub): Declare. (md_allow_local_subtract): Define. (avr_allow_local_subtract): Declare. gas/testsuite/ChangeLog * gas/avr/diffreloc_withrelax.d: New testcase. * gas/avr/noreloc_withoutrelax.d: Likewise. * gas/avr/relax.s: Likewise. include/ChangeLog * elf/avr.h: Add new DIFF relocs. ld/testsuite/ChangeLog * ld-avr/norelax_diff.d: New testcase. * ld-avr/relax_diff.d: Likewise. * ld-avr/relax.s: Likewise.
* daily updateAlan Modra2014-04-101-1/+1
|
* Add a time-stamp for chewAlan Modra2014-04-093-8/+23
| | | | | | | | | | | | One last time-stamp. Now none of the doc rules using move-if-change will run unnecessarily. * Makefile.am ($(MKDOC)): New rule, depend on chew.stamp. Move old rule to.. (chew.stamp): ..here. (DISTCLEANFILES): Move *.stamp.. (MOSTLYCLEANFILES): ..to here. * Makefile.in: Regenerate.
* Fix fallout from splitting ldbuildid.[ch] off elf32.em.Alan Modra2014-04-092-1/+5
| | | | | | | | | bfd/ * libcoff.h: Regenerate. ld/ * emultempl/spuelf.em: Include safe-ctype.h, remove duplicate errno.h. * emultempl/nds32elf.em: Include bfd_stdint.h. * po/POTFILES.in: Regenerate.
* bfd doc chewAlan Modra2014-04-093-136/+193
| | | | | | | | | | | | | | | | I got tired of watching chew.c being compiled a dozen or more times each time I do a binutils build. * Makefile.am (MKDOC): Use $@ in command. (aoutx.texi): New rule, depend on aoutx.stamp. Move old rule.. (aoutx.stamp): .. to here. Don't depend on chew.c, depend on MKDOC and omit recursive MAKE. Use $< in command. (archive.texi, archures.texi, bfdt.texi, cache.texi, coffcode.texi, core.texi, elf.texi, elfcode.texi, mmo.texi, format.texi, libbfd.texi, bfdio.texi, bfdwin.texi, opncls.texi, reloc.texi, section.texi, syms.texi, targets.texi, init.texi, hash.texi, linker.texi): Similarly. (DISTCLEANFILES): Remove *.stamp. * Makefile.in: Regenerate.
* daily updateAlan Modra2014-04-091-1/+1
|
* ppc476 icache workaround fix for bctrAlan Modra2014-04-092-19/+54
| | | | | | | | | | | | | | | | | | | | I got the ppc476 workaround wrong. bctr (and bctrl) as the last instruction in a page can hit the icache bug if the preceding mtctr insn is close by, and the destination is in the first few instructions on the next page. This scenario can occur with code generated by gcc to implement switch statements, or in code generated to call by function pointer. To prevent the bctr problem it is also necessary to remove other instructions that otherwise would be safe. bfd/ * elf32-ppc.c (ppc_elf_relocate_section): Remove bctr from list of safe ppc476 insns at end of page. Also remove non-branch insns. Expand comments. ld/ * emultempl/ppc32elf.em (no_zero_padding, ppc_finish): New functions. (LDEMUL_FINISH): Define.
* Add support for generating and inserting build IDs into COFF binaries.Jon TURNEY2014-04-086-4/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * peXXigen.c (pe_print_debugdata): New function: Displays the contents of the debug directory and decodes codeview entries. (_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out) (_bfd_XXi_slurp_codeview_record, _bfd_XXi_write_codeview_record): Add functions for reading and writing debugdir and codeview records. * libpei.h (_bfd_XXi_swap_debugdir_in, _bfd_XXi_swap_debugdir_out) (_bfd_XXi_write_codeview_record): Add prototypes and macros. * libcoff-in.h (pe_tdata): Add build-id data. * libcoff.h: Regenerate. * coffcode.h (coff_write_object_contents): Run build_id after_write_object_contents hook. * pe.h (external_IMAGE_DEBUG_DIRECTORY, _CV_INFO_PDB70) (_CV_INFO_PDB20): Add structures and constants for debug directory and codeview records. * internal.h (internal_IMAGE_DEBUG_DIRECTORY, CODEVIEW_INFO): Add structures and constants for internal representation of debug directory and codeview records. * emultempl/elf32.em (id_note_section_size, read_hex, write_build_id): Move code for parsing build-id option and calculating the build-id to... * ldbuildid.c: New file. * ldbuildid.h: New file. * Makefile.am (CFILES, HFILES, OFILES, ld_new_SOURCES): Add new files. * Makefile.in: Regenerate. * ld.texinfo: Update --build-id description to mention COFF support. * NEWS: Mention support for COFF build ids. * emultempl/pe.em (gld${EMULATION_NAME}_handle_option): (pecoff_checksum_contents, write_build_id, setup_build_id) (gld_${EMULATION_NAME}_after_open): Handle and implement build-id option. * emultempl/pep.em: Likewise.
* daily updateAlan Modra2014-04-081-1/+1
|
* daily updateAlan Modra2014-04-071-1/+1
|
* daily updateAlan Modra2014-04-061-1/+1
|
* Fix map file referenceAlan Modra2014-04-052-1/+6
| | | | | | | | | The testcase in pr16417 comment #6 produces a map file showing libpthread.so.0 (write@@GLIBC_2.2.5) ie. missing the file referencing the symbol. * elflink.c (_bfd_elf_add_default_symbol): Pass poldbfd when merging non-default sym.
* daily updateAlan Modra2014-04-051-1/+1
|
* mach-o: reject 64 bit targets when not configured for.Tristan Gingold2014-04-042-0/+14
| | | | | | bfd/ * mach-o.c (bfd_mach_o_header_p): Reject 64 bit target when not configured for.
* mach-o: fix section name conversion from bfd to mach-o.Tristan Gingold2014-04-042-4/+10
| | | | | | bfd/ * mach-o.c (bfd_mach_o_convert_section_name_to_mach_o): Fix thinko on names length.
* mach-o: output output_section target_index to write relocs.Tristan Gingold2014-04-043-2/+10
| | | | | | | bfd/ * mach-o-i386.c (bfd_mach_o_i386_swap_reloc_out): Use target index of output_section. * mach-o-x86-64.c (bfd_mach_o_x86_64_swap_reloc_out): Ditto.
* bfd_get_arch_size: return size from arch info on non-ELF targets.Tristan Gingold2014-04-042-4/+10
| | | | | bfd/ * bfd.c (bfd_get_arch_size): Default is taken from arch.
* daily updateAlan Modra2014-04-041-1/+1
|
* * peXXigen.c (pe_print_edata): Verify edt.name lies insideJon Turney2014-04-032-10/+33
| | | | | | | section before dereferencing. (pe_print_idata, pe_print_edata, pe_print_reloc) (rsrc_print_section): Don't bother interpreting the contents of sections which have no contents.
* This fixes a problem building large (> 2Gb) binaries on 32-bit hosts. Using aMaria Guseva2014-04-032-1/+7
| | | | | | | | | long type instead of long long meant that bfd_seek (SET) could be called with a negative offset. PR ld/16803 * elf.c (_bfd_elf_set_section_contents): Use correct type to hold file position.
* mach-o: fix section number while writing symbols.Tristan Gingold2014-04-032-7/+24
| | | | | | | | | bfd/ * mach-o.c (bfd_mach_o_mangle_symbols): Use index from output_section. (bfd_mach_o_build_seg_command): Add comment. Realign segment. Fix style. (bfd_mach_o_build_commands, bfd_mach_o_read_thread): Fix style.
* Fix sim breakageAlan Modra2014-04-033-2/+4
| | | | | | | | Replace "size_t size" with "bfd_size_type size". and here too. * bfd-in.h (bfd_elf_bfd_from_remote_memory): Likewise. * bfd-in2.h: Regenerate.
* ChangeLog missed from last commitAlan Modra2014-04-031-0/+10
|
* Fix sim breakageAlan Modra2014-04-033-5/+5
| | | | | | | | | | * elf-bfd.h (struct elf_backend_data <elf_backend_bfd_from_remote_memory>): Replace "size_t size" with "bfd_size_type size". (_bfd_elf32_bfd_from_remote_memory): Likewise. (_bfd_elf64_bfd_from_remote_memory): Likewise. * elf.c (bfd_elf_bfd_from_remote_memory): Likewise. * elfcode.h (bfd_from_remote_memory): Likewise.
* daily updateAlan Modra2014-04-031-1/+1
|
* mach-o: read and dump: prebound_dylib, prebind_cksum, twolevel_hints.Tristan Gingold2014-04-023-8/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | include/mach-o: * external.h (mach_o_prebound_dylib_command_external) (mach_o_prebind_cksum_command_external) (mach_o_twolevel_hints_command_external): New types. bfd/ * mach-o.h (bfd_mach_o_twolevel_hints_command) (bfd_mach_o_prebind_cksum_command): New types. (bfd_mach_o_prebound_dylib_command): Rewrite. (bfd_mach_o_load_command): Add prebind_cksum and twolevel_hints fields. * mach-o.c (bfd_mach_o_read_prebound_dylib): Read and decode the command. (bfd_mach_o_read_prebind_cksum): New function. (bfd_mach_o_read_twolevel_hints): Ditto. (bfd_mach_o_read_command): Handle prebind cksum and twolevel hints commands. binutils/ * od-macho.c (OPT_TWOLEVEL_HINTS): New macro. (options): Add entry for twolevel_hints. (dump_data_in_code): Fix error message. (dump_twolevel_hints): New function. (dump_load_command): Handle prebound dylib, prebind cksum and twolevel hints. (mach_o_dump): Handle twolevel hints.
* Handle VDSO section headers past end of pageAlan Modra2014-04-026-91/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a VDSO gets large enough that it doesn't entirely fit in one page, but not so large that the part described by the program header exceeds one page, then gdb/BFD doesn't read the section headers and symbol table information. This patch cures that by passing the size of the vdso to BFD, and fixes a number of other issues in the BFD code. bfd/ * elfcode.h (bfd_from_remote_memory): Add "size" parameter. Consolidate code handling possible section headers past end of segment. Don't use p_align for page size guess, instead use minpagesize. Take note of ld.so clearing section headers when p_memsz > p_filesz. Handle file header specifying no section headers. Handle zero p_align throughout. Default loadbase to zero. Add comments. Rename contents_size to high_offset, and make it a bfd_vma. Delete unnecessary bfd_set_error calls. * bfd-in.h (bfd_elf_bfd_from_remote_memory): Update prototpe. * elf-bfd.h (struct elf_backend_data <elf_backend_from_remote_memory>): Likewise. (_bfd_elf32_bfd_from_remote_memory): Likewise. (_bfd_elf64_bfd_from_remote_memory): Likewise. * elf.c (bfd_elf_bfd_from_remote_memory): Adjust. * bfd-in2.h: Regnerate. gdb/ * symfile-mem.c (symbol_file_add_from_memory): Add size parameter. Pass to bfd_elf_bfd_from_remote_memory. Adjust all callers. (struct symbol_file_add_from_memory_args): Add size field. (find_vdso_size): New function. (add_vsyscall_page): Attempt to find vdso size.
* daily updateAlan Modra2014-04-021-1/+1
|
* bfd/mach-o: avoid a crash when num == 0 in reloc.Tristan Gingold2014-04-012-2/+6
| | | | | | bfd/ * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Avoid to crash when num == 0.
* daily updateAlan Modra2014-04-011-1/+1
|
* daily updateAlan Modra2014-03-311-1/+1
|
* daily updateAlan Modra2014-03-301-1/+1
|
* daily updateAlan Modra2014-03-291-1/+1
|
* daily updateAlan Modra2014-03-281-1/+1
|
* Add support for limited pretty-printing of ARM PLT entries on eabi and nacl ↵Yury Gribov2014-03-272-14/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | targets. * elf32-arm.c (elf32_arm_get_synthetic_symtab): Add new callback. (elf32_arm_nacl_plt_sym_val): Likewise. (elf32_arm_plt0_size): Add helper function. (elf32_arm_plt_size): Likewise. * ld-arm/arm-app-abs32.d: Updated test. * ld-arm/arm-app.d: Likewise. * ld-arm/arm-lib-plt32.d: Likewise. * ld-arm/arm-lib.d: Likewise. * ld-arm/armthumb-lib.d: Likewise. * ld-arm/cortex-a8-fix-b-plt.d: Likewise. * ld-arm/cortex-a8-fix-bcc-plt.d: Likewise. * ld-arm/cortex-a8-fix-bl-plt.d: Likewise. * ld-arm/cortex-a8-fix-bl-rel-plt.d: Likewise. * ld-arm/cortex-a8-fix-blx-plt.d: Likewise. * ld-arm/farcall-mixed-app-v5.d: Likewise. * ld-arm/farcall-mixed-app.d: Likewise. * ld-arm/farcall-mixed-lib-v4t.d: Likewise. * ld-arm/farcall-mixed-lib.d: Likewise. * ld-arm/ifunc-10.dd: Likewise. * ld-arm/ifunc-14.dd: Likewise. * ld-arm/ifunc-15.dd: Likewise. * ld-arm/ifunc-3.dd: Likewise. * ld-arm/ifunc-4.dd: Likewise. * ld-arm/ifunc-7.dd: Likewise. * ld-arm/ifunc-8.dd: Likewise. * ld-arm/ifunc-9.dd: Likewise. * ld-arm/long-plt-format.d: Likewise. * ld-arm/mixed-app-v5.d: Likewise. * ld-arm/mixed-app.d: Likewise. * ld-arm/mixed-lib.d: Likewise. * ld-arm/thumb2-bl-undefweak.d: Likewise. * ld-arm/thumb2-bl-undefweak1.d: Likewise.
* Mach-O: disp dyld environment command in objdump -P load.Tristan Gingold2014-03-272-3/+6
| | | | | | | | | | bfd/ * mach-o.c (bfd_mach_o_read_dylinker): Remove assert. (bfd_mach_o_read_command): Handle BFD_MACH_O_LC_DYLD_ENVIRONMENT. binutils/ * od-macho.c (dump_load_command): Display value for BFD_MACH_O_LC_DYLD_ENVIRONMENT. Handle BFD_MACH_O_LC_DATA_IN_CODE and BFD_MACH_O_LC_DYLIB_CODE_SIGN_DRS.
* Mach-O: add objdump -P function_starts to display function starts.Tristan Gingold2014-03-273-5/+48
| | | | | | | | | | | | | | | | | | | | | bfd/ * mach-o.h (bfd_mach_o_get_base_address): New prototype. * mach-o.c (bfd_mach_o_write_symtab) (bfd_mach_o_write_contents) (bfd_mach_o_set_section_flags_from_bfd) (bfd_mach_o_build_seg_command): Fix indentation. (bfd_mach_o_get_base_address): New function. binutils/ * od-macho.c (OPT_FUNCTION_STARTS): New macro. (options): Add entry for function_starts. (mach_o_help): Ditto. (disp_segment_prot): New function. (dump_section_map): Call disp_segment_prot. (dump_function_starts): New function. (dump_obj_compact_unwind): Fix ouput indentation. (dump_exe_compact_unwind): Fix ouput indentation. (mach_o_dump): Handle function_starts.
* daily updateAlan Modra2014-03-271-1/+1
|
* This fixes a problem for 64-bit Cygwin, where building some packages canNick Clifton2014-03-262-0/+10
| | | | | | | | | | produce spurious errors about truncated relocations. The relocations are only truncated because they are being made against sections which are going to be discarded so that base address is zero instead of the expected 64-bit base value. * cofflink.c (_bfd_coff_generic_relocate_section): Skip relocations in discarded sections.
* Mach-O: Add BFD_MACH_O_CPU_TYPE_ARM64.Tristan Gingold2014-03-262-0/+9
| | | | | | | | | | | | include/mach-o/ * loader.h (bfd_mach_o_cpu_type): Add BFD_MACH_O_CPU_TYPE_ARM64. bfd/ * mach-o.c (bfd_mach_o_convert_architecture): Add BFD_MACH_O_CPU_TYPE_ARM64. binutils/ * od-macho.c (bfd_mach_o_cpu_name): Add BFD_MACH_O_CPU_TYPE_ARM64.
* Referencing a function's address on PowerPC64 ELFv2Alan Modra2014-03-272-43/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | ELFv2 needs to create plt entries in a non-PIC executable for an address reference to a function defined in a shared object. It's possible that an object file has no features that distinguish it as ELFv1 or ELFv2, eg. an object only containing data. Such files need to be handled like those that are known to be ELFv2. However, this unnecessarily creates plt entries for the analogous ELFv1 case, so arrange to set output abi version earlier, and use the output abi version to further distinguish ambiguous input files. bfd/ * elf64-ppc.c (ppc64_elf_check_relocs): Account for possibly needed plt entries when taking the address of functions for abiversion == 0 (ie. unknown) as well as abiversion == 2. Move opd setup and abiversion checks to.. (ppc64_elf_before_check_relocs): ..here. Renamed from ppc64_elf_process_dot_syms. Set output abiversion from input and input abiversion from output, if either is not set. (ppc64_elf_merge_private_bfd_data): Don't merge flags here. (elf_backend_check_directives): Update. ld/testsuite/ * ld-powerpc/startv1.s, * ld-powerpc/startv2.s, * ld-powerpc/funref.s, * ld-powerpc/funv1.s, * ld-powerpc/funv2.s, * ld-powerpc/ambiguousv1.d, * ld-powerpc/ambiguousv2.d: New test files. * ld-powerpc/powerpc.exp: Run new tests.