From: Jeff Law Date: Sun, 20 Mar 2022 00:01:33 +0000 (-0400) Subject: Avoid using common symbols in v850 libgloss X-Git-Tag: cygwin-3.4.0~440 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=0c8679e080d4d55a0d6b7aefbf52188584b2b8e9;p=newlib-cygwin.git Avoid using common symbols in v850 libgloss I've had this lying around for probably a year or two at this point. It just changes all the instance of "errno" from a common symbol to an extern. I can't offhand recall where the actual definition is, but it certainly exists in the generic code. --- diff --git a/libgloss/v850/_exit.c b/libgloss/v850/_exit.c index b45ae96c8..44d4132bd 100644 --- a/libgloss/v850/_exit.c +++ b/libgloss/v850/_exit.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/chmod.c b/libgloss/v850/chmod.c index c86e5c902..01ccd97be 100644 --- a/libgloss/v850/chmod.c +++ b/libgloss/v850/chmod.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/chown.c b/libgloss/v850/chown.c index 0344d77a9..c34a9d6e5 100644 --- a/libgloss/v850/chown.c +++ b/libgloss/v850/chown.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/close.c b/libgloss/v850/close.c index 3c62f68e2..40301f6a3 100644 --- a/libgloss/v850/close.c +++ b/libgloss/v850/close.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/creat.c b/libgloss/v850/creat.c index 8d468a68c..4989fc0f9 100644 --- a/libgloss/v850/creat.c +++ b/libgloss/v850/creat.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/execv.c b/libgloss/v850/execv.c index 5286be68b..38d74b413 100644 --- a/libgloss/v850/execv.c +++ b/libgloss/v850/execv.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/execve.c b/libgloss/v850/execve.c index b8d97f914..3efb98a13 100644 --- a/libgloss/v850/execve.c +++ b/libgloss/v850/execve.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/fork.c b/libgloss/v850/fork.c index 116116c1b..50bf5fa3f 100644 --- a/libgloss/v850/fork.c +++ b/libgloss/v850/fork.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/fstat.c b/libgloss/v850/fstat.c index e8783b376..9c1cecea1 100644 --- a/libgloss/v850/fstat.c +++ b/libgloss/v850/fstat.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/getpid.c b/libgloss/v850/getpid.c index 18fd1494e..32ac7fbfb 100644 --- a/libgloss/v850/getpid.c +++ b/libgloss/v850/getpid.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/gettime.c b/libgloss/v850/gettime.c index fc47532a0..7a99f8af2 100644 --- a/libgloss/v850/gettime.c +++ b/libgloss/v850/gettime.c @@ -4,7 +4,7 @@ #include "sys/syscall.h" #include "sys/time.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/isatty.c b/libgloss/v850/isatty.c index 95d2c0e84..248ab5248 100644 --- a/libgloss/v850/isatty.c +++ b/libgloss/v850/isatty.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/kill.c b/libgloss/v850/kill.c index b8e53955a..34e5db793 100644 --- a/libgloss/v850/kill.c +++ b/libgloss/v850/kill.c @@ -4,7 +4,7 @@ #include "sys/syscall.h" #include -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/link.c b/libgloss/v850/link.c index 9776d7993..f079d3726 100644 --- a/libgloss/v850/link.c +++ b/libgloss/v850/link.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/lseek.c b/libgloss/v850/lseek.c index b5d3ef0c2..75c5e0e83 100644 --- a/libgloss/v850/lseek.c +++ b/libgloss/v850/lseek.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/open.c b/libgloss/v850/open.c index 96616e528..e8f63f4f1 100644 --- a/libgloss/v850/open.c +++ b/libgloss/v850/open.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/pipe.c b/libgloss/v850/pipe.c index 494a99e36..c5219798c 100644 --- a/libgloss/v850/pipe.c +++ b/libgloss/v850/pipe.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/read.c b/libgloss/v850/read.c index ec064cbb2..b55d1cb9e 100644 --- a/libgloss/v850/read.c +++ b/libgloss/v850/read.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/sim.ld b/libgloss/v850/sim.ld index 48da1150b..bffff6220 100644 --- a/libgloss/v850/sim.ld +++ b/libgloss/v850/sim.ld @@ -195,7 +195,7 @@ SECTIONS .debug_typenames 0 : { *(.debug_typenames) } .debug_varnames 0 : { *(.debug_varnames) } /* User stack. */ - .stack 0x200000 : + .stack 0x300000 : { __stack = .; *(.stack) diff --git a/libgloss/v850/stat.c b/libgloss/v850/stat.c index dc8351e1a..b66a669df 100644 --- a/libgloss/v850/stat.c +++ b/libgloss/v850/stat.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/time.c b/libgloss/v850/time.c index d0dc93f8a..04ea03da9 100644 --- a/libgloss/v850/time.c +++ b/libgloss/v850/time.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/times.c b/libgloss/v850/times.c index a558267fe..242dffd8f 100644 --- a/libgloss/v850/times.c +++ b/libgloss/v850/times.c @@ -4,7 +4,7 @@ #include "sys/syscall.h" #include "sys/times.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/unlink.c b/libgloss/v850/unlink.c index c6261d3eb..23c60ec53 100644 --- a/libgloss/v850/unlink.c +++ b/libgloss/v850/unlink.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/utime.c b/libgloss/v850/utime.c index ea1f78993..83ee97544 100644 --- a/libgloss/v850/utime.c +++ b/libgloss/v850/utime.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/wait.c b/libgloss/v850/wait.c index d8c96f05b..9cab5ce72 100644 --- a/libgloss/v850/wait.c +++ b/libgloss/v850/wait.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/libgloss/v850/write.c b/libgloss/v850/write.c index 136ac9ec8..07bec15d4 100644 --- a/libgloss/v850/write.c +++ b/libgloss/v850/write.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/_exit.c b/newlib/libc/sys/sysnecv850/_exit.c index b45ae96c8..44d4132bd 100644 --- a/newlib/libc/sys/sysnecv850/_exit.c +++ b/newlib/libc/sys/sysnecv850/_exit.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/chmod.c b/newlib/libc/sys/sysnecv850/chmod.c index c86e5c902..01ccd97be 100644 --- a/newlib/libc/sys/sysnecv850/chmod.c +++ b/newlib/libc/sys/sysnecv850/chmod.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/chown.c b/newlib/libc/sys/sysnecv850/chown.c index 0344d77a9..c34a9d6e5 100644 --- a/newlib/libc/sys/sysnecv850/chown.c +++ b/newlib/libc/sys/sysnecv850/chown.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/close.c b/newlib/libc/sys/sysnecv850/close.c index 3c62f68e2..40301f6a3 100644 --- a/newlib/libc/sys/sysnecv850/close.c +++ b/newlib/libc/sys/sysnecv850/close.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/creat.c b/newlib/libc/sys/sysnecv850/creat.c index 8d468a68c..4989fc0f9 100644 --- a/newlib/libc/sys/sysnecv850/creat.c +++ b/newlib/libc/sys/sysnecv850/creat.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/execv.c b/newlib/libc/sys/sysnecv850/execv.c index 5286be68b..38d74b413 100644 --- a/newlib/libc/sys/sysnecv850/execv.c +++ b/newlib/libc/sys/sysnecv850/execv.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/execve.c b/newlib/libc/sys/sysnecv850/execve.c index b8d97f914..3efb98a13 100644 --- a/newlib/libc/sys/sysnecv850/execve.c +++ b/newlib/libc/sys/sysnecv850/execve.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/fork.c b/newlib/libc/sys/sysnecv850/fork.c index 116116c1b..50bf5fa3f 100644 --- a/newlib/libc/sys/sysnecv850/fork.c +++ b/newlib/libc/sys/sysnecv850/fork.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/fstat.c b/newlib/libc/sys/sysnecv850/fstat.c index b7eed0afe..f66703902 100644 --- a/newlib/libc/sys/sysnecv850/fstat.c +++ b/newlib/libc/sys/sysnecv850/fstat.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/getpid.c b/newlib/libc/sys/sysnecv850/getpid.c index 18fd1494e..32ac7fbfb 100644 --- a/newlib/libc/sys/sysnecv850/getpid.c +++ b/newlib/libc/sys/sysnecv850/getpid.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/gettime.c b/newlib/libc/sys/sysnecv850/gettime.c index fc47532a0..7a99f8af2 100644 --- a/newlib/libc/sys/sysnecv850/gettime.c +++ b/newlib/libc/sys/sysnecv850/gettime.c @@ -4,7 +4,7 @@ #include "sys/syscall.h" #include "sys/time.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/isatty.c b/newlib/libc/sys/sysnecv850/isatty.c index 95d2c0e84..248ab5248 100644 --- a/newlib/libc/sys/sysnecv850/isatty.c +++ b/newlib/libc/sys/sysnecv850/isatty.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/kill.c b/newlib/libc/sys/sysnecv850/kill.c index b8e53955a..34e5db793 100644 --- a/newlib/libc/sys/sysnecv850/kill.c +++ b/newlib/libc/sys/sysnecv850/kill.c @@ -4,7 +4,7 @@ #include "sys/syscall.h" #include -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/link.c b/newlib/libc/sys/sysnecv850/link.c index 9776d7993..f079d3726 100644 --- a/newlib/libc/sys/sysnecv850/link.c +++ b/newlib/libc/sys/sysnecv850/link.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/lseek.c b/newlib/libc/sys/sysnecv850/lseek.c index b5d3ef0c2..75c5e0e83 100644 --- a/newlib/libc/sys/sysnecv850/lseek.c +++ b/newlib/libc/sys/sysnecv850/lseek.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/open.c b/newlib/libc/sys/sysnecv850/open.c index 96616e528..e8f63f4f1 100644 --- a/newlib/libc/sys/sysnecv850/open.c +++ b/newlib/libc/sys/sysnecv850/open.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/pipe.c b/newlib/libc/sys/sysnecv850/pipe.c index 494a99e36..c5219798c 100644 --- a/newlib/libc/sys/sysnecv850/pipe.c +++ b/newlib/libc/sys/sysnecv850/pipe.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/read.c b/newlib/libc/sys/sysnecv850/read.c index ec064cbb2..b55d1cb9e 100644 --- a/newlib/libc/sys/sysnecv850/read.c +++ b/newlib/libc/sys/sysnecv850/read.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/rename.c b/newlib/libc/sys/sysnecv850/rename.c index 9d9f7dbf9..0d6e23c33 100644 --- a/newlib/libc/sys/sysnecv850/rename.c +++ b/newlib/libc/sys/sysnecv850/rename.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/stat.c b/newlib/libc/sys/sysnecv850/stat.c index dc8351e1a..b66a669df 100644 --- a/newlib/libc/sys/sysnecv850/stat.c +++ b/newlib/libc/sys/sysnecv850/stat.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/time.c b/newlib/libc/sys/sysnecv850/time.c index d0dc93f8a..04ea03da9 100644 --- a/newlib/libc/sys/sysnecv850/time.c +++ b/newlib/libc/sys/sysnecv850/time.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/times.c b/newlib/libc/sys/sysnecv850/times.c index a558267fe..242dffd8f 100644 --- a/newlib/libc/sys/sysnecv850/times.c +++ b/newlib/libc/sys/sysnecv850/times.c @@ -4,7 +4,7 @@ #include "sys/syscall.h" #include "sys/times.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/unlink.c b/newlib/libc/sys/sysnecv850/unlink.c index 34b712f02..eb19d5cb7 100644 --- a/newlib/libc/sys/sysnecv850/unlink.c +++ b/newlib/libc/sys/sysnecv850/unlink.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/utime.c b/newlib/libc/sys/sysnecv850/utime.c index ea1f78993..83ee97544 100644 --- a/newlib/libc/sys/sysnecv850/utime.c +++ b/newlib/libc/sys/sysnecv850/utime.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/wait.c b/newlib/libc/sys/sysnecv850/wait.c index d8c96f05b..9cab5ce72 100644 --- a/newlib/libc/sys/sysnecv850/wait.c +++ b/newlib/libc/sys/sysnecv850/wait.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3); diff --git a/newlib/libc/sys/sysnecv850/write.c b/newlib/libc/sys/sysnecv850/write.c index 136ac9ec8..07bec15d4 100644 --- a/newlib/libc/sys/sysnecv850/write.c +++ b/newlib/libc/sys/sysnecv850/write.c @@ -3,7 +3,7 @@ #include #include "sys/syscall.h" -int errno; +extern int errno; int __trap0 (int function, int p1, int p2, int p3);