aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2014-07-24daily updateAlan Modra1-1/+1
2014-07-23daily updateAlan Modra1-1/+1
2014-07-22daily updateAlan Modra1-1/+1
2014-07-22Add or reactivate or1k-*-rtems*Joel Sherrill2-3/+7
* bfd/config.bfd (or1k-*-rtems*): Reactivate. * gas/configure.tgt (or1k-*-rtems*): Add. Signed-off-by: Christian Svensson <blue@cmd.nu>
2014-07-21daily updateAlan Modra1-1/+1
2014-07-20daily updateAlan Modra1-1/+1
2014-07-19daily updateAlan Modra1-1/+1
2014-07-18daily updateAlan Modra1-1/+1
2014-07-17daily updateAlan Modra1-1/+1
2014-07-16Match PLT entry only for ELFOSABI_GNU inputH.J. Lu3-0/+19
* elf32-i386.c (elf_i386_plt_sym_val): Match PLT entry only for ELFOSABI_GNU input. * elf64-x86-64.c (elf_x86_64_plt_sym_val): Likewise. (elf_x86_64_plt_sym_val_offset_plt_bnd): Likewise.
2014-07-16Properly match PLT entry against .got.plt relocationH.J. Lu3-14/+122
Relocations against .got.plt section may not be in the same order as entries in PLT section. It is incorrect to assume that the Ith reloction index against .got.plt section always maps to the (I + 1)th entry in PLT section. This patch matches the .got.plt relocation offset/index in PLT entry against the index in .got.plt relocation table. It only checks R_*_JUMP_SLOT and R_*_IRELATIVE relocations. It ignores R_*_TLS_DESC and R_*_TLSDESC relocations since they have different PLT entries. bfd/ PR binutils/17154 * elf32-i386.c (elf_i386_plt_sym_val): Only match R_*_JUMP_SLOT and R_*_IRELATIVE relocation offset with PLT entry. * elf64-x86-64.c (elf_x86_64_plt_sym_val): Likewise. (elf_x86_64_plt_sym_val_offset_plt_bnd): New. (elf_x86_64_get_synthetic_symtab): Use it. ld/testsuite/ PR binutils/17154 * ld-ifunc/pr17154-i386.d: New file. * ld-ifunc/pr17154-x86-64.d: Likewise. * ld-ifunc/pr17154-x86.s: Likewise. * ld-x86-64/bnd-ifunc-2.d: Likewise. * ld-x86-64/bnd-ifunc-2.s: Likewise. * ld-x86-64/mpx.exp: Run bnd-ifunc-2. * ld-x86-64/tlsdesc-nacl.pd: Updated. * ld-x86-64/tlsdesc.pd: Likewise.
2014-07-16daily updateAlan Modra1-1/+1
2014-07-15Update elf_i386_compute_jump_table_sizeH.J. Lu2-1/+7
Commit e1f987424b7b3f5ac63a2a6ae044a202a44b8ff8 changed how next_tls_desc_index was set up. This patch updates elf_i386_compute_jump_table_size to use elf.srelplt->reloc_count instead of next_tls_desc_index. bfd/ PR ld/17057 * elf32-i386.c (elf_i386_compute_jump_table_size): Replace next_tls_desc_index with elf.srelplt->reloc_count. ld/testsuite/ PR ld/17057 * ld-i386/i386.exp: Run pr17057. * ld-i386/pr17057.d: New file. * ld-i386/pr17057.s: Likewise.
2014-07-15Account for trailing bytes read from bfd_breadAlan Modra2-2/+7
* cache.c (cache_bread_1): Don't return -1 when fread returns a positive value.
2014-07-15tidy elf_merge_st_otherAlan Modra2-33/+29
So that we munge isym->st_other once per symbol. * elflink.c (elf_merge_st_other): Update comments. Simplify visibility handling. Make isym const. Move code modifying isym->st_other for --exclude-libs to.. (elf_link_add_object_symbols): ..here.
2014-07-15daily updateAlan Modra1-1/+1
2014-07-14daily updateAlan Modra1-1/+1
2014-07-13daily updateAlan Modra1-1/+1
2014-07-12daily updateAlan Modra1-1/+1
2014-07-12Fix typo in _bfd_elf_strtab_addMaks Naumov2-1/+6
PR 17141 * elf.c (_bfd_elf_strtab_add): Check strtab name for failure.
2014-07-11daily updateAlan Modra1-1/+1
2014-07-10daily updateAlan Modra1-1/+1
2014-07-09daily updateAlan Modra1-1/+1
2014-07-08This fixes PR 17110 which shows that the SH section relocation code can be ↵Nick Clifton2-1/+9
called for input BFDs as well as output BFDs. PR ld/17110 * elf32-sh.c (sh_elf_osec_to_segment): Do not look for output segments in input bfds.
2014-07-08ld/ARM: Increase maximum page size to 64kBWill Newton2-3/+6
Increase the maximum page size to 64kB and align the TEXT_START_ADDR to a 64kB boundary. This brings AArch32 in line with AArch64 and improves compatability under certain conditions. bfd/ChangeLog: 2014-07-08 Will Newton <will.newton@linaro.org> * elf32-arm.c (ELF_MAXPAGESIZE): Increase the default value to 64kB and remove custom setting for NaCl. ld/ChangeLog: 2014-07-08 Will Newton <will.newton@linaro.org> * emulparams/armelf_linux.sh (TEXT_START_ADDR): Increase alignment to 64kB boundary. ld/testsuite/ChangeLog: 2014-07-08 Will Newton <will.newton@linaro.org> * ld-arm/arm-lib.ld: Increase MAXPAGESIZE value to match bfd. * ld-arm/cortex-a8-fix-bl-rel-plt.d: Update offsets to take into account increased segment alignment. * ld-arm/ifunc-gdesc.r: Likewise. * ld-arm/tls-lib.d: Likewise.
2014-07-08Copy st_other for linker script symbol assignmentsAlan Modra5-13/+30
This fixes a problem seen on powerpc64le ELFv2 when creating a function symbol alias with ld --defsym. st_other needs to be copied from the source symbol to the alias in order to set up the local entry offset for the alias. I decided to make this change in the generic ELF code rather than in elf64-ppc.c since it looks like other targets that use st_other bits might benefit too. bfd/ * elflink.c (_bfd_elf_copy_link_hash_symbol_type): Copy st_other bits from source to dest. * linker.c (_bfd_generic_copy_link_hash_symbol_type): Update comment. * targets.c (struct bfd_target <_bfd_copy_link_hash_symbol_type>): Likewise. * bfd-in2.h: Regenerate. ld/testsuite/ * ld-powerpc/defsym.s, * ld-powerpc/defsym.d: New test. * ld-powerpc/powerpc.exp: Run it.
2014-07-08Enable elf_backend_rela_normal for AArch64Jiong Wang2-9/+8
If we are generating non-relocatable object and --emit-relocs specified, aarch64 ld is actually generating wrong addend for rela entry when relocate against local symbol. for example, for simple testcase foo.c === const char * const a = "foo"; const char * foo () { return a; } bar.c === const char * const b = "bar"; const char * bar () { return b; } aarch64-none-linux-gnu-ld --emit-relocs -o x.o foo.o bar.o aarch64-none-linux-gnu-readelf -r x.o ... R_AARCH64_ADR_PRE 0000000000400018 .rodata + 0 ... R_AARCH64_ADD_ABS 0000000000400018 .rodata + 0 ... R_AARCH64_ADR_PRE 0000000000400018 .rodata + 0 ... R_AARCH64_ADD_ABS 0000000000400018 .rodata + 0 while it should be: ... R_AARCH64_ADR_PRE 0000000000400018 .rodata + 0 ... R_AARCH64_ADD_ABS 0000000000400018 .rodata + 0 ... R_AARCH64_ADR_PRE 0000000000400018 .rodata + 10 ... R_AARCH64_ADD_ABS 0000000000400018 .rodata + 10 bfd generic code could actually handle this properly, but only when elf_backend_rela_normal set to '1'. this patch enable this and remove those target specific hack. bfd/ * elfnn-aarch64.c (elf_backend_rela_normal): Set to 1. (elfNN_aarch64_relocate_section): Remove duplicated addend adjustment when info->relocatable be true. ld/testsuite/ * ld-aarch64/emit-relocs-local-addend-bar.s: * New source file. * ld-aarch64/emit-relocs-local-addend-foo.s: * Likewise. * ld-aarch64/emit-relocs-local-addend.d: * New testcase. * ld-aarch64/local-addend-r.d: Likewise.
2014-07-08daily updateAlan Modra1-1/+1
2014-07-07Adds support for writing values to AVR system I/O registers.Barney Stratford5-2/+78
* elf32-avr.c: Handle R_AVR_PORT5 and R_AVR_PORT6. * reloc.c: Add BFD_RELOC_AVR_PORT5 and BFD_RELOC_AVR_PORT6. * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. * avr.h: Add R_AVR_PORT5 and R_AVR_PORT6. * config/tc-avr.c (avr_operand): Permit referring to r26-r31 by name as [xyz][hl]. Permit using a symbol whoes name begins with `r' to refer to a register. Allow arbitrary expressions for the P and p operators. (md_apply_fix): Check the BFD_RELOC_AVR_PORT5 and BFD_RELOC_AVR_PORT6 relocations.
2014-07-07daily updateAlan Modra1-1/+1
2014-07-06daily updateAlan Modra1-1/+1
2014-07-05daily updateAlan Modra1-1/+1
2014-07-04Update "configure.in" in comments and docoAlan Modra9-9/+20
bfd/ * Makefile.am: Update "configure.in" comments. * PORTING: Likewise. * aoutx.h: Likewise. * configure.host: Likewise. * doc/bfdint.texi: Likewise. * targets.c: Likewise. * warning.m4: Likewise. * Makefile.in: Regenerate. gas/ * doc/internals.texi: Update "configure.in" comments. * acinclude.m4: Likewise. * config/tc-sparc.c: Likewise. ld/ * configure.ac: Update "configure.in" comments. * configure: Regenerate.
2014-07-04Rename configure.in to configure.acAlan Modra5-3/+10
bfd/ * configure.ac: Rename from configure.in. * Makefile.in: Regenerate. * config.in: Regenerate. * doc/Makefile.in: Regenerate. opcodes/ * configure.ac: Rename from configure.in. * Makefile.in: Regenerate. * config.in: Regenerate. binutils/ * configure.ac: Rename from configure.in. * Makefile.in: Regenerate. * config.in: Regenerate. * doc/Makefile.in: Regenerate. gas/ * configure.ac: Rename from configure.in. * Makefile.in: Regenerate. * config.in: Regenerate. * doc/Makefile.in: Regenerate. gprof/ * configure.ac: Rename from configure.in. * configure.ac: Rename from configure.in. * Makefile.in: Regenerate. * gconfig.in: Regenerate. ld/ * configure.ac: Rename from configure.in. * Makefile.in: Regenerate. * config.in: Regenerate.
2014-07-04Remove some more bfd/configure.in dependenciesAlan Modra3-8/+9
Missed from 2e98a7bd bfd/ * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove configure.in. * Makefile.in: Regenerate. gas/ * doc/Makefile.am (CONFIG_STATUS_DEPENDENCIES): Delete. * doc/Makefile.in: Regenerate.
2014-07-04Use modern AC_INIT in configure.inAlan Modra6-13/+21
This removes usage of the obsolete AC_INIT and AM_INIT_AUTOMAKE in all binutils configure.in files. The BFD version is now in bfd/version.m4 rather than bfd/configure.in, which allows automake to automatically track this dependency. bfd/ * version.m4: New file. * configure.in: Include version.m4. (AC_INIT): Update. * Makefile.am (RELEASE): Delete. (bfdver.h): Depend on development.sh, use instead of RELEASE. * Makefile.in: Regenerate. * doc/Makefile.in: Regenerate. opcodes/ * configure.in: Include bfd/version.m4. (AC_INIT, AM_INIT_AUTOMAKE): Use modern form. (BFD_VERSION): Delete. * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in. * configure: Regenerate. * Makefile.in: Regenerate. binutils/ * configure.in: Include bfd/version.m4. (AC_INIT, AM_INIT_AUTOMAKE): Use modern form. (BFD_VERSION): Delete. * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in. * configure: Regenerate. * Makefile.in: Regenerate. * doc/Makefile.in: Regenerate. gas/ * configure.in: Include bfd/version.m4. (AC_INIT, AM_INIT_AUTOMAKE): Use modern form. (BFD_VERSION): Delete. * configure.com: Get bfd version from bfd/version.m4. * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in. * configure: Regenerate. * Makefile.in: Regenerate. * doc/Makefile.in: Regenerate. gprof/ * configure.in: Include bfd/version.m4. (AC_INIT, AM_INIT_AUTOMAKE): Use modern form. (BFD_VERSION): Delete. * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in. * configure: Regenerate. * Makefile.in: Regenerate. ld/ * configure.in: Include bfd/version.m4. (AC_INIT, AM_INIT_AUTOMAKE): Use modern form. (BFD_VERSION): Delete. * Makefile.am (CONFIG_STATUS_DEPENDENCIES): Remove bfd/configure.in. * configure: Regenerate. * Makefile.in: Regenerate.
2014-07-04daily updateAlan Modra1-1/+1
2014-07-03daily updateAlan Modra1-1/+1
2014-07-02Taking an undefined function's address in an executableAlan Modra3-10/+40
doesn't always mean you need to define a function symbol on plt code. If all references are in read-write sections, then using dynamic relocs is OK. bfd/ * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Clear pointer_equality_needed when !readonly_dynrelocs. * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Likewise. ld/testsuite/ * ld-powerpc/ambiguousv1.d: Match symbol table too. * ld-powerpc/ambiguousv2.d: Likewise. * ld-powerpc/ambiguousv1b.d: New. * ld-powerpc/ambiguousv2b.d: New. * ld-powerpc/powerpc.exp: Run new tests.
2014-07-02Set DF_STATIC_TLS for PIEsAlan Modra3-6/+10
If we can dlopen an object then DF_STATIC_TLS is relevant. * elf32-ppc.c (ppc_elf_check_relocs): Set DF_STATIC_TLS for PIEs too. * elf64-ppc.c (ppc64_elf_check_relocs): Likewise.
2014-07-02daily updateAlan Modra1-1/+1
2014-07-01Reorganise struct bfdAlan Modra4-124/+120
for better packing. Removes a field and a flag that are never set. bfd/ * bfd.c (struct bfd): Reorganise for better packing. Delete "ifd" field. Make "format", "direction" and "flags" bitfields. (HAS_LOAD_PAGE): Delete, renumber following flags. * bfd-in2.h: Regenerate. * coff-tic4x.c: Remove HAS_LOAD_PAGE from extra flags in target vecs. binutils/ * objdump.c (dump_bfd_header): Don't print HAS_LOAD_PAGE.
2014-07-01Add symbols for global entry stub, and report statsAlan Modra2-5/+42
The undefined function symbols (with non-zero value) on global entry stubs are discarded by objdump when disassembling, so give objdump another symbol to mark the stubs. Also fixes a couple of bugs: - entry_section was set to .opd for ELFv2, which meant a hard error rather than a warning when _start wasn't defined. - global entry stubs were not built if they were the only type of stub in an executable. bfd/ * elf64-ppc.c (ppc_stub_type): Add ppc_stub_global_entry. (struct ppc_link_hash_table): Increase size of stub_count array. (build_global_entry_stubs): Emit symbol on global entry stub. (ppc64_elf_build_stubs): NULL check htab->brlt. Add global entry stub stats. ld/ * emultempl/ppc64elf.em (stub_added): Delete. (gld${EMULATION_NAME}_finish): Call ppc64_elf_build_stubs even when none of the usual stubs have been added. Only change entry_section for ELFv1.
2014-07-01Linker foreign output format support for PowerPC64 ELFv2Alan Modra2-19/+61
Makes the ld srec tests pass. Uses a horrible scan through symbols to find ELF fields for symbol definitions, but the generic linker doesn't offer anything better. Might be slow. Anyway, sane people will link to ELF output then objcopy to convert formats. * elf64-ppc.c (abiversion, set_abiversion): Move earlier. (ppc64_elf_branch_reloc): Adjust addend for ELFv2 local offset. (ppc64_elf_set_toc): Set ".TOC." symbol value when using generic linker. (ppc64_elf_relocate_section): Disable ELFv2 function entry optimisation when --traditional-format.
2014-07-01Add support for the AVR Tiny series of microcontrollers.Barney Stratford7-77/+137
* archures.c: add avrtiny architecture for avr target. * bfd-in2.h: Regenerate. * cpu-avr.c (arch_info_struct): add avrtiny arch info. * elf32-avr.c (elf_avr_howto_table): new relocation R_AVR_LDS_STS_16 added for 16 bit LDS/STS instruction of avrtiny arch. (avr_reloc_map): reloc R_AVR_LDS_STS_16 is mapped to BFD_RELOC_AVR_LDS_STS_16. (bfd_elf_avr_final_write_processing): select machine number avrtiny arch. (elf32_avr_object_p): set machine number for avrtiny arch. * libbfd.h: Regenerate. * reloc.c: Add documentation for BFD_RELOC_AVR_LDS_STS_16 reloc. * config/tc-avr.c (mcu_types): Add avrtiny arch. Add avrtiny arch devices attiny4, attiny5, attiny9, attiny10, attiny20 and attiny40. (md_show_usage): Add avrtiny arch in usage message. (avr_operand): validate and issue error for invalid register for avrtiny. add new reloc exp for 16 bit lds/sts instruction. (md_apply_fix): check 16 bit lds/sts operand for out of range and encode. (md_assemble): check ISA for arch and issue diagnostic. * include/elf/avr.h (E_AVR_MACH_AVRTINY): define avrtiny machine number. (R_AVR_LDS_STS_16): define 16 bit lds/sts reloc number. * include/opcode/avr.h (AVR_ISA_TINY): define avrtiny specific ISA. (AVR_ISA_2xxxa): define ISA without LPM. (AVR_ISA_AVRTINY): define avrtiny arch ISA. Add doc for contraint used in 16 bit lds/sts. Adjust ISA group for icall, ijmp, pop and push. Add 16 bit lds/sts encoding and update 32 bit lds/sts constraints. * opcodes/avr-dis.c (avr_operand): Handle constraint j for 16 bit lds/sts. (print_insn_avr): do not select opcode if insn ISA is avrtiny and machine is not avrtiny. * Makefile.am (ALL_EMULATION_SOURCES): add avrtiny emulation source. (eavrtiny.c): add rules for avrtiny emulation source. * Makefile.in: Regenerate. * configure.tgt: Add avrtiny to avr target emulations. * scripttempl/avrtiny.sc: New file. linker script template for avrtiny arch. * emulparams/avrtiny.sh: New file. emulation parameters for avrtiny arch.
2014-07-01daily updateAlan Modra1-1/+1
2014-06-30daily updateAlan Modra1-1/+1
2014-06-28daily updateAlan Modra1-1/+1
2014-06-27daily updateAlan Modra1-1/+1
2014-06-26Fixes a problem displaying the contents of a binary containing corrupt debugNick Clifton2-4/+25
information, specifically a DW_AT_MIPS_linkage_name attribute that has a numeric value rather than a string value. PR binutils/16949 * dwarf2.c (is_str_attr): New function. (find_abstract_instance_name): Use it to determine when an attribute has a string value.