head	1.17;
access;
symbols
	perseant-exfatfs-base-20250801:1.17
	perseant-exfatfs-base-20240630:1.17
	cjep_sun2x:1.17.0.44
	cjep_sun2x-base:1.17
	cjep_staticlib_x-base1:1.17
	cjep_staticlib_x:1.17.0.42
	cjep_staticlib_x-base:1.17
	phil-wifi-20200421:1.17
	phil-wifi-20200411:1.17
	phil-wifi-20200406:1.17
	pgoyette-compat-merge-20190127:1.17
	pgoyette-compat-20190127:1.17
	pgoyette-compat-20190118:1.17
	pgoyette-compat-1226:1.17
	pgoyette-compat-1126:1.17
	pgoyette-compat-1020:1.17
	pgoyette-compat-0930:1.17
	pgoyette-compat-0906:1.17
	pgoyette-compat-0728:1.17
	pgoyette-compat-0625:1.17
	pgoyette-compat-0521:1.17
	pgoyette-compat-0502:1.17
	pgoyette-compat-0422:1.17
	pgoyette-compat-0415:1.17
	pgoyette-compat-0407:1.17
	pgoyette-compat-0330:1.17
	pgoyette-compat-0322:1.17
	pgoyette-compat-0315:1.17
	pgoyette-compat:1.17.0.40
	pgoyette-compat-base:1.17
	perseant-stdc-iso10646:1.17.0.38
	perseant-stdc-iso10646-base:1.17
	prg-localcount2-base3:1.17
	prg-localcount2-base2:1.17
	prg-localcount2-base1:1.17
	prg-localcount2:1.17.0.36
	prg-localcount2-base:1.17
	pgoyette-localcount-20170426:1.17
	bouyer-socketcan-base1:1.17
	pgoyette-localcount-20170320:1.17
	bouyer-socketcan:1.17.0.34
	bouyer-socketcan-base:1.17
	pgoyette-localcount-20170107:1.17
	pgoyette-localcount-20161104:1.17
	localcount-20160914:1.17
	pgoyette-localcount-20160806:1.17
	pgoyette-localcount-20160726:1.17
	pgoyette-localcount:1.17.0.32
	pgoyette-localcount-base:1.17
	netbsd-5-2-3-RELEASE:1.17
	netbsd-5-1-5-RELEASE:1.17
	yamt-pagecache-base9:1.17
	yamt-pagecache-tag8:1.17
	tls-earlyentropy:1.17.0.28
	tls-earlyentropy-base:1.17
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.17
	riastradh-drm2-base3:1.17
	netbsd-5-2-2-RELEASE:1.17
	netbsd-5-1-4-RELEASE:1.17
	netbsd-5-2-1-RELEASE:1.17
	netbsd-5-1-3-RELEASE:1.17
	agc-symver:1.17.0.30
	agc-symver-base:1.17
	tls-maxphys-base:1.17
	yamt-pagecache-base8:1.17
	netbsd-5-2:1.17.0.26
	yamt-pagecache-base7:1.17
	netbsd-5-2-RELEASE:1.17
	netbsd-5-2-RC1:1.17
	yamt-pagecache-base6:1.17
	yamt-pagecache-base5:1.17
	yamt-pagecache-base4:1.17
	netbsd-5-1-2-RELEASE:1.17
	netbsd-5-1-1-RELEASE:1.17
	yamt-pagecache-base3:1.17
	yamt-pagecache-base2:1.17
	yamt-pagecache:1.17.0.24
	yamt-pagecache-base:1.17
	bouyer-quota2-nbase:1.17
	bouyer-quota2:1.17.0.22
	bouyer-quota2-base:1.17
	matt-nb5-pq3:1.17.0.20
	matt-nb5-pq3-base:1.17
	netbsd-5-1:1.17.0.18
	netbsd-5-1-RELEASE:1.17
	netbsd-5-1-RC4:1.17
	netbsd-5-1-RC3:1.17
	netbsd-5-1-RC2:1.17
	netbsd-5-1-RC1:1.17
	netbsd-5-0-2-RELEASE:1.17
	netbsd-5-0-1-RELEASE:1.17
	jym-xensuspend-nbase:1.17
	netbsd-5-0:1.17.0.16
	netbsd-5-0-RELEASE:1.17
	netbsd-5-0-RC4:1.17
	netbsd-5-0-RC3:1.17
	netbsd-5-0-RC2:1.17
	jym-xensuspend:1.17.0.14
	jym-xensuspend-base:1.17
	netbsd-5-0-RC1:1.17
	netbsd-5:1.17.0.12
	netbsd-5-base:1.17
	mjf-devfs2:1.17.0.10
	mjf-devfs2-base:1.17
	yamt-pf42-base4:1.17
	yamt-pf42-base3:1.17
	hpcarm-cleanup-nbase:1.17
	yamt-pf42-base2:1.17
	yamt-pf42:1.17.0.8
	yamt-pf42-base:1.17
	keiichi-mipv6:1.17.0.6
	keiichi-mipv6-base:1.17
	cube-autoconf:1.17.0.4
	cube-autoconf-base:1.17
	hpcarm-cleanup:1.17.0.2
	hpcarm-cleanup-base:1.17
	netbsd-1-3-PATCH003:1.12
	netbsd-1-3-PATCH003-CANDIDATE2:1.12
	netbsd-1-3-PATCH003-CANDIDATE1:1.12
	netbsd-1-3-PATCH003-CANDIDATE0:1.12
	ARM32-BROKEN-RELOCS:1.13.0.2
	netbsd-1-3-PATCH002:1.12
	netbsd-1-3-PATCH001:1.12
	netbsd-1-3-RELEASE:1.12
	netbsd-1-3-BETA:1.12
	netbsd-1-3:1.12.0.2
	netbsd-1-3-base:1.12;
locks; strict;
comment	@ * @;


1.17
date	98.12.17.15.38.58;	author pk;	state dead;
branches;
next	1.16;

1.16
date	98.12.15.21.22.52;	author pk;	state Exp;
branches;
next	1.15;

1.15
date	98.10.19.03.09.33;	author matt;	state Exp;
branches;
next	1.14;

1.14
date	98.09.05.13.08.39;	author pk;	state Exp;
branches;
next	1.13;

1.13
date	98.01.05.22.00.46;	author cgd;	state Exp;
branches;
next	1.12;

1.12
date	95.08.04.21.32.15;	author pk;	state Exp;
branches;
next	1.11;

1.11
date	94.11.30.18.25.29;	author pk;	state Exp;
branches;
next	1.10;

1.10
date	94.08.21.15.15.43;	author pk;	state Exp;
branches;
next	1.9;

1.9
date	94.02.10.21.21.28;	author pk;	state Exp;
branches;
next	1.8;

1.8
date	94.01.29.02.03.43;	author jtc;	state Exp;
branches;
next	1.7;

1.7
date	94.01.28.21.04.18;	author pk;	state Exp;
branches;
next	1.6;

1.6
date	93.12.08.10.29.04;	author pk;	state Exp;
branches;
next	1.5;

1.5
date	93.11.13.11.20.37;	author pk;	state Exp;
branches;
next	1.4;

1.4
date	93.11.10.21.46.06;	author pk;	state Exp;
branches;
next	1.3;

1.3
date	93.10.24.00.48.20;	author pk;	state Exp;
branches;
next	1.2;

1.2
date	93.10.19.21.42.38;	author pk;	state Exp;
branches;
next	1.1;

1.1
date	93.10.16.21.54.35;	author pk;	state Exp;
branches;
next	;


desc
@@


1.17
log
@These files now live in `src/libexec/ld.aout_so/arch'
@
text
@/*	$NetBSD: md.h,v 1.16 1998/12/15 21:22:52 pk Exp $	*/

/*-
 * Copyright (c) 1998 The NetBSD Foundation, Inc.
 * All rights reserved.
 *
 * This code is derived from software contributed to The NetBSD Foundation
 * by Paul Kranenburg.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *        This product includes software developed by the NetBSD
 *        Foundation, Inc. and its contributors.
 * 4. Neither the name of The NetBSD Foundation nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * SPARC machine dependent definitions
 */

#define	MAX_ALIGNMENT	(sizeof (double))

#ifdef __NetBSD__
#define PAGSIZ			__LDPGSZ

#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))

/*
 * Should be handled by a.out.h ?
 */
#define N_ADJUST(ex)		(((ex).a_entry < PAGSIZ) ? -PAGSIZ : 0)
#define TEXT_START(ex)		(N_TXTADDR(ex) + N_ADJUST(ex))
#define DATA_START(ex)		(N_DATADDR(ex) + N_ADJUST(ex))

#else /* __NetBSD__ */

/* Get the SunOS a.out and relocation nomenclature */
#define EX_DYNAMIC		1

#define N_IS_DYNAMIC(ex)	((ex).a_dynamic)

#define N_SET_FLAG(ex, f) {			\
	(ex).a_dynamic = ((f) & EX_DYNAMIC);	\
}

#undef  relocation_info
#define relocation_info	                reloc_info_sparc
#define r_symbolnum			r_index
#endif /* __NetBSD__ */

#define N_BADMID(ex) \
	(N_GETMID(ex) != 0 && N_GETMID(ex) != MID_MACHINE && \
						!md_midcompat(&(ex)))

/* Sparc (Sun 4) macros */
#define RELOC_ADDRESS(r)		((r)->r_address)
#define RELOC_EXTERN_P(r)		((r)->r_extern)
#define RELOC_TYPE(r)			((r)->r_symbolnum)
#define RELOC_SYMBOL(r)			((r)->r_symbolnum)
#define RELOC_MEMORY_SUB_P(r)		0
#ifdef RTLD
/* XXX - consider this making SUN_COMPAT --> repercussions on rrs.c */
#define RELOC_MEMORY_ADD_P(r)		1
#else
#define RELOC_MEMORY_ADD_P(r)		0
#endif
#define RELOC_ADD_EXTRA(r)		((r)->r_addend)
#define RELOC_PCREL_P(r) \
	(((r)->r_type >= RELOC_DISP8 && (r)->r_type <= RELOC_WDISP22) \
	 || ((r)->r_type == RELOC_PC10 || (r)->r_type == RELOC_PC22)  \
	 || (r)->r_type == RELOC_JMP_TBL)
#define RELOC_VALUE_RIGHTSHIFT(r)	(reloc_target_rightshift[(r)->r_type])
#define RELOC_TARGET_SIZE(r)		(reloc_target_size[(r)->r_type])
#define RELOC_TARGET_BITPOS(r)		0
#define RELOC_TARGET_BITSIZE(r)		(reloc_target_bitsize[(r)->r_type])

#define RELOC_JMPTAB_P(r)		((r)->r_type == RELOC_JMP_TBL)

#define RELOC_BASEREL_P(r) \
	((r)->r_type >= RELOC_BASE10 && (r)->r_type <= RELOC_BASE22)

#define RELOC_RELATIVE_P(r)		((r)->r_type == RELOC_RELATIVE)
#define RELOC_COPY_DAT (RELOC_RELATIVE+1)	/*XXX*/
#define RELOC_COPY_P(r)			((r)->r_type == RELOC_COPY_DAT)
#define RELOC_LAZY_P(r)			((r)->r_type == RELOC_JMP_SLOT)

#define RELOC_STATICS_THROUGH_GOT_P(r)		(1)
#define JMPSLOT_NEEDS_RELOC			(1)
#define	RELOC_SYMBOLICS_THROUGH_JMPSLOT		(1)
#define	JMPSLOT_NONEXTERN_IS_INTERMODULE	(0)

/*
 * Define the range of usable Global Offset Table offsets
 * when using sparc 13 bit relocation types (-4096 - 4092);
 * this is the case if the object files are compiles with `-fpic'.
 * IF a "large" model is used (i.e. `-fPIC'), pairs of
 * <RELOC_BASE10,RELOC_BASE22> relocations are used which establish
 * 32-bit addressability of the GOT table.
 */
#define MAX_GOTOFF(t)		((t)==PIC_TYPE_SMALL?4092:LONG_MAX)
#define MIN_GOTOFF(t)		((t)==PIC_TYPE_SMALL?-4096:LONG_MIN)

#define RELOC_PIC_TYPE(r) ( \
	((r)->r_type == RELOC_BASE10 || (r)->r_type == RELOC_BASE22) \
		? PIC_TYPE_LARGE \
		: ((r)->r_type==RELOC_BASE13 ? \
			PIC_TYPE_SMALL : \
			PIC_TYPE_NONE) )

#define CHECK_GOT_RELOC(r) \
	((r)->r_type == RELOC_PC10 || (r)->r_type == RELOC_PC22)

#define md_got_reloc(r)			(-(r)->r_address)

#define RELOC_INIT_SEGMENT_RELOC(r)	((r)->r_type = RELOC_32)

#ifdef SUN_COMPAT
/*
 * Sun plays games with `r_addend'
 */
#define md_get_rt_segment_addend(r,a)	(0)
#endif

/* Width of a Global Offset Table entry */
typedef long	got_t;

typedef struct jmpslot {
	u_long	opcode1;
	u_long	opcode2;
	u_long	reloc_index;
#define JMPSLOT_RELOC_MASK		(0x003fffff)	/* 22 bits */
} jmpslot_t;

#define SAVE	0x9de3bfa0	/* Build stack frame (opcode1) */
#define SETHI	0x03000000	/* %hi(addr) -> %g1 (opcode1) */
#define CALL	0x40000000	/* Call instruction (opcode2) */
#define JMP	0x81c06000	/* Jump %g1 instruction (opcode2) */
#define NOP	0x01000000	/* Delay slot NOP for (reloc_index) */
#define TRAP	0x91d02001	/* ta 0x1 */


/*
 * Byte swap defs for cross linking
 */

#if !defined(NEED_SWAP)

#define md_swapin_exec_hdr(h)
#define md_swapout_exec_hdr(h)
#define md_swapin_symbols(s,n)
#define md_swapout_symbols(s,n)
#define md_swapin_zsymbols(s,n)
#define md_swapout_zsymbols(s,n)
#define md_swapin_reloc(r,n)
#define md_swapout_reloc(r,n)
#define md_swapin__dynamic(l)
#define md_swapout__dynamic(l)
#define md_swapin_section_dispatch_table(l)
#define md_swapout_section_dispatch_table(l)
#define md_swapin_so_debug(d)
#define md_swapout_so_debug(d)
#define md_swapin_rrs_hash(f,n)
#define md_swapout_rrs_hash(f,n)
#define md_swapin_sod(l,n)
#define md_swapout_sod(l,n)
#define md_swapout_jmpslot(j,n)
#define md_swapout_got(g,n)
#define md_swapin_ranlib_hdr(h,n)
#define md_swapout_ranlib_hdr(h,n)

#endif /* NEED_SWAP */

#ifdef CROSS_LINKER

#ifdef NEED_SWAP

/* Define IO byte swapping routines */

void	md_swapin_exec_hdr __P((struct exec *));
void	md_swapout_exec_hdr __P((struct exec *));
void	md_swapin_reloc __P((struct relocation_info *, int));
void	md_swapout_reloc __P((struct relocation_info *, int));
void	md_swapout_jmpslot __P((jmpslot_t *, int));

#define md_swapin_symbols(s,n)			swap_symbols(s,n)
#define md_swapout_symbols(s,n)			swap_symbols(s,n)
#define md_swapin_zsymbols(s,n)			swap_zsymbols(s,n)
#define md_swapout_zsymbols(s,n)		swap_zsymbols(s,n)
#define md_swapin__dynamic(l)			swap__dynamic(l)
#define md_swapout__dynamic(l)			swap__dynamic(l)
#define md_swapin_section_dispatch_table(l)	swap_section_dispatch_table(l)
#define md_swapout_section_dispatch_table(l)	swap_section_dispatch_table(l)
#define md_swapin_so_debug(d)			swap_so_debug(d)
#define md_swapout_so_debug(d)			swap_so_debug(d)
#define md_swapin_rrs_hash(f,n)			swap_rrs_hash(f,n)
#define md_swapout_rrs_hash(f,n)		swap_rrs_hash(f,n)
#define md_swapin_sod(l,n)			swapin_sod(l,n)
#define md_swapout_sod(l,n)			swapout_sod(l,n)
#define md_swapout_got(g,n)			swap_longs((long*)(g),n)
#define md_swapin_ranlib_hdr(h,n)		swap_ranlib_hdr(h,n)
#define md_swapout_ranlib_hdr(h,n)		swap_ranlib_hdr(h,n)

#define md_swap_short(x) ( (((x) >> 8) & 0xff) | (((x) & 0xff) << 8) )

#define md_swap_long(x) ( (((x) >> 24) & 0xff    ) | (((x) >> 8 ) & 0xff00   ) | \
			(((x) << 8 ) & 0xff0000) | (((x) << 24) & 0xff000000))

#define get_byte(p)	( ((unsigned char *)(p))[0] )

#define get_short(p)	( ( ((unsigned char *)(p))[1] << 8) | \
			  ( ((unsigned char *)(p))[0]     )   \
			)
#define get_long(p)	( ( ((unsigned char *)(p))[3] << 24) | \
			  ( ((unsigned char *)(p))[2] << 16) | \
			  ( ((unsigned char *)(p))[1] << 8 ) | \
			  ( ((unsigned char *)(p))[0]      )   \
			)

#define put_byte(p, v)	{ ((unsigned char *)(p))[0] = ((unsigned long)(v)); }

#define put_short(p, v)	{ ((unsigned char *)(p))[1] =			\
				((((unsigned long)(v)) >> 8) & 0xff); 	\
			  ((unsigned char *)(p))[0] =			\
				((((unsigned long)(v))     ) & 0xff); }

#define put_long(p, v)	{ ((unsigned char *)(p))[3] =			\
				((((unsigned long)(v)) >> 24) & 0xff); 	\
			  ((unsigned char *)(p))[2] =			\
				((((unsigned long)(v)) >> 16) & 0xff); 	\
			  ((unsigned char *)(p))[1] =			\
				((((unsigned long)(v)) >>  8) & 0xff); 	\
			  ((unsigned char *)(p))[0] =			\
				((((unsigned long)(v))      ) & 0xff); }

#else	/* We need not swap, but must pay attention to alignment: */

#define md_swap_short(x)	(x)
#define md_swap_long(x)		(x)

#define get_byte(p)	( ((unsigned char *)(p))[0] )

#define get_short(p)	( ( ((unsigned char *)(p))[0] << 8) | \
			  ( ((unsigned char *)(p))[1]     )   \
			)

#define get_long(p)	( ( ((unsigned char *)(p))[0] << 24) | \
			  ( ((unsigned char *)(p))[1] << 16) | \
			  ( ((unsigned char *)(p))[2] << 8 ) | \
			  ( ((unsigned char *)(p))[3]      )   \
			)


#define put_byte(p, v)	{ ((unsigned char *)(p))[0] = ((unsigned long)(v)); }

#define put_short(p, v)	{ ((unsigned char *)(p))[0] =			\
				((((unsigned long)(v)) >> 8) & 0xff); 	\
			  ((unsigned char *)(p))[1] =			\
				((((unsigned long)(v))     ) & 0xff); }

#define put_long(p, v)	{ ((unsigned char *)(p))[0] =			\
				((((unsigned long)(v)) >> 24) & 0xff); 	\
			  ((unsigned char *)(p))[1] =			\
				((((unsigned long)(v)) >> 16) & 0xff); 	\
			  ((unsigned char *)(p))[2] =			\
				((((unsigned long)(v)) >>  8) & 0xff); 	\
			  ((unsigned char *)(p))[3] =			\
				((((unsigned long)(v))      ) & 0xff); }

#endif /* NEED_SWAP */

#else	/* Not a cross linker: use native */

#define md_swap_short(x)		(x)
#define md_swap_long(x)			(x)

#define get_byte(where)			(*(char *)(where))
#define get_short(where)		(*(short *)(where))
#define get_long(where)			(*(long *)(where))

#define put_byte(where,what)		(*(char *)(where) = (what))
#define put_short(where,what)		(*(short *)(where) = (what))
#define put_long(where,what)		(*(long *)(where) = (what))

#endif /* CROSS_LINKER */

@


1.16
log
@NetBSD -> __NetBSD__
@
text
@d1 1
a1 1
/*	$NetBSD: md.h,v 1.15 1998/10/19 03:09:33 matt Exp $	*/
@


1.15
log
@Back out change to md_make_gotreloc which added 4 arguement of got_t *.
Add argument to md_fix_jmpslot indicating whether this the first (i.e
tranfer) jmpslot or not.  Add better support for VAX (the VAX can support
pure text code; let ld that advantage of it).  Checking in verified and
working versions of rtld VAX support routines.
@
text
@d1 1
a1 1
/*	$NetBSD: md.h,v 1.14 1998/09/05 13:08:39 pk Exp $	*/
d45 1
a45 1
#ifdef NetBSD
d59 1
a59 1
#else
d73 1
a73 1
#endif /* NetBSD */
@


1.14
log
@Assign my copyrights to TNF.
@
text
@d1 1
a1 1
/*	$NetBSD: md.h,v 1.13 1998/01/05 22:00:46 cgd Exp $	*/
d111 4
a114 2
#define RELOC_STATICS_THROUGH_GOT_P(r)	(1)
#define JMPSLOT_NEEDS_RELOC		(1)
@


1.13
log
@RCS Id police
@
text
@d1 1
a1 1
/*	$NetBSD$	*/
d3 2
a4 2
/*
 * Copyright (c) 1993 Paul Kranenburg
d7 3
d20 5
a24 3
 *      This product includes software developed by Paul Kranenburg.
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission
d26 11
a36 10
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
a41 1

@


1.12
log
@Handle object code with the "large" model PIC (eg. gcc's `-fPIC' option).
@
text
@d1 2
a30 2
 *
 *	$Id: md.h,v 1.11 1994/11/30 18:25:29 pk Exp $
@


1.11
log
@Another md macro to initialize a home-made struct reloc needed
for N_SET* type relocations in shared objects.
@
text
@d30 1
a30 1
 *	$Id: md.h,v 1.10 1994/08/21 15:15:43 pk Exp $
d99 1
a99 1
        ((r)->r_type >= RELOC_BASE10 && (r)->r_type <= RELOC_BASE22)
d111 5
a115 1
 * when using sparc 13 bit relocation types (-4096 - 4092).
d117 9
a125 3
#define MAX_GOTSIZE			(8192)
#define MAX_GOTOFF			(4092)
#define MIN_GOTOFF			(-4096)
d128 1
a128 1
		((r)->r_type == RELOC_PC10 || (r)->r_type == RELOC_PC22)
@


1.10
log
@Define Global Offset Table range.
@
text
@d30 1
a30 1
 *	$Id: md.h,v 1.9 1994/02/10 21:21:28 pk Exp $
d121 2
@


1.9
log
@Define an adjustment for {TEXT,DAT}_ADDRs.
Hide some things from rtld with #ifdef RTLD.
@
text
@d30 1
a30 1
 *	$Id$
d108 8
@


1.8
log
@Fix spelling error in Copyright notice
@
text
@d30 1
a30 1
 *	$Id: md.h,v 1.7 1994/01/28 21:04:18 pk Exp $
d46 7
@


1.7
log
@Like others, allow for SunOS .o files.
@
text
@d17 1
a17 1
 *    derived from this software withough specific prior written permission
d30 1
a30 1
 *	$Id: md.h,v 1.6 1993/12/08 10:29:04 pk Exp $
@


1.6
log
@Small nits.
@
text
@d30 1
a30 1
 *	$Id$
d63 4
d146 6
a151 6
#define md_swapin_link_dynamic(l)
#define md_swapout_link_dynamic(l)
#define md_swapin_link_dynamic_2(l)
#define md_swapout_link_dynamic_2(l)
#define md_swapin_ld_debug(d)
#define md_swapout_ld_debug(d)
d154 2
a155 2
#define md_swapin_link_object(l,n)
#define md_swapout_link_object(l,n)
d175 17
a191 17
#define md_swapin_symbols(s,n)		swap_symbols(s,n)
#define md_swapout_symbols(s,n)		swap_symbols(s,n)
#define md_swapin_zsymbols(s,n)		swap_zsymbols(s,n)
#define md_swapout_zsymbols(s,n)	swap_zsymbols(s,n)
#define md_swapin_link_dynamic(l)	swap_link_dynamic(l)
#define md_swapout_link_dynamic(l)	swap_link_dynamic(l)
#define md_swapin_link_dynamic_2(l)	swap_link_dynamic_2(l)
#define md_swapout_link_dynamic_2(l)	swap_link_dynamic_2(l)
#define md_swapin_ld_debug(d)		swap_ld_debug(d)
#define md_swapout_ld_debug(d)		swap_ld_debug(d)
#define md_swapin_rrs_hash(f,n)		swap_rrs_hash(f,n)
#define md_swapout_rrs_hash(f,n)	swap_rrs_hash(f,n)
#define md_swapin_link_object(l,n)	swapin_link_object(l,n)
#define md_swapout_link_object(l,n)	swapout_link_object(l,n)
#define md_swapout_got(g,n)		swap_longs((long*)(g),n)
#define md_swapin_ranlib_hdr(h,n)	swap_ranlib_hdr(h,n)
#define md_swapout_ranlib_hdr(h,n)	swap_ranlib_hdr(h,n)
@


1.5
log
@Call breakpoint `BPT' in stead of `TRAP'.
@
text
@d30 1
a30 1
 *	$Id: md.h,v 1.4 1993/11/10 21:46:06 pk Exp $
d125 1
a125 1
#define BPT	0x91d02001	/* breakpoint: `ta 0x1' */
@


1.4
log
@Added function `md_set_breakpoint()'.
Define for TRAP. NOTE: THIS IS DEFINED AS `ta 1'!. This may need to be
changed for NetBSD.
@
text
@d30 1
a30 1
 *	$Id: md.h,v 1.3 1993/10/24 00:48:20 pk Exp $
d125 1
a125 1
#define TRAP	0x91d02001	/* ta 0x1 */
@


1.3
log
@Use MID_MACHINE.
#ifdef NetBSD in stead of #ifdef sun
@
text
@d30 1
a30 1
 *	$Id: md.h,v 1.2 1993/10/19 21:42:38 pk Exp $
d125 1
@


1.2
log
@Make better distinction between SunOS and BSD.
@
text
@d30 1
a30 1
 *	$Id$
d40 1
a40 1
#ifdef BSD
a41 1
#endif
d43 6
a48 1
#ifdef sun
a49 1

d61 1
a61 1
#endif /* sun */
@


1.1
log
@A linker supporting shared libraries (sparc dependent code).
@
text
@d2 29
a30 1
 * $Id$		- SPARC machine dependent definitions
d33 6
d40 2
a41 1
#ifdef sun
d44 2
a45 1
#define	MAX_ALIGNMENT	(sizeof (double))
a46 1
#ifndef EX_DYNAMIC
d48 2
a49 1
#endif
d55 4
a58 2
#define N_IS_DYNAMIC(ex)	((ex).a_dynamic)

a60 3
#undef relocation_info
#define relocation_info	                reloc_info_sparc
#define r_symbolnum			r_index
d62 3
a64 3
#define RELOC_EXTERN_P(r)               ((r)->r_extern)
#define RELOC_TYPE(r)                   ((r)->r_index)
#define RELOC_SYMBOL(r)                 ((r)->r_index)
d67 1
d77 4
a80 4
#define RELOC_VALUE_RIGHTSHIFT(r)       (reloc_target_rightshift[(r)->r_type])
#define RELOC_TARGET_SIZE(r)            (reloc_target_size[(r)->r_type])
#define RELOC_TARGET_BITPOS(r)          0
#define RELOC_TARGET_BITSIZE(r)         (reloc_target_bitsize[(r)->r_type])
a106 6
/*
int reloc_target_rightshift[];
int reloc_target_size[];
int reloc_target_bitsize[];
*/

a107 1
#define GOT_ENTRY_SIZE	4
@
