summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-02-14 10:57:07 +0000
committerbde <bde@FreeBSD.org>1997-02-14 10:57:07 +0000
commit10b3d5abf856f043c36cba06071549cb6c93a0ca (patch)
tree1028f0950d8f99b6d1a52efab13cccf7d834022d /lib/libc
parent6a98120bf12e969772a97c58983f18fe332010a6 (diff)
downloadFreeBSD-src-10b3d5abf856f043c36cba06071549cb6c93a0ca.zip
FreeBSD-src-10b3d5abf856f043c36cba06071549cb6c93a0ca.tar.gz
Moved definitions of PIC macros from SYS.h to DEFS.h so that SYS.h
doesn't need to be included in files that have nothing to do with syscalls. Added missing `.text' to START_ENTRY so that ENTRY() works when invoked in the data section.
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/amd64/SYS.h20
-rw-r--r--lib/libc/i386/DEFS.h22
-rw-r--r--lib/libc/i386/SYS.h20
3 files changed, 21 insertions, 41 deletions
diff --git a/lib/libc/amd64/SYS.h b/lib/libc/amd64/SYS.h
index ac65687..a1bcab0 100644
--- a/lib/libc/amd64/SYS.h
+++ b/lib/libc/amd64/SYS.h
@@ -41,26 +41,6 @@
#include <sys/syscall.h>
#include "DEFS.h"
-#ifdef PIC
-#define PIC_PROLOGUE \
- pushl %ebx; \
- call 1f; \
-1: \
- popl %ebx; \
- addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
-#define PIC_EPILOGUE \
- popl %ebx
-#define PIC_PLT(x) x@PLT
-#define PIC_GOT(x) x@GOT(%ebx)
-#define PIC_GOTOFF(x) x@GOTOFF(%ebx)
-#else
-#define PIC_PROLOGUE
-#define PIC_EPILOGUE
-#define PIC_PLT(x) x
-#define PIC_GOT(x) x
-#define PIC_GOTOFF(x) x
-#endif
-
#define SYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); ENTRY(x); lea __CONCAT(SYS_,x),%eax; KERNCALL; jb 2b
#define RSYSCALL(x) SYSCALL(x); ret
diff --git a/lib/libc/i386/DEFS.h b/lib/libc/i386/DEFS.h
index 252ba3f..753215e 100644
--- a/lib/libc/i386/DEFS.h
+++ b/lib/libc/i386/DEFS.h
@@ -40,6 +40,26 @@
#include <sys/cdefs.h>
+#ifdef PIC
+#define PIC_PROLOGUE \
+ pushl %ebx; \
+ call 1f; \
+1: \
+ popl %ebx; \
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b],%ebx
+#define PIC_EPILOGUE \
+ popl %ebx
+#define PIC_PLT(x) x@PLT
+#define PIC_GOT(x) x@GOT(%ebx)
+#define PIC_GOTOFF(x) x@GOTOFF(%ebx)
+#else
+#define PIC_PROLOGUE
+#define PIC_EPILOGUE
+#define PIC_PLT(x) x
+#define PIC_GOT(x) x
+#define PIC_GOTOFF(x) x
+#endif
+
/*
* CNAME and HIDENAME manage the relationship between symbol names in C
* and the equivalent assembly language names. CNAME is given a name as
@@ -57,7 +77,7 @@
/* XXX should use align 4,0x90 for -m486. */
-#define _START_ENTRY .align 2,0x90;
+#define _START_ENTRY .text; .align 2,0x90;
#if 0
/* Data is not used, except perhaps by non-g prof, which we don't support. */
#define _MID_ENTRY .data; .align 2; 8:; .long 0; \
diff --git a/lib/libc/i386/SYS.h b/lib/libc/i386/SYS.h
index ac65687..a1bcab0 100644
--- a/lib/libc/i386/SYS.h
+++ b/lib/libc/i386/SYS.h
@@ -41,26 +41,6 @@
#include <sys/syscall.h>
#include "DEFS.h"
-#ifdef PIC
-#define PIC_PROLOGUE \
- pushl %ebx; \
- call 1f; \
-1: \
- popl %ebx; \
- addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
-#define PIC_EPILOGUE \
- popl %ebx
-#define PIC_PLT(x) x@PLT
-#define PIC_GOT(x) x@GOT(%ebx)
-#define PIC_GOTOFF(x) x@GOTOFF(%ebx)
-#else
-#define PIC_PROLOGUE
-#define PIC_EPILOGUE
-#define PIC_PLT(x) x
-#define PIC_GOT(x) x
-#define PIC_GOTOFF(x) x
-#endif
-
#define SYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); ENTRY(x); lea __CONCAT(SYS_,x),%eax; KERNCALL; jb 2b
#define RSYSCALL(x) SYSCALL(x); ret
OpenPOWER on IntegriCloud