Age | Commit message (Collapse) | Author | Files | Lines |
|
Generating the linker dump test list using file globbing makes it
difficult to exclude specific tests under certain circumstances. List
them explicitly instead. This enables to add tests in the future that
can be excluded. While at it reorganize how s390 linker tests get
run for s390x.
ld/testsuite/
* ld-s390/s390.exp: Reorganize and explicitly list linker dump
tests.
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
|
|
The .sframe section may have a trailing padding due to the architecture-
specific default section alignment. Do not treat this padding as error
when converting between target and host endianness.
This can be observed when building Binutils with SFrame s390x support on
x86-64 for s390x using configure option "--target=s390x-ibm-linux-gnu"
and running the GAS test suite.
While at it reuse the determined SFrame section header size.
libsframe/
* sframe.c (flip_sframe): Ignore .sframe section padding. Reuse
SFrame header size.
Reported-by: Indu Bhagat <indu.bhagat@oracle.com>
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
|
|
|
|
Swap AM_PO_SUBDIRS and ZW_GNU_GETTEXT_SISTER_DIR lines in
*/configure.ac. ZW_GNU_GETTEXT_SISTER_DIR indirectly invokes
AC_REQUIRE(AM_PO_SUBDIRS) so results in AM_PO_SUBDIRS being emitted
before ZW_GNU_GETTEXT_SISTER_DIR if it hasn't already been invoked.
|
|
The v850 md_convert_frag function oddly calls subseg_change twice
(commit 1cd986c58543). Neither call is needed, because that is done
in size_seg.
Convert the fr_opcode fixup field back (to an opindex, not fx_r_type)
using a cast rather than a union, since we used casts when setting up
those values. I guess the union was added to silence compiler
warnings about wrong-size casts, but unfortunately results in the
wrong value being retrieved on big-endian hosts.
Change "buffer" to a char* as there is no need to make it an
unsigned char*, and that way requires fewer casts. Finally, fix
formatting and use uintptr_t when make the rs_machine_dependent frags.
Remove subseg_change calls from cr16, crx, mn10200, mn10300, and sh
md_convert_frag too.
|
|
Rename the old enum alpha_macro_arg to alpha_macro_argset, and create
a union alpha_macro_arg to use in all the alpha_macro.emit functions.
This avoids intptr_t casts on retrieving index values and void* casts
on storing them in the alpha_macros array.
|
|
|
|
Import the following commits from GCC as of r16-2170-g2f2e9bcfb0fd9c:
0fd98b6f9f2 libiberty: add routines to handle type-sensitive doubly linked lists
|
|
The entry of "zce imply zcf" needs check_implicit_for_zcf, so it needs to be
placed after the entries of "whatever imply f". Otherwise the implicit zcf
may be missed. Also merge the march-implu-zce* testcases into imply testcases.
|
|
This also fix the imply result for .option rvc.
Imply zcf when c and f and rv32
Imply zcd when c and d
Imply zca when c
Changed INSN_CLASS_C to INSN_CLASS_ZCA
Changed INSN_CLASS_F_AND_C to INSN_CLASS_ZCF
Changed INSN_CLASS_D_AND_C to INSN_CLASS_ZCD
Changed INSN_CLASS_ZIHINTNTL_AND_C to INSN_CLASS_ZIHINTNTL_AND_ZCA
|
|
Before we figure out the whole remove situations for ".option arch, -ext", and
have any RISC-V public spec defines it, we should just deprecate it.
|
|
|
|
for SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS.
The intention of creating an abstraction like
SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS is to address the concern that there
should be a central place to enforce harmonious flags between GNU as and
ld. At the moment, the only flag that needs to be enforced is
SFRAME_F_FDE_FUNC_START_PCREL.
sframe.h and sframe-api.h are installed headers by libsframe for the
specification and implementation respectively. Adding a definition like
SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS does not fit in either. Create a
new internal header instead to keep the definition uncoupled from
sframe.h and sframe-api.h. Rename the previously added
SFRAME_F_LD_MUSTHAVE_FLAGS to define the new
SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS.
bfd/
* elf-sframe.c (_bfd_elf_merge_section_sframe): Use the new
internal header and SFRAME_V2_GNU_AS_LD_ENCODING_FLAGS.
gas/
* gen-sframe.c (output_sframe_internal): Likewise.
include/
* sframe-api.h (SFRAME_F_LD_MUSTHAVE_FLAGS): Move from..
* sframe-internal.h: ..to here. New file.
|
|
init_private_section_data is used by the linker and is a special case
of copy_private_section_data that copies a reduced set of section data
from input to output. Merge the two functions, adding a link_info
param to copy_private_section_data and remove init_private_section_data.
|
|
This continues the saga of removing unnecessary casts, and making
small code tidies in gas. Hopefully this sees the last of K&R
anachronisms.
|
|
The point here is that when valueT is 64 bits and int is 32 bits,
1 << align doesn't work for shifts larger than the size of int. (Not
that anyone is likely to use such large alignments in real code.)
|
|
This patch removes more unnecessary arg casts in various function
calls.
|
|
Remove unnecessary arg casts in fix_new and similar calls.
|
|
This patch removes many unneeded casts to char or unsigned char. It's
worth noting that safe-ctype.h macros ISDIGIT and the like cope with
either signed or unsigned char.
In some cases a cast to unsigned char is replaced by anding with 0xff,
which accomplishes the same thing but doesn't rely on char being eight
bits. The patch also removes pointer casts, and a few unsigned char
pointer variables.
|
|
Use standard sign extend and range checking using unsigned
expressions that don't rely on implementation defined right shifts or
size of short and int.
|
|
Calls to md_number_to_chars don't need to cast their value arg (*).
Remove those casts. avr_output_property_recode made a call to
md_number_to_chars with size of 1. Simplify that. tc-bpf.c
md_convert_frag used write_insn_bytes that simply copied input to
output. Dispense with that nonsense, and similarly in a couple of
other places where md_number_to_chars was called with size 1.
*) unless the value arg is an expression that needs a cast, eg. tic54x
emit_insn where the shift left could trigger signed overflow UB
without a cast.
|
|
z8k opcode_entry_type.func is never used as a function pointer, only
as a pointer to a pseudo_typeS. Change it to a void*.
|
|
This removes assorted unneeded casts of void* pointers, and casts when
passing args to void* parameters or storing to void* pointers. The
patch also changes obj-coff.c stack_push to take a void* parameter,
and replaces an odd memcpy in tc-metag.c find_insn_templates with a
simple assignment.
|
|
This removes a bunch of casts involving const pointers, in some cases
by making variables const pointers so a cast is not needed. In a
couple of places the cast hid errors with "&array" written rather than
"array", see iq2000_macro_defs and s_pru_align. tc-xgate.c cmp_opcode
is changed to be the standard qsort predicate to avoid a function
cast.
|
|
d30v has a bunch of casts that are only needed due to various types
missing a const. Fix that.
|
|
All of the various memory allocation function return a "void *"
pointer, which needs no cast to assign to other pointer types.
|
|
bfd_{h_,}put_* and bfd_{h_,}get_* have "void *" pointer params
nowadays. We don't need casts on their pointer args. We also don't
need to cast values passed to bfd_put.
|
|
This removes many unnecessary NULL casts. I'm also adding a few arg
casts in concat calls, to make the code consistent. Advice from quite
a few years ago was that it's better to use the exact type for args
corresponding to function ellipses, in case NULL is defined as plain
0. (I think that happened with some early 64-bit systems. Plain NULL
ought to be OK nowadays.)
|
|
s3_FAIL is defined as 0x80000000 which is unsigned, but everywhere it
is used it is cast to int. Get rid of that silliness, and likewise
for s7_FAIL.
|
|
Remove more unnecessary enum casts.
|
|
Enumeration constants are integer types, so there should be no need to
cast such constants to int in expressions. (Perhaps some older gccs
warned, I checked back to gcc-4.5.) Remove some of those unnecessary
casts. Also remove unnecessary casts to bfd_reloc_code_real_type.
|
|
* ecoff.c: Remove unnecessary arg casts in add_ecoff_symbol
calls throughout file.
|
|
Many frag_var calls have unnecessary casts on arguments, no doubt from
the days when binutils was written for K&R C. (ie. functions were not
prototyped so you needed to cast anything that didn't match the
expected type after default promotions, as you still do for args
matching a function ellipsis.) Remove those casts.
* config/tc-alpha.c (s_alpha_comm): Use offset_T for cur_size
to avoid need for casts. Remove casts from frag_var args.
* config/tc-ia64.c (obj_elf_vms_common): Remove casts from
frag_var args.
* config/tc-m32r.c (m32r_scomm): Likewise.
* config/tc-m68hc11.c (build_jump_insn): Likewise.
(build_dbranch_insn): Likewise.
* config/tc-m68k.c (md_assemble): Likewise.
* config/tc-microblaze.c (microblaze_s_lcomm): Likewise.
* config/tc-mmix.c (s_loc): Likewise.
* config/tc-ppc.c (ppc_elf_lcomm, ppc_comm): Likewise.
* config/tc-score.c (s3_s_score_lcomm): Likewise.
* config/tc-score7.c (s7_s_score_lcomm): Likewise.
* config/tc-sh.c (sh_cons_align): Likewise.
* config/tc-sparc.c (s_reserve, s_common): Likewise.
(sparc_cons_align): Likewise.
* config/tc-tic4x.c (tic4x_seg_alloc, tic4x_bss): Likewise.
* config/tc-tic54x.c (tic54x_bss, tic54x_space): Likewise.
(tic54x_usect, tic54x_field): Likewise.
* config/tc-tic6x.c (s_tic6x_scomm): Likewise.
* config/tc-v850.c (v850_offset, v850_comm): Likewise.
* frags.c (frag_align, frag_align_pattern, frag_align_code): Likewise.
* gen-sframe.c (output_sframe_row_entry): Likewise.
(output_sframe_funcdesc): Likewise.
* read.c (s_fill, do_org, s_space, emit_leb128_expr): Likewise.
* symbols.c (colon)): Likewise.
|
|
Use "intptr_t" or "uintptr_t" for these conversions, not "long" which
is wrong on LLP64 systems, or "size_t" which is better but still not
the correct type.
* config/tc-alpha.c (emit_ldXu, emit_ldX, emit_uldXu, emit_uldX),
(emit_stX, emit_ustX, emit_sextX): Use correct type when
converting vlgsize pointer to in. Use "int" rather than
"long" for result.
* config/tc-ia64.c (generate_unwind_image): Use intptr_t cast
when passing personality_routine to frag_var.
* config/tc-ppc.c (ppc_frob_symbol <coff>): Use uintptr_t cast
when converting symbol pointer to valueT.
* config/tc-v850.c (md_assemble): Use intptr_t cast when
loading integer opindex.
|
|
|
|
|
|
This will improve readability when more combinations of "SVE* or SME*"
are added.
|
|
add support to recording 2 missing AVX instructions: vaddsubps and vaddsubpd, and add associated tests.
Approved-By: Guinevere Larsen <guinevere@redhat.com>
|
|
Use bfd_follow_gnu_debuglink() and bfd_follow_gnu_debugaltlink() to find files
with debug info.
If necessary, gprofng-archive copies these files to EXP/archives.
For each executable, gprofng creates the Elf class twice.
One of them was a memory leak.
Fixed this by adding a new argument to Stabs::Stabs().
gprofng/ChangeLog
2025-07-07 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
PR 32147
PR 30194
* src/Disasm.cc (get_funcname_in_plt): Use the executable file instead
of the debug information file.
* src/Dwarf.h: Define debug_alt_strSec.
* src/DwarfLib.cc: Add support for DW_FORM_GNU_ref_alt,
DW_FORM_GNU_strp_alt.
* src/Elf.h (find_gnu_debug_files, get_dwr_section): New functions.
* src/Elf.cc: Likewise.
* src/Experiment.cc (copy_file): Add the const qualifier.
* src/Experiment.h: Likewise.
* src/LoadObject.cc (get_elf, openDebugInfo): Find files with debug info.
* src/LoadObject.h: Remove unused variables.
* src/Module.cc: Remove an argument in openDebugInfo().
* src/Stabs.cc (Stabs::Stabs): Add the Elf* argument.
* src/Stabs.h: Likewise.
* src/gp-archive.cc: Archive files with debug info.
* src/gp-archive.h (archive_file): New function.
|
|
A recent patch of mine modified wchar.exp, but I failed to notice one
part of the review. This patch updates the code to conform to the
review comments.
|
|
|
|
When building a cross-compiler ld for RISC-V Linux systems, you can specify
target=riscv64*-linux* to create a linker that supports both 32-bit
(-march=rv32*) and 64-bit (-march=rv64*) architectures. The specified -march
value populates the EMULATION_NAME variable, which determines the default
linker script selection. For proper riscv64 target support, the build process
must prepare both elf32lriscv* and elf64lriscv* linker scripts. These should
align with the standard RISC-V Linux sysroot directory structure.
Signed-off-by: Mark Goncharov <mark.goncharov@syntacore.com>
|
|
|
|
|
|
|
|
|
|
Reference commit 1dcb9720d62cd053a72c31881b7724ce9f74332c
bfd/
* elfnn-riscv.c (RISCV_COPY_INPUT_RELOC): Bind defined symbol
locally in PIE.
ld/
* testsuite/ld-riscv-elf/pie-bind-locally-a.s: New test source.
* testsuite/ld-riscv-elf/pie-bind-locally-b.s: Likewise.
* testsuite/ld-riscv-elf/pie-bind-locally-rv32.d: New testcase.
* testsuite/ld-riscv-elf/pie-bind-locally-rv64.d: Likewise.
Signed-off-by: Linsen Zhou <i@lin.moe>
|
|
|
|
class ElfReloc is not used after we started use libbfd.
Removed ElfReloc and other unused declarations.
gprofng/ChangeLog
2025-07-03 Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
* src/Disasm.cc: Remove unused functions and variables.
* src/Disasm.h: Likewise.
* src/Dwarf.cc: Likewise.
* src/DwarfLib.cc: Likewise.
* src/DwarfLib.h: Likewise.
* src/Elf.cc: Likewise.
* src/Elf.h: Likewise.
* src/Stabs.cc: Likewise.
* src/Stabs.h: Likewise.
|
|
Hannes filed a bug that pointed out that:
print L'\\'
... did not work correctly. The bug is in convert_escape, which
simply transcribes the backslash character, rather than convert it
between encodings.
This patch fixes the error. I also turned a macro into a lambda to
clean up this code a little.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33124
Reviewed-By: Tom de Vries <tdevries@suse.de>
Tested-By: Hannes Domani <ssbssa@yahoo.de>
|