Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
bfd/
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
ld/
* po/BLD-POTFILES.in: Regenerate.
|
|
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.
|
|
|
|
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-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 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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
section symbols.
PR 23113
* elf.c (ignore_section_sym): Check for the output_section pointer
being NULL before dereferencing it.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
|
|
|
|
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.
|
|
|
|
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.
|
|
* 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.
|
|
|
|
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.
|
|
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".
|
|
|
|
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.
|
|
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.
|
|
|
|
|
|
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'.
|
|
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.
|
|
filename.
PR 23065
* dwarf2.c (concat_filename): Check for a NULL table pointer.
|
|
|
|
PR 23061
* coffgen.c (coff_pointerize_aux): Check for an out of range
fixup.
|