Age | Commit message (Collapse) | Author | Files | Lines |
|
It's not needed for sizing fixups since 0e2779e98dc, and wrong to emit
this reloc to the object file.
* coff-rs6000.c (_bfd_xcoff_reloc_type_lookup): Remove BFD_RELOC_16.
* coff64-rs6000.c (xcoff64_reloc_type_lookup): Likewise.
|
|
|
|
|
|
|
|
* Renamed obsolete UJ/SB types and RVC types, also added CSS/CL(CS) types,
[VALID/EXTRACT/ENCODE macros]
BTYPE_IMM: Renamed from SBTYPE_IMM.
JTYPE_IMM: Renamed from UJTYPE_IMM.
CITYPE_IMM: Renamed from RVC_IMM.
CITYPE_LUI_IMM: Renamed from RVC_LUI_IMM.
CITYPE_ADDI16SP_IMM: Renamed from RVC_ADDI16SP_IMM.
CITYPE_LWSP_IMM: Renamed from RVC_LWSP_IMM.
CITYPE_LDSP_IMM: Renamed from RVC_LDSP_IMM.
CIWTYPE_IMM: Renamed from RVC_UIMM8.
CIWTYPE_ADDI4SPN_IMM: Renamed from RVC_ADDI4SPN_IMM.
CSSTYPE_IMM: Added for .insn without special encoding.
CSSTYPE_SWSP_IMM: Renamed from RVC_SWSP_IMM.
CSSTYPE_SDSP_IMM: Renamed from RVC_SDSP_IMM.
CLTYPE_IMM: Added for .insn without special encoding.
CLTYPE_LW_IMM: Renamed from RVC_LW_IMM.
CLTYPE_LD_IMM: Renamed from RVC_LD_IMM.
RVC_SIMM3: Unused and removed.
CBTYPE_IMM: Renamed from RVC_B_IMM.
CJTYPE_IMM: Renamed from RVC_J_IMM.
* Added new operands and removed the unused ones,
C5: Unsigned CL(CS) immediate, added for .insn directive.
C6: Unsigned CSS immediate, added for .insn directive.
Ci: Unused and removed.
C<: Unused and removed.
bfd/
PR 27158
* elfnn-riscv.c (perform_relocation): Updated encoding macros.
(_bfd_riscv_relax_call): Likewise.
(_bfd_riscv_relax_lui): Likewise.
* elfxx-riscv.c (howto_table): Likewise.
gas/
PR 27158
* config/tc-riscv.c (riscv_ip): Updated encoding macros.
(md_apply_fix): Likewise.
(md_convert_frag_branch): Likewise.
(validate_riscv_insn): Likewise. Also arranged operands, including
added C5 and C6 operands, and removed unused Ci and C< operands.
* doc/c-riscv.texi: Updated and added CSS/CL/CS types.
* testsuite/gas/riscv/insn.d: Added CSS/CL/CS instructions.
* testsuite/gas/riscv/insn.s: Likewise.
gdb/
PR 27158
* riscv-tdep.c (decode_ci_type_insn): Updated encoding macros.
(decode_j_type_insn): Likewise.
(decode_cj_type_insn): Likewise.
(decode_b_type_insn): Likewise.
(decode): Likewise.
include/
PR 27158
* opcode/riscv.h: Updated encoding macros.
opcodes/
PR 27158
* riscv-dis.c (print_insn_args): Updated encoding macros.
* riscv-opc.c (MASK_RVC_IMM): defined to ENCODE_CITYPE_IMM.
(match_c_addi16sp): Updated encoding macros.
(match_c_lui): Likewise.
(match_c_lui_with_hint): Likewise.
(match_c_addi4spn): Likewise.
(match_c_slli): Likewise.
(match_slli_as_c_slli): Likewise.
(match_c_slli64): Likewise.
(match_srxi_as_c_srxi): Likewise.
(riscv_insn_types): Added .insn css/cl/cs.
sim/
PR 27158
* riscv/sim-main.c (execute_i): Updated encoding macros.
|
|
|
|
Make the opcode/riscv-opc.c and include/opcode/riscv.h tidy, move the
spec versions stuff to bfd/cpu-riscv.h. Also move the csr stuff and
ext_version_table to gas/config/tc-riscv.c for internal use. To avoid
too many repeated code, define general RISCV_GET_SPEC_NAME/SPEC_CLASS
macros. Therefore, assembler/dis-assembler/linker/gdb can get all spec
versions related stuff from cpu-riscv.h and cpu-riscv.c, since the stuff
are defined there uniformly.
bfd/
* Makefile.am: Added cpu-riscv.h.
* Makefile.in: Regenerated.
* po/SRC-POTFILES.in: Regenerated.
* cpu-riscv.h: Added to support spec versions controlling.
Also added extern arrays and functions for cpu-riscv.c.
(enum riscv_spec_class): Define all spec classes here uniformly.
(struct riscv_spec): Added for all specs.
(RISCV_GET_SPEC_CLASS): Added to reduce repeated code.
(RISCV_GET_SPEC_NAME): Likewise.
(RISCV_GET_ISA_SPEC_CLASS): Added to get ISA spec class.
(RISCV_GET_PRIV_SPEC_CLASS): Added to get privileged spec class.
(RISCV_GET_PRIV_SPEC_NAME): Added to get privileged spec name.
* cpu-riscv.c (struct priv_spec_t): Replaced with struct riscv_spec.
(riscv_get_priv_spec_class): Replaced with RISCV_GET_PRIV_SPEC_CLASS.
(riscv_get_priv_spec_name): Replaced with RISCV_GET_PRIV_SPEC_NAME.
(riscv_priv_specs): Moved below.
(riscv_get_priv_spec_class_from_numbers): Likewise, updated.
(riscv_isa_specs): Moved from include/opcode/riscv.h.
* elfnn-riscv.c: Included cpu-riscv.h.
(riscv_merge_attributes): Initialize in_priv_spec and out_priv_spec.
* elfxx-riscv.c: Included cpu-riscv.h and opcode/riscv.h.
(RISCV_UNKNOWN_VERSION): Moved from include/opcode/riscv.h.
* elfxx-riscv.h: Removed extern functions to cpu-riscv.h.
gas/
* config/tc-riscv.c: Included cpu-riscv.h.
(enum riscv_csr_clas): Moved from include/opcode/riscv.h.
(struct riscv_csr_extra): Likewise.
(struct riscv_ext_version): Likewise.
(ext_version_table): Moved from opcodes/riscv-opc.c.
(default_isa_spec): Updated type to riscv_spec_class.
(default_priv_spec): Likewise.
(riscv_set_default_isa_spec): Updated.
(init_ext_version_hash): Likewise.
(riscv_init_csr_hash): Likewise, also fixed indent.
include/
* opcode/riscv.h: Moved stuff and make the file tidy.
opcodes/
* riscv-dis.c: Included cpu-riscv.h, and removed elfxx-riscv.h.
(default_priv_spec): Updated type to riscv_spec_class.
(parse_riscv_dis_option): Updated.
* riscv-opc.c: Moved stuff and make the file tidy.
|
|
|
|
There is a tiny error left in dwarf.c:read_leb128 after Nick fixed the
signed overflow problem in code I wrote. It's to do with sleb128
values that have unnecessary excess bytes. For example, -1 is
represented as 0x7f, the most efficient encoding, but also as
0xff,0x7f or 0xff,0xff,0x7f and so on. None of these sequences
overflow any size signed value, but read_leb128 will report an
overflow given enough excess bytes. This patch fixes that problem,
and since the proper test for signed values with excess bytes can
easily be adapted to also test a sleb byte with just some bits that
overflow the result, I changed the code to not use signed right
shifts. (The C standard ISO/IEC 9899:1999 6.5.7 says signed right
shifts of negative values have an implementation defined value. A
long time ago I even used a C compiler for a certain microprocessor
that always did unsigned right shifts. Mind you, it is very unlikely
to be compiling binutils with such a compiler.)
bfd/
* wasm-module.c: Guard include of limits.h.
(CHAR_BIT): Provide backup define.
(wasm_read_leb128): Use CHAR_BIT to size "result" in bits.
Correct signed overflow checking.
opcodes/
* wasm32-dis.c: Include limits.h.
(CHAR_BIT): Provide backup define.
(wasm_read_leb128): Use CHAR_BIT to size "result" in bits.
Correct signed overflow checking.
binutils/
* dwarf.c: Include limits.h.
(CHAR_BIT): Provide backup define.
(read_leb128): Use CHAR_BIT to size "result" in bits. Correct
signed overflow checking.
* testsuite/binutils-all/pr26548.s,
* testsuite/binutils-all/pr26548.d,
* testsuite/binutils-all/pr26548e.d: New tests.
* testsuite/binutils-all/readelf.exp: Run them.
(readelf_test): Drop unused "xfails" parameter. Update all uses.
|
|
RISC-V only defines two float ABIs, soft-float and double-float, and the
value of soft-float is 0x0. But 0x0 usually means unknown/default setting
for many targets, and the non-ABI binary, which is generated by "ld/objcopy
-b binary", also has the 0x0 elf header flags, this may be confused.
We probably can define a new unknown/default ABI value to make them more
clear, but that will need more bits in the elf header flags, and also need
to discuss in the riscv psabi spec.
Training linker have a default ABI setting, and can be changed by ld
options or configure options is another solution, like what assemblr
usually do. So all objects, including the binary files, will have
explicit ABI setting. But the binary files will no longer be linked
with any object, users need to recompile them with the exactly ABI
they want. It may be inconvenience sometimes. Besides, I think linker
doesn't need to know the default arch/abi so far, just set them according
to the linked objects should be enough.
Therefore, without changing the riscv psabi, and keep the non-ABI binary
can be linked with any object, we don't check the ABI flags if no code
section in the PR24389. Just that we find the first input non-ABI binary
still cannot be linked with others in the PR27200. This patch fixs the
problem by delaying the elf_flags_init(obfd) check, since the flags of
non-ABI object with no code cannot be copyed to output BFD, we should
skip it, even if it is the first linked object.
However, there is a strange "break" at the end of loop in the PR24389.
The "break" cause the ld testcase "Link with zlib-gabi compressed debug
output 1" fails for rv64gc-linux toolchain, after applying the above
change. The root cause is that - the "break" make linker only checks
the "first" section of input BFD rather than the entire sections.
I have checked that AARCH64 and ARM both have the "break" at the end
of loop, but ARC doesn't. I suppose we should remove the "break" like
what ARC do, or use a pair of braces for the if statement.
I have passed the elf/linux toolchain regressions, so the change should
be fine.
bfd/
PR 27200
* elfnn-riscv.c (_bfd_riscv_elf_merge_private_bfd_data): Delay
copying the elf flags from input BFD to output BFD, until we have
checked if the input BFD has no code section or not. Also fix the
problem that we only check the first section rather than the entire
sections for input BFD.
|
|
|
|
* libbfd.c (_bfd_read_unsigned_leb128): Avoid excessive shift.
(_bfd_safe_read_leb128, _bfd_read_signed_leb128): Likewise.
|
|
|
|
"cp -p" has been observed to fail on Cygwin when the build tree is on a
local drive but the sources are on a Samba share. We don't really need
full copies of the files here - symlinks suffice.
|
|
nds32_elf_get_relocated_section_contents uses nds32_get_section_contents
to read sections contents, but nds32_get_section_contents has the wrong
behaviour as it calls bfd_malloc_and_get_section. That function always
mallocs its output buffer, whereas get_relocated_section_contents must
support an already allocated buffer.
bfd/
* elf32-nds32.c (nds32_get_section_contents): Replace
bfd_malloc_and_get_section with bfd_get_full_section_contents.
(nds32_elf_relax_delete_blanks): Init contents.
(nds32_elf_relax_section, nds32_relax_fp_as_gp): Likewise.
binutils/
* testsuite/binutils-all/compress.exp: Remove nds32 xfails.
* testsuite/binutils-all/objdump.exp: Likewise.
|
|
Use bfd_get_full_section_contents and tidy the start of this function
to match current generic get_relocated_section_contents.
* coff-alpha.c (alpha_ecoff_get_relocated_section_contents): Use
bfd_get_full_section_contents.
|
|
|
|
In particular, bfd_get_full_section_contents rather than
bfd_get_section_contents so that compressed sections are handled
properly.
Necessary for mips if objdump is to not cache debug sections.
* elfxx-mips.c (_bfd_elf_mips_get_relocated_section_contents): Apply
all fixes to bfd_generic_get_relocated_section_contents since this
function was split out.
|
|
|
|
|
|
|
|
* config.bfd: Remove ia64 from obsolete list.
|
|
This reverts commit db41f6eb5234ea3c74c1ce4798cf9923d4a45a98.
|
|
PR 27294
* elf32-avr.c (avr_elf32_load_records_from_section): Use
bfd_malloc_and_get_section. Use bfd_byte* vars and remove then
unnecessary casts.
|
|
Makes the code a little more elegant too. Note that the unsigned
overflow reported here is well defined so this patch doesn't fix any
real problem.
PR 27291
* section.c (bfd_get_section_contents): Avoid possible overflow
when range checking offset and count.
(bfd_set_section_contents): Likewise.
|
|
|
|
Right now, these libraries hardwire -L../intl -lintl on a few fixed
platforms, which works fine on those platforms but on other platforms
leads to shared libraries that lack libintl_* symbols when configured
--with-included-gettext, and/or static libraries that contain libintl as
*another* static library. If we instead use the LIBINTL variable
defined in ../intl/config.intl, this gives us the right thing on all
three classes of platform (gettext in libc, gettext in system libintl,
gettext in ../intl/libintl.a).. This also means we can rip out some
Darwin-specific machinery from configure.ac and also simplify the Cygwin
side.
This also means that the libctf testsuite (and other places that include
libbfd, libopcodes or libctf) don't need to grow libintl dependencies
just on account of those libraries (though they still need such
dependencies if they themselves use gettext machinery).
bfd/ChangeLog
2021-02-03 Nick Alcock <nick.alcock@oracle.com>
* configure.ac (SHARED_LIBADD): Remove explicit -lintl population in
favour of LIBINTL.
* configure: Regenerated.
libctf/ChangeLog
2021-02-02 Nick Alcock <nick.alcock@oracle.com>
* configure.ac (CTF_LIBADD): Remove explicit -lintl population in
favour of LIBINTL.
* Makefile.am (libctf_nobfd_la_LIBADD): No longer explicitly
include $(LIBINTL).
(check-DEJAGNU): Pass down to tests as well.
* configure: Regenerated.
* Makefile.in: Likewise.
opcodes/ChangeLog
2021-02-04 Nick Alcock <nick.alcock@oracle.com>
* configure.ac (SHARED_LIBADD): Remove explicit -lintl population in
favour of LIBINTL.
* configure: Regenerated.
|
|
|
|
* configure.ac: Delete arm*-*-symbianelf* entry.
* configure: Regenerate.
bfd/
* config.bfd (arm*-*-symbianelf*): Move from obsolete to removed.
* configure.ac: Delete symbian entries.
* elf-bfd.h (enum elf_target_os): Delete is_symbian.
* elf32-arm.c: Remove symbian support. Formatting.
* targets.c: Delete symbian entries.
* configure: Regenerate.
binutils/
* testsuite/lib/binutils-common.exp (supports_gnu_osabi): Remove
symbianelf.
gas/
* Makefile.am (TARG_ENV_HFILES): Remove config/te-symbian.h.
* config/tc-arm.c (elf32_arm_target_format): Remove TE_SYMBIAN
support.
* config/te-symbian.h: Delete.
* configure.tgt: Remove arm-*-symbianelf*.
* testsuite/gas/arm/arch4t-eabi.d: Don't mention symbianelf in
target selection.
* testsuite/gas/arm/arch4t.d: Likewise.
* testsuite/gas/arm/got_prel.d: Likewise.
* testsuite/gas/arm/mapdir.d: Likewise.
* testsuite/gas/arm/mapmisc.d: Likewise.
* testsuite/gas/arm/mapsecs.d: Likewise.
* testsuite/gas/arm/mapshort-eabi.d: Likewise.
* testsuite/gas/arm/thumb-eabi.d: Likewise.
* testsuite/gas/arm/thumb.d: Likewise.
* testsuite/gas/arm/thumbrel.d: Likewise.
* Makefile.in: Regenerate.
* po/POTFILES.in: Regenerate.
ld/
* Makefile.am (ALL_EMULATION_SOURCES): Remove earmsymbian.c.
Don't include symbian dep file.
* configure.tgt: Remove arm*-*-symbianelf* entry.
* emulparams/armsymbian.sh: Delete.
* ld.texi: Don't mention symbian.
* scripttempl/armbpabi.sc: Delete.
* testsuite/ld-arm/symbian-seg1.d: Delete.
* testsuite/ld-arm/symbian-seg1.s: Delete.
* testsuite/ld-arm/arm-elf.exp: Don't run symbian-seg1.
* Makefile.in: Regenerate.
* po/BLD-POTFILES.in: Regenerate.
|
|
|
|
|
|
|
|
|
|
|
|
Provide
[hjl@gnu-cfl-2 ld]$ ./ld-new -z norelro -L/export/gnu/import/git/gitlab/x86-binutils/ld/testsuite/ld-x86-64 -melf32_x86_64 -Ttext=0x80000000 -o tmpdir/dump tmpdir/pr19609-7.o
tmpdir/pr19609-7.o: in function `_start':
(.text+0x2): failed to convert GOTPCREL relocation against 'foobar'; relink with --no-relax
[hjl@gnu-cfl-2 ld]$
instead of
[hjl@gnu-cfl-2 ld]$ ld -z norelro -L/export/gnu/import/git/gitlab/x86-binutils/ld/testsuite/ld-x86-64 -melf32_x86_64 -Ttext=0x80000000 -o tmpdir/dump tmpdir/pr19609-7.o
ld: failed to convert GOTPCREL relocation; relink with --no-relax
[hjl@gnu-cfl-2 ld]$
bfd/
PR ld/19609
* elf64-x86-64.c (elf_x86_64_relocate_section): Provide more
info when failed to convert GOTPCREL relocation.
ld/
PR ld/19609
* testsuite/ld-x86-64/pr19609-2a.d: Updated.
* testsuite/ld-x86-64/pr19609-2b.d: Likewise.
* testsuite/ld-x86-64/pr19609-4a.d: Likewise.
* testsuite/ld-x86-64/pr19609-4c.d: Likewise.
* testsuite/ld-x86-64/pr19609-5d.d: Likewise.
* testsuite/ld-x86-64/pr19609-7a.d: Likewise.
* testsuite/ld-x86-64/pr19609-7c.d: Likewise.
|
|
bfd/
* elfxx-riscv.c (riscv_parse_prefixed_ext): Removed zb*.
gas/
* config/tc-riscv.c (riscv_multi_subset_supports): Removed
INSN_CLASS_ZB*.
* testsuite/gas/riscv/bitmanip-insns-32.d: Removed.
* testsuite/gas/riscv/bitmanip-insns-64.d: Removed.
* testsuite/gas/riscv/bitmanip-insns.s: Removed.
include/
* opcode/riscv-opc.h: Removed macros for zb* extensions.
* opcode/riscv.h (riscv_insn_class): Removed INSN_CLASS_ZB*.
opcodes/
* riscv-opc.c (MASK_RVB_IMM): Removed.
(riscv_opcodes): Removed zb* instructions.
(riscv_ext_version_table): Removed versions for zb*.
|
|
bfd/
PR 27311
* elflink.c (elf_link_add_object_symbols): Don't pull in as-needed
libraries for IR references on pass over libraries after LTO
recompilation.
ld/
* testsuite/ld-plugin/pr27311d.c: New test.
* testsuite/ld-plugin/lto.exp: Rename pr27311 to pr27311-1, compile
and link new test as pr27311-2.
|
|
|
|
This does exactly the same as making decisions based on an override
in _bfd_elf_add_default_symbol, and is simpler.
PR 27311
* elflink.c (_bfd_elf_add_default_symbol): Revert last two changes.
(elf_link_add_object_symbols): Here too. Don't pull in as-needed
libraries when H is an indirect symbol after calling
_bfd_elf_add_default_symbol.
|
|
bfd/
PR 27311
* elflink.c (_bfd_elf_add_default_symbol): Clear override when
undecorated symbol will have a different version.
ld/
* testsuite/ld-ifunc/ifunc.exp (libpr16467b.so, libpr16467bn.so):
Link with --as-needed.
|
|
|
|
A default versioned symbol definition in a shared library is
overridden by an unversioned definition in a regular object file, and
thus should not be reason to make an as-needed library needed.
bfd/
PR 27311
* elflink.c (_bfd_elf_add_default_symbol): Add override parameter.
Use when handling default versioned symbol. Rename existing
override variable to nondef_override and use for non-default
versioned symbol.
(elf_link_add_object_symbols): Adjust call to suit. Don't
pull in as-needed libraries when override is set.
ld/
* testsuite/ld-plugin/pr27311.d,
* testsuite/ld-plugin/pr27311.ver,
* testsuite/ld-plugin/pr27311a.c,
* testsuite/ld-plugin/pr27311b.c,
* testsuite/ld-plugin/pr27311c.c: New testcase.
* testsuite/ld-plugin/lto.exp: Run it. Correct PR14918 and
PR12982 entries.
|
|
|
|
* configure.tgt: Add *-*-genode* as a target for AArch64 and x86.
|
|
PR 27254
* elf32-rl78.c (rl78_elf_relocate_section): Fix calculation of
offset for the R_RL78_RH_SADDR relocation.
|
|
|
|
|
|
|
|
bfd/
PR 27271
* elflink.c (bfd_elf_link_record_dynamic_symbol): Don't segfault
on symbols defined in absolute or other special sections.
ld/
* testsuite/ld-tic6x/tic6x.exp: Add pr27271 test.
|
|
|