Commit Graph

112683 Commits

Author SHA1 Message Date
Mike Frysinger
12d563bbf7 sim: sh: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:58 -05:00
Mike Frysinger
7e9c749ccc sim: mcore: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:58 -05:00
Mike Frysinger
758f5a9875 sim: h8300: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:58 -05:00
Mike Frysinger
2a91447ab8 sim: pru: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so drop the pru.h include and move the remaining
pru-specific settings into it.
2022-12-23 08:32:58 -05:00
Mike Frysinger
627bdb6394 sim: mn10300: standardize the arch-specific settings a little
Rename mn10300_sim.h to mn10300-sim.h to match other ports, and move most
of the arch-specific content out of sim-main.h to it.  This isn't a big
win though as we still have to include the header in sim-main.h due to the
igen interface: it hardcodes including sim-main.h in its files.  So until
we can fix that, we have to keep bleeding these settings into the common
codes.

Also take the opportunity to purge a lot of unused headers from these.
The local modules should already include the right headers, so there's
no need to force everyone to pull them in.  A lot of this is a hold over
from the pre-igen days of this port.
2022-12-23 08:32:58 -05:00
Mike Frysinger
7790fabeb7 sim: microblaze: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:58 -05:00
Mike Frysinger
ca6fd35084 sim: example-synacor: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:58 -05:00
Mike Frysinger
9da0101a1f sim: moxie: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:58 -05:00
Mike Frysinger
f3e1a3e6fa sim: riscv: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.

We can also move the machs.h include out since the model logic was all
generalized from compile-time to runtime last year.
2022-12-23 08:32:58 -05:00
Mike Frysinger
f625c714c2 sim: v850: standardize the arch-specific settings a little
Rename v850_sim.h to v850-sim.h to match other ports, and move most
of the arch-specific content out of sim-main.h to it.  This isn't a
big win though as we still have to include the header in sim-main.h
due to the igen interface: it hardcodes including sim-main.h in its
files.  So until we can fix that, we have to keep bleeding these
settings into the common codes.
2022-12-23 08:32:58 -05:00
Mike Frysinger
dcd1a4d15a sim: msp430: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so drop the msp430-sim.h include and move it to
the few files that actually need it.

While we're here, drop redundant includes from sim-main.h:
* sim-config.h & sim-types.h included by sim-basics.h already
* sim-engine.h included by sim-base.h already
And move sim-options.h to the one file that needs it.
2022-12-23 08:32:58 -05:00
Mike Frysinger
84bc490d58 sim: ft32: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so drop the ft32-sim.h include and move it to
the few files that actually need it.
2022-12-23 08:32:58 -05:00
Mike Frysinger
6960600787 sim: d10v: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so drop the d10v_sim.h include and move it to
the few files that actually need it.

Also rename the file to standardize it a bit better with other ports.
2022-12-23 08:32:58 -05:00
Mike Frysinger
e79b75a3cf sim: cr16: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so drop the cr16_sim.h include and move it to
the few files that actually need it.

Also rename the file to standardize it a bit better with other ports.
2022-12-23 08:32:58 -05:00
Mike Frysinger
e50840893d sim: arm: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.

The BIT override would be better in the place where it's redefined, so
move it to armdefs.h instead.
2022-12-23 08:32:58 -05:00
Mike Frysinger
e24a921d40 sim: aarch64: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.

While we're here, drop redundant includes from sim-main.h:
* sim-types.h is included by sim-base.h already
* sim-base.h is included twice
* sim-io.h is included by sim-base.h already
2022-12-23 08:32:57 -05:00
Mike Frysinger
42b68db170 sim: avr: move arch-specific settings to internal header
There's no need for these settings to be in sim-main.h which is shared
with common/ sim code, so move it all out to a new header which only
this port will include.
2022-12-23 08:32:57 -05:00
Nick Clifton
8af23b30ed Fix illegal memory access parsing corrupt DWARF information.
PR 29936
	* dwarf2.c (concat_filename): Fix check for a directory index off
	the end of the directory table.
2022-12-23 13:02:42 +00:00
Eli Zaretskii
8fbad19958 Fix MinGW build using mingw.org's MinGW
This allows to build GDB even though the default value of
_WIN32_WINNT is lower than the one needed to expose some
new APIs used here, and leave the test for their actual
support to run time.
* gdb/nat/windows-nat.c (EXTENDED_STARTUPINFO_PRESENT): Define if
not defined.
(create_process_wrapper): Use 'gdb_lpproc_thread_attribute_list'
instead of 'PPROC_THREAD_ATTRIBUTE_LIST' (which might not be defined
at compile time).  This fixes compilation error using mingw.org's
MinGW.
2022-12-23 13:21:03 +02:00
Mark Harmstone
8d25f5ef2c ld: Write linker symbols in PDB 2022-12-23 21:10:09 +10:30
Mark Harmstone
5d9c033689 ld: Copy other symbols into PDB file 2022-12-23 21:02:21 +10:30
Mark Harmstone
81814b6f5b ld: Write globals stream in PDB 2022-12-23 20:54:40 +10:30
Mark Harmstone
817840046a ld: Parse LF_UDT_SRC_LINE records when creating PDB file 2022-12-23 20:45:30 +10:30
Mark Harmstone
fca9096a94 ld: Write types into IPI stream of PDB 2022-12-23 20:13:31 +10:30
Mark Harmstone
d5b4c0ddb9 ld: Write types into TPI stream of PDB 2022-12-23 20:05:48 +10:30
Mark Harmstone
598c1ae610 ld: Write DEBUG_S_LINES entries in PDB file 2022-12-23 19:57:56 +10:30
Mark Harmstone
8b182dc3c6 ld: Fix segfault in populate_publics_stream 2022-12-23 19:49:47 +10:30
Mark Harmstone
803561cb74 ld: Write DEBUG_S_FILECHKSMS entries in PDBs 2022-12-23 19:37:57 +10:30
Mark Harmstone
f559276dc5 ld: Generate PDB string table 2022-12-23 19:37:44 +10:30
Alan Modra
f27d07a1c2 pdb build fixes
Enable compilation of ld/pdb.c just for x86, as is done for bfd/pdb.c.
This reduces the size of ld and is necessary with the following
patches that call a COFF-only bfd function from ld/pdb.c.  Without it
we'd break every non-COFF target build.
2022-12-23 19:20:31 +10:30
Mike Frysinger
110028744c sim: lm32/m32r: drop redundant opcode/cgen.h include
The xxx-desc.h header file already includes this, and it's how the
other cgen ports are getting it, so drop it from these two.
2022-12-23 00:58:40 -05:00
Mike Frysinger
10861ec94f sim: ppc: drop unused types from sim-main.h
The common sim headers should define these for us already, so there's
no need for the ppc header to set them up.
2022-12-23 00:57:32 -05:00
Mike Frysinger
3eaecff513 sim: cgen: move symcat.h include to where it's used
Move this out of the global sim-main.h and to the few files that
actually use functions from it.  Only the cgen ports were pulling
this, so this makes cgen & non-cgen behave more the same.
2022-12-23 00:52:04 -05:00
Mike Frysinger
d9e217e950 sim: cgen: move cgen-types.h include to cgen-defs.h
The cgen-types.h header sets up types that are needed by cgen-defs.h,
so move the include out of sim-main.h and to that header.  It might
be needed in other specific modules, but for now let's kick it out of
sim-main.h to make some progress.  Things still build with just this.
2022-12-23 00:51:14 -05:00
Mike Frysinger
a4c4d804d6 Revert "sim: mn10300: drop unused sim-main.c"
This reverts commit 681a422b85.

I missed that this was included via common/sim-inline.c.  I thought
I had grepped the top of the tree, but I must have only done mn10300.

Add a comment to make it clear where/how this file is used.
2022-12-23 00:22:53 -05:00
Mike Frysinger
681a422b85 sim: mn10300: drop unused sim-main.c
Nothing compiles or references this, so punt it.
2022-12-22 23:39:35 -05:00
Mike Frysinger
b15fa15bc4 sim: endian: move bfd.h from header to source
The bfd APIs are used only by sim-n-endian.h which is only included by
sim-endian.c, so move the bfd.h include there and out of sim-endian.h
which is included by many other modules.
2022-12-22 22:06:52 -05:00
Mike Frysinger
6cf3ddd23e sim: move bfd.h include out of sim-main.h
Not all arches include this in sim-main.h, and the ones that do don't
actually use bfd defines in the sim-main.h header.  Prune it to make
sim-main.h simpler so we can kill it off entirely in the future.

We add the include to the files that utilize e.g. bfd_vma though.
2022-12-22 22:06:12 -05:00
Mike Frysinger
4c337f2dd3 sim: mcore: replace custom "word" type with int32_t
This is a 32-bit architecture with 32-bit registers, so replace the
custom "word" long int typedef with an explicit int32_t.  This is
a correctness fix since long will be 64-bits on most 64-bit hosts.
2022-12-22 21:55:47 -05:00
Mike Frysinger
be2e4e6538 sim: moxie: replace custom "word" type with int32_t
This is a 32-bit architecture with 32-bit registers, so replace the
custom "word" int typedef with an explicit int32_t.  Practically
speaking, this produces the same code, but it should hopefully make
it easier to merge common code in the future.
2022-12-22 21:55:47 -05:00
Mike Frysinger
547eedc132 sim: cr16/d10v/mcore/moxie: clean up unused word & uword types
Nothing actually uses these, so punt them.  Some of the ports are
using local "word" types, but we'll clean those up in a follow up.
2022-12-22 21:55:47 -05:00
Mike Frysinger
3841a73a27 sim: mips: trim redundant igen settings
These variables are setting the same value as the defaults.  Trim
this redundant logic to make it easier to see the real differences
so we can try to keep unifying cases.
2022-12-22 21:29:21 -05:00
Mike Frysinger
022e1fb26c sim: mips: merge mips64* with existing multi-run build
Change the default (unhandled) mips64* targets to use the existing
mips64 multi-run build.  It already handles the formats, we just
have to list the mips8000 bfd for it.
2022-12-22 21:24:09 -05:00
Mike Frysinger
a54eee6db6 sim: mips: merge mips64vr5000 with existing multi-run build
The existing mips64vr-* multi-run build already handles mips5000
targets, so reuse that for mips64vr5* targets too.  This moves
more logic from build-time to runtime so we can have a single
binary that supports many targets.
2022-12-22 21:20:44 -05:00
Nelson Chu
fa6f3b911f RISC-V: Relax the order checking for the architecture string
* riscv-toolchain-conventions,
PR, https://github.com/riscv-non-isa/riscv-toolchain-conventions/pull/14
Issue, https://github.com/riscv-non-isa/riscv-toolchain-conventions/issues/11

* Refer to the commit afc41ffb,
RISC-V: Reorder the prefixed extensions which are out of order.

In the past we only allow to reorder the prefixed extensions.  But according
to the PR 14 in the riscv-toolchain-convention, we can also relax the order
checking to allow the whole extensions be written out of orders, including
the single standard extensions and the prefixed multi-letter extensions.
Just that we still need to follow the following rules as usual,

1. prefixed extensions need to be seperated with `_'.
2. prefixed extensions need complete <major>.<minor> version if set.

Please see the details in the march-ok-reorder gas testcase.

Passed the riscv-gnu-toolchain regressions.

bfd/
    * elfxx-riscv.c (enum riscv_prefix_ext_class): Changed RV_ISA_CLASS_UNKNOWN
    to RV_ISA_CLASS_SINGLE, since everything that does not belong to the
    multi-keyword will possible be a single extension for the current parser.
    (parse_config): Likewise.
    (riscv_get_prefix_class): Likewise.
    (riscv_compare_subsets): Likewise.
    (riscv_parse_std_ext): Removed, and merged with riscv_parse_prefixed_ext
    into riscv_parse_extensions.
    (riscv_parse_prefixed_ext): Likewise.
    (riscv_parse_subset): Only need to call riscv_parse_extensions to parse
    both single standard and prefixed extensions.
gas/
    * testsuite/gas/riscv/march-fail-order-std.d: Removed since the relaxed
    order checking.
    * testsuite/gas/riscv/march-fail-order-std.l: Likewise.
    * testsuite/gas/riscv/march-fail-order-x-std.d: Likewise.
    * testsuite/gas/riscv/march-fail-order-z-std.d: Likewise.
    * testsuite/gas/riscv/march-fail-order-zx-std.l: Likewise.
    * testsuite/gas/riscv/march-fail-unknown-std.l: Updated.
    * testsuite/gas/riscv/march-ok-reorder.d: New testcase.
2022-12-23 10:00:37 +08:00
Mike Frysinger
11e25f766e sim: drop unused SIM_ADDR type [PR sim/7504]
Now that sim APIs either use 64-bit addresses all the time, or more
appropriate target-specific types, drop this now-unused 32-bit-only
address type.

Bug: https://sourceware.org/PR7504
2022-12-22 20:10:14 -05:00
Mike Frysinger
697e27f0ee sim: mips: switch from SIM_ADDR to address_word
The latter type matches the address size configured for this sim.

Also take the opportunity to simplify printf logic by leveraging
PRI* macros.
2022-12-22 20:10:13 -05:00
Mike Frysinger
ae0faac067 sim: v850: switch from SIM_ADDR to address_word
The latter type matches the address size configured for this sim.
2022-12-22 19:46:36 -05:00
Mike Frysinger
63fd5b5dda sim: switch sim_{read,write} APIs to 64-bit all the time [PR sim/7504]
We've been using SIM_ADDR which has always been 32-bit.  This means
the upper 32-bit address range in 64-bit sims is inaccessible.  Use
64-bit addresses all the time since we want the APIs to be stable
regardless of the active arch backend (which can be 32 or 64-bit).

The length is also 64-bit because it's completely feasible to have
a program that is larger than 4 GiB in size/image/runtime.  Forcing
the caller to manually chunk those accesses up into 4 GiB at a time
doesn't seem useful to anyone.

Bug: https://sourceware.org/PR7504
2022-12-22 19:29:24 -05:00
Mike Frysinger
20fea6638f sim: use bfd_vma when reading start addr from bfd info
Since SIM_ADDR is always 32-bit, it might truncate the address with
64-bit ELFs.  Since we load that addr from the bfd, use the bfd_vma
type which matches the bfd_get_start_address API.
2022-12-22 19:29:10 -05:00