Commit Graph

102554 Commits

Author SHA1 Message Date
Tom de Vries
6d3d6e4ba7 [gdb/testsuite] Fix gdb.reverse/solib-{precsave,reverse}.exp with gcc-8
With gcc-8, we have the following FAILs, which are not there for gcc-7:
...
FAIL: gdb.reverse/solib-precsave.exp: reverse-step into solib function one
FAIL: gdb.reverse/solib-precsave.exp: reverse-step within solib function one
FAIL: gdb.reverse/solib-precsave.exp: reverse-step back to main one
FAIL: gdb.reverse/solib-precsave.exp: reverse-step into solib function two
FAIL: gdb.reverse/solib-precsave.exp: reverse-step within solib function two
FAIL: gdb.reverse/solib-precsave.exp: reverse-step back to main two
FAIL: gdb.reverse/solib-precsave.exp: run until end part two
FAIL: gdb.reverse/solib-precsave.exp: reverse-next over solib function one
FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function one
FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function one
FAIL: gdb.reverse/solib-reverse.exp: reverse-step back to main one
FAIL: gdb.reverse/solib-reverse.exp: reverse-step into solib function two
FAIL: gdb.reverse/solib-reverse.exp: reverse-step within solib function two
FAIL: gdb.reverse/solib-reverse.exp: reverse-step back to main two
FAIL: gdb.reverse/solib-reverse.exp: run until end part two
FAIL: gdb.reverse/solib-reverse.exp: reverse-next over solib function one
...

Looking at the first FAIL for gdb.reverse/solib-precsave.exp, we have:
...
 (gdb) PASS: reverse-next first shr1
 reverse-next^M
 40        b[0] = 6;   b[1] = 9;     /* generic statement, end part two */^M
 (gdb) PASS: reverse-next generic
 reverse-step^M
-shr2 (x=17) at gdb.reverse/shr2.c:23^M
-23      }^M
-(gdb) PASS: reverse-step into solib function one
+38        b[1] = shr2(17);              /* middle part two */^M
+(gdb) FAIL: reverse-step into solib function one
...

There's a difference in line number info for line 38, where for gcc-7 we have:
...
Line number    Starting address    View    Stmt
         38            0x4005c6               x
...
and for gcc-8:
...
         38            0x4005c1               x
         38            0x4005cb               x
...
which explains why we don't step directly into "solib function one".

Fix this by recognizing the extra "recommended breakpoint location" and
issuing an additional reverse-next/step.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-07-21  Tom de Vries  <tdevries@suse.de>

	* gdb.reverse/solib-precsave.exp: Handle additional "recommended
	breakpoint locations".
	* gdb.reverse/solib-reverse.exp: Same.
2020-07-21 16:22:34 +02:00
Tom de Vries
803d0592ab [gdb/testsuite] Fix step-reverse.c with gcc-10
The file gdb.reverse/step-reverse.c is used in test-cases:
- gdb.reverse/step-reverse.exp
- gdb.reverse/next-reverse-bkpt-over-sr.exp
- gdb.reverse/step-precsave.exp

With gcc-7, there are only PASSes (apart from one KFAIL), but with gcc-10, we
have the following FAILs:
...
FAIL: gdb.reverse/step-reverse.exp: reverse stepi from a function call \
  (start statement)
FAIL: gdb.reverse/step-reverse.exp: simple reverse stepi
FAIL: gdb.reverse/step-reverse.exp: reverse step out of called fn
FAIL: gdb.reverse/step-reverse.exp: reverse next over call
FAIL: gdb.reverse/step-reverse.exp: reverse step test 1
FAIL: gdb.reverse/step-reverse.exp: reverse next test 1
FAIL: gdb.reverse/step-reverse.exp: reverse step test 2
FAIL: gdb.reverse/step-reverse.exp: reverse next test 2
FAIL: gdb.reverse/step-precsave.exp: reverse stepi from a function call \
  (start statement)
FAIL: gdb.reverse/step-precsave.exp: simple reverse stepi
FAIL: gdb.reverse/step-precsave.exp: reverse step out of called fn
FAIL: gdb.reverse/step-precsave.exp: reverse next over call
FAIL: gdb.reverse/step-precsave.exp: reverse step test 1
FAIL: gdb.reverse/step-precsave.exp: reverse next test 1
FAIL: gdb.reverse/step-precsave.exp: reverse step test 2
FAIL: gdb.reverse/step-precsave.exp: reverse next test 2
...

Looking at the first step-precsave.exp FAIL, we have:
...
(gdb) stepi^M
26        myglob++; return 0;   /* ARRIVED IN CALLEE */^M
(gdb) PASS: gdb.reverse/step-precsave.exp: reverse stepi thru function return
stepi^M
0x000000000040055f      26        myglob++; return 0;   /* ARRIVED IN CALLEE */^M
(gdb) FAIL: gdb.reverse/step-precsave.exp: reverse stepi from a function call \
  (start statement)
...

There's a difference in line info for callee:
...
    25  int callee() {          /* ENTER CALLEE */
    26    myglob++; return 0;   /* ARRIVED IN CALLEE */
    27  }                       /* RETURN FROM CALLEE */
...
between gcc-7:
...
Line number    Starting address    View    Stmt
         25            0x400557               x
         26            0x40055b               x
         27            0x40056f               x
...
and gcc-10:
...
         25            0x400552               x
         26            0x400556               x
         26            0x400565               x
         27            0x40056a               x
...

The two "recommend breakpoint location" entries at line 26 are for the two
statements ("myglob++" and "return 0"), but the test-case expects to hit line
26 only once.

Fix this by rewriting the two statements into a single statement:
...
-  myglob++; return 0;  /* ARRIVED IN CALLEE */
+  return myglob++;     /* ARRIVED IN CALLEE */
...

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-07-21  Tom de Vries  <tdevries@suse.de>

	* gdb.reverse/step-reverse.c (callee): Merge statements.
2020-07-21 15:27:18 +02:00
Kamil Rytarowski
1de14d77bb Enable multi-process mode in the NetBSD native target.
This enables proper support for multiple inferiors and ptrace(2)
assisted management of the inferior processes and their threads.

(gdb) info inferior
  Num  Description       Connection           Executable
* 1    process 14952     1 (native)           /usr/bin/dig
  2    <null>            1 (native)
  3    process 25684     1 (native)           /bin/ls
  4    <null>            1 (native)           /bin/ls

Without this patch, additional inferiors can be added, but not
properly controlled.

gdb/ChangeLog:

        * nbsd-nat.h (nbsd_nat_target::supports_multi_process): New
        declaration.
        * nbsd-nat.c (nbsd_nat_target::supports_multi_process): New
        function.
2020-07-21 14:43:36 +02:00
Jan Beulich
bf4ba07ca6 Revert "x86: Don't display eiz with no scale"
This reverts commit 04c662e2b6.
In my underlying suggestion I neglected the fact that in those
cases (,%eiz,1) is the only visible indication that 32-bit
addressing is in effect.
2020-07-21 14:20:11 +02:00
Cooper Qu
2b42b0415a Fix Unreasonable arch and cpu conflict warning for ther CSky architecture.
* config/tc-csky.c (md_begin): Fix tests of arch and mach flags.
2020-07-21 11:32:44 +01:00
Nick Clifton
84dc5f0b5c Updated Swedish translation for the binutils sub-directory 2020-07-21 11:22:36 +01:00
Tom de Vries
e9bdc5108c [gdb/testsuite] Fix gdb.fortran/info-modules.exp with gcc-8
When using test-case gdb.fortran/info-modules.exp with gcc 8.4.0, I run into:
...
FAIL: gdb.fortran/info-modules.exp: info module variables: check for entry \
  'info-types.f90', '35', 'Type m1t1 mod1::__def_init_mod1_M1t1;'
FAIL: gdb.fortran/info-modules.exp: info module variables: check for entry \
  'info-types.f90', '35', 'Type __vtype_mod1_M1t1 mod1::__vtab_mod1_M1t1;'
...

This is caused by this change in gdb output:
...
 (gdb) info module variables
    ...
 File gdb.fortran/info-types.f90:
-35:     Type m1t1 mod1::__def_init_mod1_M1t1;
+        Type m1t1 mod1::__def_init_mod1_M1t1;
-35:     Type __vtype_mod1_M1t1 mod1::__vtab_mod1_M1t1;
+        Type __vtype_mod1_M1t1 mod1::__vtab_mod1_M1t1;
 21:     real(kind=4) mod1::mod1_var_1;
 22:     integer(kind=4) mod1::mod1_var_2;
...
caused by a change in debug info.

Fix this by allowing those entries without line number.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-07-21  Tom de Vries  <tdevries@suse.de>

	* gdb.fortran/info-modules.exp (info module variables): Allow missing
	line numbers for some variables.
2020-07-21 11:37:17 +02:00
Jan Beulich
185a798e66 Revert "x86: Replace evex-no-scale.s with evex-no-scale-[32|64].s"
This reverts commit 19449d7c67, addressing
the issue that was run into back then: There was no relationship to i686-*
and/or cross builds on 64-bit hosts. The sole problem was the use of / as
as comment character in certain ELF targets. Instead of division, use a
comparison operation.

At the same time also revert the ELF related part of 99c2d522f7 ("x86:
Update assembler tests for non-ELF targets") by replacing the construct
that's problematic for non-ELF, and by adding the "#pass" patterns to
the expected output files to cover for the tail padding generated into
COFF output.
2020-07-21 11:34:40 +02:00
Tom de Vries
f0f9e75a82 [gdb/testsuite] Make inline-locals.c deterministic
When running testcase gdb.opt/inline-locals.exp on openSUSE Tumbleweed, I get:
...
(gdb) info locals^M
array = {0 <repeats 48 times>, 15775231, 0, 194, 0, -11497, 32767, 4199061, \
  0, 0, 0, 0, 0, 4198992, 0, 4198432, 0}^M
(gdb) FAIL: gdb.opt/inline-locals.exp: info locals above bar 2
...

Fix this by:
- completely initializing array before printing any value
- updating the pattern to match "array = {0 <repeats 64 times>}"

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-07-21  Tom de Vries  <tdevries@suse.de>

	* gdb.opt/inline-locals.c (init_array): New func.
	(func1): Use init_array.
	* gdb.opt/inline-locals.exp: Update pattern.
2020-07-21 10:25:42 +02:00
Tom de Vries
bd460ecb31 [gdb/testsuite] Don't leak env vars in gdb.debuginfod/fetch_src_and_symbols.exp
Test-case gdb.debuginfod/fetch_src_and_symbols.exp leaks env vars
DEBUGINFOD_URLS, DEBUGINFOD_TIMEOUT and DEBUGINFOD_CACHE_PATH, causing
timeouts in subsequent tests.

Fix this by using save_vars.  Also, fix PATH and DUPLICATE errors.  Finally,
cleanup whitespace.

gdb/testsuite/ChangeLog:

2020-07-21  Tom de Vries  <tdevries@suse.de>

	* gdb.debuginfod/fetch_src_and_symbols.exp: Use save_vars for env
	vars.  Fix PATH and DUPLICATE errors.  Cleanup whitespace.
2020-07-21 09:40:21 +02:00
Maciej W. Rozycki
ec4fcab0ee MIPS/GAS: Remove stale `prev_reloc_op_frag' variable
Ever since commit 4d7206a284 ("Rework MIPS macro relaxation, fix string
merging bug"), <https://sourceware.org/ml/binutils/2004-01/msg00248.html>,
`prev_reloc_op_frag' has only been set and never used.  Remove it then.

	gas/
	* config/tc-mips.c (prev_reloc_op_frag): Remove variable.
	(my_getSmallExpression): Adjust accordingly.
2020-07-21 01:59:24 +01:00
GDB Administrator
3ce8f1ed68 Automatic date update in version.in 2020-07-21 00:00:06 +00:00
John Baldwin
ed810cc7d3 Implement the skip_solib_resolver gdbarch hook for FreeBSD architectures.
The ELF runtime linker on all FreeBSD architectures uses the
"_rtld_bind" entry point for unresolved PTL entries.  FreeBSD/mips has
an additional entry point called "_mips_rtld_bind".

gdb/ChangeLog:

	* fbsd-tdep.c (fbsd_skip_solib_resolver): New function.
	(fbsd_init_abi): Install gdbarch "skip_solib_resolver" method.
	* fbsd-tdep.h (fbsd_skip_solib_resolver): New prototype.
	* mips-fbsd-tdep.c (mips_fbsd_skip_solib_resolver): New function.
	(mips_fbsd_init_abi): Install gdbarch "skip_solib_resolver"
	method.
2020-07-20 09:10:18 -07:00
Ludovic Courtès
ae5369e773 guile: Add support for Guile 3.0.
gdb/ChangeLog
2020-06-28  Ludovic Courtès  <ludo@gnu.org>

	* guile/scm-math.c (vlscm_integer_fits_p): Use 'uintmax_t'
	and 'intmax_t' instead of 'scm_t_uintmax' and 'scm_t_intmax',
	which are deprecated in Guile 3.0.
	* configure.ac (try_guile_versions): Add "guile-3.0".
	* configure (try_guile_versions): Regenerate.
	* NEWS: Update entry.

gdb/testsuite/ChangeLog
2020-06-28  Ludovic Courtès  <ludo@gnu.org>

	* gdb.guile/source2.scm: Add #f first argument to 'format'.
	* gdb.guile/types-module.exp: Remove "ERROR:" from
	regexps since Guile 3.0 no longer prints that.

gdb/doc/ChangeLog
2020-06-28  Ludovic Courtès  <ludo@gnu.org>

	* doc/guile.texi (Guile Introduction): Mention Guile 3.0.

Change-Id: Iff116c2e40f334e4e0ca4e759a097bfd23634679
2020-07-20 11:00:55 -04:00
Ludovic Courtès
68cf161c24 guile: Add support for Guile 2.2.
This primarily updates code that uses the I/O port API of Guile.

gdb/ChangeLog
2020-06-28  Ludovic Courtès  <ludo@gnu.org>
            Doug Evans  <dje@google.com>

	PR gdb/21104
	* guile/scm-ports.c (USING_GUILE_BEFORE_2_2): New macro.
	(ioscm_memory_port)[read_buf_size, write_buf_size]: Wrap in #if
	USING_GUILE_BEFORE_2_2.
	(stdio_port_desc, memory_port_desc) [!USING_GUILE_BEFORE_2_2]:
	Change type to 'scm_t_port_type *'.
	(natural_buffer_size) [!USING_GUILE_BEFORE_2_2]: New variable.
	(ioscm_open_port) [USING_GUILE_BEFORE_2_2]: Add 'stream'
	parameter and honor it.  Update callers.
	(ioscm_open_port) [!USING_GUILE_BEFORE_2_2]: New function.
	(ioscm_read_from_port, ioscm_write) [!USING_GUILE_BEFORE_2_2]: New
	functions.
	(ioscm_fill_input, ioscm_input_waiting, ioscm_flush): Wrap in #if
	USING_GUILE_BEFORE_2_2.
	(ioscm_init_gdb_stdio_port) [!USING_GUILE_BEFORE_2_2]: Use
	'ioscm_read_from_port'.  Call 'scm_set_port_read_wait_fd'.
	(ioscm_init_stdio_buffers) [!USING_GUILE_BEFORE_2_2]: New function.
	(gdbscm_stdio_port_p) [!USING_GUILE_BEFORE_2_2]: Use 'SCM_PORTP'
	and 'SCM_PORT_TYPE'.
	(gdbscm_memory_port_end_input, gdbscm_memory_port_seek)
	(ioscm_reinit_memory_port): Wrap in #if USING_GUILE_BEFORE_2_2.
	(gdbscm_memory_port_read, gdbscm_memory_port_write)
	(gdbscm_memory_port_seek, gdbscm_memory_port_close)
	[!USING_GUILE_BEFORE_2_2]: New functions.
	(gdbscm_memory_port_print): Remove use of 'SCM_PTOB_NAME'.
	(ioscm_init_memory_port_type) [!USING_GUILE_BEFORE_2_2]: Use
	'gdbscm_memory_port_read'.
	Wrap 'scm_set_port_end_input', 'scm_set_port_flush', and
	'scm_set_port_free' calls in #if USING_GUILE_BEFORE_2_2.
	(gdbscm_get_natural_buffer_sizes) [!USING_GUILE_BEFORE_2_2]: New
	function.
	(ioscm_init_memory_port): Remove.
	(ioscm_init_memory_port_stream): New function
	(ioscm_init_memory_port_buffers) [USING_GUILE_BEFORE_2_2]: New
	function.
	(gdbscm_memory_port_read_buffer_size) [!USING_GUILE_BEFORE_2_2]:
	Return scm_from_uint (0).
	(gdbscm_set_memory_port_read_buffer_size_x)
	[!USING_GUILE_BEFORE_2_2]: Call 'scm_setvbuf'.
	(gdbscm_memory_port_write_buffer_size) [!USING_GUILE_BEFORE_2_2]:
	Return scm_from_uint (0).
	(gdbscm_set_memory_port_write_buffer_size_x)
	[!USING_GUILE_BEFORE_2_2]: Call 'scm_setvbuf'.
	* configure.ac (try_guile_versions): Add "guile-2.2".
	* configure: Regenerate.
	* NEWS: Add entry.

gdb/testsuite/ChangeLog
2020-06-28  Ludovic Courtès  <ludo@gnu.org>

	* gdb.guile/scm-error.exp ("source $remote_guile_file_1"): Relax
	error regexp to match on Guile 2.2.

gdb/doc/ChangeLog
2020-06-28  Ludovic Courtès  <ludo@gnu.org>

	* guile.texi (Memory Ports in Guile): Mark
	'memory-port-read-buffer-size',
	'set-memory-port-read-buffer-size!',
	'memory-port-write-buffer-size',
	'set-memory-port-read-buffer-size!' as deprecated.
	* doc/guile.texi (Guile Introduction): Clarify which Guile
	versions are supported.

Change-Id: Ib119b10a2787446e0ae482a5e1b36d809c44bb31
2020-07-20 10:59:47 -04:00
Gary Benson
c14b491355 Skip tests requiring "alignof (void)" when compiling using clang
As an extension, GCC allows void pointer arithmetic, with sizeof(void)
and alignof(void) both 1.  GDB supports this extension, but clang does
not, and fails to compile the generated output of gdb.cp/align.exp
with the following error:

 gdb compile failed, /gdbtest/build/gdb/testsuite/outputs/gdb.cp/align/align.cc:28:23:
       error: invalid application of 'alignof' to an incomplete type 'void'
    unsigned a_void = alignof (void);
                      ^       ~~~~~~
 1 error generated.

This commit adds preprocessor conditionals to the generated output, to
omit the unsupported code when using clang, and supplies the expected
value so the test can complete.

gdb/testsuite/ChangeLog:

	* gdb.cp/align.exp: Fix "alignof (void)" tests when compiling
	with clang.
2020-07-20 15:01:04 +01:00
Nick Clifton
39326c35dd Fix problem running a few PowerPC linker tests when the .data section is retained.
* testsuite/ld-powerpc/powerpc.exp (ppcelftests): Use section name
	.PPC.EMB.apuinfo instead of section number 2 in apuinfo tests.
2020-07-20 14:57:38 +01:00
Alan Modra
2f5541f384 PR26265, Spurious 'gc-sections requires ... when --init or --fini
bfd/
	* elflink.c (_bfd_elf_gc_keep): Use bfd_is_const_section.
ld/
	PR 26265
	* ldlang.c (undef_from_cmdline): Delete.
	(ldlang_add_undef): Mark "cmdline" param unused.
	(lang_end): Traverse gc_sym_list to determine whether a symbol root
	has been specified.  Update error message.
	* testsuite/ld-gc/noent.d: Adjust for changed error message.
2020-07-20 22:21:11 +09:30
Tom de Vries
b243ba58e8 [gdb/testsuite] Stabilize execution order in omp-par-scope.c
In openmp test-case gdb.threads/omp-par-scope.exp we xfail and kfail dependent
on omp_get_thread_num ().  Since execution order of the threads can vary from
execution to execution, this can cause changes in test results.

F.i., we can see this difference between two test runs:
...
-KFAIL: single_scope: first thread: print i3 (PRMS: gdb/22214)
+PASS: single_scope: first thread: print i3
-PASS: single_scope: second thread: print i3
+KFAIL: single_scope: second thread: print i3 (PRMS: gdb/22214)
...
In both cases, the KFAIL is for omp_get_thread_num () == 1, but in one case
that corresponds to the first thread executing that bit of code, and in the
other case to the second thread.

Get rid of this difference by stabilizing execution order.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-07-20  Tom de Vries  <tdevries@suse.de>

	* gdb.threads/omp-par-scope.c (lock, lock2): New variable.
	(omp_set_lock_in_order): New function.
	(single_scope, multi_scope, nested_func, nested_parallel): Use
	omp_set_lock_in_order and omp_unset_lock.
	(main): Init and destroy lock and lock2.
2020-07-20 14:40:52 +02:00
H.J. Lu
98b3697bcd x86: Update PR gas/26263 linker tests
Update and run PR gas/26263 linker tests for all x86 ELF targets to
accept any program header layout.

	PR gas/26263
	* testsuite/ld-i386/pr26263.d: Updated.
	* testsuite/ld-x86-64/pr26263.d: Likewise.
	* testsuite/ld-x86-64/x86-64.exp: Run gas/26263 test for all ELF
	targets.
2020-07-20 04:53:58 -07:00
Tom de Vries
c06ad8b573 [gdb/testsuite] Fix valgrind-infcall-2.exp without libc debug info
When running test-case gdb.base/valgrind-infcall-2.exp on a system without
libc debug info installed, I run into:
...
(gdb) p printf ("bla")^M
'printf' has unknown return type; cast the call to its declared return type^M
(gdb) FAIL: gdb.base/valgrind-infcall-2.exp: do printf
...

Fix this by casting the result of the printf call to int.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-07-20  Tom de Vries  <tdevries@suse.de>

	* gdb.base/valgrind-infcall-2.exp: Handle printf unknown return type.
2020-07-20 11:19:51 +02:00
Tom de Vries
6e22f11784 [gdb/testsuite] Bail out after gdb_start error in gdb.threads/attach-slow-waitpid.exp
When building gdb using CFLAGS/CXXFLAGS+=-fsanitizer=address and
LDFLAGS+=-lasan, and running test-case gdb.threads/attach-slow-waitpid.exp,
we get:
...
spawn gdb -nw -nx -data-directory data-directory^M
==16079==ASan runtime does not come first in initial library list; \
  you should either link runtime to your application or manually preload \
  it with LD_PRELOAD.^M
ERROR: (eof) GDB never initialized.
ERROR: : spawn id exp10 not open
    while executing
"expect {
-i exp10 -timeout 120
        -re "Kill the program being debugged. .y or n. $" {
            send_gdb "y\n" answer
            verbose "\t\tKilling previous pro..."
    ("uplevel" body line 1)
    invoked from within
"uplevel $body" NONE : spawn id exp10 not open
WARNING: remote_expect statement without a default case
ERROR: : spawn id exp10 not open
    while executing
"expect {
-i exp10 -timeout 120
        -re "Reading symbols from.*LZMA support was disabled.*$gdb_prompt $" {
            verbose "\t\tLoaded $arg into $GDB; .gnu_..."
    ("uplevel" body line 1)
    invoked from within
"uplevel $body" NONE : spawn id exp10 not open
ERROR: Couldn't load attach-slow-waitpid into GDB (eof).
ERROR: Couldn't send attach 16070 to GDB.
UNRESOLVED: gdb.threads/attach-slow-waitpid.exp: attach to target
...

Bail out at the first ERROR, such that we have instead:
...
ERROR: (eof) GDB never initialized.
UNTESTED: gdb.threads/attach-slow-waitpid.exp: \
  Couldn't start GDB with preloaded lib
...

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-07-20  Tom de Vries  <tdevries@suse.de>

	* gdb.threads/attach-slow-waitpid.exp: Bail out if gdb_start fails.
2020-07-20 10:54:31 +02:00
Jan Beulich
b3983e5f53 x86: handle SVR4 escaped binary operators
PR gas/4572

When / is a comment character, its use as binary "divide" operator needs
escaping by a backslash. Besides the scrubber needing to support this
(addressed in an earlier change), there are also a few provisions needed
in target specific operator handling.

As the spec calls for % and * to also be escaped because of being
"overloaded", also recognize these, despite the overloading there not
really preventing their use as operators in most (%) or all (*) cases,
given the way how the rest of the assembler works.

To bring source and testsuite in line, also drop the TE_I386AIX part of
the respective conditional, as i?86-*-aix* support had been removed a
while ago.
2020-07-20 08:57:18 +02:00
Jan Beulich
750e4bf70f gas: generalize comment character escaping recognition
PR gas/4572

Generalize what ab1fadc6b2 ("PR22714, Assembler preprocessor loses
track of \@") did to always honor escaped comment chars. Use this then
to support escaped /, %, and * operators on x86, when / is a comment
char (to match the Sun assembler's behavior).
2020-07-20 08:56:23 +02:00
Jan Beulich
48ef937e91 x86: honor absolute section when emitting code
Various provisions exist for insns to be placed in the absolute section,
yet actually trying to do so didn't work. While data emission (of non-
zero values) is not allowed by generic code, I think this functionality
is useful for the programmer to be able to determine the size of insns.
Therefore, rather than turning the silnet failure into a verbose one,
make things mostly work; the one class of insns not supported (yet) are
branches (JMP and Jcc) with dynamically determined displacement widths.
In this one case, an error now gets reported instead of silently
ignoring the code.

Also avoid recording ISA / feature usage for insns emitted to the
absolute section.
2020-07-20 08:55:48 +02:00
Jan Beulich
693bec1ed6 ix86: enable more ELF tests for VxWorks
The tree-wide is_elf_format predicate excludes VxWorks, but the majority
of ELF specific tests is quite fine for this target.
2020-07-20 08:54:37 +02:00
GDB Administrator
49bcc13929 Automatic date update in version.in 2020-07-20 00:00:05 +00:00
H.J. Lu
53752b85ac gold: Update x32 test
* testsuite/split_x32.sh: Likewise.
2020-07-19 07:30:42 -07:00
H.J. Lu
9e6b97601b gold: Update x86-64 tests
commit 36938cabf0
Author: Jan Beulich <jbeulich@suse.com>
Date:   Wed Jul 15 08:53:55 2020 +0200

    x86: avoid attaching suffixes to unambiguous insns

removed the 'a' suffix on call and jmp from disassembler output.  Update
gold x86-64 tests.

	* testsuite/bnd_ifunc_1.sh: Updated.
	* testsuite/bnd_plt_1.sh: Likewise.
	* testsuite/split_x86_64.sh: Likewise.
	* testsuite/x86_64_indirect_call_to_direct.sh: Likewise.
2020-07-19 07:18:07 -07:00
H.J. Lu
2585b7a5ce x86: Change PLT32 reloc against section to PC32
Commit 292676c1 resolved PLT32 reloc aganst local symbol to section.
Since PLT32 relocation must be against symbols, turn such PLT32
relocation into PC32 relocation.

gas/

	PR gas/26263
	* config/tc-i386.c (i386_validate_fix): Change PLT32 reloc
	against section to PC32 reloc.
	* testsuite/gas/i386/relax-5.d: Updated.
	* testsuite/gas/i386/x86-64-relax-4.d: Likewise.

ld/

	PR gas/26263
	* testsuite/ld-i386/i386.exp: Run PR gas/26263 test.
	* testsuite/ld-x86-64/x86-64.exp: Likewise.
	* testsuite/ld-i386/pr26263.d: New file.
	* testsuite/ld-x86-64/pr26263.d: Likewise.
	* testsuite/ld-x86-64/pr26263.s: Likewise.
2020-07-19 06:51:32 -07:00
Hans-Peter Nilsson
4609ada49f ld: optionally emit _etext last, before .data
So, here's my suggestion for making _init .. __etext cover .text +
.rodata (including things like the read-only exception tables) for
elf64mmix.  A quick web search gives that __etext (and friends) isn't
well defined, so each target can interpret the "end of text segment"
to their own liking.  It seems likely this change is also a better fit
than the default for other ports, at least those with .rodata after
.text in the same segment.

The presence of a separate rodata-segment is optional (and not true
for elf64mmix).  This is reflected in the name as SEPARATE_TEXT /
SEPARATE_CODE isn't considered, to keep it simple; each target has to
make sure their settings of variables make sense.

ld:
	* scripttempl/elf.sc (ETEXT_LAST_IN_RODATA_SEGMENT): New variable.
	* emulparams/elf64mmix.sh (ETEXT_LAST_IN_RODATA_SEGMENT): Define.
	* testsuite/ld-mmix/sec-1.d: Adjust.
2020-07-19 06:08:07 +02:00
Alan Modra
e10a07b32d Power10 stub selection
This patch better supports mixing of power10 and non-power10 code,
as might be seen in a cpu-optimized library using ifuncs to select
functions optimized for a given cpu.  Using -Wl,--no-power10-stubs
isn't that good in this situation since non-power10 notoc stubs are
slower and larger than the power10 variants, which you'd like to use
on power10 code paths.

With this change, power10 pc-relative code that makes calls marked
@notoc uses power10 stubs if stubs are necessary, and other calls use
non-power10 instructions in stubs.  This will mean that if gcc is
generating code for -mcpu=power10 but with pc-rel disabled then you'll
get the older stubs even on power10 (unless you force with
-Wl,--power10-stubs).  That shouldn't be too big a problem: stubs that
use r2 are reasonable.  It's just the ones that set up addressing
using "mflr 12; bcl 20,31,.+4; mflr 11; mtlr 12" that should be
avoided if possible.

bfd/
	* elf64-ppc.c (struct ppc_link_hash_table): Add has_power10_relocs.
	(select_alt_stub): New function.
	(ppc_get_stub_entry): Use it here.
	(ppc64_elf_check_relocs): Set had_power10_relocs rather than
	power10_stubs.
	(ppc64_elf_size_stubs): Clear power10_stubs here instead.  Don't
	merge notoc stubs with other varieties when power10_stubs is "auto".
	Instead dup the stub hash table entry.
	(plt_stub_size, ppc_build_one_stub, ppc_size_one_stub): Adjust
	tests of power10_stubs.
ld/
	* emultempl/ppc64elf.em (power10-stubs): Accept optional "auto" arg.
	* ld.texi (power10-stubs): Update.
	* testsuite/ld-powerpc/callstub-1.d: Force --power10-stubs.
	* testsuite/ld-powerpc/callstub-2.d: Relax branch offset comparison.
	* testsuite/ld-powerpc/callstub-4.d: New test.
	* testsuite/ld-powerpc/notoc.d: Force --no-power10-stubs.
	* testsuite/ld-powerpc/notoc3.d,
	* testsuite/ld-powerpc/notoc3.s,
	* testsuite/ld-powerpc/notoc3.wf: New test.
	* testsuite/ld-powerpc/powerpc.exp: Run new tests.  Pass
	--no-power10-stubs for notoc link.
2020-07-19 12:27:47 +09:30
GDB Administrator
6095ca5257 Automatic date update in version.in 2020-07-19 00:00:06 +00:00
Tom Tromey
aee91db3eb Remove "linux_multi_process" global
The "linux_multi_process" is initialized but never modified.  I
discussed this with Pedro on irc, and he said that, while it was
useful when developing this feature, it is now no longer needed.  So,
this removes it.

gdb/ChangeLog
2020-07-18  Tom Tromey  <tom@tromey.com>

	* linux-nat.c (linux_multi_process): Remove.
	(linux_nat_target::supports_multi_process): Return true.
2020-07-18 10:43:16 -06:00
GDB Administrator
dea6fdedf9 Automatic date update in version.in 2020-07-18 00:00:06 +00:00
Andrew Burgess
0e26741636 gdb/riscv: delete target descriptions when gdb exits
It was pointed out on IRC that the RISC-V target allocates target
descriptions and stores them in a global map, and doesn't delete these
target descriptions when GDB shuts down.

This isn't a particular problem, the total number of target
descriptions we can create is very limited so creating these on demand
and holding them for the entire run on GDB seems reasonable.

However, not deleting these objects on GDB exit means extra warnings
are printed from tools like valgrind, and the address sanitiser,
making it harder to spot real issues.  As it's reasonably easy to have
GDB correctly delete these objects on exit, lets just do that.

I started by noticing that we already have a target_desc_up type, a
wrapper around unique_ptr that calls a function that will correctly
delete target descriptions, so I want to use that, but....

...that type is declared in gdb/target-descriptions.h.  If I try to
include that file in gdb/arch/riscv.c I run into a problem, that file
is compiled into both GDB and GDBServer.

OK, I could guard the include with #ifdef, but surely we can do
better.

So then I decided to move the target_desc_up type into
gdbsupport/tdesc.h, this is the interface file for generic code shared
between GDB and GDBserver (relating to target descriptions).  The
actual implementation for the delete function still lives in
gdb/target-description.c, but now gdb/arch/riscv.c can see the
declaration.  Problem solved....

... but, though RISC-V doesn't use it I've now exposed the
target_desc_up type to gdbserver, so in future someone _might_ start
using it, which is fine, except right now there's no definition of the
delete function - remember the delete I used is only defined in GDB
code.

No problem, I add an implementation of the delete operator into
gdbserver/tdesc.cc, and all is good..... except....

I start getting this error from GCC:

  tdesc.cc:109:10: error: deleting object of polymorphic class type ‘target_desc’ which has non-virtual destructor might cause undefined behavior [-Werror=delete-non-virtual-dtor]

Which is caused because gdbserver's target_desc type inherits from
tdesc_element which has a virtual method, and so GCC worries that
target_desc might be used as a base class.

The solution is to declare gdbserver's target_desc class as final.
This is fine so long as we never intent to inherit from
target_desc (in gdbserver).  But if we did then we'd want to make
target_desc's destructor virtual anyway, so the error above would be
resolved, and there wouldn't be an issue.

gdb/ChangeLog:

	* arch/riscv.c (riscv_tdesc_cache): Change map type.
	(riscv_lookup_target_description): Return pointer out of
	unique_ptr.
	* target-descriptions.c (allocate_target_description): Add
	comment.
	(target_desc_deleter::operator()): Likewise.
	* target-descriptions.h (struct target_desc_deleter): Moved to
	gdbsupport/tdesc.h.
	(target_desc_up): Likewise.

gdbserver/ChangeLog:

	* tdesc.cc (allocate_target_description): Add header comment.
	(target_desc_deleter::operator()): New function.
	* tdesc.h (struct target_desc): Declare as final.

gdbsupport/ChangeLog:

	* tdesc.h (struct target_desc_deleter): Moved here
	from gdb/target-descriptions.h, extend comment.
	(target_desc_up): Likewise.
2020-07-17 21:15:32 +01:00
Tom de Vries
33176ea7d7 [gdb/testsuite] Add gdb.base/valgrind-infcall-2.exp
In commit ee3c5f8968 "Fix GDB crash when registers cannot be modified", we
fix a GDB crash:
...
$ valgrind /usr/bin/sleep 10000
==31595== Memcheck, a memory error detector
==31595== Command: /usr/bin/sleep 10000
==31595==
$ gdb /usr/bin/sleep
(gdb) target remote | vgdb --pid=31595
Remote debugging using | vgdb --pid=31595
  ...
$hex in __GI___nanosleep () at nanosleep.c:27
27	  return SYSCALL_CANCEL (nanosleep, requested_time, remaining);
(gdb) p printf ("bla")
terminate called after throwing an instance of 'gdb_exception_error'
Aborted (core dumped)
...

This patch adds a test-case for it.

Unfortunately, I was not able to trigger the error condition using a regular
vgdb_start, so I've added a parameter active_at_startup, and when set to 0
this causes valgrind to be started without --vgdb-error=0.

Tested on x86_64-linux.

Tested with the commit mentioned above reverted, resulting in:
...
(gdb) p printf ("bla")^M
terminate called after throwing an instance of 'gdb_exception_error'^M
ERROR: GDB process no longer exists
GDB process exited with wait status 6152 exp10 0 0 CHILDKILLED SIGABRT SIGABRT
UNRESOLVED: gdb.base/valgrind-infcall-2.exp: do printf
...

gdb/testsuite/ChangeLog:

2020-07-17  Tom de Vries  <tdevries@suse.de>

	* gdb.base/valgrind-infcall-2.c: New test.
	* gdb.base/valgrind-infcall-2.exp: New file.
	* lib/valgrind.exp (vgdb_start): Add and handle active_at_startup.
2020-07-17 17:33:18 +02:00
Tom Tromey
f80c8ec423 Use boolean literals in linux-nat.c
I noticed a couple of spots in linux-nat.c that use 0/1 where boolean
literals would be more idiomatic.  This patch makes this change.

gdb/ChangeLog
2020-07-17  Tom Tromey  <tromey@adacore.com>

	* linux-nat.c (linux_nat_target::supports_non_stop)
	(linux_nat_target::always_non_stop_p): Use "true".
	(linux_nat_target::supports_disable_randomization): Use "true" and
	"false".
2020-07-17 09:21:12 -06:00
Tom de Vries
90c3ec2d21 [gdb/testsuite] Use MACRO_AT_{func,range}
Use dwarf assembly procs MACRO_AT_func and MACRO_AT_range in test-cases where
that's appropriate.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-07-17  Tom de Vries  <tdevries@suse.de>

	* gdb.dlang/circular.c (found): Use found_label as label name.
	* gdb.dwarf2/arr-subrange.c (main): Use main_label as label name.
	* gdb.dwarf2/comp-unit-lang.c (func): Use func_label as label name.
	* gdb.dlang/circular.exp: Use MACRO_AT_func and MACRO_AT_range.
	* gdb.dwarf2/ada-linkage-name.exp: Same.
	* gdb.dwarf2/arr-subrange.exp: Same.
	* gdb.dwarf2/atomic-type.exp: Same.
	* gdb.dwarf2/comp-unit-lang.exp: Same.
	* gdb.dwarf2/cpp-linkage-name.exp: Same.
	* gdb.dwarf2/dw2-bad-mips-linkage-name.exp: Same.
	* gdb.dwarf2/dw2-lexical-block-bare.exp: Same.
	* gdb.dwarf2/dw2-regno-invalid.exp: Same.
	* gdb.dwarf2/implptr-64bit.exp: Same.
	* gdb.dwarf2/imported-unit-abstract-const-value.exp: Same.
	* gdb.dwarf2/imported-unit-runto-main.exp: Same.
	* gdb.dwarf2/imported-unit.exp: Same.
	* gdb.dwarf2/main-subprogram.exp: Same.
	* gdb.dwarf2/missing-type-name.exp: Same.
	* gdb.dwarf2/nonvar-access.exp: Same.
	* gdb.dwarf2/struct-with-sig.exp: Same.
	* gdb.dwarf2/typedef-void-finish.exp: Same.
	* gdb.dwarf2/void-type.exp: Same.
2020-07-17 16:42:37 +02:00
Tom de Vries
10da644dc4 [gdb/testsuite] Drop src arg of MACRO_AT_{func,range}
The dwarf assembly procs MACRO_AT_func and MACRO_AT_range have a src
parameter, which is set to $srcdir/$subdir/$srcfile in every single call.

Drop the src parameter and hardcode usage of $srcdir/$subdir/$srcfile in the
procs.

Build and reg-tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-07-17  Tom de Vries  <tdevries@suse.de>

	* lib/dwarf.exp (Dwarf::MACRO_AT_func, Dwarf::MACRO_AT_range): Drop
	src parameter.
	* gdb.dlang/watch-loc.exp: Update MACRO_AT_{func,range} calls.
	* gdb.dwarf2/bitfield-parent-optimized-out.exp: Same.
	* gdb.dwarf2/dw2-ifort-parameter.exp: Same.
	* gdb.dwarf2/dw2-opt-structptr.exp: Same.
	* gdb.dwarf2/dwz.exp: Same.
	* gdb.dwarf2/implptr-optimized-out.exp: Same.
	* gdb.dwarf2/implref-array.exp: Same.
	* gdb.dwarf2/implref-const.exp: Same.
	* gdb.dwarf2/implref-global.exp: Same.
	* gdb.dwarf2/implref-struct.exp: Same.
	* gdb.dwarf2/info-locals-optimized-out.exp: Same.
	* gdb.dwarf2/opaque-type-lookup.exp: Same.
	* gdb.dwarf2/var-access.exp: Same.
	* gdb.dwarf2/varval.exp: Same.
	* gdb.trace/entry-values.exp: Same.
2020-07-17 14:35:44 +02:00
Tom de Vries
315e6afc82 [gdb/testsuite] Remove Dwarf::extern
The file lib/dwarf.exp contains:
...
    # Declare a global label.  This is typically used to refer to
    # labels defined in other files, for example a function defined in
    # a .c file.
    proc extern {args} {
	foreach name $args {
	    _op .global $name
	}
    }
...

The assembler directive to refer to labels defined in other files is
not .global, but .extern, and that one is ignored by gas.

Since we require gas for all dwarf assembly test-cases, remove the proc and
all it's uses.

Tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-07-17  Tom de Vries  <tdevries@suse.de>

	* lib/dwarf.exp (Dwarf::extern): Remove.
	* gdb.compile/compile-ops.exp: Remove use of Dwarf::extern.
	* gdb.dlang/circular.exp: Same.
	* gdb.dwarf2/comp-unit-lang.exp: Same.
	* gdb.dwarf2/dw2-ifort-parameter.exp: Same.
	* gdb.dwarf2/dw2-symtab-includes.exp: Same.
	* gdb.dwarf2/dwz.exp: Same.
	* gdb.dwarf2/imported-unit-abstract-const-value.exp: Same.
	* gdb.dwarf2/imported-unit-runto-main.exp: Same.
	* gdb.dwarf2/imported-unit.exp: Same.
	* gdb.dwarf2/opaque-type-lookup.exp: Same.
2020-07-17 13:06:42 +02:00
GDB Administrator
a26a62b197 Automatic date update in version.in 2020-07-17 00:00:07 +00:00
Hans-Peter Nilsson
555a578963 mmix ld: move .init (and _init) first.
This both makes the section layout more similar to that of the general
default for ELF and fixes (makes true) an assumption that code and
rodata is located between _init and __etext, in
libgcc/config/mmix/crti.S.  Sadly, that's not actually true for ELF
(generally and for elf64mmix), where exception-tables and .rodata is
after _etext; I'm pondering what to do about that.

The original mmix simulator behavior is that memory magically appears
on access, initialized with 0, which is not preferable when chasing
bugs by throwing code the size of the gcc test-suite to the simulator.
The code in crti.S compatibly enables simulator machinery to identify
undefined memory and instead stopping the simulator with an error
(going to interactive mode for interactive runs).  See
http://gcc.gnu.org/legacy-ml/gcc-patches/2012-10/msg01871.html for
more, including the mmix-sim.ch "patch file".

This fixes only one error in the gcc testsuite,
gcc.c-torture/execute/pr20621-1.c with LTO, where for some reason
gcc/lto chooses to move (writable) data that is only used to read 0 to
.rodata.  An access (sufficiently far inside a block) in an
unregistered place is flagged as an invalid access.

The bpo-9m test that I had to adjust, actually exposes a wart: mmo
does not have the notion of symbol types (or sections) and the
test-case now has leading zeros at "Main" eventually leading to it
being misdiagnosed as being outside .text and .data, thus here mapped
to BFD as an absolute symbol.  The test is not intended to check the
mmo symbol-type machinery, so I'm just tweaking it to be
symbol-type-neutral for "Main".

Since you have to jump through hoops to see the problem, I don't think
this commit is worth putting on the 2.35-branch.

ld:
	* scripttempt/mmo.sc: Move .init first in .text output section.
	* testsuite/ld-mmix/bpo-9m.d: Adjust accordingly.
2020-07-17 00:56:17 +02:00
Sandra Loosemore
5597c9402d Fix POSIX-isms in gdb.base/shell.exp
Some recent tests added to gdb.base/shell.exp have been failing on
Windows host due to assumptions that the shell is a POSIX variant.  On
Windows, GDB uses CMD.EXE via the system() call to run shell commands
instead.

There seems to be no obvious CMD.EXE equivalent for "kill -2 $$" to
signal the shell process, so this patch skips those tests on Windows
host.  The second problem addressed here is that CMD.EXE only
recognizes double quotes, not single quotes; that change can be made
unconditionally since POSIX shells recognize double quotes as well.

2020-07-16  Sandra Loosemore  <sandra@codesourcery.com>

	gdb/testsuite/
	* gdb.base/shell.exp: Skip pipe tests dependent on sh on Windows host.
	Use double quotes instead of single quotes.
2020-07-16 14:03:09 -07:00
Caroline Tice
d0ce17d853 gdb: fix issues with handling DWARF v5 rnglists & .dwo files.
While experimenting with GDB on DWARF 5 with split debug (dwo files),
I discovered that GDB was not reading the rnglist index
properly (it needed to be reprocessed in the same way the loclist
index does), and that there was no code for reading rnglists out of
dwo files at all.  Also, the rnglist address reading function
(dwarf2_rnglists_process) was adding the base address to all rnglist
entries, when it's only supposed to add it to the DW_RLE_offset_pair
entries (http://dwarfstd.org/doc/DWARF5.pdf, p. 53), and was not
handling several entry types.

- Added 'reprocessing' for reading rnglist index (as is done for loclist
  index).
- Added code for reading rnglists out of .dwo files.
- Added several missing rnglist forms to dwarf2_rnglists_process.
- Fixed bug that was alwayas adding base address for rnglists (only
  one form needs that).
- Updated dwarf2_rnglists_process to read rnglist out of dwo file when
  appropriate.
- Added new functions cu_debug_rnglist_section & read_rnglist_index.
- Added new testcase, dw5-rnglist-test.{cc,exp}

Special note about the new testcase:

In order for the test case to test anything meaningful, it must be
compiled with clang, not GCC.  The way to do this is as follows:

$ make check RUNTESTFLAGS="CC_FOR_TARGET=/path/to/clang CXX_FOR_TARGET=/path/to/clang++ dw5-rnglist-test.exp"

This following version of clang was used for this testing:

clang version 9.0.1-11
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Change-Id: I3053c5ddc345720b8ed81e23a88fe537ab38748d
2020-07-16 11:37:15 -04:00
Tom de Vries
853772cc18 [gdb/testsuite] Add pseudo line number program instruction: line
There's an idiom in dwarf assembly test-cases:
...
set line1 [gdb_get_line_number "line 1"]
set line2 [gdb_get_line_number "line 2"]
set line3 [gdb_get_line_number "line 3"]
  ...
            {DW_LNS_advance_line [expr $line1 - 1]}
  ...
            {DW_LNS_advance_line [expr $line2 - $line1]}
  ...
            {DW_LNS_advance_line [expr $line3 - $line2]}
...

Add a pseudo line number program instruction "line", such that we can simply
write:
...
            {line $line1}
  ...
            {line $line2}
  ...
            {line $line3}
...

Build and reg-tested on x86_64-linux.

gdb/testsuite/ChangeLog:

2020-07-16  Tom de Vries  <tdevries@suse.de>

	* lib/dwarf.exp (program): Initialize _line.
	(DW_LNE_end_sequence): Reinitialize _line.
	(DW_LNS_advance_line): Update _line.
	(line): New proc.
	* gdb.dwarf2/dw2-inline-many-frames.exp: Use line.
	* gdb.dwarf2/dw2-inline-small-func.exp: Same.
	* gdb.dwarf2/dw2-inline-stepping.exp: Same.
	* gdb.dwarf2/dw2-is-stmt-2.exp: Same.
	* gdb.dwarf2/dw2-is-stmt.exp: Same.
	* gdb.dwarf2/dw2-ranges-func.exp: Same.
2020-07-16 15:34:00 +02:00
GDB Administrator
8ed8e29f05 Automatic date update in version.in 2020-07-16 00:00:06 +00:00
Andrew Burgess
fe07b5721a gdb/testsuite: Update test pattern in ptype-on-functions.exp
It was pointed out that the recently added test
gdb.fortran/ptype-on-functions.exp fails on older versions of
gfortran.  This is because the ABI for passing string lengths changed
from a 4-byte to 8-byte value (on some targets).

This change is documented here:
  https://gcc.gnu.org/gcc-8/changes.html.

  Character variables longer than HUGE(0) elements are now possible on
  64-bit targets. Note that this changes the procedure call ABI for
  all procedures with character arguments on 64-bit targets, as the
  type of the hidden character length argument has changed. The hidden
  character length argument is now of type INTEGER(C_SIZE_T).

This commit just relaxes the pattern to accept any size of integer for
the string length argument.

gdb/testsuite/ChangeLog:

	* gdb.fortran/ptype-on-functions.exp: Make the result pattern more
	generic.
2020-07-15 16:12:17 +01:00
H.J. Lu
04c662e2b6 x86: Don't display eiz with no scale
Change

67 48 8b 1c 25 ef cd ab 89 	mov    0x89abcdef(,%eiz,1),%rbx

to

67 48 8b 1c 25 ef cd ab 89 	mov    0x89abcdef,%rbx

in AT&T syntax and

67 48 8b 1c 25 ef cd ab 89 	mov    rbx,QWORD PTR [eiz*1+0x89abcdef]

to

67 48 8b 1c 25 ef cd ab 89 	mov    rbx,QWORD PTR ds:0x89abcdef

in Intel syntax.

gas/

	PR gas/26237
	* testsuite/gas/i386/evex-no-scale-64.d: Updated.
	* testsuite/gas/i386/addr32.d: Likewise.
	* testsuite/gas/i386/x86-64-addr32-intel.d: Likewise.
	* testsuite/gas/i386/x86-64-addr32.d: Likewise.

opcodes/

	PR gas/26237
	* i386-dis.c (OP_E_memory): Don't display eiz with no scale
	without base nor index registers.
2020-07-15 06:57:47 -07:00
Nick Clifton
56c1b507aa Fix the generation of relocs for missing build notes.
* write.c (create_note_reloc): Add desc2_size parameter.  Zero out
	the addend field of REL relocations.  Store the full addend into
	the note for REL relocations.
2020-07-15 12:52:53 +01:00