about summary refs log tree commit diff
path: root/sysdeps/unix/i386/sysdep.h
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/i386/sysdep.h')
-rw-r--r--sysdeps/unix/i386/sysdep.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/sysdeps/unix/i386/sysdep.h b/sysdeps/unix/i386/sysdep.h
index 38dd2378b5..4e4b6e6ab5 100644
--- a/sysdeps/unix/i386/sysdep.h
+++ b/sysdeps/unix/i386/sysdep.h
@@ -20,11 +20,20 @@ Cambridge, MA 02139, USA.  */
 
 #ifdef	ASSEMBLER
 
+/* Define an entry point visible from C.  */
 #define	ENTRY(name)							      \
-  .globl C_SYMBOL_NAME(name);						      \
+  ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name);				      \
+  ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function)			      \
   .align 4;								      \
   C_LABEL(name)
 
+/* For ELF we need the `.type' directive to make shared libs work right.  */
+#ifdef HAVE_ELF
+#define ASM_TYPE_DIRECTIVE(name,type)	.type name,type;
+#else
+#define ASM_TYPE_DIRECTIVE(name,type) /* Nothing is specified.  */
+#endif
+
 #ifdef	NO_UNDERSCORES
 /* Since C identifiers are not normally prefixed with an underscore
    on this system, the asm identifier `syscall_error' intrudes on the
@@ -36,7 +45,13 @@ Cambridge, MA 02139, USA.  */
   .globl syscall_error;							      \
   ENTRY (name)								      \
   DO_CALL (syscall_name, args);						      \
-  jb syscall_error
+  jb JUMPTARGET(syscall_error)
+
+#ifdef PIC
+#define JUMPTARGET(name) name@PLT
+#else
+#define JUMPTARGET(name) name
+#endif
 
 /* This is defined as a separate macro so that other sysdep.h files
    can include this one and then redefine DO_CALL.  */