(LIB_SPEC): Support -fshared-data.
authorRichard Kenner <kenner@gcc.gnu.org>
Sat, 7 May 1994 16:12:53 +0000 (12:12 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Sat, 7 May 1994 16:12:53 +0000 (12:12 -0400)
(CPP_SPEC): Set _SEQUENT_ to 1.
(SHARED_SECTION_ASM_OP, ASM_OUTPUT_SHARED_COMMON): Supply new macros.
(SHARED_BSS_SECTION_ASM_OP, BSS_SECTION_FUNCTION): Likewise.

From-SVN: r7262

gcc/config/i386/seq-sysv3.h

index f3998cf231ebea6972c9e6a084fb0169e521d431..dabdb594229870e3d1fca1fde8bd737533a9e8b8 100644 (file)
  %{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp}"
 
 #undef LIB_SPEC
-#define LIB_SPEC "%{posix:-lcposix} %{shlib:-lc_s} -lc crtend.o%s"
+#define LIB_SPEC \
+"%{posix:-lcposix}\
+ %{shlib:-lc_s}\
+ %{fshared-data:-lpps -lseq} -lc crtend.o%s"
 
 #undef CPP_SPEC
-#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} -D_SEQUENT_"
+#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} -D_SEQUENT_=1"
 
 /* Although the .init section is used, it is not automatically invoked.
    This because the _start() function in /lib/crt0.o never calls anything
    our own exit function.  */
 #define HAVE_ATEXIT
 
-/* Assembler pseudo-op for shared data segment. */
+/* Assembler pseudo-op for initialized shared variables (.shdata). */
+#undef  SHARED_SECTION_ASM_OP
 #define SHARED_SECTION_ASM_OP ".section .shdata, \"ws\""
+
+/* Assembler pseudo-op for uninitialized shared global variables (.shbss). */
+#undef  ASM_OUTPUT_SHARED_COMMON
+#define ASM_OUTPUT_SHARED_COMMON(FILE, NAME, SIZE, ROUNDED) \
+( fputs(".comm ", (FILE)),                     \
+  assemble_name((FILE), (NAME)),               \
+   fprintf((FILE), ",%u,-3\n", (SIZE)))
+
+/* Assembler pseudo-op for uninitialized shared local variables (.shbss). */
+#undef  SHARED_BSS_SECTION_ASM_OP
+#define SHARED_BSS_SECTION_ASM_OP ".section .shbss, \"bs\""
+#undef  BSS_SECTION_FUNCTION
+#define BSS_SECTION_FUNCTION                                   \
+void                                                           \
+bss_section ()                                                 \
+{                                                              \
+  if (in_section != in_bss)                                    \
+    {                                                          \
+      if (flag_shared_data)                                     \
+        fprintf (asm_out_file, "%s\n", SHARED_BSS_SECTION_ASM_OP);     \
+      else                                                     \
+        fprintf (asm_out_file, "%s\n", BSS_SECTION_ASM_OP);    \
+      in_section = in_bss;                                     \
+    }                                                          \
+}