OpenCores
URL https://opencores.org/ocsvn/zipcpu/zipcpu/trunk

Subversion Repositories zipcpu

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /zipcpu
    from Rev 123 to Rev 124
    Reverse comparison

Rev 123 → Rev 124

/trunk/sw/gcc-zippatch.patch
138,7 → 138,7
+
+struct gcc_targetm_common targetm_common = TARGETM_COMMON_INITIALIZER;
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/aarch64/aarch64-linux.h gcc-5.3.0-zip/gcc/config/aarch64/aarch64-linux.h
--- gcc-5.3.0-original/gcc/config/aarch64/aarch64-linux.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/aarch64/aarch64-linux.h 2016-04-11 22:20:22.139907680 -0400
+++ gcc-5.3.0-zip/gcc/config/aarch64/aarch64-linux.h 2015-07-24 12:00:26.000000000 -0400
@@ -21,7 +21,7 @@
#ifndef GCC_AARCH64_LINUX_H
150,7 → 150,7
#undef ASAN_CC1_SPEC
#define ASAN_CC1_SPEC "%{%:sanitize(address):-funwind-tables}"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/alpha/linux-elf.h gcc-5.3.0-zip/gcc/config/alpha/linux-elf.h
--- gcc-5.3.0-original/gcc/config/alpha/linux-elf.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/alpha/linux-elf.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/alpha/linux-elf.h 2015-01-05 07:33:28.000000000 -0500
@@ -23,8 +23,8 @@
#define EXTRA_SPECS \
164,7 → 164,7
#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
#elif DEFAULT_LIBC == LIBC_GLIBC
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/arm/linux-eabi.h gcc-5.3.0-zip/gcc/config/arm/linux-eabi.h
--- gcc-5.3.0-original/gcc/config/arm/linux-eabi.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/arm/linux-eabi.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/arm/linux-eabi.h 2015-01-05 07:33:28.000000000 -0500
@@ -68,8 +68,8 @@
GLIBC_DYNAMIC_LINKER_DEFAULT and TARGET_DEFAULT_FLOAT_ABI. */
178,7 → 178,7
#define GLIBC_DYNAMIC_LINKER \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/arm/linux-elf.h gcc-5.3.0-zip/gcc/config/arm/linux-elf.h
--- gcc-5.3.0-original/gcc/config/arm/linux-elf.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/arm/linux-elf.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/arm/linux-elf.h 2015-06-23 05:26:54.000000000 -0400
@@ -62,7 +62,7 @@
190,7 → 190,7
#define LINUX_TARGET_LINK_SPEC "%{h*} \
%{static:-Bstatic} \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/bfin/linux.h gcc-5.3.0-zip/gcc/config/bfin/linux.h
--- gcc-5.3.0-original/gcc/config/bfin/linux.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/bfin/linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/bfin/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -45,7 +45,7 @@
%{shared:-G -Bdynamic} \
202,7 → 202,7
#undef TARGET_SUPPORTS_SYNC_CALLS
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/cris/linux.h gcc-5.3.0-zip/gcc/config/cris/linux.h
--- gcc-5.3.0-original/gcc/config/cris/linux.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/cris/linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/cris/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -102,7 +102,7 @@
#undef CRIS_DEFAULT_CPU_VERSION
214,7 → 214,7
#undef CRIS_LINK_SUBTARGET_SPEC
#define CRIS_LINK_SUBTARGET_SPEC \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/freebsd-spec.h gcc-5.3.0-zip/gcc/config/freebsd-spec.h
--- gcc-5.3.0-original/gcc/config/freebsd-spec.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/freebsd-spec.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/freebsd-spec.h 2015-06-25 13:53:14.000000000 -0400
@@ -129,9 +129,9 @@
#endif
229,7 → 229,7
/* NOTE: The freebsd-spec.h header is included also for various
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/frv/linux.h gcc-5.3.0-zip/gcc/config/frv/linux.h
--- gcc-5.3.0-original/gcc/config/frv/linux.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/frv/linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/frv/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -34,7 +34,7 @@
#define ENDFILE_SPEC \
241,7 → 241,7
#undef LINK_SPEC
#define LINK_SPEC "\
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/gnu.h gcc-5.3.0-zip/gcc/config/i386/gnu.h
--- gcc-5.3.0-original/gcc/config/i386/gnu.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/i386/gnu.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/i386/gnu.h 2015-01-05 07:33:28.000000000 -0500
@@ -22,7 +22,7 @@
#define GNU_USER_LINK_EMULATION "elf_i386"
253,7 → 253,7
#undef STARTFILE_SPEC
#if defined HAVE_LD_PIE
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu64.h gcc-5.3.0-zip/gcc/config/i386/kfreebsd-gnu64.h
--- gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu64.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu64.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/i386/kfreebsd-gnu64.h 2015-01-05 07:33:28.000000000 -0500
@@ -22,6 +22,6 @@
#define GNU_USER_LINK_EMULATION64 "elf_x86_64_fbsd"
266,7 → 266,7
+#define GLIBC_DYNAMIC_LINKER64 "/lib/ld-kfreebsd-x86-64.so.1"
+#define GLIBC_DYNAMIC_LINKERX32 "/lib/ld-kfreebsd-x32.so.1"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu.h gcc-5.3.0-zip/gcc/config/i386/kfreebsd-gnu.h
--- gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/i386/kfreebsd-gnu.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/i386/kfreebsd-gnu.h 2015-01-05 07:33:28.000000000 -0500
@@ -19,4 +19,4 @@
<http://www.gnu.org/licenses/>. */
275,7 → 275,7
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld.so.1"
+#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/linux64.h gcc-5.3.0-zip/gcc/config/i386/linux64.h
--- gcc-5.3.0-original/gcc/config/i386/linux64.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/i386/linux64.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/i386/linux64.h 2015-01-05 07:33:28.000000000 -0500
@@ -27,6 +27,6 @@
#define GNU_USER_LINK_EMULATION64 "elf_x86_64"
288,7 → 288,7
+#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
+#define GLIBC_DYNAMIC_LINKERX32 "/libx32/ld-linux-x32.so.2"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/i386/linux.h gcc-5.3.0-zip/gcc/config/i386/linux.h
--- gcc-5.3.0-original/gcc/config/i386/linux.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/i386/linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/i386/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -20,4 +20,4 @@
<http://www.gnu.org/licenses/>. */
297,7 → 297,7
-#define GLIBC_DYNAMIC_LINKER "/tools/lib/ld-linux.so.2"
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/ia64/linux.h gcc-5.3.0-zip/gcc/config/ia64/linux.h
--- gcc-5.3.0-original/gcc/config/ia64/linux.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/ia64/linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/ia64/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -55,7 +55,7 @@
/* Define this for shared library support because it isn't in the main
309,7 → 309,7
#undef LINK_SPEC
#define LINK_SPEC "\
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/knetbsd-gnu.h gcc-5.3.0-zip/gcc/config/knetbsd-gnu.h
--- gcc-5.3.0-original/gcc/config/knetbsd-gnu.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/knetbsd-gnu.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/knetbsd-gnu.h 2015-01-05 07:33:28.000000000 -0500
@@ -32,4 +32,4 @@
318,7 → 318,7
-#define GNU_USER_DYNAMIC_LINKER "/tools/lib/ld.so.1"
+#define GNU_USER_DYNAMIC_LINKER "/lib/ld.so.1"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/kopensolaris-gnu.h gcc-5.3.0-zip/gcc/config/kopensolaris-gnu.h
--- gcc-5.3.0-original/gcc/config/kopensolaris-gnu.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/kopensolaris-gnu.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/kopensolaris-gnu.h 2015-01-05 07:33:28.000000000 -0500
@@ -31,5 +31,4 @@
while (0)
328,7 → 328,7
-
+#define GNU_USER_DYNAMIC_LINKER "/lib/ld.so.1"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/linux.h gcc-5.3.0-zip/gcc/config/linux.h
--- gcc-5.3.0-original/gcc/config/linux.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -73,10 +73,10 @@
GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
346,7 → 346,7
#define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
#define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/lm32/uclinux-elf.h gcc-5.3.0-zip/gcc/config/lm32/uclinux-elf.h
--- gcc-5.3.0-original/gcc/config/lm32/uclinux-elf.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/lm32/uclinux-elf.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/lm32/uclinux-elf.h 2015-01-05 07:33:28.000000000 -0500
@@ -67,7 +67,7 @@
%{shared:-shared} \
358,7 → 358,7
#define TARGET_OS_CPP_BUILTINS() GNU_USER_TARGET_OS_CPP_BUILTINS()
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/m68k/linux.h gcc-5.3.0-zip/gcc/config/m68k/linux.h
--- gcc-5.3.0-original/gcc/config/m68k/linux.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/m68k/linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/m68k/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -71,7 +71,7 @@
When the -shared link option is used a final link is not being
370,7 → 370,7
#undef LINK_SPEC
#define LINK_SPEC "-m m68kelf %{shared} \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/microblaze/linux.h gcc-5.3.0-zip/gcc/config/microblaze/linux.h
--- gcc-5.3.0-original/gcc/config/microblaze/linux.h 2016-04-06 17:56:01.475918570 -0400
--- gcc-5.3.0-original/gcc/config/microblaze/linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/microblaze/linux.h 2015-05-28 10:08:19.000000000 -0400
@@ -28,7 +28,7 @@
#undef TLS_NEEDS_GOT
382,7 → 382,7
#define SUBTARGET_EXTRA_SPECS \
{ "dynamic_linker", DYNAMIC_LINKER }
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/mips/linux.h gcc-5.3.0-zip/gcc/config/mips/linux.h
--- gcc-5.3.0-original/gcc/config/mips/linux.h 2016-04-06 17:56:01.479918541 -0400
--- gcc-5.3.0-original/gcc/config/mips/linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/mips/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -22,20 +22,20 @@
#define GNU_USER_LINK_EMULATIONN32 "elf32%{EB:b}%{EL:l}tsmipn32"
412,7 → 412,7
#define BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
#define GNU_USER_DYNAMIC_LINKERN32 \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/mn10300/linux.h gcc-5.3.0-zip/gcc/config/mn10300/linux.h
--- gcc-5.3.0-original/gcc/config/mn10300/linux.h 2016-04-06 17:56:01.479918541 -0400
--- gcc-5.3.0-original/gcc/config/mn10300/linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/mn10300/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -32,7 +32,7 @@
#undef ASM_SPEC
424,7 → 424,7
#undef LINK_SPEC
#define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/pa/pa-linux.h gcc-5.3.0-zip/gcc/config/pa/pa-linux.h
--- gcc-5.3.0-original/gcc/config/pa/pa-linux.h 2016-04-06 17:56:01.479918541 -0400
--- gcc-5.3.0-original/gcc/config/pa/pa-linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/pa/pa-linux.h 2015-09-24 20:04:26.000000000 -0400
@@ -37,7 +37,7 @@
/* Define this for shared library support because it isn't in the main
436,7 → 436,7
#undef LINK_SPEC
#define LINK_SPEC "\
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/rs6000/linux64.h gcc-5.3.0-zip/gcc/config/rs6000/linux64.h
--- gcc-5.3.0-original/gcc/config/rs6000/linux64.h 2016-04-06 17:56:01.479918541 -0400
--- gcc-5.3.0-original/gcc/config/rs6000/linux64.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/rs6000/linux64.h 2015-03-09 19:18:57.000000000 -0400
@@ -357,14 +357,14 @@
#undef LINK_OS_DEFAULT_SPEC
459,7 → 459,7
#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
#elif DEFAULT_LIBC == LIBC_GLIBC
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/rs6000/sysv4.h gcc-5.3.0-zip/gcc/config/rs6000/sysv4.h
--- gcc-5.3.0-original/gcc/config/rs6000/sysv4.h 2016-04-06 17:56:01.479918541 -0400
--- gcc-5.3.0-original/gcc/config/rs6000/sysv4.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/rs6000/sysv4.h 2015-09-24 09:46:45.000000000 -0400
@@ -757,8 +757,8 @@
473,7 → 473,7
#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
#elif !defined (DEFAULT_LIBC) || DEFAULT_LIBC == LIBC_GLIBC
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/s390/linux.h gcc-5.3.0-zip/gcc/config/s390/linux.h
--- gcc-5.3.0-original/gcc/config/s390/linux.h 2016-04-06 17:56:01.479918541 -0400
--- gcc-5.3.0-original/gcc/config/s390/linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/s390/linux.h 2015-05-11 03:14:10.000000000 -0400
@@ -60,8 +60,8 @@
#define MULTILIB_DEFAULTS { "m31" }
487,7 → 487,7
#undef LINK_SPEC
#define LINK_SPEC \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/sh/linux.h gcc-5.3.0-zip/gcc/config/sh/linux.h
--- gcc-5.3.0-original/gcc/config/sh/linux.h 2016-04-06 17:56:01.479918541 -0400
--- gcc-5.3.0-original/gcc/config/sh/linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/sh/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -43,7 +43,7 @@
499,7 → 499,7
#undef SUBTARGET_LINK_EMUL_SUFFIX
#define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/sparc/linux64.h gcc-5.3.0-zip/gcc/config/sparc/linux64.h
--- gcc-5.3.0-original/gcc/config/sparc/linux64.h 2016-04-06 17:56:01.479918541 -0400
--- gcc-5.3.0-original/gcc/config/sparc/linux64.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/sparc/linux64.h 2015-01-05 07:33:28.000000000 -0500
@@ -84,8 +84,8 @@
When the -shared link option is used a final link is not being
522,7 → 522,7
%{!static: \
%{rdynamic:-export-dynamic} \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/sparc/linux.h gcc-5.3.0-zip/gcc/config/sparc/linux.h
--- gcc-5.3.0-original/gcc/config/sparc/linux.h 2016-04-06 17:56:01.479918541 -0400
--- gcc-5.3.0-original/gcc/config/sparc/linux.h 2016-04-11 22:20:22.143907624 -0400
+++ gcc-5.3.0-zip/gcc/config/sparc/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -83,7 +83,7 @@
When the -shared link option is used a final link is not being
534,7 → 534,7
#undef LINK_SPEC
#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/vax/linux.h gcc-5.3.0-zip/gcc/config/vax/linux.h
--- gcc-5.3.0-original/gcc/config/vax/linux.h 2016-04-06 17:56:01.479918541 -0400
--- gcc-5.3.0-original/gcc/config/vax/linux.h 2016-04-11 22:20:22.147907567 -0400
+++ gcc-5.3.0-zip/gcc/config/vax/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -41,7 +41,7 @@
%{!shared: \
546,7 → 546,7
#undef WCHAR_TYPE
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/xtensa/linux.h gcc-5.3.0-zip/gcc/config/xtensa/linux.h
--- gcc-5.3.0-original/gcc/config/xtensa/linux.h 2016-04-06 17:56:01.479918541 -0400
--- gcc-5.3.0-original/gcc/config/xtensa/linux.h 2016-04-11 22:20:22.147907567 -0400
+++ gcc-5.3.0-zip/gcc/config/xtensa/linux.h 2015-01-05 07:33:28.000000000 -0500
@@ -44,7 +44,7 @@
%{mlongcalls:--longcalls} \
696,8 → 696,8
+
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/zip/zip.c gcc-5.3.0-zip/gcc/config/zip/zip.c
--- gcc-5.3.0-original/gcc/config/zip/zip.c 1969-12-31 19:00:00.000000000 -0500
+++ gcc-5.3.0-zip/gcc/config/zip/zip.c 2016-04-06 17:47:47.255349663 -0400
@@ -0,0 +1,2099 @@
+++ gcc-5.3.0-zip/gcc/config/zip/zip.c 2016-04-07 16:23:35.651592937 -0400
@@ -0,0 +1,2126 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Filename: zip.c
1120,6 → 1120,7
+ * Here's what we are looking at (top is the current, bottom is the last ...)
+ *
+ * Stack Pointer ->
+ * Outgoing arguments
+ * Local variables (could be variable size)
+ * Frame Pointer -> (= Stack Pointer + sp_fp_offset)
+ * Saved return address, if saved
1137,7 → 1138,9
+zip_compute_frame(void) {
+ int regno;
+ int args_size;
+ const bool dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
+
+ if (dbg) fprintf(stderr, "ZIP-COMPUTE-FRAME\n");
+ // gcc_assert(crtl);
+ gcc_assert(cfun);
+ gcc_assert(cfun->machine);
1171,7 → 1174,20
+ cfun->machine->size_for_adjusting_sp = cfun->machine->local_vars_size
+ + cfun->machine->saved_reg_size
+ + args_size;
+
+ if(dbg) {
+ fprintf(stderr, "\tFRAME-POINTR: %s\n",
+ cfun->machine->fp_needed?"Yes":"No");
+ fprintf(stderr, "\tARGS-SIZE : %d\n",
+ args_size);
+ fprintf(stderr, "\tLOCALS-SIZE : %d\n",
+ cfun->machine->local_vars_size);
+ fprintf(stderr, "\tREGISTERS : %d\n",
+ cfun->machine->saved_reg_size);
+ fprintf(stderr, "\tSP_FP_OFFSET: %d\n",
+ cfun->machine->sp_fp_offset);
+ fprintf(stderr, "\tSP-ADJUSTMNT: %d\n",
+ cfun->machine->size_for_adjusting_sp);
+ }
+}
+
+void
1181,7 → 1197,7
+ const bool dbg = ((ALL_DEBUG_ON)||(false))&&(!ALL_DEBUG_OFF);
+ zip_compute_frame();
+
+ if (dbg) fprintf(stderr, "Computing Prologue instructions\n");
+ if (dbg) fprintf(stderr, "PROLOGUE: Computing Prologue instructions\n");
+ if (cfun->machine->size_for_adjusting_sp != 0) {
+ insn = emit_insn(gen_subsi3(stack_pointer_rtx,
+ stack_pointer_rtx,
1196,11 → 1212,10
+ int offset = 0, regno;
+ for(regno=0; regno < FIRST_PSEUDO_REGISTER; regno++) {
+ if (zip_save_reg(regno)) {
+ insn=emit_insn(gen_movsi_sto(
+ gen_rtx_MEM(SImode, plus_constant(
+ Pmode, stack_pointer_rtx,
+ cfun->machine->sp_fp_offset
+ +offset++, true)),
+ insn=emit_insn(gen_movsi_sto_off(
+ stack_pointer_rtx,
+ GEN_INT(cfun->machine->sp_fp_offset
+ +offset++),
+ gen_rtx_REG(SImode, regno)));
+ RTX_FRAME_RELATED_P(insn) = 1;
+ }
1213,9 → 1228,8
+ if (dbg) zip_debug_rtx(stack_pointer_rtx);
+ if (dbg) zip_debug_rtx(frame_pointer_rtx);
+ insn = emit_insn(gen_movsi_reg_off(frame_pointer_rtx,
+ stack_pointer_rtx, gen_int_mode(
+ cfun->machine->sp_fp_offset,
+ SImode)));
+ stack_pointer_rtx,
+ GEN_INT(cfun->machine->sp_fp_offset)));
+ RTX_FRAME_RELATED_P(insn) = 1;
+ if (dbg) fprintf(stderr, "sp_fp_offset is %d\n", cfun->machine->sp_fp_offset);
+ }
1280,33 → 1294,46
+
+ if (dbg) fprintf(stderr, "EPILOG::\n");
+ if (cfun->machine->fp_needed) {
+ // This is done special--if you can't trust the stack pointer
+ // enough so that you must have a frame pointer, then you can't
+ // trust its offset enough to restore from it. Hence, we start
+ // by moving the frame pointer to the stack pointer to recover
+ // the stack pointer back to a usable value.
+ if (dbg) fprintf(stderr, "EPILOG::Moving frame pointer to stack register\n");
+ emit_insn(gen_movsi_reg(stack_pointer_rtx, frame_pointer_rtx));
+ }
+
+ if (cfun->machine->saved_reg_size != 0) {
+ offset = (cfun->machine->size_for_adjusting_sp -
+ cfun->machine->sp_fp_offset
+ - cfun->machine->saved_reg_size);
+ if (cfun->machine->fp_needed)
+ offset = 0;
+ else
+ offset = cfun->machine->sp_fp_offset;
+ if (dbg) fprintf(stderr, "EPILOG::Saved_REG_Size = %d\n", cfun->machine->saved_reg_size);
+ for(regno=0; regno < FIRST_PSEUDO_REGISTER; regno++) {
+ if (zip_save_reg(regno)) {
+ if (dbg) fprintf(stderr, "EPILOG::RESTORING R%d\n", regno);
+ emit_insn(gen_movsi_lod(
+ emit_insn(gen_movsi_lod_off(
+ gen_rtx_REG(SImode, regno),
+ gen_rtx_MEM(SImode, plus_constant( SImode,
+ stack_pointer_rtx, offset++, true))));
+ stack_pointer_rtx,
+ GEN_INT(offset++)));
+ }
+ }
+ }
+
+ if (cfun->machine->size_for_adjusting_sp != 0) {
+ if (cfun->machine->fp_needed) {
+ // Restore the stack pointer back to the original, the
+ // difference being the difference from the frame pointer
+ // to the original stack
+ emit_insn(gen_addsi3(stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT(cfun->machine->size_for_adjusting_sp
+ -cfun->machine->sp_fp_offset)));
+ } else {
+ // else now the difference is between the stack pointer and
+ // the original stack pointer.
+ if (dbg) fprintf(stderr, "EPILOG::ADDSI3(StackPtr, %d)\n",
+ cfun->machine->size_for_adjusting_sp);
+ emit_insn(gen_addsi3(stack_pointer_rtx, stack_pointer_rtx,
+ gen_int_mode(
+ cfun->machine->size_for_adjusting_sp
+ -cfun->machine->sp_fp_offset, SImode)));
+ GEN_INT(cfun->machine->size_for_adjusting_sp)));
+ }
+ if (dbg) fprintf(stderr, "EPILOG::EMITTING-RETURN\n");
+
2299,7 → 2326,7
+ else if ((GET_CODE(x)==PLUS)&&(CONST_INT_P(XEXP(x,1)))) {
+ if ((INTVAL(XEXP(x, 1)) > zip_max_mov_offset)
+ ||(INTVAL(XEXP(x, 1)) < zip_min_mov_offset)) {
+ if (dbg) fprintf(stderr, "ZIP-VALID-MOVE-OPERAND -> NO! (reg+int), int out of bounds: %d\n", INTVAL(XEXP(x,1)));
+ if (dbg) fprintf(stderr, "ZIP-VALID-MOVE-OPERAND -> NO! (reg+int), int out of bounds: %ld\n", INTVAL(XEXP(x,1)));
+ return false;
+ }
+ }
6786,8 → 6813,8
+
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/config/zip/zip.md gcc-5.3.0-zip/gcc/config/zip/zip.md
--- gcc-5.3.0-original/gcc/config/zip/zip.md 1969-12-31 19:00:00.000000000 -0500
+++ gcc-5.3.0-zip/gcc/config/zip/zip.md 2016-04-06 17:47:12.387591487 -0400
@@ -0,0 +1,2262 @@
+++ gcc-5.3.0-zip/gcc/config/zip/zip.md 2016-04-08 15:26:57.622343817 -0400
@@ -0,0 +1,2422 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Filename: zip.md
7128,7 → 7155,7
+ ""
+ "MOV %1,%0"
+ [(set_attr "ccresult" "unchanged")])
+(define_insn "mov<mode>_reg_off" ; Register to register move
+(define_insn "mov<mode>_reg_off" ; Register to register move, used by prologue
+ [(set (match_operand:ZI 0 "register_operand" "=r")
+ (plus:ZI (match_operand:ZI 1 "register_operand" "r")
+ (match_operand:ZI 2 "zip_mvimm_operand_p" "M")))
7158,13 → 7185,13
+ ""
+ "LOD\t%1,%0"
+ [(set_attr "predicable" "yes") (set_attr "ccresult" "unchanged")])
+;(define_insn "*movsi_lod_off"
+ ;[(set (match_operand:SI 0 "register_operand" "=r")
+ ;(mem:SI (plus:SI (match_operand:SI 1 "register_operand" "r")
+ ;(match_operand:SI 2 "const_int_operand" "N"))))]
+ ;""
+ ;"LOD\t%2(%1),%0"
+ ;[(set_attr "predicable" "yes") (set_attr "ccresult" "unchanged")])
+(define_insn "movsi_lod_off" ; used by epilogue code
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (mem:SI (plus:SI (match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "const_int_operand" "N"))))]
+ ""
+ "LOD\t%2(%1),%0"
+ [(set_attr "predicable" "yes") (set_attr "ccresult" "unchanged")])
+(define_expand "mov<mode>_sto" ; Store into memory
+ [(set (match_operand:ZI 0 "zip_memory_operand_p" "=Q")
+ (match_operand:ZI 1 "register_operand" "r"))]
7175,14 → 7202,14
+ ""
+ "STO\t%1,%0"
+ [(set_attr "predicable" "yes") (set_attr "ccresult" "unchanged")])
+;(define_insn "*movsi_sto_off"
+ ;[(set (mem:SI (plus:SI
+ ;(match_operand:SI 0 "register_operand" "r")
+ ;(match_operand:SI 1 "const_int_operand" "N")))
+ ;(match_operand:SI 2 "register_operand" "r"))]
+ ;""
+ ;"STO\t%2,%1(%0)"
+ ;[(set_attr "predicable" "yes") (set_attr "ccresult" "unchanged")])
+(define_insn "movsi_sto_off" ; used by prologue code
+ [(set (mem:SI (plus:SI
+ (match_operand:SI 0 "register_operand" "r")
+ (match_operand:SI 1 "const_int_operand" "N")))
+ (match_operand:SI 2 "register_operand" "r"))]
+ ""
+ "STO\t%2,%1(%0)"
+ [(set_attr "predicable" "yes") (set_attr "ccresult" "unchanged")])
+(define_insn "mov<mode>_ldi" ; Load immediate
+ [(set (match_operand:ZI 0 "register_operand" "=r")
+ (match_operand:ZI 1 "immediate_operand" "ipU"))]
8120,6 → 8147,7
+ (pc)))]
+ ""
+ {
+ if (false) {
+ extern void zip_debug_rtx_pfx(const char *, const_rtx);
+ //; Two branches give us no end of difficulty when implementing.
+ //; Let's check for these two branch codes, and swap the
8206,7 → 8234,7
+ emit_jump_insn(gen_cbranch_jmp_ltu(operands[3]));
+ DONE;
+ }
+ }
+ }}
+ })
+(define_insn "cbranch_jmp_eq"
+ [(set (pc) (if_then_else (eq (reg:CC CC_REG) (const_int 0))
8863,7 → 8891,14
+; ADD 1,%0
+; BV %2"
+; "")
+
+;
+; Match:
+; CMP R1,R0
+; BGTU lbl
+; Transform to:
+; CMP R0,R1
+; BC lbl
+;
+(define_peephole2
+ [(set (reg:CC CC_REG) (compare:CC
+ (match_operand:SI 0 "register_operand")
8877,6 → 8912,15
+ (label_ref (match_dup 2))
+ (pc)))]
+ "")
+;
+;
+; Match:
+; CMP R1,R0
+; BGEU lbl
+; Transform to:
+; CMP 1(R0),R1
+; BC lbl
+;
+(define_peephole2
+ [(set (reg:CC CC_REG) (compare:CC
+ (match_operand:SI 0 "register_operand")
8891,6 → 8935,15
+ (label_ref (match_dup 2))
+ (pc)))]
+ "")
+;
+;
+; Match:
+; CMP R1,R0
+; BGE lbl
+; Transform to:
+; CMP 1(R0),R1
+; BLT lbl
+;
+(define_peephole2
+ [(set (reg:CC CC_REG) (compare:CC
+ (match_operand:SI 0 "register_operand")
8905,6 → 8958,15
+ (label_ref (match_dup 2))
+ (pc)))]
+ "")
+;
+;
+; Match:
+; CMP R1,R0
+; BLEU lbl
+; Transform to:
+; CMP 1(R1),R0
+; BLT lbl
+;
+(define_peephole2
+ [(set (reg:CC CC_REG) (compare:CC
+ (match_operand:SI 0 "register_operand" "")
8951,19 → 9013,7
+;
+;
+;
+; Need a peephole optimizer (not peephole2) for
+; [(call ...
+; (set (pc) (label))]
+; To result with
+; "MOV\tlabel,R0
+; JMP\tsubroutine"
+;
+; and for
+; BRA target
+; BRA target ; two branches to the same identical target in a row ...
+;
+;
+;
+; Match:
+; MOV A(R1),R3
+; CMP R3,R0
8991,8 → 9041,8
+; ALU OpB,R0
+;
+(define_peephole2
+ [(parallel [(set (match_operand 0 "register_operand")
+ (match_operand 1 ""))
+ [(parallel [(set (match_operand:SI 0 "register_operand")
+ (match_operand:SI 1 ""))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 0) (const_int 0)))])
+ (set (reg:CC CC_REG) (compare:CC (match_dup 0) (const_int 0)))]
+ ""
9010,10 → 9060,10
+; MOV R0,R1
+;
+(define_peephole2
+ [(parallel [(set (match_operand 0 "register_operand")
+ (match_operand 1 ""))
+ [(parallel [(set (match_operand:SI 0 "register_operand")
+ (match_operand:SI 1 ""))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 0) (const_int 0)))])
+ (set (match_operand 2 "nonimmediate_operand") (match_operand 3 ""))
+ (set (match_operand:SI 2 "nonimmediate_operand") (match_operand:SI 3 ""))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 0) (const_int 0)))]
+ "(!REG_P(operands[2]))||((REGNO(operands[2])!=REGNO(operands[0]))&&((REGNO(operands[2])>FIRST_PSEUDO_REGISTER)||(REGNO(operands[2])<CC_REG)))"
+ [(parallel [(set (match_dup 0) (match_dup 1))
9031,10 → 9081,10
+; MOV R0,R1
+;
+(define_peephole2
+ [(parallel [(set (match_operand 0 "register_operand")
+ (match_operand 1 ""))
+ [(parallel [(set (match_operand:SI 0 "register_operand")
+ (match_operand:SI 1 ""))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 0) (const_int 0)))])
+ (set (match_operand 2 "register_operand") (match_dup 0))
+ (set (match_operand:SI 2 "register_operand") (match_dup 0))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 2) (const_int 0)))]
+ ""
+ [(parallel [(set (match_dup 0) (match_dup 1))
9041,8 → 9091,145
+ (set (reg:CC CC_REG) (compare:CC (match_dup 0) (const_int 0)))])
+ (set (match_dup 2) (match_dup 3))
+ ])
+
+;
+;
+; Match:
+; MOV A(R0),R0
+; ADD $x,R1
+; (CCREG is dead, and (A+x) is within range ...)
+; Transform to:
+; MOV (A+$x)(R1),R0
+; ... how do I do the plus? Let's build it with a plus of zero, and work from
+; there
+; MOV R1,R0
+; ADD $x,R0
+; (CCREG is dead, and x is within range ...)
+; Transform to:
+; MOV (A+$x)(R1),R0
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand")
+ (match_operand:SI 1 "register_operand"))
+ (parallel [(set (match_dup 0) (plus:SI (match_dup 0)
+ (match_operand 2 "zip_mvimm_operand_p")))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 0) (const_int 0)))])
+ ]
+ "(peep2_regno_dead_p(2,CC_REG))"
+ [(set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))])
+;
+;
+;
+; Match:
+; ADD $x,R0
+; MOV R0,R1
+; (CCREG is dead, and R0 is dead)
+; Transform to:
+; MOV (A+$x)(R0),R1
+; ... again, how do I build this plus?
+;
+(define_peephole2
+ [(parallel [(set (match_operand:SI 0 "register_operand")
+ (plus:SI (match_dup 0)
+ (match_operand 1 "zip_mvimm_operand_p")))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 0) (const_int 0)))])
+ (set (match_operand:SI 2 "register_operand") (match_dup 0))]
+ "(peep2_regno_dead_p(2, REGNO(operands[0])))&&(peep2_regno_dead_p(2,CC_REG))"
+ [(set (match_dup 2) (plus:SI (match_dup 0) (match_dup 1)))])
+;
+;
+; Match:
+; ADD $x,R0
+; ADD R0,Rn
+; (R0 is dead, if R0 is not Rn)
+; Transform to:
+; ADD $x(R0),Rn
+;
+(define_peephole2
+ [(parallel [(set (match_operand:SI 0 "register_operand")
+ (plus:SI (match_dup 0)
+ (match_operand 1 "zip_opb_immv_p")))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 0) (const_int 0)))])
+ (parallel [(set (match_operand:SI 2 "register_operand")
+ (plus:SI (match_dup 2) (match_dup 0)))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 2) (const_int 0)))])
+ ]
+ "(REGNO(operands[0])!=REGNO(operands[2]))&&(peep2_regno_dead_p(2, REGNO(operands[0])))"
+ [(parallel [(set (match_dup 2)
+ (plus:SI (match_dup 2)
+ (plus:SI (match_dup 0)
+ (match_dup 1))))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 2) (const_int 0)))])
+ ])
+;
+; Match:
+; ADD $x,R0
+; LOD -x(R0),R1
+; Transform to:
+; LOD (R0),R1
+; ADD $x,R0
+;
+(define_peephole2
+ [(parallel [(set (match_operand:SI 0 "register_operand")
+ (plus:SI (match_dup 0)
+ (match_operand 1 "zip_opb_immv_p")))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 0) (const_int 0)))])
+ (set (match_operand:SI 3 "register_operand")
+ (mem:SI (plus:SI (match_dup 0)
+ (match_operand 2 "zip_opb_immv_p"))))
+ ]
+ "(REGNO(operands[0])!=REGNO(operands[1]))&&(INTVAL(operands[1])==-INTVAL(operands[2]))"
+ [(set (match_dup 3) (mem:SI (match_dup 0)))
+ (parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 0) (const_int 0)))])
+ ])
+;
+;
+;
+; Match:
+; ADD $x,R0
+; STO R1,-x(R0)
+; Transform to:
+; STO R1,(R0)
+; ADD $x,R0
+;
+(define_peephole2
+ [(parallel [(set (match_operand:SI 0 "register_operand")
+ (plus:SI (match_dup 0)
+ (match_operand 1 "zip_opb_immv_p")))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 0) (const_int 0)))])
+ (set (mem:SI (plus:SI (match_dup 0) (match_operand 2 "zip_opb_immv_p")))
+ (match_operand:SI 3 "register_operand"))
+ ]
+ "(REGNO(operands[0])!=REGNO(operands[1]))&&(INTVAL(operands[1])==-INTVAL(operands[2]))"
+ [(set (mem:SI (match_dup 0)) (match_dup 3))
+ (parallel [(set (match_dup 0) (plus:SI (match_dup 0) (match_dup 1)))
+ (set (reg:CC CC_REG) (compare:CC (match_dup 0) (const_int 0)))])
+ ])
+;
+;
+; Match:
+; ADD $x,R0
+; ANY R1,R2 (destination is not R0, source does not reference R0)
+; ADD R0,Rn (could be 1 or 2, not 0)
+; (R0 is dead)
+; Transform to:
+; ANY R1,R2
+; ADD $x(R0),Rn
+;
+;
+;
+; Need a peephole optimizer (not peephole2) for
+; [(call ...
+; (set (pc) (label))]
+; To result with
+; "MOV\tlabel,R0
+; JMP\tsubroutine"
+;
+; and for
+; BRA target
+; BRA target ; two branches to the same identical target in a row ...
+;
+;
+;
+; STILL MISSING:
+; SYSCALL(ID)
+; MOV %ID,R0
10019,7 → 10206,7
diff -Naur '--exclude=*.swp' gcc-5.3.0-original/gcc/reload1.c gcc-5.3.0-zip/gcc/reload1.c
--- gcc-5.3.0-original/gcc/reload1.c 2015-01-15 08:28:42.000000000 -0500
+++ gcc-5.3.0-zip/gcc/reload1.c 2016-04-06 17:44:36.240674020 -0400
+++ gcc-5.3.0-zip/gcc/reload1.c 2016-04-08 18:48:36.995557279 -0400
@@ -72,6 +72,14 @@
#include "dumpfile.h"
#include "rtl-iter.h"
/trunk/sw/binutils-2.25.patch
2375,8 → 2375,8
optimize the copying in the simple case without using the
diff -Naur '--exclude=*.swp' binutils-2.25-original/gas/config/tc-zip.c binutils-2.25/gas/config/tc-zip.c
--- binutils-2.25-original/gas/config/tc-zip.c 1969-12-31 19:00:00.000000000 -0500
+++ binutils-2.25/gas/config/tc-zip.c 2016-04-06 13:07:19.208882461 -0400
@@ -0,0 +1,2283 @@
+++ binutils-2.25/gas/config/tc-zip.c 2016-04-08 19:37:24.940027857 -0400
@@ -0,0 +1,2285 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Filename: tc-zip.c
2898,8 → 2898,8
+ if (sgn)
+ return "ERR: Not expecting a signed label!";
+
+ ptr = zip_skip_white_spaces(ptr+1);
+ if ((*ptr)&&(*ptr == '+')&&(isdigit(ptr[1]))) {
+ ptr = zip_skip_white_spaces(ptr);
+ if ((*ptr)&&((*ptr == '+')||(*ptr == '-'))&&(isdigit(ptr[1]))) {
+ ptr++;
+ char *end = (char *)ptr;
+ unsigned long v = strtoul(ptr, &end, 0);
3007,7 → 3007,6
+ insn->i_rp->r_pcrel = FALSE;
+ insn->i_rp->r_fr_offset = 0;
+ insn->i_rp->r_fix = NULL;
+ insn->i_imm = 0;
+ }
+ }
+
3014,8 → 3013,11
+ /*
+ if ((*lbl)&&(insn->i_imm == 0))
+ printf("OPB-RESULT: %s", lbl);
+ else
+ else {
+ printf("OPB-RESULT: 0x%08x", insn->i_imm);
+ if (*lbl)
+ printf(" + %s", lbl);
+ }
+ if (insn->i_breg != ZIP_RNONE)
+ printf(" + R%d", insn->i_breg);
+ printf("\n");
3505,6 → 3507,7
+ break;
+ case ZIPO_JMP:
+ insn->i_op = ZIPO_MOV; // fall through
+ break;
+ case ZIPO_BRA: // Leave as ZIPO_BRA until we assemble it
+ insn->i_areg = ZIP_PC;
+ break;
3782,7 → 3785,7
+ zip_dump_sym(insn->i_rp->r_sym);
+#endif
+ unsigned long symv = 0;
+ int sym_defined = 0, this_frag = 0, this_segment = 0, sym_known = 0;
+ int sym_defined = 0, this_segment = 0, sym_known = 0;
+ symbolS *sym = NULL;
+
+ if (insn->i_rp) {
3791,13 → 3794,14
+ sym = insn->i_rp->r_sym;
+ symv = ((sym)&&(S_IS_DEFINED(sym))) ? (S_GET_VALUE(sym)) : 0;
+ sym_frag = symbol_get_frag(sym);
+ this_frag = (sym_frag == fragP);
+ this_segment = (S_GET_SEGMENT(sym) == seg);
+
+ symv += fragP->fr_offset;
+
+#ifdef ZIP_DEBUG
+ { int this_frag = (sym_frag == fragP);
+ printf("Determined symbol is %sin this frag, and %sin this segment\n", (this_frag)?"":"not ", (this_segment)?"":"not ");
+ }
+#endif
+
+ if ((stretch != 0)
4251,7 → 4255,7
+ OCTETS_PER_BYTE * insn->i_rp->r_fr_offset, // where w/in frag?
+ 4, // 1,2, or 4 usually ... ??
+ insn->i_rp->r_sym, // Add symbol,
+ 0, // Fixed/known offset to the symbol
+ insn->i_imm, // Fixed/known offset to the symbol
+ insn->i_rp->r_pcrel, // T if PC-Relative reloc
+ insn->i_rp->r_type); // Reloc type
+ insn->i_rp = NULL;
4277,7 → 4281,7
+ OCTETS_PER_BYTE*(1+insn->i_naux),
+ rs_machine_dependent, // Subtype
+ insn->i_rp->r_sym, // Symbol
+ 0, // Offset (to be added to symbol)
+ insn->i_imm, // Offset (to be added to symbol)
+ (char *)zip_copy_insn(insn)); // Opcode
+
+ }
4356,7 → 4360,7
+ (*val) &= 0x0ffffffff;
+
+#ifdef ZIP_DEBUG
+ printf("MD-APPLY-FIX: FRAG=%08x@%08x+%08x(%d), IWORD = %08x Val=%08x (RTYP=%d->%s)%s%s\n",
+ printf("MD-APPLY-FIX: FRAG=%08x@%08x+%08x(%d), IWORD = %08x Val=%08x (RTYP=%d->%s)%s%s, ADDEND=%08lx\n",
+ ((unsigned)((unsigned long)fixP->fx_frag->fr_literal)),
+ ((unsigned)((unsigned long)fixP->fx_frag->fr_address)),
+ ((unsigned)((unsigned long)fixP->fx_where)),
4364,7 → 4368,8
+ iword, (unsigned)(*val), fixP->fx_r_type,
+ bfd_get_reloc_code_name(fixP->fx_r_type),
+ (fixP->fx_pcrel)?" PC-Rel ":" std ",
+ (fixP->fx_addsy)?"":"(Null Sym)");
+ (fixP->fx_addsy)?"":"(Null Sym)",
+ fixP->fx_offset);
+#endif
+ switch(fixP->fx_r_type) {
+ case BFD_RELOC_NONE:
4464,9 → 4469,10
+arelent *
+tc_gen_reloc(asection *section ATTRIBUTE_UNUSED, fixS *fixP)
+{
+//#ifdef ZIP_DEBUG
+// printf("Call to TC-GEN-RELOC(%s,FIX);\n", segment_name(section));
+//#endif
+#ifdef ZIP_DEBUG
+ printf("Call to TC-GEN-RELOC(%s,FIX,%s,+%ld);\n", segment_name(section),
+ S_GET_NAME(fixP->fx_addsy),fixP->fx_offset);
+#endif
+
+ arelent *relP;
+
4476,17 → 4482,12
+ *relP->sym_ptr_ptr = symbol_get_bfdsym(fixP->fx_addsy);
+ relP->address = (fixP->fx_frag->fr_address + fixP->fx_where)/OCTETS_PER_BYTE;
+ // The addend value is added to the symbols value after the value is
+ // is resolved. It is useful for PC relative addressing. However,
+ // in general (based on observing bfd/*), it seems to just muck things
+ // up.
+ // relP->addend = 0;
+ // I had it set before where this was set to fixP->fx_offset
+ // relP->addend = fixP->fx_offset; //
+ // I just can't see any reasonable reason for doing so.
+ // On the other hand, since I set this field to zero in fx_new, and
+ // it's an allowable offset to a valid symbol value, let's maintain that
+ // capability--only it's just a capability we're not using.
+ // is resolved. It is useful for PC relative addressing, as well as
+ // instructions giving offsets to symbols, such as LDI .x+50,R0.
+ relP->addend = fixP->fx_offset;
+#ifdef ZIP_DEBUG
+ printf("ADDEND = %08lx\n", relP->addend);
+#endif
+ relP->howto = bfd_reloc_type_lookup(stdoutput, fixP->fx_r_type);
+ if (! relP->howto) {
+ const char *name;
4531,12 → 4532,13
+ int i, old_naux = insn->i_naux;
+
+#ifdef ZIP_DEBUG
+ fprintf(stderr, "--- FIX --- @%08x/%08x, Sym %s (zip_relax_frag), stretch = %ld/offset = %08lx\n",
+ fprintf(stderr, "--- FIX --- @%08x/%08x, Sym %s (zip_relax_frag), stretch = %ld/offset = %08lx, addr=%08x\n",
+ (int)((long)(fragP->fr_literal)),
+ (unsigned)fragP->fr_address,
+ (insn->i_rp->r_sym)? S_GET_NAME(insn->i_rp->r_sym)
+ :"(Null)",
+ stretch, insn->i_rp->r_fr_offset);
+ stretch, insn->i_rp->r_fr_offset,
+ insn->i_imm);
+ // zip_dump_insn(insn);
+#endif
+
4613,7 → 4615,7
+ OCTETS_PER_BYTE * insn->i_rp->r_fr_offset, // where w/in frag?
+ 4, // 1,2, or 4 usually ... ??
+ insn->i_rp->r_sym, // Add symbol,
+ 0, // Fixed/known offset to the symbol
+ insn->i_imm,// Fixed/known offset to the symbol
+ insn->i_rp->r_pcrel, // T if PC-Relative reloc
+ // BREV would change the Reloc type
+ // to BFD_RELOC_ZIP_BREV
4622,7 → 4624,7
+ OCTETS_PER_BYTE * (insn->i_rp->r_fr_offset+1), // where w/in frag?
+ 4, // 1,2, or 4 usually ... ??
+ insn->i_rp->r_sym, // Add symbol,
+ 0, // Fixed/known offset to the symbol
+ insn->i_imm,// Fixed/known offset to the symbol
+ insn->i_rp->r_pcrel, // T if PC-Relative reloc
+ BFD_RELOC_ZIP_LLO); // Reloc type
+ } else {
4630,7 → 4632,7
+ OCTETS_PER_BYTE * (insn->i_rp->r_fr_offset+1), // where w/in frag?
+ 4, // 1,2, or 4 usually ... ??
+ insn->i_rp->r_sym, // Add symbol,
+ 0, // Fixed/known offset to the symbol
+ insn->i_imm, // Fixed/known offset to the symbol
+ insn->i_rp->r_pcrel, // T if PC-Relative reloc
+ BFD_RELOC_ZIP_LDI); // Reloc type
+ }

powered by: WebSVN 2.1.0

© copyright 1999-2022 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.