OSDN Git Service

* configure.ac (gcc_cv_ld_sol2_emulation): Test for GNU ld *_sol2
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / sol2-10.h
index 1cd2897..d57ed7f 100644 (file)
@@ -120,7 +120,18 @@ along with GCC; see the file COPYING3.  If not see
 #define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE
 
 #ifdef TARGET_GNU_LD
-#define TARGET_LD_EMULATION "%{m64:-m elf_x86_64}%{!m64:-m elf_i386} "
+/* Since binutils 2.21, GNU ld supports new *_sol2 emulations to strictly
+   follow the Solaris 2 ABI.  Prefer them if present.  */
+#ifdef HAVE_LD_SOL2_EMULATION
+#define I386_EMULATION "elf_i386_sol2"
+#define X86_64_EMULATION "elf_x86_64_sol2"
+#else
+#define I386_EMULATION "elf_i386"
+#define X86_64_EMULATION "elf_x86_64"
+#endif
+
+#define TARGET_LD_EMULATION "%{m64:-m " X86_64_EMULATION "}" \
+                           "%{!m64:-m " I386_EMULATION "} "
 #else
 #define TARGET_LD_EMULATION ""
 #endif