xref: /openbsd-src/sys/arch/powerpc/include/reloc.h (revision 2fa72412907ae78c4787a4a8f888c5f0486e225c)
1*2fa72412Spirofti /*	$OpenBSD: reloc.h,v 1.4 2011/03/23 16:54:36 pirofti Exp $	*/
247bc79e1Srahnds /*	$NetBSD: reloc.h,v 1.1 1996/09/30 16:34:33 ws Exp $	*/
347bc79e1Srahnds 
447bc79e1Srahnds /*-
547bc79e1Srahnds  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
647bc79e1Srahnds  * Copyright (C) 1995, 1996 TooLs GmbH.
747bc79e1Srahnds  * All rights reserved.
847bc79e1Srahnds  *
947bc79e1Srahnds  * Redistribution and use in source and binary forms, with or without
1047bc79e1Srahnds  * modification, are permitted provided that the following conditions
1147bc79e1Srahnds  * are met:
1247bc79e1Srahnds  * 1. Redistributions of source code must retain the above copyright
1347bc79e1Srahnds  *    notice, this list of conditions and the following disclaimer.
1447bc79e1Srahnds  * 2. Redistributions in binary form must reproduce the above copyright
1547bc79e1Srahnds  *    notice, this list of conditions and the following disclaimer in the
1647bc79e1Srahnds  *    documentation and/or other materials provided with the distribution.
1747bc79e1Srahnds  * 3. All advertising materials mentioning features or use of this software
1847bc79e1Srahnds  *    must display the following acknowledgement:
1947bc79e1Srahnds  *	This product includes software developed by TooLs GmbH.
2047bc79e1Srahnds  * 4. The name of TooLs GmbH may not be used to endorse or promote products
2147bc79e1Srahnds  *    derived from this software without specific prior written permission.
2247bc79e1Srahnds  *
2347bc79e1Srahnds  * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR
2447bc79e1Srahnds  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
2547bc79e1Srahnds  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
2647bc79e1Srahnds  * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2747bc79e1Srahnds  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2847bc79e1Srahnds  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
2947bc79e1Srahnds  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
3047bc79e1Srahnds  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
3147bc79e1Srahnds  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
3247bc79e1Srahnds  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3347bc79e1Srahnds  */
34*2fa72412Spirofti #ifndef	_POWERPC_RELOC_H_
35*2fa72412Spirofti #define	_POWERPC_RELOC_H_
3647bc79e1Srahnds 
3747bc79e1Srahnds /*
3847bc79e1Srahnds  * Quite a number of relocation types
3947bc79e1Srahnds  */
4047bc79e1Srahnds enum reloc_type {
4147bc79e1Srahnds 	RELOC_NONE,
4247bc79e1Srahnds 	RELOC_32,
4347bc79e1Srahnds 	RELOC_24,
4447bc79e1Srahnds 	RELOC_16,
4547bc79e1Srahnds 	RELOC_16_LO,
4647bc79e1Srahnds 	RELOC_16_HI,	/* RELOC_ADDIS = 5 */
4747bc79e1Srahnds 	RELOC_16_HA,
4847bc79e1Srahnds 	RELOC_14,
4947bc79e1Srahnds 	RELOC_14_TAKEN,
5047bc79e1Srahnds 	RELOC_14_NTAKEN,
5147bc79e1Srahnds 	RELOC_REL24,	/* RELOC_BRANCH = 10 */
5247bc79e1Srahnds 	RELOC_REL14,
5347bc79e1Srahnds 	RELOC_REL14_TAKEN,
5447bc79e1Srahnds 	RELOC_REL14_NTAKEN,
5547bc79e1Srahnds 	RELOC_GOT16,
5647bc79e1Srahnds 	RELOC_GOT16_LO,
5747bc79e1Srahnds 	RELOC_GOT16_HI,
5847bc79e1Srahnds 	RELOC_GOT16_HA,
5947bc79e1Srahnds 	RELOC_PLT24,
6047bc79e1Srahnds 	RELOC_COPY,
6147bc79e1Srahnds 	RELOC_GLOB_DAT,
6247bc79e1Srahnds 	RELOC_JMP_SLOT,
6347bc79e1Srahnds 	RELOC_RELATIVE,
6447bc79e1Srahnds 	RELOC_LOCAL24PC,
6547bc79e1Srahnds 	RELOC_U32,
6647bc79e1Srahnds 	RELOC_U16,
6747bc79e1Srahnds 	RELOC_REL32,
6847bc79e1Srahnds 	RELOC_PLT32,
6947bc79e1Srahnds 	RELOC_PLTREL32,
7047bc79e1Srahnds 	RELOC_PLT16_LO,
7147bc79e1Srahnds 	RELOC_PLT16_HI,
7247bc79e1Srahnds 	RELOC_PLT16_HA,
7347bc79e1Srahnds     /* ABI defines this as 32nd entry, but we ignore this, at least for now */
7447bc79e1Srahnds 	RELOC_SDAREL,
755779dc49Sguenther 
765779dc49Sguenther 	RELOC_TLSC = 67,
775779dc49Sguenther 	RELOC_DTPMOD32,
785779dc49Sguenther 	RELOC_TPREL16,
795779dc49Sguenther 	RELOC_TPREL16_LO,
805779dc49Sguenther 	RELOC_TPREL16_HI,
815779dc49Sguenther 	RELOC_TPREL16_HA,
825779dc49Sguenther 	RELOC_TPREL32,
835779dc49Sguenther 	RELOC_DTPREL16,
845779dc49Sguenther 	RELOC_DTPREL16_LO,
855779dc49Sguenther 	RELOC_DTPREL16_HI,
865779dc49Sguenther 	RELOC_DTPREL16_HA,
875779dc49Sguenther 	RELOC_DTPREL32,
8847bc79e1Srahnds 	RELOC_MAX
8947bc79e1Srahnds };
9047bc79e1Srahnds 
91*2fa72412Spirofti #endif	/* _POWERPC_RELOC_H_ */
92