| Age | Commit message (Collapse) | Author | Files | Lines |
|
Current gcc adds a note to the LTO "using serial compilation" warning.
* lib/binutils-common.exp (prune_warnings_extra): Remove
lto-wrapper note.
|
|
This reverts commit f70242a98f91b7f5ec5b375346d8bfa7f9a61c4a.
Nick already applied this..
|
|
Limit the warning to ET_REL.
|
|
|
|
mergeable sections
|
|
PR 33701
* dwarf.c (process_debug_info): Set debug_info_p NULL when
DEBUG_INFO_UNAVAILABLE.
|
|
It is possible for dump_relocations to return on an error from
slurp_rela_relocs or slurp_rel_relocs without writing to
"all_relocations". In that case an uninitialised r_symbol is passed
to free at the end of process_got_section_contents.
PR 33698
PR 33700
* readelf.c (update_all_relocations): Zero array. Remove
unnecessary casts.
|
|
PR 33697
* readelf.c (process_relocs): Don't segfault on no sections.
|
|
On Solaris 11.4, there is SHT_SUNW_symnsort and no SHT_SUNW_symtabnsort.
SHT_SUNW_symnsort is defined to 0x6fffffec, which is the same as
SHT_SUNW_symtabnsort. There is also SHT_SUNW_ctf. Add SHT_SUNW_ctf and
rename SHT_SUNW_symtabnsort to SHT_SUNW_symnsort. Move SHT_SUNW_phname
after SHT_SUNW_symnsort.
binutils/
* readelf.c (get_solaris_section_type): Add SHT_SUNW_ctf and
SHT_SUNW_symnsort. Move SHT_SUNW_phname after SHT_SUNW_symnsort.
Remove SHT_SUNW_symtabnsort.
include/
* elf/common.h (SHT_SUNW_ctf): New.
(SHT_SUNW_symtabnsort): Renamed to ...
(SHT_SUNW_symnsort): This.
(SHT_SUNW_phname): Moved after SHT_SUNW_symnsort.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
|
end of a mergeable section.
|
|
* objcopy.c (copy_object): Re-indent.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
|
bringing the definitions of DW_AT_language_name and DW_AT_language_version. Add code to binutils/dwarf.c to display these attributes.
|
|
When DWARF5 support was added to binutils in commit 77145576fadc,
the loop over CUs in process_debug_info set do_types when finding a
DW_UT_type unit, in order to process the signature and type offset
entries. Unfortunately that broke debug_information/debug_info_p
handling, which previously was allocated and initialised for each unit
in .debug_info. debug_info_p was NULL when processing a DWARF4
.debug_types section. After the 77145576fadc change it was possible
for debug_infp_p to be non-NULL but point to zeroed data, in
particular a zeroed offset_size. A zero for offset_size led to the
byte_get_little_endian abort triggered by the fuzzer testcase.
I haven't investigated whether there is any need for a valid
offset_size when processing a non-fuzzed DWARF4 .debug_types section.
Presumably we'd have found that out in the last 6 years if that was
the case. We don't want to change debug_information[] for
.debug_types!
PR 33637
* dwarf.c (process_debug_info): Don't change DO_TYPES flag bit
depending on cu_unit_type. Instead test cu_unit_type along
with DO_TYPES to handle signature and type_offset for a type
unit. Move find_cu_tu_set_v2 call a little later.
|
|
Commit 1f7e70ddd2c4 made changes to process_debug_info parameters
without adjusting the function comment to suit. Fix that, and tidy
do_printing flag use.
* dwarf.c (process_debug_info): Edit function comment.
Make do_printing a bool. Fold DO_LOC test into do_printing.
|
|
use do_loc and do_types arguments into a signle unsigned int do_flags for
better code readability.
binutils/
* dwarf.c (DO_LOC, DO_TYPES): Define.
(process_debug_info): Change arguments do_loc and do_types
to a single unsigned int do_flags.
(find_cu_tu_set_v2): Change parameter do_types from int to bool.
Signed-off-by: Guillaume VACHERIAS <guillaume.vacherias@foss.st.com>
|
|
The default Solaris tail doesn't support "tail -n +4", apparently.
Use sed instead.
PR 33396
* testsuite/binutils-all/objdump.exp: Replace tail with an
equivalent sed expression in dwarf5 objdump -Wi test.
|
|
when a symbol 'foo' is exported and non-hidden and hence is
available for resolving from other objects it's unreasonable
for readelf to print it as 'foo@@'. If it's not available
for unversioned resolving because its version is hidden
(but without name), then continue printing it as 'foo@' to
indicate that something special goes on.
|
|
I missed one needed strdup of symbol names, needed since the original
symbol name memory is freed on bfd_close.
PR 33651
* dlltool.c (scan_filtered_symbols): xstrdup symbol name.
|
|
The fuzzed testcase in this PR prints an almost endless table of
offsets, due to a bogus offset count. Limit that count, and the total
length too.
PR 33639
* dwarf.c (display_loclists_unit_header): Return error on
length too small to read header. Limit length to section
size. Limit offset count similarly.
|
|
The fuzzed testcase in this PR continuously outputs an error about
the debug_rnglists header. Fixed by taking notice of the error and
stopping output. The patch also limits the length in all cases, not
just when a relocation is present, and limits the offset entry count
read from the header. I removed the warning and the test for relocs
because the code can't work reliably with unresolved relocs in the
length field.
PR 33638
* dwarf.c (display_debug_rnglists_list): Return bool. Rename
"inital_length" to plain "length". Verify length is large
enough to read header. Limit length to rest of section.
Similarly limit offset_entry_count.
(display_debug_ranges): Check display_debug_rnglists_unit_header
return status. Stop output on error.
|
|
Allow copy_private_symbol_data to replace osym if a target desires.
Change isym similarly for symmetry. The idea is to make it possible
to give the asymbol an output target specific extension. Some
targets, eg. som, use such an extension when outputting symbols,
behaving badly if the input object is not som. There are no
functional changes in this patch; It just changes the signatures.
bfd/
* elf-bfd.h (_bfd_elf_copy_private_symbol_data): Replace
asymbol* params with asymbol**.
* elf.c (_bfd_elf_copy_private_symbol_data): Likewise.
* libbfd-in.h (_bfd_bool_bfd_asymbol_bfd_asymbol_true): Likewise.
* libbfd.c (_bfd_bool_bfd_asymbol_bfd_asymbol_true): Likewise.
* mach-o.c (bfd_mach_o_bfd_copy_private_symbol_data): Likewise.
* mach-o.h (bfd_mach_o_bfd_copy_private_symbol_data): Likewise.
* plugin.c (bfd_plugin_bfd_copy_private_symbol_data): Likewise.
* som.c (som_bfd_copy_private_symbol_data): Likewise.
* targets.c (bfd_target <_bfd_copy_private_symbol_data>): Likewise.
* bfd-in2.h: Regenerate.
* libbfd.h: Regenerate.
binutils/
* objcopy.c (copy_object): Adjust bfd_copy_private_symbol_data call.
gas/
* symbols.c symbol_clone): Adjust bfd_copy_private_symbol_data call.
|
|
The Floating Point Mode Register is a new register which controls the
behaviour of FP8 instructions. This is handled by the Linux kernel
through a new NT_ARM_FPMR register set.
This patch adds required code to support core file dumps with
NT_ARM_FPMR in them.
|
|
This exposes an error on alpha-linux-gnuecoff where the start and end
syms are given the wrong storage class.
* testsuite/binutils-all/objcopy.exp (binary_symbol): Tighten
symbol type checking.
|
|
A small tidy that allows other symbols or warnings to appear in nm
output, and works around the case problem of windows drive letters
by simply omitting the $srcdir match.
* testsuite/binutils-all/objcopy.exp (binary_symbol): Check
objcopy and nm return status. Don't repeat prune_warnings
already done in binutils_run. Match each symbol separately,
reporting which match failed on a failure. Don't match
$srcdir in implicit test.
|
|
Change "it they exist" to "if they exist" in the description
of the --version-info option in the readelf man page.
|
|
Update readelf to display the base symbol version as
Symbol table for image contains 5 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000003008 0 OBJECT GLOBAL DEFAULT 10 bar@@
2: 0000000000000000 0 OBJECT GLOBAL DEFAULT ABS VERS_1
3: 0000000000003008 0 OBJECT GLOBAL DEFAULT 10 bar@@VERS_1
4: 0000000000003000 0 OBJECT GLOBAL DEFAULT 10 foo@
instead of
Symbol table for image contains 5 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000003008 0 OBJECT GLOBAL DEFAULT 10 bar
2: 0000000000000000 0 OBJECT GLOBAL DEFAULT ABS VERS_1
3: 0000000000003008 0 OBJECT GLOBAL DEFAULT 10 bar@@VERS_1
4: 0000000000003000 0 OBJECT GLOBAL DEFAULT 10 foo
That is bar@@ and foo@ vs bar and foo.
binutils/
PR binutils/33599
* readelf.c (process_version_sections): Replace 0x8001 with
(VERSYM_HIDDEN | VERSYM_BASE).
(get_symbol_version_string): Likewise. Return "" for the base
version.
include/
PR binutils/33599
* elf/common.h (VERSYM_BASE): New.
ld/
PR binutils/33599
* testsuite/ld-elf/pr33599.d: New file.
* testsuite/ld-elf/pr33599.map: Likewise.
* testsuite/ld-elf/pr33599.s: Likewise.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
|
As agreed with Nick I will be co-maintaining gprofng moving forward
along with Claudiu. Update the MAINTAINERS file accordingly.
|
|
the display of a fuzzed input file to complete without triggering an abort.
PR 33448
|
|
In CLANG_PLUGIN_FILE it is possible for plugin_file to be non-NULL
when LLVMgold.so does not exist.
configure output is messy, with results not printed against their
"checking.." line, eg.
checking for clang... (cached) yes
checking for clang plugin file... checking for x86_64-pc-linux-gnu-ar... (cached) ar --plugin /usr/lib/llvm-20/lib/clang/20/../../LLVMgold.so
/usr/lib/llvm-20/lib/clang/20/../../LLVMgold.so
This patch fixes those problems, and a similar interposition of other
configure output between AC_MSG_CHECKING and AC_MSG_RESULT in
gcc-plugin.m4. It also tidies some of the message text, and makes
similar code in gcc-plugin.m4 and clang-plugin.m4 a little more
consistent.
config/
* clang-plugin.m4 (CLANG_PLUGIN_FILE): Don't place checks for
tools (llvm-config, ar) inside AC_MSG_CHECKING..AC_MSG_RESULT
for clang plugin file. Clear plugin_file before loop exit.
(CLANG_PLUGIN_FILE_FOR_TARGET): Similarly.
* gcc-plugin.m4 (GCC_PLUGIN_OPTION): Similarly.
(GCC_PLUGIN_OPTION_FOR_TARGET): Correct AC_MSG_CHECKING. Tidy
return code.
binutils/
* testsuite/lib/binutils-common.exp <llvm_plug_opt>: Set for
non-native.
* configure: Regenerate.
/
* configure: Regenerate.
bfd/
* configure: Regenerate.
gas/
* configure: Regenerate.
gdb/
* configure: Regenerate.
gprof/
* configure: Regenerate.
gprofng/
* configure: Regenerate.
* libcollector/configure: Regenerate.
ld/
* configure: Regenerate.
libbacktrace/
* configure: Regenerate.
libctf/
* configure: Regenerate.
libiberty/
* configure: Regenerate.
libsframe/
* configure: Regenerate.
opcodes/
* configure: Regenerate.
sim/
* configure: Regenerate.
zlib/
* configure: Regenerate.
|
|
objcopy -I binary -O some_coff_target does not currently work without
choosing a valid arch with -B. This used to be the case for ELF
targets too, until commit 6765ee1825d9.
* testsuite/binutils-all/objcopy.exp (binary_symbol): Pass
-B arch to objcopy. Choose different output object files for
the two tests.
|
|
When using --input-target=binary, objcopy currently derives symbol names
from a mangled version of the input file name. This approach can lead to
unpredictable results, as the generated symbols depend on the file path and
working directory.
This patch introduces a new option:
--binary-symbol-prefix <prefix> Use <prefix> as the base symbol name for
the input file (default: derived from
file name)
It allows specifying an explicit symbol prefix, while preserving the existing
behavior as a fallback.
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
|
|
If zstd is not available or was intentionally disabled by the user
don't add it to the list of the available options to compress debug
sections when showing usage.
binutils/
* objcopy.c (copy_usage): Only output
--compress-debug-sections=zstd if HAVE_ZSTD.
|
|
In DWARF CFI an "undefined" register rule for the return address (RA)
register indicates that there is no return address and the stack trace
is complete.
Represent DW_CFA_undefined as SFrame FRE without any offsets, so that a
stack tracer implementation can use this as indication that an outermost
frame has been reached and the stack trace is complete.
This representation is backward compatible, as existing stack tracers
should already deal with the case, that an SFrame FRE a so far invalid
offset count of zero and stop the trace.
include/
* sframe.h (SFRAME_V2_FRE_RA_UNDEFINED_P): New macro to test
FRE info word for RA undefined (FRE without any offsets).
binutils/
* NEWS: Mention SFrame can represent an undefined RA as FRE
without any offsets.
gas/
* gen-sframe.h (struct sframe_row_entry): Add ra_undefined_p
flag.
* gen-sframe.c (sframe_row_entry_new): Initialize ra_undefined_p
flag to not set.
(sframe_row_entry_initialize): Treat ra_undefined_p flag as
sticky.
(sframe_fre_set_ra_track): Reset ra_undefined_p flag.
(sframe_xlate_do_restore): Reset ra_undefined_p flag to saved
state.
(sframe_xlate_do_same_value): Reset ra_undefined_p flag.
(sframe_xlate_do_cfi_undefined): For RA set ra_undefined_p flag.
(output_sframe_row_entry): Represent RA undefined as SFrame FRE
without any offsets and FRE info word fields zeroed.
* NEWS: Mention assembler represents .cfi_undefined RA in SFrame
as FRE without any offsets.
libsframe/
* doc/sframe-spec.texi (Changes from Version 1 to Version 2):
Mention that a SFrame FRE without any offsets flag indicates an
outermost frame with an undefined RA.
(fre_offset_count): Document that a FRE offset count of zero
indicates an outermost frame with an undefined RA.
* sframe.c (sframe_get_fre_ra_undefined_p): Use macro
SFRAME_V2_FRE_RA_UNDEFINED_P.
(sframe_fre_get_fp_offset, sframe_fre_get_ra_offset): Do not
return fixed FP/RA offset if RA undefined.
* sframe-dump.c (dump_sframe_func_with_fres): Show FRE without
any offsets as "RA undefined".
gas/testsuite/
* gas/cfi-sframe/cfi-sframe.exp: Run tests for .cfi_undefined RA
on AArch64, s390x, and x86-64.
* gas/cfi-sframe/cfi-sframe-aarch64-ra-undefined-1.d: Add test
for .cfi_undefined RA on AArch64.
* gas/cfi-sframe/cfi-sframe-aarch64-ra-undefined-1.s: Likewise.
* as/cfi-sframe/cfi-sframe-s390x-ra-undefined-1.d: Add test
for .cfi_undefined RA on s390x.
* gas/cfi-sframe/cfi-sframe-s390x-ra-undefined-1.s: Likewise.
* gas/cfi-sframe/cfi-sframe-x86_64-ra-undefined-1.d: Add test
for .cfi_undefined RA on x86-64.
* gas/cfi-sframe/cfi-sframe-x86_64-ra-undefined-1.s: Likewise.
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
|
|
|
|
|
|
This is just so the target won't need excluding in a forthcoming new
testcase. Without doing so objdump would fail saying "option -P/--private
not supported by this file".
|
|
Whether targ_defvec is set to the best match for the configured target
or some of the other supported targets usually doesn't matter, as the
actual target being used, usually is set by some other mechanism, like
an input object file.
In some situations it matters though: it might be confusing to see
--help output not showing the configured target first in the list of
supported targets. Also, some corner cases risk running into bugs like
PR33485, for cris-elf and cris-linux because cris_aout_vec is the
default target where instead the bug-free behavior of
cris_elf32_us_vec or cris_elf32_vec would be expected.
The test just verifies that the target list emitted for the --help
option has the expected target first.
bfd:
* config.bfd <cris-*-* | crisv32-*-*>: Split into <cris-*-*aout*>,
<cris-*-linux-* | crisv32-*-linux-*>, <cris-*-* | crisv32-*-*> cases
respectively setting targ_defvec per the target instead of always
cris_aout_vec.
binutils:
* testsuite/binutils-all/cris: New directory intended for
tests focused on behavior of the binutils programs, not the assembler
or linker.
* testsuite/binutils-all/cris/cris.exp: New file with run_dump_test
loop.
testsuite/binutils-all/cris/tgt-a.d,
testsuite/binutils-all/cris/tgt-e.d,
testsuite/binutils-all/cris/tgt-l.d: New tests.
Co-authored-by: Maciej W. Rozycki <macro@redhat.com>
|
|
In commit 6c3458a8b7ee I claimed that u.kenum is always non-NULL,
which is true for debug_make_enum_type, but not for enums made by
debug_make_undefined_tagged_type. Fix that oversight
PR 32829
* debug.c (debug_write_type): Handle NULL u.kenum.
(debug_type_samep): Likewise.
|
|
A fuzzed object file hit this sanitizer error.
readelf.c:16764:9: runtime error: pointer index expression with base
0x6dd4491e1590 overflowed to 0xe7af96d4491e17a1
The same could occur in any of the IN_RANGE reloc checks, where the
reloc address is calculated as "start + r_offset" then compared
against "start" and "end". So don't do that. Compare r_offset
against the memory size, first.
* readelf.c (IN_RANGE): Delete.
(in_range): New inline funcion.
(target_specific_reloc_handling): Replace "end" param with
"size". Update uses. Replace IN_RANGE with in_range.
(apply_relocations): Delete "end" variable. Update
target_specific_reloc_handling calls and replace IN_RANGE.
Avoid pointer overflow.
|
|
As already is the case for fetch_indexed_string() and
fetch_alt_indirect_string(), have them return a pointer to plain char,
properly compatible with e.g. the %s format specifier that the return
values are used with in several cases. This way no casts at call sites are
necessary, and several (bogus) ones in the functions can be exchanged for
just one each. Some other constification is needed elsewhere, now that
const-ness isn't being cast away anymore.
|
|
Detect the clang plugin file and and pass it to --plugin for ar and ranlib
so that binutils can be built with clang LTO.
bfd/
PR binutils/33470
* Makefile.in: Regenerated.
* aclocal.m4: Likewise.
* configure: Likewise.
binutils/
PR binutils/33470
* Makefile.in: Regenerated.
* aclocal.m4: Likewise.
* configure: Likewise.
gas/
PR binutils/33470
* Makefile.in: Regenerated.
* aclocal.m4: Likewise.
* configure: Likewise.
gprof/
PR binutils/33470
* Makefile.in: Regenerated.
* aclocal.m4: Likewise.
* configure: Likewise.
* testsuite/Makefile.in: Likewise.
gprofng/
PR binutils/33470
* Makefile.am (ACLOCAL_AMFLAGS): Add -I ../config.
* Makefile.in: Regenerated.
* aclocal.m4: Likewise.
* configure: Likewise.
* gp-display-html/Makefile.in: Likewise.
* libcollector/Makefile.in: Likewise.
* libcollector/aclocal.m4: Likewise.
* libcollector/configure: Likewise.
* src/Makefile.in: Likewise.
* libcollector/Makefile.am (ACLOCAL_AMFLAGS): Add -I ../../config.
ld/
PR binutils/33470
* Makefile.in: Regenerated.
* aclocal.m4: Likewise.
* configure: Likewise.
libctf/
PR binutils/33470
* Makefile.in: Regenerated.
* aclocal.m4: Likewise.
* configure: Likewise.
libsframe/
PR binutils/33470
* Makefile.in: Regenerated.
* aclocal.m4: Likewise.
* configure: Likewise.
opcodes/
PR binutils/33470
* Makefile.in: Regenerated.
* aclocal.m4: Likewise.
* configure: Likewise.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
|
|
|
There are two places in readelf.exp where we generate duplicate
testnames.
The first is due to calling readelf_find_size twice with the same
iteration index (2). This is fixed by using 4 for the second
instance.
The other is at the end of readelf_thin_archive_test. This test calls
readelf_test before unconditionally passing. It happens to construct
exactly the same test name as readelf test (might not be a
coincidence), so we end up with a duplicate test. But it seems wrong
anyway to 'pass' a test that readelf_test might have failed, so simply
delete this duplicate pass entry.
|
|
binutils tests support running a test with distinct options to the
assembler by allowing
#as: <optset-1>
#as: <optset-2>
But results in both test runs using the same test name in the summary
file. This causes confusion if one test fails but the other doesn't
(and GCC's compare_tests script will diagnose this as an error). To
fix the ambiguity append the appropriate optset to the test name.
We only do this if a test has multiple runs in this way to avoid
causing every test result name to change.
|
|
This reverts commit 897d8d7bba581e4c1614af5712b730b006f03407.
|
|
A comment in display_relocations said "RELRS has been freed by
dump_relr_relocations". Except that hadn't happened on all return
paths. Tidy that by freeing relrs allocated in dump_relr_relocations
in that function, and relrs allocated in display_relocation in that
function.
* readelf.c (dump_relr_relocations): Only free relrs allocated
in this function.
(display_relocations): Free relrs here, on error return paths
too.
|
|
..., like PR33360 does for strings.
Signed-off-by: Andrew C Aitchison <github@aitchison.me.uk>
|
|
If an ifunc symbol is processed in print_symbol(), a 'type' field of a
'syminfo' structure is set to any character specified by a user with an
'--ifunc-chars' option. But afterwards the 'type' field is used to
check whether a symbol is a stab in print_symbol_info_{bsd,sysv}()
functions in order to print additional stab related data. If the 'type'
field equals '-', a symbol is treated as a stab. If '--ifunc-chars=--'
is given, all ifunc symbols will be treated as stab symbols and
uninitialized stab related fields of the 'syminfo' structure will be
printed which can lead to segmentation fault.
To fix this, check if a symbol is a stab before override the 'type'
field. Also, add a test case for this fix.
PR binutils/32556
* nm.c (extended_symbol_info): Add is_stab.
(print_symbol): Check if a symbol is a stab.
(print_symbol_info_bsd): Use info->is_stab.
(print_symbol_info_sysv): Use info->is_stab.
* testsuite/binutils-all/nm.exp: Test nm --ifunc-chars=--.
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32556
Fixes: e6f6aa8d184 ("Add option to nm to change the characters displayed for ifunc symbols")
Signed-off-by: Dmitry Klochkov <dmitry.klochkov@bell-sw.com>
|
|
Trying to dump .sframe in a PE file results in a segfault accessing
elf_section_data.
* objdump (dump_sframe_section, dump_dwarf_section): Don't access
elf_section_type without first checking the file is ELF.
|
|
an error message that references the target string, not the file being copied
|