Commit Graph

120147 Commits

Author SHA1 Message Date
Alan Modra
e5375abb67 Revert "bfd_elf_sym_name_raw"
This reverts commit 265757dc6e.
2024-10-08 15:12:14 +10:30
Alan Modra
9b09ceea7d Revert "get_synthetic_symtab fixes for commit 68bbe1183379"
This reverts commit 0c13ac533e.
2024-10-08 15:12:14 +10:30
Alan Modra
e022977bc5 Revert "is_target_special_symbol fixes for commit 68bbe1183379"
This reverts commit 6e40f9bb31.
2024-10-08 15:12:14 +10:30
Alan Modra
b0623fda9f Revert "dlltool fixes for commit 68bbe1183379"
This reverts commit 06116013f8.
2024-10-08 15:12:14 +10:30
Alan Modra
e8859e4947 Revert "elf.c and elflink.c fixes for commit 68bbe1183379"
This reverts commit 389fdfbe0d.
2024-10-08 15:12:14 +10:30
Alan Modra
22ad34b314 Revert "objcopy fixes for commit 68bbe1183379"
This reverts commit ef166f451f.
2024-10-08 15:12:14 +10:30
Xiao Zeng
542d8137f9 RISC-V: Fix implicit dependency of Zabha and Zacas
1 Zabha depends on Zaamo:
<https://github.com/riscv/riscv-isa-manual/blob/main/src/zabha.adoc>

2 Zacas depends on Zaamo:
<https://github.com/riscv/riscv-isa-manual/blob/main/src/zacas.adoc>

bfd/ChangeLog:

	* elfxx-riscv.c: Zabha and Zacas implicitly depend on Zaamo.

gas/ChangeLog:

	* testsuite/gas/riscv/imply.d: Updated.

Signed-off-by: Xiao Zeng <zengxiao@eswincomputing.com>
2024-10-08 11:45:28 +08:00
Vladimir Mezentsev
004d348063 gprofng: add hardware counters for Neoverse-N1 and Ampere-1 processors
gprofng/ChangeLog
2024-10-03  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>.

	* common/hwc_cpus.h: New constant for Neoverse-N1 and Ampere-1.
	* common/hwctable.c: Add the hwc table for Neoverse-N1 and Ampere-1.
	* src/hwc_arm_ampere_1.h: New file with hwc table for Ampere-1.
	* src/hwc_arm_neoverse_n1.h: New file with hwc table for Neoverse-N1.
2024-10-07 18:41:36 -07:00
GDB Administrator
ebeedbe2bb Automatic date update in version.in 2024-10-08 00:00:33 +00:00
Andreas Schwab
3f30f11f6d m68k: Support for jump visualization in disassembly
opcodes/
	* m68k-dis.c (m68k_opcode_to_insn_type): Define.
	(match_insn_m68k): Call it to set insn_type.
	(print_insn_arg) [case 'B']: Set branch target address.
	(print_insn_m68k): Set insn_info_valid.
2024-10-07 21:26:04 +02:00
Tom de Vries
11fe8653a9 [gdb/testsuite] Fix gdb.python/py-inferior.exp with -fsanitize=thread
With a gdb build with -fsanitize=thread, and test-case
gdb.python/py-inferior.exp I run into:
...
(gdb) python gdb.selected_inferior().read_memory (0, 0xffffffffffffffff)^M
ERROR: ThreadSanitizer: requested allocation size 0xffffffffffffffff exceeds \
  maximum supported size of 0x10000000000^M
...

There's already a workaround for this using ASAN_OPTIONS, and apparently the
same is needed for TSAN_OPTIONS.

Add the allocator_may_return_null=1 workaround also in TSAN_OPTIONS.

Likewise in gdb.dap/memory.exp.

Tested on x86_64-linux.
2024-10-07 10:44:45 +02:00
GDB Administrator
d396fcc9d1 Automatic date update in version.in 2024-10-07 00:00:09 +00:00
Gaius Mulley
8e756a12bd gdb/m2: add builtin procedure function ADR
This patch introduces ADR to the Modula-2 language interface.
It return the address of the parameter supplied.
The patch also contains a dejagnu test for ADR.

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
2024-10-06 20:40:59 +01:00
Gaius Mulley
8503550c45 gdb/MAINTAINERS: update my email address
Sync the maintainers file with my new email address.
2024-10-06 20:08:04 +01:00
Tom de Vries
23ca0175c6 [gdb] Rerun spellcheck.sh
Fix the following common misspellings:
...
completetion -> completion
inital -> initial
...
2024-10-06 08:07:31 +02:00
Tom de Vries
dda9cf662b [gdb] Fix more common misspellings
Fix the following common misspellings:
...
addres -> address, adders
behavour -> behavior, behaviour
intented -> intended, indented
ther -> there, their, the
throught -> thought, through, throughout
...

Tested on x86_64-linux.
2024-10-06 07:59:48 +02:00
Tom de Vries
8f6606b6e3 [gdb] Fix common misspellings
Fix the following common misspellings:
...
accidently -> accidentally
additonal -> additional
addresing -> addressing
adress -> address
agaisnt -> against
albiet -> albeit
arbitary -> arbitrary
artifical -> artificial
auxillary -> auxiliary
auxilliary -> auxiliary
bcak -> back
begining -> beginning
cannonical -> canonical
compatiblity -> compatibility
completetion -> completion
diferent -> different
emited -> emitted
emiting -> emitting
emmitted -> emitted
everytime -> every time
excercise -> exercise
existance -> existence
fucntion -> function
funtion -> function
guarentee -> guarantee
htis -> this
immediatly -> immediately
layed -> laid
noone -> no one
occurances -> occurrences
occured -> occurred
originaly -> originally
preceeded -> preceded
preceeds -> precedes
propogate -> propagate
publically -> publicly
refering -> referring
substract -> subtract
substracting -> subtracting
substraction -> subtraction
taht -> that
targetting -> targeting
teh -> the
thier -> their
thru -> through
transfered -> transferred
transfering -> transferring
upto -> up to
vincinity -> vicinity
whcih -> which
whereever -> wherever
wierd -> weird
withing -> within
writen -> written
wtih -> with
doesnt -> doesn't
...

Tested on x86_64-linux.
2024-10-06 07:59:48 +02:00
Tom de Vries
67eca1ccc1 [gdb/contrib] Add spellcheck.sh
I came across a table containing common misspellings [1], and wrote a script to
detect and correct these misspellings.

The table also contains entries that have alternatives, like this:
...
addres->address, adders
...
and for those the script prints a TODO instead.

The script downloads the webpage containing the table, extracts the table and
caches it in .git/wikipedia-common-misspellings.txt to prevent downloading it
over and over again.

Example usage:
...
$ gdb/contrib/spellcheck.sh gdb*
...

ChangeLog files are silently skipped.

Checked with shellcheck.

Tested on x86_64-linux, by running it on the gdb* dirs on doing a build and
test run.

The results of running it are in the two following patches.

Reviewed-By: Andrew Burgess <aburgess@redhat.com>
Approved-By: Tom Tromey <tom@tromey.com>

[1] https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines
2024-10-06 07:59:48 +02:00
GDB Administrator
2e676da72d Automatic date update in version.in 2024-10-06 00:00:12 +00:00
Alan Modra
ef166f451f objcopy fixes for commit 68bbe11833
* objcopy.c (is_specified_symbol): Handle NULL name.
	(filter_symbols): Drop syms with a NULL name.
2024-10-05 10:58:37 +09:30
Alan Modra
389fdfbe0d elf.c and elflink.c fixes for commit 68bbe11833
Plus some tidies to swap_out_syms.

	* elf.c (swap_out_syms): Handle NULL sym name.  Use correct type
	for return of _bfd_elf_strtab_add.  Simplify.
	* elflink.c (bfd_elf_match_symbols_in_sections): Handle NULL
	sym name.
2024-10-05 10:58:37 +09:30
GDB Administrator
c1947f57ee Automatic date update in version.in 2024-10-05 00:00:12 +00:00
Alan Modra
753e2f771b gdb segv in elfread.c:elf_rel_plt_read
After commit 68bbe11833, ELF symbols read via bfd_canonicalize_symtab
and similar functions which have bad st_name fields will have NULL in
the name rather than "(null)".  gdb.base/bfd-errors.exp deliberately
creates a faulty shared library with st_name pointing outside of
.dynsym for some symbols, and thus now results in NULL symbol names.
This triggers a segv on string_buffer.assign(name).  Fix that.
2024-10-04 22:16:49 +09:30
Alan Modra
06116013f8 dlltool fixes for commit 68bbe11833
For some reason, dlltool supports mcore-elf input files.

	* dlltool.c (filter_symbols): Drop symbols with NULL names.
	(identify_member_contains_symname): Don't consider symbols
	with NULL names.
2024-10-04 22:07:22 +09:30
Alan Modra
6e40f9bb31 is_target_special_symbol fixes for commit 68bbe11833
* elf.c (_bfd_elf_is_local_label_name): Don't segv on NULL name.
	* elf32-v850.c (v850_elf_is_local_label_name): Likewise.
	* elfnn-riscv.c (riscv_elf_is_target_special_symbol): Likewise.
2024-10-04 17:47:21 +09:30
Alan Modra
0c13ac533e get_synthetic_symtab fixes for commit 68bbe11833
Given that relocation symbol name can now be NULL for ELF, adjust
various get_synthetic_symtab routines so they don't segfault.

	* elf.c (_bfd_elf_get_synthetic_symtab): Cope with sym->name
	possibly being NULL.
	* elf32-arm.c (elf32_arm_get_synthetic_symtab): Likewise.
	* elf32-ppc.c (ppc_elf_get_synthetic_symtab): Likewise.
	* elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise.
	* elfxx-mips.c (_bfd_mips_elf_get_synthetic_symtab): Likewise.
	* elfxx-x86.c (_bfd_x86_elf_get_synthetic_symtab): Likewise.
2024-10-04 17:47:21 +09:30
Alan Modra
265757dc6e bfd_elf_sym_name_raw
Many uses of bfd_elf_sym_name report errors.  They ought to not return
a NULL, as was the case prior to commit 68bbe11833.  Introduce a new
function for cases where we'd like to know there is a problem with a
symbol st_name.

	* elf-bfd.h  (bfd_elf_sym_name_raw): Declare.
	* elf.c (bfd_elf_sym_name_raw): New function.
	(bfd_elf_sym_name): Revert to behaviour prior to 68bbe11833,
	but returning "<null>" rather than "(null)" for st_name errors.
	(group_signature): Use bfd_elf_sym_name_raw.
	* elfcode.h (elf_slurp_symbol_table): Likewise.
	* elf32-i386.c (elf_i386_scan_relocs): Whitespace.
2024-10-04 17:47:21 +09:30
Jan Beulich
85ef4a5ed8 gas: hide emulation struct format_ops instances when not needed
Most targets don't even support emulations, so this data (and certain
functions) are entirely dead code for them.
2024-10-04 09:42:45 +02:00
Jan Beulich
e9285aa046 x86: prune OBJ_MAYBE_... uses
With the removal of emulations, OBJ_MAYBE_... can no longer be defined.
Tidy code wherever they're used, which also includes the dropping of
most IS_ELF and uses and checks of OUTPUT_FLAVOR.

Where touching such constructs anyway, also drop TE_PEP checks when used
together with TE_PE ones (the former implies the latter).
2024-10-04 09:42:13 +02:00
Jan Beulich
46f44aa700 x86: drop largely defunct gas emulations
Both ELF and COFF have various sub-flavors, each of which would then
require its own emulation: Right now when configuring a COFF/PE
secondary target (with perhaps an ELF primary one), one gets plain COFF
emulation rather than COFF/PE one.

As such a multitude of emulations would be unwieldy (and likely fragile)
drop gas emulations altogether instead.
2024-10-04 09:41:38 +02:00
Jan Beulich
87d2a20152 include: de-duplicate i386.h and x86_64.h
Move common definitions to a new x86.h, thus allowing gas'es obj-coff.h
to include just that, getting rid of a TE_PEP compile-time dependency.
2024-10-04 09:39:36 +02:00
Jan Beulich
d6b42c3035 gas: drop generate_asm_lineno emulation hook
It's not wired up, so can't be used.
2024-10-04 09:38:05 +02:00
Jan Beulich
ccaa95c887 gas: don't use COFF-specific SF_SET_LOCAL() directly from read.c
Make this a proper obj-format hook instead.
2024-10-04 09:37:37 +02:00
Jan Beulich
833c28eefb gas/dw2gencfi: correct .sframe section conditional
While originally this was in preparation of a subsequent change making
SUPPORT_FRAME_LINKONCE potentially dependent on a global variable, the
construct appears unlikely to have been correct in the first place: The
variable would have been passed reliably uninitialized when
SUPPORT_FRAME_LINKONCE is build-time true.

While there correct indentation of the parameters passed to
get_cfi_seg().
2024-10-04 09:36:56 +02:00
Jan Beulich
c41215350b gas: put emul decls in emul.h
The individual struct emulation instances shouldn't be declared in a .c
file; it and the producers of the symbols want to both see the
declarations, so declarations and definitions don't go out of sync. Move
these declarations to emul.h.

While there also adjust the conditional around this_format: That symbol
is never #define-d anywhere, and it's needed only when USE_EMULATIONS is
defined. (Really, when obj-multi isn't in use, it also is effectively
only ever written to.)
2024-10-04 09:36:24 +02:00
Jan Beulich
2ced0b79da gas: drop unused fields from struct emulation
Neither .match not .bfd_name appear to ever have been used in the last
about 25 years. Purge them.
2024-10-04 09:35:56 +02:00
Jan Beulich
af16469a90 MAINTAINERS: move M R Swami Reddy to Past Maintainers
He/she cannot be reached at the given address anymore, and the name is
apparently too common to identify the person to attempt to establish
another contact. Sadly this orphans the CR16 and CRx ports.
2024-10-04 09:34:11 +02:00
Jan Beulich
4b59d30c84 MAINTAINERS: move Matt Thomas to Past Maintainers
Matt cannot be reached at the @netbsd.org address anymore, and I was
unable to find another one, even with the help of the NetBSD community
(where his resigning was announced over 4 years ago [1]).

[1] http://mail-index.netbsd.org/netbsd-announce/2020/05/07/msg000314.html
2024-10-04 09:33:49 +02:00
GDB Administrator
33bb412bda Automatic date update in version.in 2024-10-04 00:00:11 +00:00
oltolm
59529d80e8 gdb-dap: disable events when deleting breakpoints
when I disable a breakpoint in VS Code the breakpoint is removed
instead. I compared the behavior to lldb-dap and disabled events when
removing a breakpoint. Now it is possible to disable and enable
breakpoints in VS Code.
2024-10-03 11:12:40 -06:00
Alexey Izbyshev
98b1464bdf bfd: fix unnecessary bfd.info regen
When building from an unmodified release tarball, a REGEN_TEXI
invocation is supposed to create a symlink to the .texi file
in the source directory and discard the newly generated .tmp file.
However, after commit bd32be01c9 ("bfd: merge doc subdir up a level")
it creates the symlink at the wrong level, and then a .texi with
a fresh timestamp, which in turn forces bfd.info regeneration.
This breaks builds in environments without makeinfo program.

Fix this by creating the symlink at the level of the target stamp.

Fixes: bd32be01c9 ("bfd: merge doc subdir up a level")
Signed-off-by: Alexey Izbyshev <izbyshev@ispras.ru>
2024-10-03 12:58:50 +09:30
Alan Modra
424890868f peicode.h formatting
Fix some overlong line, comment block style, whitespace issues.
2024-10-03 12:58:50 +09:30
Alan Modra
c6bf8c475a Enable dlltool --leading-underscore for targets other than x86
This also makes the dlltool tests run more PE targets, finding that
sh-pe dlltool reports "Machine 'sh' not supported".  I guess no one
cares about that.

	PR19459
	* dlltool.c (asm_prefix): Remove "mach" parameter.  Return
	leading_underscore independent of machine.
	(ASM_PREFIX): Adjust.
	* testsuite/binutils-all/dlltool.exp: Run on any target
	satisfying is_pecoff_format for which dlltool is built.
	Revert commit 0398b8d6c8.  Remove target_xfail.
2024-10-03 12:31:46 +09:30
Alan Modra
45a7f5a29d dlltool leading_underscore
This patch tidies dlltool code dealing with adding a leading
underscore to generated symbol names.  There should be no functional
change here, but there could be if we ever have a bfd target with
symbol_leading_char something other than '_' or 0.

	* dlltool.c (leading_underscore): Change from an int to a
        char*.  Update all uses.  If neither --leading-underscore or
        --no=leading-underscore is given, set leading_underscore to a
        string with first char returned by bfd_get_target_info as the
        target's symbol underscoring.
2024-10-03 12:31:45 +09:30
Alan Modra
d2ea1a9411 nm: don't try to print line numbers for symbols without names
It doesn't make much sense trying to print line numbers for what are
usually broken symbols, and there is a possibility of a segfault if
we pass strcmp a NULL.
2024-10-03 12:31:45 +09:30
Alan Modra
68bbe11833 Don't return "(null)" from bfd_elf_sym_name
A NULL return from bfd_elf_string_from_elf_section indicates an error.
That shouldn't be masked by bfd_elf_sym_name but rather passed up to
callers such as group_signature.  If we want to print "(null)" then
that should be done at a higher level.  That's what this patch does,
except that I chose to print "<null>" instead, like readelf.  If we
see "(null)" we're probably passing a NULL to printf.  I haven't
changed aoutx.h or pdp11.c print_symbol functions because they already
handle NULL names by omitting the name.  I also haven't changed
mach-o.c, mmo.c, som.c, srec.c, tekhex.c, vms-alpha.c and
wasm-module.c print_symbol function because it looks like they will
never have NULL symbol names.

bfd/
	* elf.c (bfd_elf_sym_name): Don't turn a NULL name into a
	pointer to "(null)".
	(bfd_elf_print_symbol): Print "<null>" for NULL symbol names.
	* coffgen.c (coff_print_symbol): Likewise.
	* ecoff.c (_bfd_ecoff_print_symbol): Likewise.
	* pef.c (bfd_pef_print_symbol): Likewise.
	* syms.c (bfd_symbol_info): Return "<null>" in symbol_info.name
	if symbol name is NULL.
ld/
	* ldlang.c (ld_is_local_symbol): Don't check for "(null)"
	symbol name.
2024-10-03 12:31:45 +09:30
GDB Administrator
a3aa9cb83f Automatic date update in version.in 2024-10-03 00:00:21 +00:00
Ruud van der Pas
63b5e37fbc gprofng: fix a problem with hardware event counters
Fix a bug where an experiment with hardware event counter data
causes the source and disassembly files not to be generated.
No longer suppress zero valued metrics and change the name
of the man page in a warning message. Adapt line lengths to
not exceed 79.

gprofng/ChangeLog
2024-09-24  Ruud van der Pas  <ruud.vanderpas@oracle.com>

	PR 32193
	PR 32199
	PR 32201
	* gp-display-html/gp-display-html.in: Implement all
	the above changes.
2024-10-02 10:34:52 -07:00
Andrew Burgess
bcb92f7ba7 gdb: more file name styling
While looking at the recent line number styling commit I noticed a few
places where we could add more file name styling.  So lets do that.

Approved-By: Tom Tromey <tom@tromey.com>
2024-10-02 10:10:20 +01:00
Martin Storsjö
042f14505e Add support for IMPORT_NAME_EXPORTAS in ILF (MSVC style) import libraries
This import name type is formally yet undocumented, but MSVC
produces/supports it, primarily for ARM64EC import libraries.

LLVM/LLD also supports this import name type. Since recently,
llvm-dlltool also uses this type for certain kinds of renamed imports
(that are easy to do in the long style import libraries produced by
GNU dlltool, but require this name type in short import libraries).

This name type contains a third string, in addition to the symbol
name and the DLL name, indicating the actual imported name to
reference in the import tables - which now can be distinct different
from the symbol name on the object file level.

8f23464a5d
and
7b275aa243
show how this import name type was added in LLVM.

Signed-off-by: Martin Storsjö <martin@martin.st>
2024-10-02 11:50:12 +03:00