a.out file data structure

Guy Harris guy at auspex.UUCP
Fri Jan 27 19:14:24 AEST 1989


>I am interested in finding out what the data structure is in the a.out
>file that has been dynamically linked between the end of procedure 
>instructions in the text segment and the recognized end as reflected in 
>the value of _etext symbol.

"Dynamically linked".  Are you, perhaps, referring to SunOS 4.0 dynamic
linking?  If so, you should have said so, because not all readers would
necessarily have been able to infer that....

>I have examined both the a.out.h and exec.h include files along with
>the man entries for ld, and a.out. None seem to indicate what is the
>data that resides there.

Well, if you *are* referring to SunOS 4.0 dynamic linking, "exec.h"
won't help you; the kernel doesn't know beans about SunOS 4.0 shared
libraries.  "a.out.h" probably won't help you either, for much the same
reason.  The data structures used by the run-time loader are, from the
point of view of "exec", just stuff that's part of the data to be loaded
from the executable image (I don't remember whether it's part of the
"text segment", part of the "data segment", or both); it can't
distinguish between those data structures and code or initialized data.

>My initial guess is that it is some sort of initialization data for the 
>dynamic loader to inform it as to locations where libraries can be loaded.
>Is this true?

Again, if it's SunOS 4.0, and "locations where libraries can be loaded"
refers to addresses in the process's address space where the text and
data from the shared library can be placed, this is definitely *not*
true - the run-time loader doesn't choose where to place shared
libraries, it just tells the kernel "put this where you think it should
go" and the kernel tells the run-time loader where they were put.  (See
MMAP(2).)

Unfortunately, there is at present no documentation on the data
structures used by the run-time loader.



More information about the Comp.unix.questions mailing list