When running test-case gdb.base/info-macros.exp, I run into:
...
PASS: gdb.base/info-macros.exp: info macro --
PASS: gdb.base/info-macros.exp: info macro --
DUPLICATE: gdb.base/info-macros.exp: info macro --
PASS: gdb.base/info-macros.exp: info macro --
...
These messages come from gdb_test calls using the following commands:
- "info macro --"
- "info macro -- "
- "info macro -- ".
Apparantly the test names get stripped of trailing whitespace, and the first
two end up identical.
Fix this by explicitly specifying an <EOL> after the trailing whitespace in
the test name, such that we have:
...
PASS: gdb.base/info-macros.exp: info macro --
PASS: gdb.base/info-macros.exp: info macro -- <EOL>
PASS: gdb.base/info-macros.exp: info macro -- <EOL>
...
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2021-06-24 Tom de Vries <tdevries@suse.de>
* gdb.base/info-macros.exp: Add <EOL> after trailing whitespace in
test names.
I found the following duplicates in gdb.base/argv0-symlink.exp:
...
DUPLICATE: gdb.base/argv0-symlink.exp: set print repeats 10000
DUPLICATE: gdb.base/argv0-symlink.exp: set print elements 10000
...
Fix these by using with_test_prefix "file symlink" / "dir symlink".
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2021-06-24 Tom de Vries <tdevries@suse.de>
* gdb.base/argv0-symlink.exp: Use with_test_prefix.
Power10 prefixed instructions must not cross 64-byte boundaries.
This is already handled.
However, on XCOFF, the csect must be updated to match the new
alignment.
* config/tc-ppc.c (md_assemble): Update ppc_current_csect
alignment when finding prefixed instructions.
If code tries to send a signal to itself, the callback layer ignores
it and forces the caller to handle it. This allows the sim to turn
that into an engine halt rather than actually killing the sim.
This will make it easier to emulate the syscall. If the kill target
is the sim itself, don't do anything. This forces the higher layers
to make a decision as to how to handle this event: like halting the
overall engine process.
We rewrite srcdir in subdir Makefiles that we generate from the common
parent dir since it points to the parent dir. Since @srcdir@ can be a
variety of formats (relative & absolute), switch to @abs_srcdir@ which
is a lot easier to adjust. Our use of srcdir in here should handle it.
On Ubuntu 20.04, when the debug info package for libc is not installed,
I get:
FAIL: gdb.base/info-types-c++.exp: info types
FAIL: gdb.base/info-types-c.exp: info types
The reason is that the output of info types is exactly:
(gdb) info types
All defined types:
File /home/smarchi/src/binutils-gdb/gdb/testsuite/gdb.base/info-types.c:
52: typedef enum {...} anon_enum_t;
45: typedef struct {...} anon_struct_t;
68: typedef union {...} anon_union_t;
28: typedef struct baz_t baz;
31: typedef struct baz_t * baz_ptr;
21: struct baz_t;
double
33: enum enum_t;
float
int
38: typedef enum enum_t my_enum_t;
17: typedef float my_float_t;
16: typedef int my_int_t;
54: typedef enum {...} nested_anon_enum_t;
47: typedef struct {...} nested_anon_struct_t;
70: typedef union {...} nested_anon_union_t;
30: typedef struct baz_t nested_baz;
29: typedef struct baz_t nested_baz_t;
39: typedef enum enum_t nested_enum_t;
19: typedef float nested_float_t;
18: typedef int nested_int_t;
62: typedef union union_t nested_union_t;
56: union union_t;
unsigned int
(gdb)
The lines we expect in the test contain an empty line at the end:
...
"62:\[\t \]+typedef union union_t nested_union_t;" \
"56:\[\t \]+union union_t;" \
"--optional" "\[\t \]+unsigned int" \
""]
This is written with the supposition that other files will be listed, so
an empty line will be included to separate the symbols from this file
from the next one. This empty line is not included when info-types.c is
the only file listed.
Fix this by rewriting gdb_test_lines to accept a single, plain tcl multiline
regexp, such that we can write:
...
"62:\[\t \]+typedef union union_t nested_union_t;" \
"56:\[\t \]+union union_t;(" \
"\[\t \]+unsigned int)?" \
"($|\r\n.*)"]
...
Tested affected test-cases:
- gdb.base/info-types-c.exp
- gdb.base/info-types-c++.exp
- gdb.base/info-macros.exp
- gdb.cp/cplusfuncs.exp
on x86_64-linux (openSUSE Leap 15.2), both with check and check-read1.
Also tested the first two with gcc-4.8.
Also tested on ubuntu 18.04.
gdb/testsuite/ChangeLog:
2021-06-23 Tom de Vries <tdevries@suse.de>
* lib/gdb.exp (gdb_test_lines): Rewrite to accept single
multiline tcl regexp.
* gdb.base/info-types.exp.tcl: Update. Make empty line at end of
regexp optional.
* gdb.base/info-macros.exp: Update.
* gdb.cp/cplusfuncs.exp: Update.
There's been a prototype for this forever, but the implementation was
missing. Probably because there weren't any callers, but we'll start
using it to implement the kill function.
These ports only use the pieces that have been unified, so we can
merge them into the common configure script and get rid of their
unique one entirely.
We still compile & link separate run programs, and have dedicated
subdir Makefiles, but the configure script portion is merged.
do_target_wait has a wait_ptid parameter, to filter what ptid we wait
on. The sole caller of do_target_wait passes minus_one_ptid, meaning
"all ptids". So in practice, this parameter is not needed, remove it.
gdb/ChangeLog:
* infrun.c (do_target_wait): Remove wait_ptid parameter.
(fetch_inferior_event): Adjust.
Change-Id: I54119beb43db678e4b2081dc490f89e7ff878e74
If we have multiple registered unwinders, this will helps identify which
unwinder was chosen and make it easier to track down potential problems.
Unwinders have a mandatory name argument, which we can use in the
message.
First, make gdb._execute_unwinders return a tuple containing the name,
in addition to the UnwindInfo. Then, make pyuw_sniffer include the name
in the debug message.
I moved the debug message earlier. I think it's good to print it as
early as possible, so that we see it in case an assert is hit in the
loop below, for example.
gdb/ChangeLog:
* python/lib/gdb/__init__.py (_execute_unwinders): Return tuple
with name of chosen unwinder.
* python/py-unwind.c (pyuw_sniffer): Print name of chosen
unwinder in debug message.
Change-Id: Id603545b44a97df2a39dd1872fe1f38ad5059f03
Without that it is impossible to debug on riscv64.
gdb/
PR symtab/27999
* dwarf2/loc.c (decode_debug_loclists_addresses): Support
DW_LLE_start_end.
gdb/testsuite/
PR symtab/27999
* lib/dwarf.exp (start_end): New proc inside loclists.
* gdb.dwarf2/loclists-start-end.exp: New file.
* gdb.dwarf2/loclists-start-end.c: New file.
This test-case is intended to excercise this code in process_imported_unit_die:
...
/* We're importing a C++ compilation unit with tag DW_TAG_compile_unit
into another compilation unit, at root level. Regard this as a hint,
and ignore it. */
if (die->parent && die->parent->parent == NULL
&& per_cu->unit_type == DW_UT_compile
&& per_cu->lang == language_cplus)
return;
...
in the sense that the test-case should fail if the
"per_cu->lang == language_cplus" clause is removed.
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2021-06-22 Tom de Vries <tdevries@suse.de>
* gdb.dwarf2/imported-unit-c.exp: New file.
The original discussion was here,
https://github.com/riscv/riscv-elf-psabi-doc/issues/184
After discussing with Kito Cheng, I think the addends of %pcrel_hi
and %pcrel_lo are both allowed in GNU toolchain. However, both of
the them mean the offset of symbols, rather than the pc address.
But the addends of %got_pcrel_hi and it's %pcrel_lo do not look
reasonable. I believe gcc won't generate the got patterns with
addends, so linker should report dangerous relocation errors,
in case the assembly code use them.
Another issue was here,
https://sourceware.org/pipermail/binutils/2021-June/116983.html
At the beginnig, I suppose %pcrel_hi and %pcrel_lo are valid only
when they are in the same input section. But Jim Wilson points out
that gcc may generate %hi and %lo in the different input sections,
when -freorder-blocks-and-partition option is used. So that a memory
references for a loop may have the %hi outside the loop, but the %lo
remain in the loop. However, it is hard to create the testcases,
to see if %pcrel_hi and %pcrel_lo have the same behavior.
Unfortunately, I notice that the current pcrel resolver cannot
work for the above case. For now we build a hash table for pcrel
at the start of riscv_elf_relocate_section, and then free the hash
at the end. But riscv_elf_relocate_section only handles an input
section at a time, so that means we can only resolve the %pcrel_hi
and %pcrel_lo which are in the same input section. Otherwise, like
the above case, we will report "%pcrel_lo missing matching %pcrel_hi"
for them. I have no plan to improve this in the short-term, so maybe
we can wait until someone meets the problem before we deal with it.
bfd/
* elfnn-riscv.c (riscv_pcrel_hi_reloc): Added field to store
the original relocation type, in case the type is converted to
R_RISCV_HI20.
(riscv_pcrel_lo_reloc): Removed unused name field.
(riscv_pcrel_relocs): Added comments.
(riscv_zero_pcrel_hi_reloc): Removed unused input_bfd.
(riscv_record_pcrel_hi_reloc): Updated.
(riscv_record_pcrel_lo_reloc): Likewise.
(riscv_resolve_pcrel_lo_relocs): Likewise. Check the original
type of auipc, to make sure the %pcrel_lo without any addends.
Otherwise, report dangerous relocation error.
(riscv_elf_relocate_section): Updated above functions are changed.
For R_RISCV_GOT_HI20, report dangerous relocation error when addend
isn't zero.
ld/
* testsuite/ld-riscv-elf/ld-riscv-elf.exp: Updated.
* testsuite/ld-riscv-elf/pcrel-lo-addend-3a.d: New testcase.
* testsuite/ld-riscv-elf/pcrel-lo-addend-3a.s: Likewise.
* testsuite/ld-riscv-elf/pcrel-lo-addend-3b.d: New testcase.
Should report error since the %pcrel_lo with addend refers to
%got_pcrel_hi.
* testsuite/ld-riscv-elf/pcrel-lo-addend-3b.s: Likewise.
* testsuite/ld-riscv-elf/pcrel-lo-addend-3c.d: New testcase.
Should report error since the %got_pcrel_hi with addend.
* testsuite/ld-riscv-elf/pcrel-lo-addend-3c.s: Likewise.
* testsuite/ld-riscv-elf/pcrel-lo-addend-3.ld: Likewise.
I randomly hit a situation where gdbserver crashed immediately before
I issued a 'stepi' to GDB, it turns out that this causes GDB itself to
crash.
What happens is that as part of the stepi we try to insert some
breakpoints into the inferior, so from insert_breakpoints we figure
out what we want to insert, then, eventually, try to send some packets
to the remote to get the breakpoints inserted.
It is only at this point that GDB realises that the target has gone
away. This causes GDB to then enter this call stack:
unpush_and_perror
remote_unpush_target
generic_mourn_inferior
breakpoint_init_inferior
delete_breakpoint
update_global_location_list
So, we realise the target is gone and so delete the breakpoints
associated with that target.
GDB then throws a TARGET_CLOSE_ERROR from unpush_and_error.
This error is caught in insert_breakpoints where we then try to print
a nice error saying something like:
Cannot insert breakpoint %d: some error text here...
To fill in the '%d' we try to read properties of the breakpoint
object.
Which was deleted due to the delete_breakpoint call above.
And so GDB dies...
My proposal in this commit is that, should we catch a
TARGET_CLOSE_ERROR in insert_breakpoints, then we just rethrow the
error.
This will cause the main event loop to print something like:
Remote connection closed
Which I think is fine, I don't think the user will care much which
particular breakpoint GDB was operating on when the connection closed,
just knowing that the connection closed should be enough I think.
I initially added a test to 'gdb.server/server-kill.exp' for this
issue, however, my first attempt was not good enough, the test was
passing even without my fix.
Turns out that the server-kill.exp test actually kills the PID of the
inferior, not the PID of the server. This means that gdbserver is
actually able to send a packet to GDB saying that the inferior has
exited prior to gdbserver itself shutting down. This extra
information was enough to prevent the bug I was seeing manifest.
So, I have extended server-kill.exp to run all of the tests twice, the
first time we still kill the inferior. On the second run we hard kill
the gdbserver itself, this prevents the server from sending anything
to GDB before it exits.
My new test is only expected to fail in this second mode of
operation (killing gdbserver itself), and without my fix, that is what
I see.
gdb/ChangeLog:
* breakpoint.c (insert_bp_location): If we catch a
TARGET_CLOSE_ERROR just rethrow it, the breakpoints might have
been deleted.
gdb/testsuite/ChangeLog:
* gdb.server/server-kill.exp: Introduce global kill_pid_of, and
make use of this in prepare to select which pid we should kill.
Run all the tests twice with a different kill_pid_of value.
(prepare): Make use of kill_pid_of.
(test_stepi): New proc.
This commit provides a small performance improvement when starting up
CGEN based disassemblers by making use of __builtin_popcount.
The #if check used in this commit was copied from bfd/elf32-arm.c
where __builtin_popcount is also used.
I ran into this code while investigating some GDB tests that would
occasionally timeout. One of the reason these tests were having
problems is that the m16c and m32c disassemblers take so long to
initialise themselves. Speeding up count_decodable_bits helps, but is
not a total solution. Still, this felt like an easy win which added
minimal extra complexity, so I figure its worth doing.
opcodes/ChangeLog:
* cgen-dis.c (count_decodable_bits): Use __builtin_popcount when
available.
Commit 54758c3e39 made changes to the picojava support based on
https://sourceware.org/pipermail/binutils/2005-November/045136.html
An update from picojava to picojava II, I think. Unfortunately the
patch neglected any changes to the gas testsuite, resulting in
"FAIL: pj" since that date. This patch makes a few relatively simple
changes to cure the regression.
gas/
* config/tc-pj.c (md_apply_fix): Apply PJ_CODE_REL32 relocs.
* testsuite/gas/pj/ops.s: Update jsr, ret, getstatic,
putstatic, getfield, putfield, invokevirtual, invokespecial,
invokestatic, invokeinterface, goto_w, jsr_w assembly. Delete
version 1 picojava opcodes.
* testsuite/gas/pj/ops.d: Match expected output.
opcodes/
* pj-dis.c (print_insn_pj): Don't print trailing tab. Do
print separator for pcrel insns.
The sim-hardware configure option allows builders to select a set of
device models to enable. But this seems like unnecessary overkill:
the existence of individual device models doesn't affect performance
at all as they are only enabled at runtime if the config uses them,
and individually these are all <5KB a piece. Stripping off a total
of ~50KB from a ~1MB binary doesn't seem useful, and it's extremely
unlikely anyone will ever bother.
So let's simplify the configure/make logic by turning sim-hardware
into a boolean option like many of the other sim options. Any ports
that have unique device models will declare them in their Makefile
instead of at configure time. This will allow us to (eventually)
unify the setting into the common dir.
This commit adds support to RISC-V GDB for vector registers in the
incoming target description.
The vector registers should be described in a feature called
"org.gnu.gdb.riscv.vector", and should contain the register v0 to
v31. There's no restriction on the size or type of these registers,
so the target description can set these up as it requires.
However, if the target feature is present then all of the registers
must be present, and they must all be the same size, these
requirements are, I believe, inline with the RISC-V vector extension.
The DWARF register numbers for the vector registers have been added,
and the code to map between GDB's internal numbering and the DWARF
numbering has been updated.
I have not yet added a feature/riscv/*.xml file for the vector
extension, the consequence of this is that we can't, right now, detect
vector registers on a native target, this patch is all about
supporting vectors on a remote target.
It is worth noting that I don't actually have access to a RISC-V
target with vectors, so the only testing that this patch has had has
been done using 'set tdesc filename ....' to load a target description
to which I have manually added the vector feature. This has shown
that the vector register feature can be successfully parsed, and that
the registers show up in the expected register groups.
Additionally, the RISC-V vector extension is currently at v0.10, which
is also the v1.0 draft release. However, this extension is not yet
finalised. It is possible (but unlikely I think) that the register
set could change between now and the final release of the vector
extension. If this were to happen then we would potentially end up
changing the requirements for the new org.gnu.gdb.riscv.vector
feature. I really don't think it is likely that the register set will
change this late in the process, and even if it did, changing the
feature requirements will not be a problem as far as I am
concerned (when the alternative is GDB just continues without this
feature for now).
gdb/ChangeLog:
* NEWS: Mention new target feature name.
* arch/riscv.c (riscv_create_target_description): GDB doesn't
currently create target descriptions containing vector registers.
* arch/riscv.h (struct riscv_gdbarch_features) <vlen>: New member
variable.
<operator==>: Also compare vlen.
<hash>: Also include vlen.
* riscv-tdep.c (riscv_feature_name_vector): New static global.
(struct riscv_vector_feature): New struct.
(riscv_vector_feature): New static global.
(riscv_register_reggroup_p): Ensure vector registers are part of
the 'all' group, and part of the 'vector' group.
(riscv_dwarf_reg_to_regnum): Handle vector registers.
(riscv_gdbarch_init): Check vector register feature.
* riscv-tdep.h: Add vector registers to GDB's internal register
numbers, and to the DWARF register numbers.
gdb/doc/ChangeLog:
* gdb.texinfo (RISC-V Features): Mention vector register feature.
Add new methods to the PendingFrame and Frame classes to obtain the
stack frame level for each object.
The use of 'level' as the method name is consistent with the existing
attribute RecordFunctionSegment.level (though this is an attribute
rather than a method).
For Frame/PendingFrame I went with methods as these classes currently
only use methods, including for simple data like architecture, so I
want to be consistent with this interface.
gdb/ChangeLog:
* NEWS: Mention the two new methods.
* python/py-frame.c (frapy_level): New function.
(frame_object_methods): Register 'level' method.
* python/py-unwind.c (pending_framepy_level): New function.
(pending_frame_object_methods): Register 'level' method.
gdb/doc/ChangeLog:
* python.texi (Unwinding Frames in Python): Mention
PendingFrame.level.
(Frames In Python): Mention Frame.level.
gdb/testsuite/ChangeLog:
* gdb.python/py-frame.exp: Add Frame.level tests.
* gdb.python/py-pending-frame-level.c: New file.
* gdb.python/py-pending-frame-level.exp: New file.
* gdb.python/py-pending-frame-level.py: New file.
We already have two helper functions in py-utils.c:
gdb_py_object_from_longest (LONGEST l)
gdb_py_object_from_ulongest (ULONGEST l)
these wrap around calls to either PyLong_FromLongLong,
PyLong_FromLong, or PyInt_From_Long (if Python 2 is being used).
There is one place in gdb/python/* where a call to PyLong_FromLong was
added outside of the above utility functions, this was done in the
recent commit:
commit 55789354fc
Date: Fri May 14 11:56:31 2021 +0200
gdb/python: add a 'connection_num' attribute to Inferior objects
In this commit I replace the direct use of PyLong_FromLong with a call
to gdb_py_object_from_longest. The only real change with this commit,
is that, for Python 2, we will now end up calling PyInt_FromLong
instead of PyLong_FromLong, but this should be invisible to the user.
For Python 3 there should be absolutely no change.
gdb/ChangeLog:
* python/py-inferior.c (infpy_get_connection_num): Call
gdb_py_object_from_longest instead of PyLong_FromLong directly.
This patch came about because I wanted to write a frame unwinder that
would corrupt the backtrace in a particular way. In order to achieve
what I wanted I ended up trying to write an unwinder like this:
class FrameId(object):
.... snip class definition ....
class TestUnwinder(Unwinder):
def __init__(self):
Unwinder.__init__(self, "some name")
def __call__(self, pending_frame):
pc_desc = pending_frame.architecture().registers().find("pc")
pc = pending_frame.read_register(pc_desc)
sp_desc = pending_frame.architecture().registers().find("sp")
sp = pending_frame.read_register(sp_desc)
# ... snip code to decide if this unwinder applies or not.
fid = FrameId(pc, sp)
unwinder = pending_frame.create_unwind_info(fid)
unwinder.add_saved_register(pc_desc, pc)
unwinder.add_saved_register(sp_desc, sp)
return unwinder
The important things here are the two calls:
unwinder.add_saved_register(pc_desc, pc)
unwinder.add_saved_register(sp_desc, sp)
On x86-64 these would fail with an assertion error:
gdb/regcache.c:168: internal-error: int register_size(gdbarch*, int): Assertion `regnum >= 0 && regnum < gdbarch_num_cooked_regs (gdbarch)' failed.
What happens is that in unwind_infopy_add_saved_register (py-unwind.c)
we call register_size, as register_size should only be called on
cooked (real or pseudo) registers, and 'pc' and 'sp' are implemented
as user registers (at least on x86-64), we trigger the assertion.
A simple fix would be to check in unwind_infopy_add_saved_register if
the register number we are handling is a cooked register or not, if
not we can throw a 'Bad register' error back to the Python code.
However, I think we can do better.
Consider that at the CLI we can do this:
(gdb) set $pc=0x1234
This works because GDB first evaluates '$pc' to get a register value,
then evaluates '0x1234' to create a value encapsulating the
immediate. The contents of the immediate value are then copied back
to the location of the register value representing '$pc'.
The value location for a user-register will (usually) be the location
of the real register that was accessed, so on x86-64 we'd expect this
to be $rip.
So, in this patch I propose that in the unwinder code, when
add_saved_register is called, if it is passed a
user-register (i.e. non-cooked) then we first fetch the register,
extract the real register number from the value's location, and use
that new register number when handling the add_saved_register call.
If either the value location that we get for the user-register is not
a cooked register then we can throw a 'Bad register' error back to the
Python code, but in most cases this will not happen.
gdb/ChangeLog:
* python/py-unwind.c (unwind_infopy_add_saved_register): Handle
saving user registers.
gdb/testsuite/ChangeLog:
* gdb.python/py-unwind-user-regs.c: New file.
* gdb.python/py-unwind-user-regs.exp: New file.
* gdb.python/py-unwind-user-regs.py: New file.
Inline the stats printf calls to avoid compiler warnings about
non-literal format strings. This in turn highlights bad type
sizes being passed in, so fix the strings to use the right size
type. This in turn highlights the rest of the func using casts
rather than the right type directly, so adjust all of those.
Finally, replace a few abort+sim_engine_halt calls with the
common sim_engine_abort. This provides good output while still
aborting as we want.
Move these options up to the common dir so we only test & export
them once across all ports. This takes a page from the cgen maint
logic to make $(MAINT) work for non-automake Makefiles which will
allow us to merge it together.
Move these options up to the common dir so we only test & export
them once across all ports. It makes it available to targets that
aren't cgen-based, but those will just ignore the settings, so it
shouldn't be an issue.
Since GOTOFF relocations against IFUNC symbols must go through PLT,
set PLT reference count to 1 for GOTOFF relocation.
bfd/
PR ld/27998
* elfxx-x86.c (elf_x86_allocate_dynrelocs): Count PLT for GOTOFF
relocation against IFUNC symbols.
(_bfd_x86_elf_adjust_dynamic_symbol): Likewise.
ld/
PR ld/27998
* testsuite/ld-i386/i386.exp: Run PR ld/27998 tests.
* testsuite/ld-i386/pr27998a.d: New file.
* testsuite/ld-i386/pr27998a.s: Likewise.
* testsuite/ld-i386/pr27998b.d: Likewise.
* testsuite/ld-i386/pr27998b.s: Likewise.
These dirs don't use automake, so use AC_CONFIG_MACRO_DIRS to specify
../config as a search dir for m4 macros. This allows removal of a lot
of hand-written m4_include's from acinclude.m4 files, and simplifies
use of `aclocal` or `autoreconf` as manual -I is not needed.
I get this when building with gcc 11:
CC common/common_libcommon_a-sim-load.o
In file included from /home/simark/src/binutils-gdb/sim/common/sim-n-bits.h:27,
from /home/simark/src/binutils-gdb/sim/common/sim-bits.c:259,
from /home/simark/src/binutils-gdb/sim/common/sim-bits.h:599,
from /home/simark/src/binutils-gdb/sim/common/sim-basics.h:122,
from /home/simark/src/binutils-gdb/sim/common/sim-load.c:30:
/home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:39:27: error: 'offset_16' defined but not used [-Werror=unused-function]
39 | #define offset_N XCONCAT2(offset_,N)
| ^~~~~~~
/home/simark/src/binutils-gdb/sim/../include/symcat.h:23:26: note: in definition of macro 'CONCAT2'
23 | #define CONCAT2(a,b) a##b
| ^
/home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:39:18: note: in expansion of macro 'XCONCAT2'
39 | #define offset_N XCONCAT2(offset_,N)
| ^~~~~~~~
/home/simark/src/binutils-gdb/sim/common/sim-n-endian.h:138:1: note: in expansion of macro 'offset_N'
138 | offset_N (unsigned_N *x,
| ^~~~~~~~
offset_N uses INLINE_SIM_ENDIAN, which uses UNUSED to put the "unused"
attribute. However, it appears after the function's return type, which
seems to make it not apply to the function. Moving it to before the
return type fixes the error.
Change all instances found in that file.
sim/common/ChangeLog:
* sim-inline.h: Move UNUSED before TYPE.
Change-Id: Ide20106683ed7a9ebf35d484dabf70b309cb1ba6
Only one arch uses this currently, but others could too. By moving
it up to the common checks, it'll also let us simplify the moxie code
significantly.
Use the same basic names as the common sim inline logic so we can
merge the two. We don't do that here, just prepare for it.
The common code seems to be based on the ppc version but with slightly
different names as it was cleaned up & generalized. I *think* these
concepts are the same, so binding them together is OK, but maybe I'm
misreading them. If so, can always tweak them later.
REVEAL_MODULE -> H_REVEALS_MODULE
INLINE_MODULE -> C_REVEALS_MODULE
Change
ld: warning: creating DT_TEXTREL in a PIE
to
ld: warning: creating DT_TEXTREL in a PDE
on PDE.
bfd/
* elflink.c (bfd_elf_final_link): Correct DT_TEXTREL warning in
PDE.
ld/
* testsuite/ld-x86-64/textrel-1.err: New file.
* testsuite/ld-x86-64/textrel-1a.s: Likewise.
* testsuite/ld-x86-64/textrel-1b.s: Likewise.
* testsuite/ld-x86-64/x86-64.exp: Run textrel-1 tests.