summaryrefslogtreecommitdiff
path: root/gcc/config/i386/linux.h
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-24 02:56:23 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-24 02:56:23 +0000
commit6396cc37141180db4d2c8f73cab4f5977d8a1e19 (patch)
tree611b7c19931269b92d455ba78be01fea92ceb74f /gcc/config/i386/linux.h
parent7206da1bce6e7a9272829191a94c704a400f023c (diff)
downloadgcc-6396cc37141180db4d2c8f73cab4f5977d8a1e19.tar.gz
Patch from Robert Millan.
* config.gcc: Merge kfreebsd*-gnu with linux* and add knetbsd*-gnu. * config/i386/linux.h: Allow overriding of LINK_EMULATION, DYNAMIC_LINKER and register names in sc_ structure. * config/kfreebsd-gnu.h: New. kfreebsd-gnu followup for linux.h. * config/i386/kfreebsd-gnu.h: New. Ditto for i386-kfreebsd-gnu. * config/knetbsd-gnu.h: New. Ditto for knetbsd-gnu. * config/i386/knetbsd-gnu.h: New. Ditto for i386-knetbsd-gnu. * config/kfreebsdgnu.h: Remove. * config/t-kfreebsd-gnu: Likewise. * config/i386/kfreebsdgnu.h: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83577 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/linux.h')
-rw-r--r--gcc/config/i386/linux.h44
1 files changed, 24 insertions, 20 deletions
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index e7d19ec181a..85e6cf2c98f 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -108,24 +108,26 @@ Boston, MA 02111-1307, USA. */
/* If ELF is the default format, we should not use /lib/elf. */
-#undef LINK_SPEC
+#define LINK_EMULATION "elf_i386"
#ifdef USE_GNULIBC_1
-#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
- %{!shared: \
- %{!ibcs: \
- %{!static: \
- %{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
- %{static:-static}}}"
+# define DYNAMIC_LINKER "/lib/ld-linux.so.1"
#else
-#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
+# define DYNAMIC_LINKER "/lib/ld-linux.so.2"
+#endif
+
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+ { "link_emulation", LINK_EMULATION },\
+ { "dynamic_linker", DYNAMIC_LINKER }
+
+#undef LINK_SPEC
+#define LINK_SPEC "-m %(link_emulation) %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
%{rdynamic:-export-dynamic} \
- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
+ %{!dynamic-linker:-dynamic-linker %(dynamic_linker)}} \
%{static:-static}}}"
-#endif
/* A C statement (sans semicolon) to output to the stdio stream
FILE the assembler definition of uninitialized global DECL named
@@ -217,6 +219,8 @@ Boston, MA 02111-1307, USA. */
#include <signal.h>
#include <sys/ucontext.h>
+#define REG_NAME(reg) reg
+
#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
do { \
unsigned char *pc_ = (CONTEXT)->ra; \
@@ -245,28 +249,28 @@ Boston, MA 02111-1307, USA. */
else \
break; \
\
- new_cfa_ = sc_->esp; \
+ new_cfa_ = sc_->REG_NAME(esp); \
(FS)->cfa_how = CFA_REG_OFFSET; \
(FS)->cfa_reg = 4; \
(FS)->cfa_offset = new_cfa_ - (long) (CONTEXT)->cfa; \
\
/* The SVR4 register numbering macros aren't usable in libgcc. */ \
(FS)->regs.reg[0].how = REG_SAVED_OFFSET; \
- (FS)->regs.reg[0].loc.offset = (long)&sc_->eax - new_cfa_; \
+ (FS)->regs.reg[0].loc.offset = (long)&sc_->REG_NAME(eax) - new_cfa_; \
(FS)->regs.reg[3].how = REG_SAVED_OFFSET; \
- (FS)->regs.reg[3].loc.offset = (long)&sc_->ebx - new_cfa_; \
+ (FS)->regs.reg[3].loc.offset = (long)&sc_->REG_NAME(ebx) - new_cfa_; \
(FS)->regs.reg[1].how = REG_SAVED_OFFSET; \
- (FS)->regs.reg[1].loc.offset = (long)&sc_->ecx - new_cfa_; \
+ (FS)->regs.reg[1].loc.offset = (long)&sc_->REG_NAME(ecx) - new_cfa_; \
(FS)->regs.reg[2].how = REG_SAVED_OFFSET; \
- (FS)->regs.reg[2].loc.offset = (long)&sc_->edx - new_cfa_; \
+ (FS)->regs.reg[2].loc.offset = (long)&sc_->REG_NAME(edx) - new_cfa_; \
(FS)->regs.reg[6].how = REG_SAVED_OFFSET; \
- (FS)->regs.reg[6].loc.offset = (long)&sc_->esi - new_cfa_; \
+ (FS)->regs.reg[6].loc.offset = (long)&sc_->REG_NAME(esi) - new_cfa_; \
(FS)->regs.reg[7].how = REG_SAVED_OFFSET; \
- (FS)->regs.reg[7].loc.offset = (long)&sc_->edi - new_cfa_; \
+ (FS)->regs.reg[7].loc.offset = (long)&sc_->REG_NAME(edi) - new_cfa_; \
(FS)->regs.reg[5].how = REG_SAVED_OFFSET; \
- (FS)->regs.reg[5].loc.offset = (long)&sc_->ebp - new_cfa_; \
+ (FS)->regs.reg[5].loc.offset = (long)&sc_->REG_NAME(ebp) - new_cfa_; \
(FS)->regs.reg[8].how = REG_SAVED_OFFSET; \
- (FS)->regs.reg[8].loc.offset = (long)&sc_->eip - new_cfa_; \
+ (FS)->regs.reg[8].loc.offset = (long)&sc_->REG_NAME(eip) - new_cfa_; \
(FS)->retaddr_column = 8; \
goto SUCCESS; \
} while (0)