diff options
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/rtld-aout/Makefile | 4 | ||||
-rw-r--r-- | libexec/rtld-aout/i386/md.c | 16 | ||||
-rw-r--r-- | libexec/rtld-aout/i386/md.h | 15 |
3 files changed, 23 insertions, 12 deletions
diff --git a/libexec/rtld-aout/Makefile b/libexec/rtld-aout/Makefile index 09277ba..1a76c51 100644 --- a/libexec/rtld-aout/Makefile +++ b/libexec/rtld-aout/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.6 1993/11/25 01:06:42 jkh Exp $ +# $Id: Makefile,v 1.7 1993/12/11 21:05:59 jkh Exp $ PROG= ld.so SRCS= mdprologue.S sbrk.c rtld.c shlib.c etc.c md.c @@ -7,7 +7,7 @@ LDDIR?= $(.CURDIR)/.. #PICFLAG=-pic PICFLAG=-fpic CFLAGS += -I$(LDDIR) -I$(.CURDIR) -I$(LDDIR)/$(MACHINE) -O $(PICFLAG) -DRTLD -LDFLAGS = -Bshareable -Bsymbolic -assert nosymbolic +LDFLAGS = -Bshareable -Bsymbolic -assert nosymbolic -Z LIBS = -lc_pic -lgcc_pic BINDIR= /usr/libexec ASFLAGS = -k diff --git a/libexec/rtld-aout/i386/md.c b/libexec/rtld-aout/i386/md.c index 40766df..02fda41 100644 --- a/libexec/rtld-aout/i386/md.c +++ b/libexec/rtld-aout/i386/md.c @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: md.c,v 1.4 1993/11/22 19:05:23 jkh Exp $ + * $Id: md.c,v 1.6 1993/12/02 01:03:04 jkh Exp $ */ #include <sys/param.h> @@ -41,6 +41,8 @@ #include "ld.h" +int netzmagic = 0; + /* * Get relocation addend corresponding to relocation record RP * from address ADDR @@ -96,10 +98,14 @@ md_init_header(hp, magic, flags) struct exec *hp; int magic, flags; { - if (oldmagic) - hp->a_midmag = oldmagic; - else - N_SETMAGIC((*hp), magic, MID_I386, flags); + if (!netzmagic && (magic == ZMAGIC) && !(link_mode & DYNAMIC)) { + hp->a_midmag = magic; + } else { + if (netzmagic) + N_SETMAGIC_NET((*hp), magic, MID_I386, flags); + else + N_SETMAGIC((*hp), magic, MID_I386, flags); + } /* TEXT_START depends on the value of outheader.a_entry. */ if (!(link_mode & SHAREABLE)) /*WAS: if (entry_symbol) */ diff --git a/libexec/rtld-aout/i386/md.h b/libexec/rtld-aout/i386/md.h index 285b0e6..c7271b3 100644 --- a/libexec/rtld-aout/i386/md.h +++ b/libexec/rtld-aout/i386/md.h @@ -27,7 +27,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: md.h,v 1.5 1993/12/08 10:14:48 pk Exp $ + * $Id: md.h,v 1.6 1993/12/11 12:02:05 jkh Exp $ */ @@ -45,10 +45,15 @@ #define PAGSIZ 4096 #endif -#define N_SET_FLAG(ex,f) N_SETMAGIC(ex,N_GETMAGIC(ex), MID_MACHINE, \ - N_GETFLAG(ex)|(f)) - -#define N_IS_DYNAMIC(ex) ((N_GETFLAG(ex) & EX_DYNAMIC)) +#define N_SET_FLAG(ex,f) (netzmagic ? \ + N_SETMAGIC_NET(ex,N_GETMAGIC_NET(ex), MID_MACHINE, \ + N_GETFLAG_NET(ex)|(f)) : \ + N_SETMAGIC(ex,N_GETMAGIC(ex), MID_MACHINE, \ + N_GETFLAG(ex)|(f))) + +#define N_IS_DYNAMIC(ex) ((N_GETMAGIC_NET(ex) == ZMAGIC) ? \ + ((N_GETFLAG_NET(ex) & EX_DYNAMIC)) : \ + ((N_GETFLAG(ex) & EX_DYNAMIC))) /* * Should be handled by a.out.h ? |