Open neozeed opened 3 years ago
Looks like I found the 'so far' patch which includes the full interp.c here: all-so-far.patch.txt
Not sure why it's changing the pc, but it clearly removes the .bss check
diff -ruN interp.c ../../../interp.c |more
--- interp.c 2021-08-26 08:59:58.112051400 +0800
+++ ../../../interp.c 2021-08-29 15:20:51.159402200 +0800
@@ -31,7 +31,6 @@
typedef int word;
typedef unsigned int uword;
-static unsigned long heap_ptr = 0;
host_callback * callback;
#define EXTRACT_WORD(addr) (((addr)[0] << 24) \
@@ -94,13 +93,13 @@
Simulation speed is deemed more important. */
#define NUM_GGX_REGS 8
+#define PC_REGNO 8
/* The ordering of the ggx_regset structure is matched in the
gdb/config/ggx/tm-ggx.h file in the REGISTER_NAMES macro. */
struct ggx_regset
{
- word regs[NUM_GGX_REGS]; /* primary registers */
- word pc; /* the program counter */
+ word regs[NUM_GGX_REGS + 1]; /* primary registers */
word cc; /* the condition code reg */
int exception;
unsigned long msize;
@@ -175,7 +174,7 @@
init_pointers ();
/* Set up machine just out of reset. */
- cpu.asregs.pc = 0;
+ cpu.asregs.regs[PC_REGNO] = 0;
memsize = cpu.asregs.msize / (1024 * 1024);
@@ -375,7 +374,7 @@
sigsave = signal (SIGINT, interrupt);
cpu.asregs.exception = step ? SIGTRAP: 0;
- pc = cpu.asregs.pc;
+ pc = cpu.asregs.regs[PC_REGNO];
insts = cpu.asregs.insts;
unsigned char *memory = cpu.asregs.memory;
@@ -1216,7 +1215,7 @@
} while (!cpu.asregs.exception);
/* Hide away the things we've cached while executing. */
- cpu.asregs.pc = pc;
+ cpu.asregs.regs[PC_REGNO] = pc;
cpu.asregs.insts += insts; /* instructions done ... */
signal (SIGINT, sigsave);
@@ -1407,7 +1406,6 @@
{
bfd * handle;
- asection * s_bss;
handle = bfd_openr (prog, 0); /* could be "ggx" */
if (!handle)
@@ -1426,26 +1424,8 @@
return SIM_RC_FAIL;
}
- /* Look for that bss section. */
- s_bss = bfd_get_section_by_name (handle, ".bss");
-
- if (!s_bss)
- {
- printf("``%s'' has no bss section.\n", prog);
- return SIM_RC_FAIL;
- }
-
- /* Appropriately paranoid would check that we have
- a traditional text/data/bss ordering within memory. */
-
- /* figure the end of the bss section */
- heap_ptr = ((unsigned long) bfd_get_section_vma (handle, s_bss)
- + (unsigned long) bfd_section_size (handle, s_bss));
-
/* Clean up after ourselves. */
bfd_close (handle);
-
- /* XXX: do we need to free the s_bss and handle structures? */
}
/* from sh -- dac */
@@ -1477,7 +1457,7 @@
set_initial_gprs ();
issue_messages = l;
- cpu.asregs.pc = bfd_get_start_address (prog_bfd);
+ cpu.asregs.regs[PC_REGNO] = bfd_get_start_address (prog_bfd);
return SIM_RC_OK;
}
I'm just starting the voyage of building the toolchain.. Since it's dated 2007 I'm using the following packages:
This seems to put things where they ought to be...?
ggx-binutilspatches.tar.gz Anyways I gathered the patches, and use a simple script to apply them all, and I noticed the Changelog of all things fails:
So it looks like the 03-23 change is missing?
Anyways here is a log of me applying the 19 patches: