From owner-freebsd-hackers Mon Dec 6 11:26:52 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from bingnet2.cc.binghamton.edu (bingnet2.cc.binghamton.edu [128.226.1.18]) by hub.freebsd.org (Postfix) with ESMTP id 7C49614C93; Mon, 6 Dec 1999 11:26:29 -0800 (PST) (envelope-from zzhang@cs.binghamton.edu) Received: from sol.cs.binghamton.edu (cs1-gw.cs.binghamton.edu [128.226.171.72]) by bingnet2.cc.binghamton.edu (8.9.3/8.9.3) with SMTP id OAA10187; Mon, 6 Dec 1999 14:26:20 -0500 (EST) Date: Mon, 6 Dec 1999 13:13:18 -0500 (EST) From: Zhihui Zhang To: freebsd-hackers@freebsd.org, freebsd-fs@freebsd.org Subject: ELF & putting inode at the front of a file Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I have modified FFS filesystem code to put the disk inode at the beginning of a file, i.e, the logical block #0 of each file begins with 128 bytes of its disk inode and the rest of it are file data. Everything seems to be working. But I am stuck with an ELF executable file stored in this layout - I can not run it. The kernel uses memory map to read the ELF file and assumes that the file data begins at offset 0. I have looked at the files kern_exec.c and imgact_elf.c trying to adjust the header pointers by an offset of 128 bytes to at least let the kernel recognize that it is an ELF file. But still I got messages like "too few PT_LOAD segments". Obviously, I need to modify the kernel files elsewhere, perhaps those under directory contrib/rtld-elf/*, which I have never read before. My questions are: (1) What consequences will my file layout affect the load and execution of an ELF file? Do I have to adjust the virtual addresses in the ELF object file as well? (2) If I modify any files under contrib/rtld-elf, how to make the modifications take effect. Is that as simple as "make" and followed by "make install". I am new to these kernel stuff. Any help or hints are very appreciated. -Zhihui To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message