Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Dec 1999 13:13:18 -0500 (EST)
From:      Zhihui Zhang <zzhang@cs.binghamton.edu>
To:        freebsd-hackers@freebsd.org, freebsd-fs@freebsd.org
Subject:   ELF & putting inode at the front of a file
Message-ID:  <Pine.GSO.3.96.991206125504.23212A-100000@sol.cs.binghamton.edu>

next in thread | raw e-mail | index | archive | help

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-fs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.3.96.991206125504.23212A-100000>