aboutsummaryrefslogtreecommitdiff
path: root/bfd
AgeCommit message (Collapse)AuthorFilesLines
2018-05-02Automatic date update in version.inGDB Administrator1-1/+1
2018-05-01Automatic date update in version.inGDB Administrator1-1/+1
2018-04-30This patch adds support to objdump for disassembly of NFP (Netronome Flow ↵Francois H. Theron14-332/+656
Processor) ELF files (.nffw) as well as some basic readelf support. bfd * Makefile.am: Added NFP files to build. * archures.c: Added bfd_arch_nfp * config.bfd: Added NFP support. * configure.ac: Added NFP support. * cpu-nfp.c: New, for NFP support. * elf-bfd.h: Added elf_section_info() * elf64-nfp.c: New, for NFP support. * po/SRC-POTFILES.in: Added NFP source files. * targets.c: Added nfp_elf64_vec * bfd-in2.h: Regenerate. * Makefile.in: Regenerate. * configure: Regenerate. binutils* readelf.c: Very basic support for EM_NFP and its section types. * testsuite/binutils-all/nfp: New directory. * testsuite/binutils-all/nfp/objdump.exp: New file. Run new tests. * testsuite/binutils-all/nfp/test2_ctx8.d: New file. * testsuite/binutils-all/nfp/test2_no-pc_ctx4.d: New file. * testsuite/binutils-all/nfp/test1.d: New file. * testsuite/binutils-all/nfp/nfp6000.nffw: New file. * testsuite/binutils-all/nfp/test2_nfp6000.nffw: New file. * NEWS: Mention the new support. include * dis-asm.h: Added print_nfp_disassembler_options prototype. * elf/common.h: Added EM_NFP, officially assigned. See Google Group Generic System V Application Binary Interface. * elf/nfp.h: New, for NFP support. * opcode/nfp.h: New, for NFP support. opcodes Makefile.am: Added nfp-dis.c. configure.ac: Added bfd_nfp_arch. disassemble.h: Added print_insn_nfp prototype. disassemble.c: Added ARCH_nfp and call to print_insn_nfp nfp-dis.c: New, for NFP support. po/POTFILES.in: Added nfp-dis.c to the list. Makefile.in: Regenerate. configure: Regenerate.
2018-04-30Automatic date update in version.inGDB Administrator1-1/+1
2018-04-29Automatic date update in version.inGDB Administrator1-1/+1
2018-04-28Automatic date update in version.inGDB Administrator1-1/+1
2018-04-27Regenerate some files for recent ARM patchesAlan Modra3-1/+13
bfd/ * bfd-in2.h: Regenerate. * libbfd.h: Regenerate. ld/ * po/BLD-POTFILES.in: Regenerate.
2018-04-27PR23123, PowerPC32 ifunc regressionAlan Modra3-7/+15
Two of the gcc ifunc tests fail for ppc32, due to my pr22374 fix being a little too enthusiastic in trimming PLT entries. ppc64 doesn't have the same failures because ppc64_elf_check_relocs happens to set needs_plt for any ifunc reloc. PR 23123 PR 22374 * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't drop plt relocs for ifuncs. * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Comment fixes.
2018-04-27Automatic date update in version.inGDB Administrator1-1/+1
2018-04-26PPC64: always make synthetic .text symbols for GNU ifunc symbolsPedro Alves2-6/+21
If you create an ifunc using GCC's __attribute__ ifunc, like: extern int gnu_ifunc (int arg); static int gnu_ifunc_target (int arg) { return 0; } __typeof (gnu_ifunc) *gnu_ifunc_resolver (unsigned long hwcap) { return gnu_ifunc_target; } __typeof (gnu_ifunc) gnu_ifunc __attribute__ ((ifunc ("gnu_ifunc_resolver"))); then you end up with two (function descriptor) symbols, one for the ifunc itself, and another for the resolver: (...) 12: 0000000000020060 104 FUNC GLOBAL DEFAULT 18 gnu_ifunc_resolver (...) 16: 0000000000020060 104 GNU_IFUNC GLOBAL DEFAULT 18 gnu_ifunc (...) Both ifunc and resolver symbols have the same address/value, so ppc64_elf_get_synthetic_symtab only creates a synthetic text symbol for one of them. In the case above, it ends up being created for the resolver, only: (gdb) maint print msymbols (...) [ 7] t 0x980 .frame_dummy section .text [ 8] T 0x9e4 .gnu_ifunc_resolver section .text [ 9] T 0xa58 __glink_PLTresolve section .text (...) GDB needs to know when a program stepped into an ifunc resolver, so that it can know whether to step past the resolver into the target function without the user noticing. The way GDB does it is my checking whether the current PC points to an ifunc symbol (since resolver and ifunc have the same address by design). The problem is then that ppc64_elf_get_synthetic_symtab never creates the synchetic symbol for the ifunc, so GDB stops stepping at the resolver (in a test added by the following patch): (gdb) step gnu_ifunc_resolver (hwcap=21) at gdb/testsuite/gdb.base/gnu-ifunc-lib.c:33 33 { (gdb) FAIL: gdb.base/gnu-ifunc.exp: resolver_attr=1: resolver_debug=1: final_debug=0: step After this commit, we get: [ 8] i 0x9e4 .gnu_ifunc section .text [ 9] T 0x9e4 .gnu_ifunc_resolver section .text And stepping an ifunc call takes to the final function: (gdb) step 0x00000000100009e8 in .final () (gdb) PASS: gdb.base/gnu-ifunc.exp: resolver_attr=1: resolver_debug=1: final_debug=0: step An alternative to touching bfd I considered was for GDB to check whether there's an ifunc data symbol / function descriptor that points to the current PC, whenever the program stops, but discarded it because we'd have to do a linear scan over .opd over an over to find a matching function descriptor for the current PC. At that point I considered caching that info, but quickly dismissed it as then that has no advantage (memory or performance) over just creating the synthetic ifunc text symbol in the first place. I ran the binutils and ld testsuites on PPC64 ELFv1 (machine gcc110 on the GCC compile farm), and saw no regressions. This commit is part of a GDB patch series that includes GDB tests that fail without this fix. bfd/ChangeLog: 2018-04-26 Pedro Alves <palves@redhat.com> * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't consider ifunc and non-ifunc symbols duplicates.
2018-04-26Automatic date update in version.inGDB Administrator1-1/+1
2018-04-25[ARM] FDPIC: Implement Thumb-only PLT for FDPIC.Christophe Lyon2-21/+52
2018-04-25 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> bfd/ * elf32-arm.c (elf32_arm_fdpic_thumb_plt_entry): New. (elf32_arm_plt_needs_thumb_stub_p): Handle thumb-only case. (elf32_arm_populate_plt_entry): Likewise. (elf32_arm_output_plt_map_1): Likewise. (elf32_arm_output_arch_local_syms): Likewise. ld/testsuite/ * arm-elf.exp: Execute the new FDPIC Thumb-only tests. * fdpic-main-m.d: New test. * fdpic-main-m.s: New. * fdpic-main-m.sym: New. * fdpic-shared-m.d: New test. * fdpic-shared-m.s: New. * fdpic-shared-m.sym: New.
2018-04-25[ARM] FDPIC: Make _GLOBAL_OFFSET_TABLE_ a relative symbolChristophe Lyon2-3/+9
2018-04-25 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> bfd/ * elf32-arm.c (elf32_arm_finish_dynamic_symbol): Handle _GLOBAL_OFFSET_TABLE_ in FDPIC mode.
2018-04-25[ARM] FDPIC: Translate R_ARM_TARGET2 relocation into R_ARM_GOT32 relocation ↵Christophe Lyon2-1/+9
for FDPIC platform 2018-04-25 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> bfd/ * elf32-arm.c (bfd_elf32_arm_set_target_params): Handle FDPIC case for R_ARM_TARGET2.
2018-04-25[ARM] FDPIC: Add stack segmentChristophe Lyon2-0/+19
The size of the stack segment defaults to 32KB, and can be overridden by defining the __stacksize symbol. 2018-04-25 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> bfd/ * elf32-arm.c (DEFAULT_STACK_SIZE): New. (elf32_arm_always_size_sections): Create stack segment.
2018-04-25[ARM] Add TLS relocations for FDPIC.Christophe Lyon4-12/+95
Define and handle TLS relocations for FDPIC in BFD and gas. In gas, the new relocations are rejected if the --fdpic option was not specified. We also define the __tdata_start symbol to mark the start of the .tdata section. This allows FDPIC static binaries to find the start of .tdata section, since phdr->p_vaddr of TLS segment is not a valid value for FDPIC. 2018-04-25 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> bfd/: * bfd-in2.h (BFD_RELOC_ARM_TLS_GD32_FDPIC) (BFD_RELOC_ARM_TLS_LDM32_FDPIC, BFD_RELOC_ARM_TLS_IE32_FDPIC): New relocations. * elf32-arm.c (elf32_arm_howto_table_2): Add R_ARM_TLS_GD32_FDPIC, R_ARM_TLS_LDM32_FDPIC, R_ARM_TLS_IE32_FDPIC relocations. (elf32_arm_reloc_map): Add R_ARM_TLS_GD32_FDPIC, R_ARM_TLS_LDM32_FDPIC, R_ARM_TLS_IE32_FDPIC. (struct elf32_arm_link_hash_table): Update comment. (elf32_arm_final_link_relocate): Handle TLS FDPIC relocations. (IS_ARM_TLS_RELOC): Likewise. (elf32_arm_check_relocs): Likewise. (allocate_dynrelocs_for_symbol): Likewise. (elf32_arm_size_dynamic_sections): Update comment. * reloc.c: Add BFD_RELOC_ARM_TLS_GD32_FDPIC, BFD_RELOC_ARM_TLS_LDM32_FDPIC, BFD_RELOC_ARM_TLS_IE32_FDPIC. gas/ * config/tc-arm.c (reloc_names): Add TLSGD_FDPIC, TLSLDM_FDPIC, GOTTPOFF_FDIC relocations. (md_apply_fix): Handle the new TLS FDPIC relocations. (tc_gen_reloc): Likewise. (arm_fix_adjustable): Likewise. include/ * elf/arm.h: Add R_ARM_TLS_GD32_FDPIC, R_ARM_TLS_LDM32_FDPIC, R_ARM_TLS_IE32_FDPIC. ld/ * scripttempl/elf.sc: Define __tdata_start for .tdata section.
2018-04-25[ARM] Implement PLT for FDPIC.Christophe Lyon2-9/+152
FDPIC requires special PLT entries, defined in this patch. Note that lazy binding is not supported because of a race condition for lack of an atomic 64-bits load instruction. 2018-04-25 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> bfd/ * elf32-arm.c (elf32_arm_fdpic_plt_entry): New. (elf32_arm_create_dynamic_sections): Handle FDPIC. (elf32_arm_allocate_plt_entry): Likewise. (elf32_arm_populate_plt_entry): Likewise. (elf32_arm_output_plt_map_1): Likewise.
2018-04-25[ARM] Implement FDPIC relocations.Christophe Lyon2-29/+720
This is the main BFD patch, that enables the linker to actually handle the FDPIC relocations. 2018-04-25 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> bfd/ * elf32-arm.c (struct fdpic_local): New. (elf_arm_obj_tdata): Add local_fdpic_cnts field. (elf32_arm_local_fdpic_cnts): New. (struct fdpic_global): New. (elf32_arm_link_hash_entry): Add fdpic_cnts field. (elf32_arm_link_hash_table): Add srofixup field. (arm_elf_add_rofixup): New. (arm_elf_fill_funcdesc): New. (elf32_arm_link_hash_newfunc): Handle fdpic_cnts. (elf32_arm_allocate_local_sym_info): Likewise. (create_got_section): Create .rofixup section. (elf32_arm_copy_indirect_symbol): Handle fdpic_cnts. (bfd_elf32_arm_set_target_params): Handle FDPIC. (elf32_arm_final_link_relocate): Likewise. (elf32_arm_check_relocs): Likewise. (allocate_dynrelocs_for_symbol): Likewise. (elf32_arm_size_dynamic_sections): Likewise. (elf32_arm_finish_dynamic_sections): Likewise. (elf32_arm_output_arch_local_syms): Likewise. (elf32_arm_fdpic_omit_section_dynsym): New. ld/ * emulparams/armelf_linux_fdpiceabi.sh: Add .rofixup section.
2018-04-25[ARM] Add FDPIC relocations definitionsChristophe Lyon4-3/+94
Add FDPIC relocation definitions in BFD and gas. Gas rejects them if the --fdpic option was not specified. 2018-04-25 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> bfd/ * bfd-in2.c (BFD_RELOC_ARM_GOTFUNCDESC) (BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC) (BFD_RELOC_ARM_FUNCDESC_VALUE): New. * elf32-arm.c (elf32_arm_howto_table_2): Add R_ARM_GOTFUNCDESC, R_ARM_GOTOFFFUNCDESC, R_ARM_FUNCDESC, R_ARM_FUNCDESC_VALUE. (elf32_arm_howto_from_type): Take new members of elf32_arm_howto_table_2 into account. (elf32_arm_reloc_map): Add BFD_RELOC_ARM_GOTFUNCDESC, BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC, BFD_RELOC_ARM_FUNCDESC_VALUE. * reloc.c: Add BFD_RELOC_ARM_GOTFUNCDESC, BFD_RELOC_ARM_GOTOFFFUNCDESC, BFD_RELOC_ARM_FUNCDESC, BFD_RELOC_ARM_FUNCDESC_VALUE. gas/ * config/tc-arm.c (reloc_names): Add gotfuncdesc, gotofffuncdesc, funcdesc. (md_apply_fix): Support the new relocations. (tc_gen_reloc): Likewise. * testsuite/gas/arm/reloc-fdpic.d: New. * testsuite/gas/arm/reloc-fdpic.s: New. include/ * elf/arm.h (R_ARM_GOTFUNCDESC, R_ARM_GOTOFFFUNCDESC) (R_ARM_FUNCDESC) (R_ARM_FUNCDESC_VALUE): Define new relocations.
2018-04-25[ARM] Add FDPIC OSABI flag support.Christophe Lyon2-1/+21
ELF files targetting ARM FDPIC use the ELFOSABI_ARM_FDPIC flag. Set it appropriately in file generators (eg. gas), and handle it in readers (eg. readelf). 2018-04-25 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> bfd/ * elf32-arm.c (elf32_arm_print_private_bfd_data): Support EF_ARM_PIC and ELFOSABI_ARM_FDPIC. (elf32_arm_post_process_headers): Support ELFOSABI_ARM_FDPIC. (ELF_OSABI): Define to ELFOSABI_ARM_FDPIC. binutils/ * readelf.c (decode_ARM_machine_flags): Support EF_ARM_PIC. (get_osabi_name): Support ELFOSABI_ARM_FDPIC. gas/ * config/tc-arm.c (arm_fdpic): New. (elf32_arm_target_format): Support FDPIC. (OPTION_FDPIC): New. (md_longopts): Support FDPIC. (md_parse_option): Likewise. (md_show_usage): Likewise. include/ * elf/arm.h (EF_ARM_FDPIC): New.
2018-04-25[ARM] Add armelf_linux_fdpiceabi and armelfb_linux_fdpiceabi BFD backendsChristophe Lyon6-2/+71
Initial definition of these new backends. 2018-04-25 Christophe Lyon <christophe.lyon@st.com> Mickaël Guêné <mickael.guene@st.com> bfd/ * config.bfd (arm*-*-linux-*): Add arm_elf32_fdpic_be_vec and arm_elf32_fdpic_le_vec to targ_selvecs. Accept arm*-*-uclinuxfdpiceabi. * configure.ac: Add support for arm_elf32_fdpic_be_vec and arm_elf32_fdpic_le_vec. * configure: Regenerate. * elf32-arm.c (struct elf32_arm_link_hash_table): Add fdpic_p. (elf32_arm_link_hash_table_create): Initialize fdpic_p. (TARGET_LITTLE_SYM, TARGET_LITTLE_NAME, TARGET_BIG_SYM) (TARGET_BIG_NAME, elf_match_priority): Define for FDPIC targets. (elf32_arm_fdpic_link_hash_table_create): New. * targets.c (_bfd_target_vector): Add arm_elf32_fdpic_be_vec and arm_elf32_fdpic_le_vec. ld/ * Makefile.am (ALL_EMULATION_SOURCES): Add earmelf_linux_fdpiceabi.c and earmelfb_linux_fdpiceabi.c. (earmelf_linux_fdpiceabi.c, earmelfb_linux_fdpiceabi.c): New rules. * Makefile.in: Regenerate. * configure.tgt (arm*-*-uclinuxfdpiceabi): Handle new target. * emulparams/armelf_linux_fdpiceabi.sh: New. * emulparams/armelfb_linux_fdpiceabi.sh: New.
2018-04-25Silence gcc-8 warningsAlan Modra3-1/+36
This seems to work with gcc-8 and a bunch of prior gcc versions I tested. * elf-linux-core.h: Disable gcc-8 string truncation warning. * elf.c (elfcore_write_prpsinfo): Likewise.
2018-04-25Remove arm-aout and arm-coff supportAlan Modra11-1341/+20
This also removes arm-netbsd (not arm-netbsdelf!), arm-openbsd, and arm-riscix. Those targets weren't on the obsolete list but they are all aout, and it doesn't make all that much sense to remove arm-aout without removing them too. bfd/ * Makefile.am: Remove arm-aout and arm-coff support. * config.bfd: Likewise. * configure.ac: Likewise. * targets.c: Likewise. * aout-arm.c: Delete. * armnetbsd.c: Delete. * riscix.c: Delete. * Makefile.in: Regenerate. * configure: Regenerate. * po/SRC-POTFILES.in: Regenerate. binutils/ * testsuite/binutils-all/arm/objdump.exp: Remove arm-aout and arm-coff support. * testsuite/binutils-all/objcopy.exp: Likewise. * testsuite/lib/binutils-common.exp: Likewise. gas/ * Makefile.am: Remove arm-aout and arm-coff support. * config/tc-arm.c: Likewise. * config/tc-arm.h: Likewise. * configure.tgt: Likewise. * testsuite/gas/aarch64/codealign.d: Likewise. * testsuite/gas/aarch64/mapping.d: Likewise. * testsuite/gas/aarch64/mapping2.d: Likewise. * testsuite/gas/arm/adds-thumb1-reloc-local-armv7-m.d: Likewise. * testsuite/gas/arm/adds-thumb1-reloc-local.d: Likewise. * testsuite/gas/arm/addsw-bad.d: Likewise. * testsuite/gas/arm/align.d: Likewise. * testsuite/gas/arm/align64.d: Likewise. * testsuite/gas/arm/arch7.d: Likewise. * testsuite/gas/arm/arch7a-mp.d: Likewise. * testsuite/gas/arm/arch7em.d: Likewise. * testsuite/gas/arm/archv8m-main-dsp-5.d: Likewise. * testsuite/gas/arm/arm-it-auto-2.d: Likewise. * testsuite/gas/arm/arm-it-auto-3.d: Likewise. * testsuite/gas/arm/arm-it-auto.d: Likewise. * testsuite/gas/arm/arm-it-bad-2.d: Likewise. * testsuite/gas/arm/arm-it.d: Likewise. * testsuite/gas/arm/armv7e-m+fpv5-d16.d: Likewise. * testsuite/gas/arm/armv7e-m+fpv5-sp-d16.d: Likewise. * testsuite/gas/arm/armv8-2-fp16-scalar-thumb.d: Likewise. * testsuite/gas/arm/armv8-2-fp16-scalar.d: Likewise. * testsuite/gas/arm/armv8-2-fp16-simd-thumb.d: Likewise. * testsuite/gas/arm/armv8-2-fp16-simd.d: Likewise. * testsuite/gas/arm/armv8-a+crypto.d: Likewise. * testsuite/gas/arm/armv8-a+fp.d: Likewise. * testsuite/gas/arm/armv8-a+ras.d: Likewise. * testsuite/gas/arm/armv8-a+rdma-warning.d: Likewise. * testsuite/gas/arm/armv8-a+rdma.d: Likewise. * testsuite/gas/arm/armv8-a+simd.d: Likewise. * testsuite/gas/arm/armv8-a-barrier-thumb.d: Likewise. * testsuite/gas/arm/armv8-r+fp.d: Likewise. * testsuite/gas/arm/armv8-r+simd.d: Likewise. * testsuite/gas/arm/armv8-r-barrier-thumb.d: Likewise. * testsuite/gas/arm/armv8_1-a+simd.d: Likewise. * testsuite/gas/arm/armv8_2+rdma.d: Likewise. * testsuite/gas/arm/armv8_2-a.d: Likewise. * testsuite/gas/arm/armv8_3-a-fp.d: Likewise. * testsuite/gas/arm/armv8_3-a-simd.d: Likewise. * testsuite/gas/arm/armv8a-automatic-hlt.d: Likewise. * testsuite/gas/arm/armv8a-automatic-lda.d: Likewise. * testsuite/gas/arm/attr-syntax.d: Likewise. * testsuite/gas/arm/automatic-bw.d: Likewise. * testsuite/gas/arm/automatic-cbz.d: Likewise. * testsuite/gas/arm/automatic-clrex.d: Likewise. * testsuite/gas/arm/automatic-lda.d: Likewise. * testsuite/gas/arm/automatic-ldaex.d: Likewise. * testsuite/gas/arm/automatic-ldaexb.d: Likewise. * testsuite/gas/arm/automatic-ldrex.d: Likewise. * testsuite/gas/arm/automatic-ldrexd.d: Likewise. * testsuite/gas/arm/automatic-movw.d: Likewise. * testsuite/gas/arm/automatic-sdiv.d: Likewise. * testsuite/gas/arm/automatic-strexb.d: Likewise. * testsuite/gas/arm/barrier-bad-thumb.d: Likewise. * testsuite/gas/arm/barrier-bad.d: Likewise. * testsuite/gas/arm/barrier-thumb.d: Likewise. * testsuite/gas/arm/barrier.d: Likewise. * testsuite/gas/arm/bignum1.d: Likewise. * testsuite/gas/arm/blx-bad.d: Likewise. * testsuite/gas/arm/blx-bl-convert.d: Likewise. * testsuite/gas/arm/blx-local.s: Likewise. * testsuite/gas/arm/crc32-armv8-a-bad.d: Likewise. * testsuite/gas/arm/crc32-armv8-a.d: Likewise. * testsuite/gas/arm/crc32-armv8-r-bad.d: Likewise. * testsuite/gas/arm/crc32-armv8-r.d: Likewise. * testsuite/gas/arm/dis-data.d: Likewise. * testsuite/gas/arm/dis-data2.d: Likewise. * testsuite/gas/arm/dis-data3.d: Likewise. * testsuite/gas/arm/eabi_attr_1.d: Likewise. * testsuite/gas/arm/fp-save.d: Likewise. * testsuite/gas/arm/group-reloc-alu-encoding-bad.d: Likewise. * testsuite/gas/arm/group-reloc-alu-parsing-bad.d: Likewise. * testsuite/gas/arm/group-reloc-alu.d: Likewise. * testsuite/gas/arm/group-reloc-ldc-encoding-bad.d: Likewise. * testsuite/gas/arm/group-reloc-ldc-parsing-bad.d: Likewise. * testsuite/gas/arm/group-reloc-ldc.d: Likewise. * testsuite/gas/arm/group-reloc-ldr-encoding-bad.d: Likewise. * testsuite/gas/arm/group-reloc-ldr-parsing-bad.d: Likewise. * testsuite/gas/arm/group-reloc-ldr.d: Likewise. * testsuite/gas/arm/group-reloc-ldrs-encoding-bad.d: Likewise. * testsuite/gas/arm/group-reloc-ldrs-parsing-bad.d: Likewise. * testsuite/gas/arm/group-reloc-ldrs.d: Likewise. * testsuite/gas/arm/insn-error-a.d: Likewise. * testsuite/gas/arm/insn-error-t.d: Likewise. * testsuite/gas/arm/inst-po-2.d: Likewise. * testsuite/gas/arm/inst-po-3.d: Likewise. * testsuite/gas/arm/inst-po-be.d: Likewise. * testsuite/gas/arm/inst-po.d: Likewise. * testsuite/gas/arm/ldconst.d: Likewise. * testsuite/gas/arm/ldgesb-bad.d: Likewise. * testsuite/gas/arm/ldgesh-bad.d: Likewise. * testsuite/gas/arm/ldst-offset0.d: Likewise. * testsuite/gas/arm/local_function.d: Likewise. * testsuite/gas/arm/local_label_coff.d: Likewise. * testsuite/gas/arm/local_label_elf.d: Likewise. * testsuite/gas/arm/mapping.d: Likewise. * testsuite/gas/arm/mapping2.d: Likewise. * testsuite/gas/arm/mapping3.d: Likewise. * testsuite/gas/arm/mapping4.d: Likewise. * testsuite/gas/arm/mapshort-elf.d: Likewise. * testsuite/gas/arm/mask_1-armv8-a.d: Likewise. * testsuite/gas/arm/mask_1-armv8-r.d: Likewise. * testsuite/gas/arm/movs-thumb1-reloc-local-armv7-m.d: Likewise. * testsuite/gas/arm/movs-thumb1-reloc-local.d: Likewise. * testsuite/gas/arm/movw-local.d: Likewise. * testsuite/gas/arm/mrs-msr-thumb-v6t2.d: Likewise. * testsuite/gas/arm/mrs-msr-thumb-v7-m.d: Likewise. * testsuite/gas/arm/mrs-msr-thumb-v7e-m.d: Likewise. * testsuite/gas/arm/msr-imm-bad.d: Likewise. * testsuite/gas/arm/msr-reg-bad.d: Likewise. * testsuite/gas/arm/msr-reg-thumb.d: Likewise. * testsuite/gas/arm/nomapping.d: Likewise. * testsuite/gas/arm/nops.d: Likewise. * testsuite/gas/arm/pic.d: Likewise. * testsuite/gas/arm/pinsn.d: Likewise. * testsuite/gas/arm/plt-1.d: Likewise. * testsuite/gas/arm/pr21458.d: Likewise. * testsuite/gas/arm/pr9722.d: Likewise. * testsuite/gas/arm/strex-t.d: Likewise. * testsuite/gas/arm/t2-branch-global.d: Likewise. * testsuite/gas/arm/target-reloc-1.d: Likewise. * testsuite/gas/arm/thumb-b-bad.d: Likewise. * testsuite/gas/arm/thumb-w-bad.d: Likewise. * testsuite/gas/arm/thumb-w-good.d: Likewise. * testsuite/gas/arm/thumb.d: Likewise. * testsuite/gas/arm/thumb2_it.d: Likewise. * testsuite/gas/arm/thumb2_it_auto.d: Likewise. * testsuite/gas/arm/thumb2_it_search.d: Likewise. * testsuite/gas/arm/thumb2_ldmstm.d: Likewise. * testsuite/gas/arm/thumb2_ldr_immediate_armv6.d: Likewise. * testsuite/gas/arm/thumb2_ldr_immediate_armv6t2.d: Likewise. * testsuite/gas/arm/thumb2_ldr_immediate_highregs_armv6t2.d: Likewise. * testsuite/gas/arm/thumb2_pool.d: Likewise. * testsuite/gas/arm/thumb2_vpool.d: Likewise. * testsuite/gas/arm/thumb2_vpool_be.d: Likewise. * testsuite/gas/arm/thumb32.d: Likewise. * testsuite/gas/arm/thumbver.d: Likewise. * testsuite/gas/arm/tls.d: Likewise. * testsuite/gas/arm/tls_vxworks.d: Likewise. * testsuite/gas/arm/undefined.d: Likewise. * testsuite/gas/arm/undefined_coff.d: Likewise. * testsuite/gas/arm/unwind.d: Likewise. * testsuite/gas/arm/v4bx.d: Likewise. * testsuite/gas/arm/vcmp-noprefix-imm.d: Likewise. * testsuite/gas/arm/vcvt-bad.d: Likewise. * testsuite/gas/arm/vfma1.d: Likewise. * testsuite/gas/arm/vldconst.d: Likewise. * testsuite/gas/arm/vldconst_be.d: Likewise. * testsuite/gas/arm/vldm-arm.d: Likewise. * testsuite/gas/arm/vldr.d: Likewise. * testsuite/gas/arm/weakdef-1.d: Likewise. * testsuite/gas/arm/weakdef-2.d: Likewise. * config/te-riscix.h: Delete. * Makefile.in: Regenerate. * po/POTFILES.in: Regenerate. ld/ * Makefile.am: Remove arm-aout and arm-coff support. * configure.tgt: Likewise. * testsuite/ld-arm/attr-merge-div-00.d: Likewise. * testsuite/ld-arm/attr-merge-div-01-m3.d: Likewise. * testsuite/ld-arm/attr-merge-div-01.d: Likewise. * testsuite/ld-arm/attr-merge-div-02.d: Likewise. * testsuite/ld-arm/attr-merge-div-10-m3.d: Likewise. * testsuite/ld-arm/attr-merge-div-10.d: Likewise. * testsuite/ld-arm/attr-merge-div-11.d: Likewise. * testsuite/ld-arm/attr-merge-div-12.d: Likewise. * testsuite/ld-arm/attr-merge-div-120.d: Likewise. * testsuite/ld-arm/attr-merge-div-20.d: Likewise. * testsuite/ld-arm/attr-merge-div-21.d: Likewise. * testsuite/ld-arm/attr-merge-div-22.d: Likewise. * testsuite/ld-arm/attr-merge-hardfp-use-1.d: Likewise. * testsuite/ld-arm/attr-merge-hardfp-use-2.d: Likewise. * testsuite/ld-arm/attr-merge-nosection-1.d: Likewise. * testsuite/ld-arm/attr-merge-unknown-2.d: Likewise. * testsuite/ld-arm/attr-merge-unknown-2r.d: Likewise. * testsuite/ld-arm/attr-merge-unknown-3.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-1.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-10.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-10r.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-11.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-11r.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-12.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-12r.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-13.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-13r.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-14.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-14r.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-1r.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-2.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-2r.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-3.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-3r.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-4.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-4r.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-5.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-5r.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-6.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-6r.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-7.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-7r.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-8.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-8r.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-9.d: Likewise. * testsuite/ld-arm/attr-merge-vfp-9r.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-00-nowarn.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-00.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-02-nowarn.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-02.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-04-nowarn.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-04.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-20-nowarn.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-20.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-22-nowarn.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-22.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-24-nowarn.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-40-nowarn.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-40.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-42-nowarn.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-44-nowarn.d: Likewise. * testsuite/ld-arm/attr-merge-wchar-44.d: Likewise. * testsuite/ld-arm/eabi-hard-float.d: Likewise. * testsuite/ld-arm/eabi-soft-float-ABI4.d: Likewise. * testsuite/ld-arm/eabi-soft-float-r.d: Likewise. * testsuite/ld-arm/eabi-soft-float.d: Likewise. * testsuite/ld-arm/gc-hidden-1.d: Likewise. * emulparams/armaoutb.sh: Delete. * emulparams/armaoutl.sh: Delete. * emulparams/armcoff.sh: Delete. * emulparams/armnbsd.sh: Delete. * emulparams/riscix.sh: Delete. * scripttempl/armaout.sc: Delete. * scripttempl/armcoff.sc: Delete. * scripttempl/riscix.sc: Delete. * Makefile.in: Regenerate. * po/BLD-POTFILES.in: Regenerate.
2018-04-25Automatic date update in version.inGDB Administrator1-1/+1
2018-04-24Fix an illegal memory access when trying to copy an ELF binary with corrupt ↵Nick Clifton2-1/+12
section symbols. PR 23113 * elf.c (ignore_section_sym): Check for the output_section pointer being NULL before dereferencing it.
2018-04-24Fix an illegal memory access when copying a PE format file with corrupt ↵Nick Clifton3-2984/+2662
debug information. PR 23110 * peXXigen.c (_bfd_XX_bfd_copy_private_bfd_data_common): Check for a negative PE_DEBUG_DATA size before iterating over the debug data.
2018-04-24Automatic date update in version.inGDB Administrator1-1/+1
2018-04-23Revert bfd part of "Silence gcc-8 warnings"Alan Modra3-20/+5
The gcc warning has been fixed, and the patch regressed builds with some older versions of gcc. * elf-linux-core.h: Revert last change. * elf.c: Likewise.
2018-04-23Prevent an illegal memory access in gprof by ensuring that string tables for ↵Nick Clifton2-3/+16
aout format files are always zero-terminated. PR 23056 * aoutx.h (aout_get_external_symbols): Allocate an extra byte at the end of the string table, and zero it.
2018-04-23Silence gcc-8 warningsAlan Modra3-0/+29
All of these warnings were false positives. -Wstringop-truncation is particularly annoying when it warns about strncpy used quite correctly. bfd/ * elf-linux-core.h (swap_linux_prpsinfo32_ugid32_out): Disable gcc-8 string truncation warning. (swap_linux_prpsinfo32_ugid16_out): Likewise. (swap_linux_prpsinfo64_ugid32_out): Likewise. (swap_linux_prpsinfo64_ugid16_out): Likewise. * elf.c (elfcore_write_prpsinfo): Likewise. gas/ * stabs.c (generate_asm_file): Use memcpy rather than strncpy. Remove call to strlen inside loop. * config/tc-cr16.c (getreg_image): Warning fix. * config/tc-crx.c (getreg_image): Warning fix.
2018-04-23Automatic date update in version.inGDB Administrator1-1/+1
2018-04-22Automatic date update in version.inGDB Administrator1-1/+1
2018-04-21Automatic date update in version.inGDB Administrator1-1/+1
2018-04-20PR22978, TLS local-dynamic incorrectly linked on hppa-linuxAlan Modra2-32/+48
We were emitting dynamic relocs on the second word of a TLS GD GOT entry pair (the dtprel offset), without the addend necessary when no symbol is present on the dynamic reloc. Unfortunately the simple solution of providing the proper addend doesn't work due to an hppa glibc ld.so bug that ignores such addends. So instead optimize the relocs. The dtprel offset is known at link time for locally defined symbols (the only case where we'll end up with no symbol on a dynamic reloc) so we can omit the dynamic reloc in that case. Furthermore, we can omit a dynamic reloc on the first word of a TLS GD GOT entry pair (the module id) if the symbol is local and we are producing an executable. Similarly, a tprel reloc on a TLS IE GOT entry is not needed for local symbols in an executable. So the condition for TLS GOT relocs can become bfd_link_dll(info) rather than bfd_link_pic(info) as needed for normal GOT relocs. This all presumes hppa ld.so doesn't need to differentiate TLS GD GOT pairs from TLS LD GOT pairs, which is currently true. PR 22978 * elf32-hppa.c (got_relocs_needed): Add extra param to special case both dtprel and tprel relocs. (allocate_dynrelocs): Adjust conditions for got relocs. (elf32_hppa_relocate_section): Likewise for local sym got relocs. Emit dynamic relocs on TLS GOT entries for shared libraries, not when pic. Omit dynamic reloc on dtprel entry when local, and on tprel entry when local and executable.
2018-04-20Automatic date update in version.inGDB Administrator1-1/+1
2018-04-19PR22537, Segmentation fault with static PIEAlan Modra2-1/+11
The only stub type that makes sense for undefined symbols, or those defined in shared libraries, is a plt call stub. This patch arranges to have "destination" set to -1 on such symbols, making for an easy test in hppa_type_of_stub. PR 22537 * elf32-hppa.c (elf32_hppa_size_stubs): Init "destination" to -1. (hppa_type_of_stub): Don't return a long branch stub for symbols other than those defined statically.
2018-04-19Reinstate mips ecoff supportAlan Modra9-11/+1635
* Makefile.am: Revert 2018-04-18 coff-mips changes. * config.bfd: Add back mips_ecoff_le_vec and mips_ecoff_be_vec to selvecs for mips targets change 2018-04-18. * configure.ac: Reinstate mips_ecoff_le_vec, mips_ecoff_be_vec and mips_ecoff_bele_vec. * targets.c: Likewise. * coff-mips.c: Resurrect. * Makefile.in: Regenerate. * configure: Regenerate. * po/SRC-POTFILES.in: Regenerate.
2018-04-19Automatic date update in version.inGDB Administrator1-1/+1
2018-04-18Remove mips aout, coff, and pe supportAlan Modra12-3210/+33
include/coff/mips.h needs to stay for ecoff debug support. include/ * coff/mipspe.h: Delete. bfd/ * Makefile.am: Remove mips aout, coff, and pe support. * config.bfd: Likewise. * configure.ac: Likewise. * targets.c: Likewise. * coff-mips.c: Delete * mipsbsd.c: Delete * pe-mips.c: Delete * pei-mips.c: Delete * Makefile.in: Regenerate. * configure: Regenerate. * po/SRC-POTFILES.in: Regenerate.
2018-04-17x86: Don't define elf32_bed/elf64_bed variablesH.J. Lu1-0/+8
Define elf32_bed and elf64_bed before including "elf32-target.h" and "elf64-target.h" to avoid local elf32_bed and elf64_bed variables. * elf32-i386.c (elf32_bed): Define before including "elf32-target.h". * elf64-x86-64.c (elf64_bed): Define before including "elf64-target.h". (elf32_bed): Define before including "elf32-target.h".
2018-04-17elf32_bed/elf64_bedH.J. Lu2-0/+8
2018-04-17x86: Use a normal input file with compatible relocationH.J. Lu2-1/+9
Use a normal input file with compatible relocation to hold linker created sections, PR ld/23055 * elfxx-x86.c (_bfd_x86_elf_link_setup_gnu_properties): Use a normal input file with compatible relocation.
2018-04-18various i386-aout and i386-coff target removalAlan Modra16-1461/+45
Also tidies some other aout leftovers in binutils-common.exp. bfd/ * Makefile.am: Remove support for assorted i386 aout and coff targets. * config.bfd: Likewise. * configure.ac: Likewise. * doc/bfdint.texi: Likewise. * targets.c: Likewise. * freebsd.h: Delete. * i386dynix.c: Delete. * i386freebsd.c: Delete. * i386linux.c: Delete. * i386mach3.c: Delete. * i386netbsd.c: Delete. * i386os9k.c: Delete. * Makefile.in: Regenerate. * configure: Regenerate. * po/SRC-POTFILES.in: Regenerate. binutils/ * testsuite/lib/binutils-common.exp: Remove support for assorted aout targets. gas/ * Makefile.am: Remove support for assorted i386 aout and coff targets. * config/obj-elf.c: Likewise. * config/tc-i386.h: Likewise. * configure.ac: Likewise. * configure.tgt: Likewise. * config/te-dynix.h: Delete. * config/te-i386aix.h: Delete. * config/te-mach.h: Delete. * Makefile.in: Regenerate. * config.in: Regenerate. * configure: Regenerate. * po/POTFILES.in: Regenerate. include/ * aout/dynix3.h: Delete. ld/ * Makefile.am: Remove support for assorted i386 aout and coff targets. * configure.tgt: Likewise. * testsuite/ld-discard/discard.exp: Likewise. * testsuite/ld-elf/binutils.exp: Likewise. * testsuite/ld-elf/tls.exp: Likewise. * testsuite/ld-elf/tls_common.exp: Likewise. * testsuite/ld-elfvers/vers.exp: Likewise. * testsuite/ld-elfvsb/elfvsb.exp: Likewise. * testsuite/ld-elfweak/elfweak.exp: Likewise. * testsuite/ld-gc/abi-note.d: Likewise. * testsuite/ld-gc/pr19167.d: Likewise. * testsuite/ld-gc/pr20022.d: Likewise. * testsuite/ld-gc/start.d: Likewise. * testsuite/ld-gc/stop.d: Likewise. * testsuite/ld-i386/i386.exp: Likewise. * testsuite/ld-ifunc/binutils.exp: Likewise. * testsuite/ld-ifunc/ifunc.exp: Likewise. * testsuite/ld-linkonce/linkonce.exp: Likewise. * testsuite/ld-plugin/lto.exp: Likewise. * testsuite/ld-scripts/empty-address-2a.d: Likewise. * testsuite/ld-scripts/empty-address-2b.d: Likewise. * testsuite/ld-scripts/phdrs2.exp: Likewise. * testsuite/ld-scripts/section-match-1.d: Likewise. * testsuite/ld-shared/shared.exp: Likewise. * testsuite/ld-size/size.exp: Likewise. * testsuite/ld-sparc/sparc.exp: Likewise. * emulparams/i386coff.sh: Delete. * emulparams/i386linux.sh: Delete. * emulparams/i386mach.sh: Delete. * emulparams/i386nbsd.sh: Delete. * emulparams/vsta.sh: Delete. * scripttempl/i386coff.sc: Delete. * Makefile.in: Regenerate. * po/BLD-POTFILES.in: Regenerate.
2018-04-18Correct ChangeLog dates for git commit 3f0a5f17d7fAlan Modra1-1/+1
2018-04-18Automatic date update in version.inGDB Administrator1-1/+1
2018-04-17[MicroBlaze] PIC data text relativeMichael Eager5-10/+141
Andrew Sadek <andrew.sadek.se@gmail.com> A new implemented feature in GCC Microblaze that allows Position Independent Code to run using Data Text Relative addressing instead of using Global Offset Table. Its aim was to make 'PIC' more efficient and flexible as elf size excess performance overhead were noticed when using GOT due to the indirect addressing. include/ChangeLog: * bfdlink.h (Add flag): Add new flag @ 'bfd_link_info' struct. * elf/microblaze.h (Add 3 new relocations): R_MICROBLAZE_TEXTPCREL_64, R_MICROBLAZE_TEXTREL_64 and R_MICROBLAZE_TEXTREL_32_LO for relax function. bfd/ChangeLog: * bfd/reloc.c (2 new BFD relocations): BFD_RELOC_MICROBLAZE_64_TEXTPCREL & BFD_RELOC_MICROBLAZE_64_TEXTPCREL * bfd/bfd-in2.h: Regenerate * bfd/libbfd.h: Regenerate * bfd/elf32-microblaze.c (Handle new relocs): define 'HOWTO' of 3 new relocs and handle them in both relocate and relax functions. (microblaze_elf_reloc_type_lookup): add mapping between for new bfd relocs. (microblaze_elf_relocate_section): Handle new relocs in case of elf relocation. (microblaze_elf_relax_section): Handle new relocs for elf relaxation. gas/ChangeLog: * gas/config/tc-microblaze.c (Handle new relocs directives in assembler): Handle new relocs from compiler output. (imm_types): add new imm types for data text relative addressing TEXT_OFFSET, TEXT_PC_OFFSET (md_convert_frag): conversion for BFD_RELOC_MICROBLAZE_64_TEXTPCREL, BFD_RELOC_MICROBLAZE_64_TEXTPCREL (md_apply_fix): apply fix for BFD_RELOC_MICROBLAZE_64_TEXTPCREL, BFD_RELOC_MICROBLAZE_64_TEXTPCREL (md_estimate_size_before_relax): estimate size for BFD_RELOC_MICROBLAZE_64_TEXTPCREL, BFD_RELOC_MICROBLAZE_64_TEXTPCREL (tc_gen_reloc): generate relocations for BFD_RELOC_MICROBLAZE_64_TEXTPCREL, BFD_RELOC_MICROBLAZE_64_TEXTPCREL ld/ChangeLog: * ld/lexsup.c (Add 2 ld options): (ld_options): add disable-multiple-abs-defs @ 'ld_options' array (parse_args): parse new option and pass flag to 'link_info' struct. * ld/ldlex.h (Add enum): add new enum @ 'option_values' enum. * ld/ld.texinfo (Add new option): Add description for 'disable-multiple-abs-defs' * ld/main.c: Initialize flags with false @ 'main'. Handle disable-multiple-abs-defs @ 'mutiple_definition'.
2018-04-17Fix illegal memory accesses trigeered when linking corrupt input files.Nick Clifton4-3/+24
PR 23055 * aoutx.h (find_nearest_line): Check that the symbol name exists and is long enough, before attempting to see if it is for a .o file. * hash.c (bfd_hash_hash): Add an assertion that the string is not NULL. * linker.c (bfd_link_hash_lookup): Fail if the table or string are NULL. (_bfd_generic_link_add_archive_symbols): Fail if an archive entry has no name.
2018-04-17Add a check for a NULL table pointer before attempting to compute a DWARF ↵Nick Clifton2-1/+6
filename. PR 23065 * dwarf2.c (concat_filename): Check for a NULL table pointer.
2018-04-17Automatic date update in version.inGDB Administrator1-1/+1
2018-04-16Prevent an illegal memory access via an out of range fixup pointer.Nick Clifton2-2/+10
PR 23061 * coffgen.c (coff_pointerize_aux): Check for an out of range fixup.