rtld_machdep.h revision 115396
165832Snyan/*-
265832Snyan * Copyright (c) 1999, 2000 John D. Polstra.
365832Snyan * All rights reserved.
465832Snyan *
565832Snyan * Redistribution and use in source and binary forms, with or without
665832Snyan * modification, are permitted provided that the following conditions
765832Snyan * are met:
865832Snyan * 1. Redistributions of source code must retain the above copyright
965832Snyan *    notice, this list of conditions and the following disclaimer.
1065832Snyan * 2. Redistributions in binary form must reproduce the above copyright
1165832Snyan *    notice, this list of conditions and the following disclaimer in the
1265832Snyan *    documentation and/or other materials provided with the distribution.
1365832Snyan *
1465832Snyan * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1565832Snyan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1665832Snyan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1765832Snyan * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1865832Snyan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1965832Snyan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2065832Snyan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2165832Snyan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2265832Snyan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2365832Snyan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2465832Snyan * SUCH DAMAGE.
2565832Snyan *
2665832Snyan * $FreeBSD: head/libexec/rtld-elf/powerpc/rtld_machdep.h 115396 2003-05-29 22:58:26Z kan $
2765832Snyan */
2865832Snyan
2965832Snyan#ifndef RTLD_MACHDEP_H
3065832Snyan#define RTLD_MACHDEP_H	1
3165832Snyan
3265832Snyan#include <sys/types.h>
3365832Snyan#include <machine/atomic.h>
3465832Snyan
3565832Snyan#define CACHE_LINE_SIZE	  32
3665832Snyan
3765832Snyanstruct Struct_Obj_Entry;
3865832Snyan
3965832Snyan/* Return the address of the .dynamic section in the dynamic linker. */
4065832Snyan#define rtld_dynamic(obj)    (&_DYNAMIC)
4165832Snyan
4265832SnyanElf_Addr reloc_jmpslot(Elf_Addr *where, Elf_Addr target,
4365832Snyan		       const struct Struct_Obj_Entry *defobj,
4465832Snyan		       const struct Struct_Obj_Entry *obj,
4565832Snyan		       const Elf_Rel *rel);
4665832Snyan
4765832Snyan#define make_function_pointer(def, defobj) \
4865832Snyan	((defobj)->relocbase + (def)->st_value)
4965832Snyan
5065832Snyan#define call_initfini_pointer(obj, target) \
5165832Snyan	(((InitFunc)(target))())
5267442Snyan
5367442Snyan/*
5465832Snyan * Lazy binding entry point, called via PLT.
5565832Snyan */
5665832Snyanvoid _rtld_bind_start(void);
5765832Snyan
5865832Snyan/*
5965832Snyan * PLT functions. Not really correct prototypes, but the
6065832Snyan * symbol values are needed.
6165832Snyan */
6265832Snyanvoid _rtld_powerpc_pltresolve(void);
6365832Snyanvoid _rtld_powerpc_pltcall(void);
6465832Snyan
6565832Snyan#endif
6665832Snyan