Commit Graph

120014 Commits

Author SHA1 Message Date
GDB Administrator
1f0bc051ac Automatic date update in version.in 2024-10-10 00:00:20 +00:00
Tom de Vries
2ae9b1b2d7 [gdb/testsuite] Fix gdb.base/reggroups.exp with check-read1
On aarch64-linux, with make target check-read1, I run into:
...
(gdb) info reg vector^M
  ...
d19            {f = 0x0, u = 0x0, s = 0x0} {f =FAIL: gdb.base/reggroups.exp: fetch reggroup regs vector (timeout)
 0, u = 0, s = 0}^M
...

The problem is that while (as documented) the corresponding gdb_test_multiple
doesn't work for vector registers, it doesn't skip them either.  This causes
the timeout, and it also causes the registers after a vector register not to
be found.

Fix this by using -lbl style matching.

Make which reggroups and registers are found more explicit using verbose -log,
which makes us notice that regnames with underscores are skipped, so fix that
as well.

While we're at it, this:
...
set invalid_register_re "Invalid register .*"
...
and this:
...
       -re $invalid_register_re {
           fail "$test (unexpected invalid register response)"
       }
...
means that the prompt may or may not be consumed.  Fix this by limiting the
regexp to one line, and using exp_continue.

While we're at it, improve readability of the complex regexp matching a single
register by factoring out regexps.

Tested on aarch64-linux and x86_64-linux.
2024-10-09 11:17:41 +02:00
Alan Modra
967dc35c78 PR32243, NAME_MAX does not exist on mingw-w64 without _POSIX_
PR 32243
	* dlltool.c: Move forward decls.  Delete unnecessary ones.
	(bfd_errmsg): Delete macro, define as inline function.
	(PATHMAX): Delete.
	(NAME_MAX): Define.
2024-10-09 12:00:11 +10:30
GDB Administrator
df475bd532 Automatic date update in version.in 2024-10-09 00:00:41 +00:00
Tom Tromey
a750186ec5 Use ui-out tables in "maint print user-regs"
This changes "maint print user-regs" to use ui-out tables rather than
printfs.

Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-10-08 17:07:37 -06:00
Tom Tromey
57f5c841c3 Use ui-out tables for info proc mappings
This changes a few implementations of "info proc mappings" to use
ui-out tables rather than printf.

Note that NetBSD and FreeBSD also use printfs here, but since I can't
test these, I didn't update them.

Approved-By: Andrew Burgess <aburgess@redhat.com>
2024-10-08 17:07:37 -06:00
Tom de Vries
09ff58c1ad [gdb/testsuite] Fix gdb.base/break-interp.exp with check-read1
When running test-case gdb.base/break-interp.exp with check-read1, I run into:
...
(gdb) info files^M
  ...
	0x00007ffff7e75980 - 0x00007ffff7e796a0 @ 0x001f1970 is .bss in /data/vries/gdb/leap-15-5/build/gdb/testsuite/outputs/gdb.base/break-interp/break-interp-BINprelinkNOdebugNOFAIL: gdb.base/break-interp.exp: ldprelink=NO: ldsepdebug=NO: binprelink=NO: binsepdebug=NO: binpie=NO: INNER: symbol-less: info files (timeout)
pieNO.d/libc.so.6^M
...

The code has two adaptations to deal with the large output:
- nested gdb_test_multiple, and
- an exp_continue in the inner gdb_test_multiple.

The former seems unnecessary, and the latter doesn't trigger often enough
because of an incomplete hex number regexp, causing the timeout.

Get rid of both of these, and use -lbl instead.

Tested on x86_64-linux.
2024-10-08 22:31:12 +02:00
Andrew Burgess
cd5e87850f gdb: include --enable-targets in 'show configuration' output
Include the value of configuration flag --enable-targets in the output
of GDB command 'show configuration' and also in the output printed for
'gdb --configuration'.  This will make it easier to see how GDB was
built.

No tests added or updated as we can't really check for a specific flag
appearing or not appearing on the configuration output.  But we do
print the configuration within lib/gdb.exp to check which features are
built into GDB, so if this change broke configuration printing then
plenty of tests should stop working (they don't).

Approved-By: Tom Tromey <tom@tromey.com>
2024-10-08 14:19:00 +01:00
Andrew Burgess
16a6f7d2ee gdb: avoid breakpoint::clear_locations calls in update_breakpoint_locations
The commit:

  commit 6cce025114
  Date:   Fri Mar 3 19:03:15 2023 +0000

      gdb: only insert thread-specific breakpoints in the relevant inferior

added a couple of calls to breakpoint::clear_locations() inside
update_breakpoint_locations().

The intention of these calls was to avoid leaving redundant locations
around when a thread- or inferior-specific breakpoint was switched
from one thread or inferior to another.

Without the clear_locations() calls the tests gdb.multi/tids.exp and
gdb.multi/pending-bp.exp have some failures.  A b/p is changed such
that the program space it is associated with changes.  This triggers a
call to breakpoint_re_set_one() but the FILTER_PSPACE argument will be
the new program space.  As a result GDB correctly calculates the new
locations and adds these to the breakpoint, but the old locations, in
the old program space, are incorrectly retained.  The call to
clear_locations() solves this by deleting the old locations.

However, while working on another patch I realised that the approach
taken here is not correct.  The FILTER_PSPACE argument passed to
breakpoint_re_set_one() and then on to update_breakpoint_locations()
might not be the program space to which the breakpoint is associated.
Consider this example:

  (gdb) file /tmp/hello.x
  Reading symbols from /tmp/hello.x...
  (gdb) start
  Temporary breakpoint 1 at 0x401198: file hello.c, line 18.
  Starting program: /tmp/hello.x

  Temporary breakpoint 1, main () at hello.c:18
  18	  printf ("Hello World\n");
  (gdb) break main thread 1
  Breakpoint 2 at 0x401198: file hello.c, line 18.
  (gdb) info breakpoints
  Num     Type           Disp Enb Address            What
  2       breakpoint     keep y   0x0000000000401198 in main at hello.c:18
  	stop only in thread 1
  (gdb) add-inferior -exec /tmp/hello.x
  [New inferior 2]
  Added inferior 2 on connection 1 (native)
  Reading symbols from /tmp/hello.x...
  (gdb) info breakpoints
  Num     Type           Disp Enb Address    What
  2       breakpoint     keep y   <PENDING>  main
  	stop only in thread 1.1

Notice that after creating the second inferior and loading a file the
thread-specific breakpoint was incorrectly made pending.  Loading the
exec file in the second inferior triggered a call to
breakpoint_re_set() with the new, second, program space as the
current_program_space.

This program space ends up being passed to
update_breakpoint_locations().

In update_breakpoint_locations this condition is true:

  if (all_locations_are_pending (b, filter_pspace) && sals.empty ())

and so we end up discarding all of the locations for this breakpoint,
making the breakpoint pending.

What we really want to do in update_breakpoint_locations() is, for
thread- or inferior- specific breakpoints, delete any locations which
are associated with a program space that this breakpoint is NOT
associated with.

But then I realised the answer was easier than that.

The ONLY time that a b/p can have locations associated with the
"wrong" program space like this is at the moment we change the thread
or inferior the b/p is associated with by calling
breakpoint_set_thread() or breakpoint_set_inferior().

And so, I think the correct solution is to hoist the call to
clear_locations() out of update_breakpoint_locations() and place a
call in each of the breakpoint_set_{thread,inferior} functions.

I've done this, and added a couple of new tests.  All of which are
now passing.

Approved-By: Tom Tromey <tom@tromey.com>
2024-10-08 13:51:47 +01:00
Tom de Vries
e232c98332 [gdb/testsuite] Fix gdb.ada/tagged-lookup.exp with read1+readnow
When running test-case gdb.ada/tagged-lookup.exp with target board readnow and
make target check-read1:
...
$ ( cd build/gdb; \
    make check-read1 \
      RUNTESTFLAGS="--target_board=readnow gdb.ada/tagged-lookup.exp" )
...
I run into:
...
(gdb) PASS: gdb.ada/tagged-lookup.exp: set debug symtab-create 1
print *the_local_var^M
$1 = (n => 2)^M
(gdb) FAIL: gdb.ada/tagged-lookup.exp: only one CU expanded
...

The problem is that the corresponding gdb_test_multiple uses line-by-line
matching (using -lbl) which doesn't work well with the multiline pattern
matching both the prompt and the line before it:
...
    -re -wrap ".* = \\\(n => $decimal\\\)" {
...

Fix this by making it a one-line pattern:
...
    -re -wrap "" {
...

While we're at it, replace an if-then-pass-else-fail with a gdb_assert.

Tested on aarch64-linux.
2024-10-08 13:45:21 +02:00
Tom de Vries
5ad960fcdb [gdb/symtab] Fix gdb.dwarf2/enum-type-c++.exp with cc-with-debug-types
When running test-case gdb.dwarf2/enum-type-c++.exp with target board
cc-with-debug-types, we run into:
...
(gdb) FAIL: gdb.dwarf2/enum-type-c++.exp: val1 has a parent
...
because val1 has no parent:
...
    [31] ((cooked_index_entry *) 0x7efedc002e90)
    name:       val1
    canonical:  val1
    qualified:  val1
    DWARF tag:  DW_TAG_enumerator
    flags:      0x0 []
    DIE offset: 0xef
    parent:     ((cooked_index_entry *) 0)

  ...

    [37] ((cooked_index_entry *) 0x38ffd280)
    name:       val1
    canonical:  val1
    qualified:  val1
    DWARF tag:  DW_TAG_enumerator
    flags:      0x0 []
    DIE offset: 0xef
    parent:     ((cooked_index_entry *) 0)
...

There are two entries, which seems to be an inefficiency, but for now let's
focus on the correctness issue.

The debug info for val1 looks like this:
...
 <1><cb>: Abbrev Number: 2 (DW_TAG_namespace)
    <cc>   DW_AT_name        : ns
    <cf>   DW_AT_declaration : 1
 <2><d3>: Abbrev Number: 12 (DW_TAG_class_type)
    <d4>   DW_AT_name        : A
    <d6>   DW_AT_declaration : 1
 <3><d6>: Abbrev Number: 13 (DW_TAG_enumeration_type)
    <db>   DW_AT_declaration : 1
 <1><dd>: Abbrev Number: 14 (DW_TAG_enumeration_type)
    <e7>   DW_AT_specification: <0xd6>
 <2><ef>: Abbrev Number: 5 (DW_TAG_enumerator)
    <f0>   DW_AT_name        : val1
    <f4>   DW_AT_const_value : 1
...

Fix this by:
- adding a cooked index entry for DIE 0xcb (and consequently for child DIE
  0xd3), by marking it interesting,
- making sure that the entry for DIE 0xcb has a name, and
- using the entry for DIE 0xd3 as parent entry for DIE 0xdd.

Tested on aarch64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
2024-10-08 12:27:20 +02:00
Tom de Vries
42d385542f [gdb/symtab] Fix parent of enumerator
As mentioned in commit 489b82720f5 ('[gdb/symtab] Revert "Change handling of
DW_TAG_enumeration_type in DWARF scanner"'), when doing "maint print objfiles" in
test-case gdb.dwarf2/enum-type.exp, for val1 we get an entry without parent:
...
    [27] ((cooked_index_entry *) 0x7fbbb4002ef0)
    name:       val1
    canonical:  val1
    qualified:  val1
    DWARF tag:  DW_TAG_enumerator
    flags:      0x0 []
    DIE offset: 0x124
    parent:     ((cooked_index_entry *) 0)
...

This happens here in cooked_indexer::index_dies:
...
	      info_ptr = recurse (reader, info_ptr,
				  is_enum_class ? this_entry : parent_entry,
				  fully);
...
when we're passing down a nullptr parent_entry, while the parent of this_entry
is deferred.

Fix this in cooked_indexer::index_dies by passing down a deffered parent
instead, such that we get:
...
    [27] ((cooked_index_entry *) 0x7ff0e4002ef0)^M
    name:       val1^M
    canonical:  val1^M
    qualified:  ns::val1^M
    DWARF tag:  DW_TAG_enumerator^M
    flags:      0x0 []^M
    DIE offset: 0x124^M
    parent:     ((cooked_index_entry *) 0x7ff0e4002f20) [ns]^M
...

Tested on x86_64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
2024-10-08 12:27:20 +02:00
Tom de Vries
e808bbbe37 [gdb/contrib] Fix "sofar->so far" misspelling
I forgot to follow up on a review comment and fix the "sofar->so far"
misspelling [1].

Fix this by adding it to gdb/contrib/common-misspellings.txt.

Tested on x86_64-linux.

[1] https://sourceware.org/pipermail/gdb-patches/2024-September/211894.html
2024-10-08 08:24:13 +02:00
Tom de Vries
0576fe8146 [gdb/contrib] Add more separators in spellcheck.sh
Add two more separators in spellcheck.sh: colon and comma.

Doing so triggers the "inbetween->between" rule, which gives an incorrect
result.  Override this with "inbetween->between, in between, in-between" [1],
in a new file gdb/contrib/common-misspellings.txt.

Fix the following common misspellings:
...
everytime -> every time
sucess -> success
thru -> through
transfered -> transferred
inbetween -> between, in between, in-between
...

Verified with spellcheck.sh.  Tested on x86_64-linux.

[1] https://www.grammarly.com/blog/commonly-confused-words/in-between-or-inbetween/
2024-10-08 08:24:13 +02:00
Tom de Vries
99fd53b19d [gdb/contrib] Factor out grep_or and sed_or in spellcheck.sh
While trying to add more separators here:
...
 # Separators: space, slash, tab.
 grep_separator=" |/|	"
 sed_separator=" \|/\|\t"
...
I mistakingly used "|" instead of "\|" in sed_separator.

Factor out new variables grep_or and sed_or, and construct the grep_separator
and sed_separator variables by joining the elements of a list using grep_or
and sed_or.

Verified with shellcheck, and tested by rerunning on x86_64-linux.

Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
2024-10-08 08:24:13 +02:00
Alan Modra
124deb3101 Revised "Don't return (null) from bfd_elf_sym_name"
Commit 68bbe11833 results in a lot of follow up work, much of which
likely is still to be done. (And yes, since this is all for corrupted
or fuzzed object files, a whole lot of work doesn't much benefit
anyone.  It was a bad idea to put NULL in asymbol->name.)  So I'm
changing the approach to instead put a unique empty string for symbols
with a corrupted st_name.  An empty string won't require much work to
ensure nm, objcopy, objdump etc. won't crash, since these tools
already must work with unnamed local symbols.

The unique empty string is called bfd_symbol_error_name.  This patch
uses that name string for corrupted symbols in the ELF and COFF
backends.  Such symbols are displayed by nm and objdump as the
translated string "<corrupt>", which is what the COFF backend used to
put directly into corrupted symbols.

ie. it's the way I should have written the original patch, plus a few
tides and cleanups I retained from the reverted patches.
2024-10-08 15:12:19 +10:30
Alan Modra
cc516199d6 Revert "Don't return "(null)" from bfd_elf_sym_name"
This reverts commit 68bbe11833.
2024-10-08 15:12:14 +10:30
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