aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/m88k
diff options
context:
space:
mode:
authorJason Merrill <merrill@gnu.org>1994-11-19 04:09:58 +0000
committerJason Merrill <merrill@gnu.org>1994-11-19 04:09:58 +0000
commit68d69835acdbeb2a30bb3338013e55afda1aca4d (patch)
treece0413f36fa899efe1a55c1519059e52060d600b /gcc/config/m88k
parent822ef9dfdac2e3cff805baccbff3937cf3f468cb (diff)
downloadgcc-68d69835acdbeb2a30bb3338013e55afda1aca4d.zip
gcc-68d69835acdbeb2a30bb3338013e55afda1aca4d.tar.gz
gcc-68d69835acdbeb2a30bb3338013e55afda1aca4d.tar.bz2
Shared library support.
From-SVN: r8519
Diffstat (limited to 'gcc/config/m88k')
-rw-r--r--gcc/config/m88k/dgux.h14
-rw-r--r--gcc/config/m88k/sysv4.h22
-rw-r--r--gcc/config/m88k/t-sysv48
3 files changed, 32 insertions, 12 deletions
diff --git a/gcc/config/m88k/dgux.h b/gcc/config/m88k/dgux.h
index 9765cbe..8cc0080 100644
--- a/gcc/config/m88k/dgux.h
+++ b/gcc/config/m88k/dgux.h
@@ -31,7 +31,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
(TARGET_SVR4 ? DWARF_DEBUG : SDB_DEBUG)
#ifndef VERSION_INFO2
-#define VERSION_INFO2 "$Revision: 1.14 $"
+#define VERSION_INFO2 "$Revision: 1.15 $"
#endif
#ifndef NO_BUGS
#define AS_BUG_IMMEDIATE_LABEL
@@ -119,8 +119,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#undef LINK_SPEC
#define LINK_SPEC "%{z*} %{h*} %{V} %{v:%{!V:-V}} \
%{static:-dn -Bstatic} \
- %{shared:-G -dy} \
- %{symbolic:-Bsymbolic -G -dy} \
+ %{shared:-G -dy -z text} \
+ %{symbolic:-Bsymbolic -G -dy -z text} \
%{pg:-L/usr/lib/libp}%{p:-L/usr/lib/libp}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt0.o%s} \
@@ -176,7 +176,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Override svr4.h and m88k.h except when compiling crtstuff.c. These must
be constant strings when compiling crtstuff.c. Otherwise, respect the
-mversion-STRING option used. */
-#undef INIT_SECTION_PREAMBLE
#undef INIT_SECTION_ASM_OP
#undef FINI_SECTION_ASM_OP
#undef CTORS_SECTION_ASM_OP
@@ -196,12 +195,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
? "section\t .dtors,\"aw\"" \
: "section\t .dtors,\"d\"")
#else
-/* These must be constant strings for crtstuff.c.
- An elf and bcs crtbegin.o are needed since bcs does not
- increment the stack pointer in the init section as elf does */
-#ifndef BCS
-#define INIT_SECTION_PREAMBLE asm ("\taddu\tr31,r31,0x20")
-#endif
+/* These must be constant strings for crtstuff.c. */
#define INIT_SECTION_ASM_OP "section\t .init,\"x\""
#define FINI_SECTION_ASM_OP "section\t .fini,\"x\""
#define CTORS_SECTION_ASM_OP "section\t .ctors,\"d\""
diff --git a/gcc/config/m88k/sysv4.h b/gcc/config/m88k/sysv4.h
index 428c2cf..cb774a5 100644
--- a/gcc/config/m88k/sysv4.h
+++ b/gcc/config/m88k/sysv4.h
@@ -60,7 +60,25 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
/* Override svr4.h and m88k.h. */
#undef INIT_SECTION_ASM_OP
#define INIT_SECTION_ASM_OP "section\t.init,\"xa\",#progbits"
+#undef FINI_SECTION_ASM_OP
+#define FINI_SECTION_ASM_OP "section\t.fini,\"xa\",#progbits"
+
+/* Define the pseudo-ops used to switch to the .ctors and .dtors sections.
+
+ Note that we want to give these sections the SHF_WRITE attribute
+ because these sections will actually contain data (i.e. tables of
+ addresses of functions in the current root executable or shared library
+ file) and, in the case of a shared library, the relocatable addresses
+ will have to be properly resolved/relocated (and then written into) by
+ the dynamic linker when it actually attaches the given shared library
+ to the executing process. (Note that on SVR4, you may wish to use the
+ `-z text' option to the ELF linker, when building a shared library, as
+ an additional check that you are doing everything right. But if you do
+ use the `-z text' option when building a shared library, you will get
+ errors unless the .ctors and .dtors sections are marked as writable
+ via the SHF_WRITE attribute.) */
+
#undef CTORS_SECTION_ASM_OP
-#define CTORS_SECTION_ASM_OP "section\t.ctors,\"a\",#progbits"
+#define CTORS_SECTION_ASM_OP "section\t.ctors,\"aw\""
#undef DTORS_SECTION_ASM_OP
-#define DTORS_SECTION_ASM_OP "section\t.dtors,\"a\",#progbits"
+#define DTORS_SECTION_ASM_OP "section\t.dtors,\"aw\""
diff --git a/gcc/config/m88k/t-sysv4 b/gcc/config/m88k/t-sysv4
index 419a9db..6a77edb 100644
--- a/gcc/config/m88k/t-sysv4
+++ b/gcc/config/m88k/t-sysv4
@@ -12,3 +12,11 @@ $(MOVE_ASM): $(srcdir)/config/m88k/m88k-move.sh
LIB2FUNCS_EXTRA = $(MOVE_ASM)
LIBGCC1 = libgcc1.null
CROSS_LIBGCC1 = libgcc1.null
+
+# We need to use -fpic when we are using gcc to compile the routines in
+# crtstuff.c. This is only really needed when we are going to use gcc/g++
+# to produce a shared library, but since we don't know ahead of time when
+# we will be doing that, we just always use -fpic when compiling the
+# routines in crtstuff.c.
+
+CRTSTUFF_T_CFLAGS=-fpic