Commit Graph

113070 Commits

Author SHA1 Message Date
Simon Marchi
6ad66f21fc gdb: move compile_instance to compile/compile.h
struct compile_instance needs to be visible to users, since we use
std::unique<compile_instance>.  language.c and c-lang.c currently
includes compile-internal.h for this reason, which kind of defeats the
purpose of having an "internal" header file.

Change-Id: Iedffe5f1173b3de7bdc1be533ee2a68e6f6c549f
Reviewed-By: Bruno Larsen <blarsen@redhat.com>
2023-01-20 14:48:56 -05:00
Simon Marchi
c85555b1a8 gdb: move type_map_instance to compile/compile.c
It's only used in compile/compile.c, it doesn't need to be in a header.

Change-Id: Ic5bec996b7b0cd7130055d1e8ff238b5ac4292a3
Reviewed-By: Bruno Larsen <blarsen@redhat.com>
2023-01-20 14:48:56 -05:00
Indu Bhagat
57ffc61c6d Upload SFrame spec files as well
binutils/
	* README-how-to-make-a-release: Include sframe-spec html and pdf
	files.
2023-01-20 11:14:11 -08:00
Tom Tromey
6ec27270ff Use bool in pc_in_* functions
I noticed that pc_in_unmapped_range had a weird return type -- it was
returning a CORE_ADDR but intending to return a bool.  This patch
changes all the pc_in_* functions to return bool instead.
2023-01-20 11:02:23 -07:00
Tom Tromey
42938c1a5b Constify notif_client
It seems to me that a notif_client is read-only, so this patch changes
the code to use "const" everywhere.
2023-01-20 10:48:26 -07:00
Simon Marchi
5a5319833d gdb: remove struct trad_frame forward declaration
I found this forward declaration for a struct that doesn't exist, remove
it.

Change-Id: Ib9473435a949452160598035e5e0fe19fcdc4d20
2023-01-20 12:35:01 -05:00
Tom Tromey
75890dfaf1 Make gdb.ada/ptype_tagged_param.exp pass
gdb.ada/ptype_tagged_param.exp is failing for me on x86-64 Fedora 36.
However, it's actually generating the correct output -- it is just
that the test thinks that the "ptype" will not work because I do not
have the GNAT debuginfo installed.

This patch changes the code to accept either result, and then to issue
a kfail as appropriate.
2023-01-20 10:05:39 -07:00
Simon Marchi
b70bff5ea5 gdb/dwarf: fix UBsan crash in read_subrange_type
When running gdb.ada/arrayptr.exp (and others) on Ubuntu 22.04, with the
`gnat-11` package installed (not `gnat`), with UBSan activated, I get:

    (gdb) break foo.adb:40
    /home/smarchi/src/binutils-gdb/gdb/dwarf2/read.c:17689:20: runtime error: shift exponent 127 is too large for 64-bit type 'long unsigned int'

The problematic DIEs are:

    0x00001460:       DW_TAG_subrange_type
                        DW_AT_lower_bound [DW_FORM_data1]   (0x00)
                        DW_AT_upper_bound [DW_FORM_data16]  (ffffffffffffffff3f00000000000000)
                        DW_AT_name [DW_FORM_strp]   ("foo__packed_array___XP7___XDLU_0__1180591620717411303423")
                        DW_AT_type [DW_FORM_ref4]   (0x0000153f "long_long_long_unsigned")
                        DW_AT_GNAT_descriptive_type [DW_FORM_ref4]  (0x0000147e)
                        DW_AT_artificial [DW_FORM_flag_present]     (true)

    0x0000153f:   DW_TAG_base_type
                    DW_AT_byte_size [DW_FORM_data1] (0x10)
                    DW_AT_encoding [DW_FORM_data1]  (DW_ATE_unsigned)
                    DW_AT_name [DW_FORM_strp]       ("long_long_long_unsigned")
                    DW_AT_artificial [DW_FORM_flag_present] (true)

When processed by this code:

    negative_mask =
      -((ULONGEST) 1 << (base_type->length () * TARGET_CHAR_BIT - 1));
    if (low.kind () == PROP_CONST
        && !base_type->is_unsigned () && (low.const_val () & negative_mask))
      low.set_const_val (low.const_val () | negative_mask);

When the base type's length (16 bytes in this case) is larger than a
ULONGEST (typically 8 bytes), the bit shift is too large.

My obvious fix is just to skip the fixup for base types larger than a
ULONGEST (8 bytes).  I don't think we really handle constant attribute
values larger than 8 bytes anyway, so this is part of a much larger
problem.

Add a test that replicates this situation, but uses bounds that fit in a
signed 64 bit, so we get a sensible result.

Change-Id: I8d0a24f3edd83b44e0761a0ce38922d3e2e112fb
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29386
2023-01-20 11:51:54 -05:00
Simon Marchi
173628ae68 gdb/testsuite: add test for negative subrange bounds with unsigned form
I am looking at this code [1]:

  /* Normally, the DWARF producers are expected to use a signed
     constant form (Eg. DW_FORM_sdata) to express negative bounds.
     But this is unfortunately not always the case, as witnessed
     with GCC, for instance, where the ambiguous DW_FORM_dataN form
     is used instead.  To work around that ambiguity, we treat
     the bounds as signed, and thus sign-extend their values, when
     the base type is signed.  */
  negative_mask =
    -((ULONGEST) 1 << (base_type->length () * TARGET_CHAR_BIT - 1));
  if (low.kind () == PROP_CONST
      && !base_type->is_unsigned () && (low.const_val () & negative_mask))
    low.set_const_val (low.const_val () | negative_mask);
  if (high.kind () == PROP_CONST
      && !base_type->is_unsigned () && (high.const_val () & negative_mask))
    high.set_const_val (high.const_val () | negative_mask);

Nothing in the testsuite seems to exercise it, as when I remove it, all
of gdb.dwarf2 still passes.  And tests in other directories would be
compiler-dependent, so would rely on having a buggy compiler.

Update gdb.dwarf2/subrange.exp to have a test for it.  When removing the
code above, the new test fails with:

  ptype array_with_buggy_negative_bounds_type^M
  type = array [240..244] of signed_byte^M
  (gdb) FAIL: gdb.dwarf2/subrange.exp: ptype array_with_buggy_negative_bounds_type

instead of the expected:

  ptype array_with_buggy_negative_bounds_type^M
  type = array [-16..-12] of signed_byte^M
  (gdb) PASS: gdb.dwarf2/subrange.exp: ptype array_with_buggy_negative_bounds_type

[1] 5ea14aa4e5/gdb/dwarf2/read.c (L17681-17695)

Change-Id: I1992a3ff0cb1e90fa8a9114dae6c591792f059c2
2023-01-20 11:41:08 -05:00
Michael Matz
ec15b12d06 Add testcase ld-elf/merge4
to check a situation that once failed with the new section merging
when it mishandled offsets pointing into alignment padding in mergable
string sections (i.e. pointing to zeros).  It made bootstrap.exp fail
but that depends on many factors to actually go wrong so this is a more
explicit variant of it.
2023-01-20 14:58:04 +01:00
Michael Matz
26ec71f512 arm32: Fix rodata-merge-map
the test expects a second, but useless, $d mapping symbol for
the partially merged section, and specifically disallows one
for the completely merged section.  The new merging algorithm
makes it so that also the partially merged sections are conceptually
SEC_EXCLUDED, except the first merge section (e.g. as if the very
first object file already contains all strings).  So that second mapping
symbol is now missing.  It never was needed anyway.

So, adjust the test.
2023-01-20 14:58:04 +01:00
Michael Matz
1a528d3ef0 Faster string merging
* use power-of-two hash table
* use better hash function (hashing 32bits at once and with better
  mixing characteristics)
* use input-offset-to-entry maps instead of retaining full input
  contents for lookup time
* don't reread SEC_MERGE section multiple times
* care for cache behaviour for the hot lookup routine

The overall effect is less usage in libz and much faster string merging
itself.  On a debug-info-enabled cc1 the effect at the time of this
writing on the machine I used was going from 14400 perf samples to 9300
perf samples or from 3.7 seconds to 2.4 seconds, i.e. about 33% .
2023-01-20 14:58:04 +01:00
Frederic Cambus
2e175383bf Add OpenBSD ARM GAS support. 2023-01-20 10:46:37 +00:00
Jan Beulich
a2e2f5ad74 x86: split i386-gen's opcode hash entry struct
All glibc malloc() implementations I've checked have a smallest
allocation size worth of 3 pointers, with an increment worth of 2
pointers. Hence mnemonics with multiple templates can be stored more
efficiently when maintaining the shared "name" field only in the actual
hash entry. (To express the shared nature, also convert "name" to by
pointer-to-const.)

While doing the conversation also pull out common code from the involved
if/else construct in expand_templates().
2023-01-20 10:18:40 +01:00
Jan Beulich
2d9e089097 x86: embed register and alike names in disassembler
Register names are (including their nul terminators) on average almost 4
bytes long. Otoh no register name is longer than 8 bytes. Hence even for
32-bit builds using a pointer is only slightly more space efficient than
embedding the strings. A level of indirection can be also avoided by
embedding the names as an array of 8 characters directly in the arrays,
and the number of base relocations in libopcodes.so (or PIE builds of
statically linked executables) goes down as well.

To amortize for the otherwise reduced folding of string literals by the
linker, use att_names_seg[] in place of string literals in append_seg()
and OP_ESreg().
2023-01-20 10:18:17 +01:00
Jan Beulich
edf772580d x86: embed register names in reg_entry
Register names are (including their nul terminators) on average almost 4
bytes long. Otoh no register name is longer than 7 bytes. Hence even for
32-bit builds using a pointer is only slightly more space efficient than
embedding the strings. A level of indirection can be also avoided by
embedding the names as an array of 8 characters directly in the struct,
and the number of base relocations in PIE builds of gas goes down as
well.
2023-01-20 10:17:53 +01:00
Jan Beulich
6d86a54595 x86: avoid strcmp() in a few places
Now that we have identifiers for the mnemonic strings we can avoid
strcmp() in a number of places, comparing the offsets into the mnemonic
string table instead. While doing this also
- convert a leftover strncmp() to startswith() (apparently an oversight
  when rebasing the original patch introducing the startswith() uses),
- use the new shorthand for current_templates->start also elsewhere in
  md_assemble() (valid up to the point where match_template() is
  called).
2023-01-20 10:17:23 +01:00
Jan Beulich
992dd393c9 x86: absorb allocation in i386-gen
When generating the mnemonic string table we already set up an
identifier for the following entry in a number of cases. Re-use that on
the next loop iteration rather than re-doing allocation and conversion.
2023-01-20 10:16:56 +01:00
Jan Beulich
3e451ee4a6 x86: re-use insn mnemonic strings as much as possible
Compact the mnemonic string table such that the tails of longer
mnemonics are re-used for shorter ones, going beyond what compilers
would typically do, but matching what ELF linkers may do when processing
SHF_MERGE|SHF_STRINGS sections. This reduces table size by about 12.5%.
2023-01-20 10:16:17 +01:00
Jan Beulich
5c13920291 x86: move insn mnemonics to a separate table
Using full pointers to reference the insn mnemonic strings is not very
efficient. With overall string size presently just slightly over 20k,
even a 16-bit value would suffice. Use "unsigned int" for now, as
there's no good use we could presently make of the otherwise saved 16
bits.

For 64-bit builds this reduces table size by 6.25% (prior to the recent
ISA extension additions it would have been 12.5%), with a similar effect
on cache occupation of table entries accessed. For PIE builds of gas
this also reduces the number of base relocations quite a bit (obviously
independent of bitness).
2023-01-20 10:15:48 +01:00
Jan Beulich
76d3f746c5 x86: abstract out obtaining of a template's mnemonic
In preparation for changing the representation of the "name" field
introduce a wrapper function. This keeps the mechanical change separate
from the functional one.
2023-01-20 10:14:46 +01:00
GDB Administrator
b863a26873 Automatic date update in version.in 2023-01-20 00:00:07 +00:00
Tom Tromey
3db27e74ee Use "maint ignore-probes" in no-libstdcxx-probe.exp
While looking at some test output, I saw that no-libstdcxx-probe.exp
was not being run.  However, it occurred to me that Tom de Vries' new
"maint ignore-probes" command could be used to enable this test
unconditionally.

Reviewed-by: Tom de Vries <tdevries@suse.de>
2023-01-19 15:18:01 -07:00
Rainer Orth
1bb82b89ae i386: Don't emit unsupported TLS relocs on Solaris
Emit R_386_TLS_LE and R_386_TLS_IE, instead of R_386_TLS_LE_32 and
R_386_TLS_IE_32, on Solaris.

	PR ld/13671
	* elf32-i386.c (elf_i386_tls_transition): Only emit R_386_TLS_LE,
	R_386_TLS_IE on Solaris.
	(elf_i386_relocate_section): Only use R_386_TLS_GD->R_386_TLS_LE
	transition on Solaris.

Co-Authored-By: H.J. Lu <hjl.tools@gmail.com>
2023-01-19 13:54:35 -08:00
Andrew Burgess
77519ab324 GDB/testsuite: Expand for character string limiting options
Modify test cases that verify the operation of the array element limit
with character strings such that they are executed twice, once with the
`set print characters' option set to `elements' and the limit controlled
with the `set print elements' option, and then again with the limit
controlled with the `set print characters' option instead.  Similarly
with the `-elements' and `-characters' options for the `print' command.
Additionally verify that said `print' command options combined yield the
expected result.

Verify correct $_gdb_setting and $_gdb_setting_str values for the `print
characters' setting, in particular the `void' value for the `elements'
default, which has no corresponding integer value exposed.

Add Guile and Python coverage for the `print characters' GDB setting.

There are new tests for Ada and Pascal, as the string printing code for
these languages is different than the generic string printing code used
by other languages.  Modula2 also has different string printing code,
but (a) this is similar to Pascal, and (b) there are no existing modula2
tests written in Modula2, so I'm not sure how I'd even test the Modula2
string printing.

Co-Authored-By: Maciej W. Rozycki <macro@embecosm.com>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-01-19 21:15:56 +00:00
Andrew Burgess
76b58849c5 GDB: Add a character string limiting option
This commit splits the `set/show print elements' option into two.  We
retain `set/show print elements' for controlling how many elements of an
array we print, but a new `set/show print characters' setting is added
which is used for controlling how many characters of a string are
printed.

The motivation behind this change is to allow users a finer level of
control over how data is printed, reflecting that, although strings can
be thought of as arrays of characters, users often want to treat these
two things differently.

For compatibility reasons by default the `set/show print characters'
option is set to `elements', which makes the limit for character strings
follow the setting of the `set/show print elements' option, as it used
to.  Using `set print characters' with any other value makes the limit
independent from the `set/show print elements' setting, however it can
be restored to the default with the `set print characters elements'
command at any time.

A corresponding `-characters' option for the `print' command is added,
with the same semantics, i.e. one can use `elements' to make a given
`print' invocation follow the limit of elements, be it set with the
`-elements' option also given with the same invocation or taken from the
`set/show print elements' setting, for characters as well regardless of
the current setting of the `set/show print characters' option.

The GDB changes are all pretty straightforward, just changing references
to the old 'print_max' to use a new `get_print_max_chars' helper which
figures out which of the two of `print_max' and `print_max_chars' values
to use.

Likewise, the documentation is just updated to reference the new setting
where appropriate.

To make people's life easier the message shown by `show print elements'
now indicates if the setting also applies to character strings:

(gdb) set print characters elements
(gdb) show print elements
Limit on string chars or array elements to print is 200.
(gdb) set print characters unlimited
(gdb) show print elements
Limit on array elements to print is 200.
(gdb)

and the help text shows the dependency as well:

(gdb) help set print elements
Set limit on array elements to print.
"unlimited" causes there to be no limit.
This setting also applies to string chars when "print characters"
is set to "elements".
(gdb)

In the testsuite there are two minor updates, one to add `-characters'
to the list of completions now shown for the `print' command, and a bare
minimum pair of checks for the right handling of `set print characters'
and `show print characters', copied from the corresponding checks for
`set print elements' and `show print elements' respectively.

Co-Authored-By: Maciej W. Rozycki <macro@embecosm.com>
Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-01-19 21:15:56 +00:00
Maciej W. Rozycki
7aeb03e2d4 GDB: Allow arbitrary keywords in integer set commands
Rather than just `unlimited' allow the integer set commands (or command
options) to define arbitrary keywords for the user to use, removing
hardcoded arrangements for the `unlimited' keyword.

Remove the confusingly named `var_zinteger', `var_zuinteger' and
`var_zuinteger_unlimited' `set'/`show' command variable types redefining
them in terms of `var_uinteger', `var_integer' and `var_pinteger', which
have the range of [0;UINT_MAX], [INT_MIN;INT_MAX], and [0;INT_MAX] each.

Following existing practice `var_pinteger' allows extra negative values
to be used, however unlike `var_zuinteger_unlimited' any number of such
values can be defined rather than just `-1'.

The "p" in `var_pinteger' stands for "positive", for the lack of a more
appropriate unambiguous letter, even though 0 obviously is not positive;
"n" would be confusing as to whether it stands for "non-negative" or
"negative".

Add a new structure, `literal_def', the entries of which define extra
keywords allowed for a command and numerical values they correspond to.
Those values are not verified against the basic range supported by the
underlying variable type, allowing extra values to be allowed outside
that range, which may or may not be individually made visible to the
user.  An optional value translation is possible with the structure to
follow the existing practice for some commands where user-entered 0 is
internally translated to UINT_MAX or INT_MAX.  Such translation can now
be arbitrary.  Literals defined by this structure are automatically used
for completion as necessary.

So for example:

const literal_def integer_unlimited_literals[] =
  {
    { "unlimited", INT_MAX, 0 },
    { nullptr }
  };

defines an extra `unlimited' keyword and a user-visible 0 value, both of
which get translated to INT_MAX for the setting to be used with.

Similarly:

const literal_def zuinteger_unlimited_literals[] =
  {
    { "unlimited", -1, -1 },
    { nullptr }
  };

defines the same keyword and a corresponding user-visible -1 value that
is used for the requested setting.  If the last member were omitted (or
set to `{}') here, then only the keyword would be allowed for the user
to enter and while -1 would still be used internally trying to enter it
as a part of a command would result in an "integer -1 out of range"
error.

Use said error message in all cases (citing the invalid value requested)
replacing "only -1 is allowed to set as unlimited" previously used for
`var_zuinteger_unlimited' settings only rather than propagating it to
`var_pinteger' type.  It could only be used for the specific case where
a single extra `unlimited' keyword was defined standing for -1 and the
use of numeric equivalents is discouraged anyway as it is for historical
reasons only that they expose GDB internals, confusingly different
across variable types.  Similarly update the "must be >= -1" Guile error
message.

Redefine Guile and Python parameter types in terms of the new variable
types and interpret extra keywords as Scheme keywords and Python strings
used to communicate corresponding parameter values.  Do not add a new
PARAM_INTEGER Guile parameter type, however do handle the `var_integer'
variable type now, permitting existing parameters defined by GDB proper,
such as `listsize', to be accessed from Scheme code.

With these changes in place it should be trivial for a Scheme or Python
programmer to expand the syntax of the `make-parameter' command and the
`gdb.Parameter' class initializer to have arbitrary extra literals along
with their internal representation supplied.

Update the testsuite accordingly.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-01-19 21:15:56 +00:00
Indu Bhagat
0fcd58d843 libsframe: Use AM_SILENT_RULES macro in configure.ac
Silence 'make' by default.

libsframe/
	* configure.ac: Use AM_SILENT_RULES.
	* configure: Regenerate.
2023-01-19 12:40:44 -08:00
Tom Tromey
5ea14aa4e5 Remove some unused includes
I noticed a few spots that include gnu-stabs.h but that do not need
to.  This patch removes these unnecessary includes.  Tested by
rebuilding.
2023-01-19 11:09:10 -07:00
Tom de Vries
ea2f6fad7e [gdb/tdep, aarch64] Remove fp and sp reg aliases, add x31 reg alias
In aarch64-tdep.c we find these register aliases:
...
{
  /* 64-bit register names.  */
  {"fp", AARCH64_FP_REGNUM},
  {"lr", AARCH64_LR_REGNUM},
  {"sp", AARCH64_SP_REGNUM},
...

The sp alias is superfluous, because the canonical name of x31 is already sp.

The fp alias is superfluous, because it's already taken by the default meaning
of fp, assigned here in _initialize_frame_reg:
...
  user_reg_add_builtin ("fp", value_of_builtin_frame_fp_reg, NULL);
...

Fix this by removing the fp and sp aliases.

While we're at it, add an x31 alias for sp.

Approved-By: Luis Machado <luis.machado@arm.com>

Tested on aarch64-linux.
PR tdep/30012
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30012
2023-01-19 14:05:08 +01:00
Tom de Vries
a0d5ef869d [gdb/testsuite] Fix gdb.python/py-value-cc.exp for big endian
On s390x-linux, I run into:
...
(gdb) python print(u[u_fields[0]])^M
99^M
(gdb) PASS: gdb.python/py-value-cc.exp: u's first field via field
python print(u[u_fields[1]])^M
0 '\000'^M
(gdb) FAIL: gdb.python/py-value-cc.exp: u's second field via field
...

There's a var u of this type:
...
union U {
  int a;
  char c;
};
...
and after assigning 99 to u.a, the test-case expects u.c to contain 99 (which
it does on x86_64), but instead it contains 0.

Fix this by instead assigning 0x63636363, to ensure that u.c == 99 for both
little and big endian.

Tested on x86_64-linux and s390x-linux.
2023-01-19 13:44:13 +01:00
Alan Modra
75c2efc6f1 Reinitialise macro_nest
* input-scrub.c (input_scrub_begin): Init macro_nest.
2023-01-19 18:40:30 +10:30
Alan Modra
8344ebca25 PR 30022, concurrent builds can fail
So let's not copy .libs/libbfd.a to libbfd.a now that nothing in the
binutils-gdb source tries to link against it.

	PR 30022
	* Makefile.am (noinst_LIBRARIES, libbfd_a_SOURCES, stamp-lib),
	(libbfd.a): Delete rules.
	(CLEANFILES): Adjust to suit.
2023-01-19 18:40:30 +10:30
Indu Bhagat
b8d21eb0cd toplevel: Makefile.def: add install-strip dependency on libsframe
As noted in PR libsframe/30014 - FTBFS: install-strip fails because
bfdlib relinks and fails to find libsframe, the install time
dependencies of libbfd need to be updated.

	PR libsframe/30014
	* Makefile.def: Reflect that libsframe needs to installed before
	libbfd.  Reorder a bit to better track libsframe dependencies.
	* Makefile.in: Regenerate.
2023-01-18 23:17:49 -08:00
Alan Modra
066bd43411 The fuzzers have found the reloc special functions in coff-aarch64.c
All of them need a bfd_reloc_offset_in_range check before accessing
data + reloc_entry->address.  This patch adds the missing checks and
sanity checks reloc offsets in coff_pe_aarch64_relocate_section too.

All of them also need changing to support objdump -W calls to
bfd_simple_get_relocated_section_contents.  At least, secrel_reloc
needs the support, the others might not be present in dwarf debug
sections.

	* coff-aarch64.c (coff_aarch64_rel21_reloc): Range check
	reloc offset.  Support final-linking.
	(coff_aarch64_po12l_reloc): Likewise.
	(coff_aarch64_addr32nb_reloc): Likewise.
	(coff_aarch64_secrel_reloc): Likewise.
	(coff_pe_aarch64_relocate_section): Range check reloc offset.
2023-01-19 17:43:53 +10:30
Alan Modra
f07170eb86 Correct coff-aarch64 howtos and delete unnecessary special functions
The remaining special functions are still broken except when called
by gas bfd_install_relocation.

	* coff-aarch64.c (coff_aarch64_addr64_reloc),
	(coff_aarch64_addr32_reloc, coff_aarch64_branch26_reloc),
	(coff_aarch64_branch19_reloc, coff_aarch64_branch14_reloc),
	(coff_aarch64_po12a_reloc): Delete.
	(HOWTO_INSTALL_ADDEND): Define as 1.
	(HOW): Remove pcrel_off.  Correct all the howtos.
	(CALC_ADDEND): Define.
	(coff_aarch64_rtype_to_howto): New function.
	(coff_rtype_to_howto): Define.
2023-01-19 17:43:53 +10:30
Alan Modra
7e42d8dc7a coff-aarch64.c howtos
This is just a patch to fix overlong lines.  Wrapping the HOWTO macro
in a new HOW macro helps in this.  No functional changes here.

	* coff-aarch64.c (HOW): Define and use for reloc howtos.
2023-01-19 17:43:53 +10:30
Alan Modra
8fb06d7c32 howto install_addend
This adds a new flag to the reloc howtos that can be used to
incrementally change targets over to simple bfd_install_relocation
that just installs the addend without any weird adjustments.
I've made a few other changes to bfd_install_relocation, removing dead
code and comments that are really only applicable to
bfd_perform_relocation.

There is also a reloc offset bounds check change.  I've moved the
check to where data is accessed, as it seems reasonable to me to not
perform the check unless it is needed.  There is precedence for this;
Relocations against absolute symbols already avoided the check.

I also tried always performing the reloc offset check, and ran into
testsuite failures due to _NONE and _ALIGN relocs at the end of
sections.  These likely would be fixed if all such reloc howtos had
size set to zero, but I would rather not edit lots of files when it
involves checking that target code does not use the size.

	* reloc.c (struct reloc_howto_struct): Add install_addend.
	(HOWTO_INSTALL_ADDEND): Define.
	(HOWTO): Init new field with HOWTO_INSTALL_ADDEND.
	(bfd_install_relocation): Remove comments copied from
	bfd_perform_relocation that aren't applicable here.  Remove
	code dealing with output_offset and output_section.  Just set
	relocation to addend if install_addend.  Move reloc offset
	bounds check to just before section data is accessed, avoiding
	the check when data is not accessed.
	* bfd-in2.h: Regenerate.
2023-01-19 17:43:53 +10:30
Mike Frysinger
cc67f780ec sim: info: convert verbose field to a bool
The verbose argument has always been an int treated as a bool, so
convert it to an explicit bool.  Further, update the API docs to
match the reality that the verbose value is actually used by some
of the internal modules.
2023-01-18 20:47:55 -05:00
Mike Frysinger
7fd14d6f58 sim: unify sim-signal.o building
Now that sim-main.h has been reduced significantly, we can remove it
from sim-signal.c and unify it across all boards since it compiles to
the same code.
2023-01-18 19:26:58 -05:00
Mike Frysinger
c743e42e22 sim: v850: reduce extra header inclusion to igen files
Limit these extra header includes to only when specific igen files
include us until we can move the includes to the igen fils directly.
2023-01-18 19:13:04 -05:00
Mike Frysinger
e560389783 sim: v850: drop redundant define
This is already in v850/local.mk, so we can drop it from sim-main.h.
2023-01-18 19:13:04 -05:00
Mark Wielaard
c064fab247 sim: mn10300: minimize mn10300-sim.h include in sim-main.h
sim-main.h is special since it is one of the files automatically
included in igen generated files. But this means anything including
sim-main.h might get everything included just for the igen files.

To prevent clashing symbols/defines only include sim-fpu.h,
sim-signal.h, mn10300-sim.h from sim-main.h if it is included
from one of the generated igen C files. Add explicit includes
of mn10300-sim.h, sim-fpu.h and/or sim-signal.h to dv-mn103cpu.c,
interp.c and op_utils.c.
2023-01-19 01:05:00 +01:00
GDB Administrator
a184bce804 Automatic date update in version.in 2023-01-19 00:00:07 +00:00
Maciej W. Rozycki
0e38c6ff4f GDB: Add references to erased args in cli-decode.c
Complement commit 1d7fe7f01b ("gdb: Introduce setting construct within
cmd_list_element") and commit 702991711a ("gdb: Have setter and getter
callbacks for settings") and update inline documentation accordingly for
`add_set_or_show_cmd' and `add_setshow_cmd_full_erased', documenting the
`args' parameter and removing references to `var', `set_setting_func'
and `get_setting_func'.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-01-18 23:38:50 +00:00
Maciej W. Rozycki
439ee79344 GDB: Add missing inline documentation for `add_setshow_cmd_full'
Complement commit 1d7fe7f01b ("gdb: Introduce setting construct
within cmd_list_element") and add missing description for
`add_setshow_cmd_full'.
2023-01-18 23:23:00 +00:00
Maciej W. Rozycki
3cfe8022bd GDB: Correct inline documentation for `add_setshow_cmd_full_erased'
Use proper English in the description of SET_LIST and SHOW_LIST.
2023-01-18 23:23:00 +00:00
Maciej W. Rozycki
a58c879377 GDB: Fix documentation for `theclass' parameters in cli-decode.c
Rename CLASS to THECLASS in the documentation for `theclass' parameters
throughout cli-decode.c, complementing commit fe978cb071 ("C++ keyword
cleanliness, mostly auto-generated").

Approved-By: Simon Marchi <simon.marchi@efficios.com>
2023-01-18 21:54:37 +00:00
Tom Tromey
bd3014572d Fix 'make TAGS' in gdbserver
PR build/29003 points out that "make TAGS" is broken in gdbserver.
This patch fixes the problem that is pointed out there, plus another
one I noticed while working on that -- namely that the "sed" computes
the wrong names for some source files.  Finally, a couple of obsolete
variable references are removed.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=29003
2023-01-18 11:12:20 -07:00
Carl Love
b986eec55f Revert "X86: reverse-finish fix"
This reverts commit b22548ddb3.

This patch is being reverted since the patch series is causing regressions.
2023-01-18 11:13:17 -05:00