From owner-cvs-all Sun Apr 21 14:28: 0 2002 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 37D1C37B41B; Sun, 21 Apr 2002 14:27:57 -0700 (PDT) Received: (from marcel@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g3LLRvP70026; Sun, 21 Apr 2002 14:27:57 -0700 (PDT) (envelope-from marcel) Message-Id: <200204212127.g3LLRvP70026@freefall.freebsd.org> From: Marcel Moolenaar Date: Sun, 21 Apr 2002 14:27:57 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/ia64/ia64 elf_machdep.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG marcel 2002/04/21 14:27:57 PDT Modified files: sys/ia64/ia64 elf_machdep.c Log: Implement elf_reloc(). The RT specification says that we can expect both Elf_Rel and Elf_Rela types of relocation, so handle them both even though we only have Rel_Rela ATM. We don't handle 32-bit and big-endian variants yet. Support for that is not trivial enough to implement it without any evidence that we ever need it in the near future. For the FPTR relocations, we currently use the fptr_storage used by _reloc() is locore.s. This is in no way a real solution, but for now provides the service we need to get the basics going. A static recursive function lookup_fdesc() is used to find the address of a function in a way that keeps track of the load module so that we can get the correct GP value if we need to construct an OPD (ie there's no OPD yet for the function. For simplicity, we create an OPD for the IPLT relocations as well and simply fill the user provided function descriptor from the OPD. Since the the official descriptors are unique, this has no bad side effects. Note that we ignore the addend for FPTR relocations, but use the addend for IPLT relocations as an offset to the function address. This commit allows us to load and relocate modules and modules appear to work correctly, although we probably need to make sure that we set GP correctly in all cases when we have inter-module calls. This especially applies to assembly coded functions that have cross module calls. Revision Changes Path 1.3 +99 -11 src/sys/ia64/ia64/elf_machdep.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message