From 0075bbfc5cd1073ba940aac964a7611f06a752d5 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sun, 1 Oct 1995 07:19:42 +0000 Subject: [PATCH] Patches to get the microcode to compile properly on Linux ELF systems. --- v7/src/microcode/cmpauxmd/i386.m4 | 8 ++++++-- v7/src/microcode/s/linux.h | 32 ++++++++++++++++++++++++++++++- 2 files changed, 37 insertions(+), 3 deletions(-) diff --git a/v7/src/microcode/cmpauxmd/i386.m4 b/v7/src/microcode/cmpauxmd/i386.m4 index 72e04715a..94fd6e8af 100644 --- a/v7/src/microcode/cmpauxmd/i386.m4 +++ b/v7/src/microcode/cmpauxmd/i386.m4 @@ -1,6 +1,6 @@ ### -*-Midas-*- ### -### $Id: i386.m4,v 1.36 1995/02/26 03:34:36 cph Exp $ +### $Id: i386.m4,v 1.37 1995/10/01 07:19:42 cph Exp $ ### ### Copyright (c) 1992-95 Massachusetts Institute of Technology ### @@ -139,12 +139,16 @@ ifdef(`DOS', `define(use_external_code,`')') ifdef(`OS2', + `define(`SUPPRESS_LEADING_UNDERSCORE',1)', + `') + +ifdef(`SUPPRESS_LEADING_UNDERSCORE', `define(external_data_reference,`$1')', `define(external_data_reference,`_$1')') define(EDR,`external_data_reference($1)') -ifdef(`OS2', +ifdef(`SUPPRESS_LEADING_UNDERSCORE', `define(external_code_reference,`$1')', `define(external_code_reference,`_$1')') diff --git a/v7/src/microcode/s/linux.h b/v7/src/microcode/s/linux.h index e70d9fcd3..ba5c8c542 100644 --- a/v7/src/microcode/s/linux.h +++ b/v7/src/microcode/s/linux.h @@ -1,7 +1,7 @@ /* -*-C-*- System file for Linux -$Id: linux.h,v 1.2 1995/06/29 23:50:31 cph Exp $ +$Id: linux.h,v 1.3 1995/10/01 07:19:07 cph Exp $ Copyright (c) 1995 Massachusetts Institute of Technology @@ -40,3 +40,33 @@ MIT in each case. */ #define LIB_DEBUG #define ALTERNATE_M4 s/ultrix.m4 + +/* The following change is necessary if ELF binaries are used. + Unfortunately, it is insufficient, because the Linux ELF + implementation also moves the data segment to 0x08000000, which + means that all of the pointer manipulation code must be changed. + This is normal for some architectures, e.g. the MIPS and HPPA, but + it make the binaries for Linux ELF different for the binaries for + all other i386 machines. + + Since I don't currently know any way to adjust the mapping of the + data segment, if ELF is in use, I'll just force the switch that + causes GCC to generate a.out format instead of ELF. This is a + temporary patch, because one of these days a.out won't be + supported, but hopefully by then we'll know how to fix this + correctly. */ +#if 0 +#ifdef __ELF__ +#define M4_SWITCH_SYSTEM -P "define(SUPPRESS_LEADING_UNDERSCORE,1)" +#else +#define M4_SWITCH_SYSTEM +#endif +#endif + +#ifdef __ELF__ +#define C_SWITCH_SYSTEM -b i486-linuxaout +#define LD_SWITCH_SYSTEM -b i486-linuxaout +#else +#define C_SWITCH_SYSTEM +#define LD_SWITCH_SYSTEM +#endif -- 2.25.1