home *** CD-ROM | disk | FTP | other *** search
- [[ Note: This text-only version of the manual was produced by hand from
- the Impression version. It is therefore likely that there are lots of
- infelicities in the formatting; in particular, font changes have been
- lost. If a sentence doesn’t seem to make any sense, see whether it’s
- any better if you pretend some of the words in it are in italics. :-) ]]
-
- User manual for makeALF
- =======================
-
-
- This is the user manual for makeALF, a program which creates a library file
- from a number of object files. It’s very short.
-
-
- Legal rubbish
- -------------
-
- These programs (makeALF and the smaller utilities included with it) are not
- public domain; they are mine. The same applies to this documentation. You
- don’t have to pay for it, and you may distribute it freely. You may not, however,
- (1) distribute modified copies, or (2) make money from it in any way.
- You may, of course, modify your own copy. If you think your modifications are
- improvements, get in touch with me and tell me more...
-
- About library files
- -------------------
-
- A library file is a file containing several object files, together with
- information about what symbols are defined in what files (so that your linker
- can read the right bits of the file). The Shared C Library is not in this sense
- a library file, by the way. There is a special format for library files, called
- ALF for “Acorn Library Format”.
-
- Why use library files? Because it saves effort when linking programs (or, if you
- use makefiles, when writing makefiles). Instead of linking with 500 different
- object files, you just use the name of your library and let the linker work out
- which bits it needs. This doesn’t result in the entire contents of the library
- being duplicated in your program; the effect is just as if you had linked with
- each of the individual object files needed.
-
- If you want more information about library files (for instance, about the exact
- file format used), look in the PRMs. Or mail me.
-
-
- About makeALF
- -------------
-
- This is a simple program which produces library files. You just give it a list
- of filenames, which should be names of object files (I am not answerable for
- the consequences if they are names of non-object files, but there’s no problem
- if one of the files doesn’t exist at all), and the name of the file it should
- create, and it does its nefarious work. The object filenames can be wildcarded,
- but if a filename begins with a hash then it will be ignored, for resaons that
- will be obvious when you've read the next section.
-
- If there are a lot of object files needing to be put into a library, you can
- instead put a list of their names into a file, and tell makeALF the name of that
- file.
-
- To be a bit more precise: the syntax is
- makeALF [-q] [-s] [-m maxfiles] [-i inputfile] [object1 ...] [-o outputfile]
- and, as is usual with these things, you can put the bracketed elements in any
- order. The -q is used to suppress some friendly output from makeALF which you
- might not want cluttering up your screen, and the -s to warn makeALF that you
- might be using foo.o instead of o.foo .
-
- You can also say just makeALF -v, which will tell you which version of makeALF
- you’re running. This version of the manual describes version 1.05.
-
-
- Input files
- -----------
-
- If you give the -i inputfile option, the file should contain a list of object
- files, one per line. Actually you can have blank lines (meaning, lines
- containing only whitespace), which are ignored; and comment lines, meaning lines
- whose first non-whitespace character is a hash ‘#’. Also, if a line contains
- non-whitespace followed by whitespace, everything from that whitespace onwards
- is ignored; so you can have a comment on the same line as a filename. I advise
- you to begin such comments with a hash.
-
- You can in fact give as many input files as you like; the effect is as if the
- filenames in each were spliced into the input line in place of the input file
- specification. (But you need a separate -i for each input file.)
-
-
- Other things
- ------------
-
- Unless told not to with the -q option, makeALF will tell you what it’s doing
- as it goes along. Its operation is divided into three phases: first it reads
- some information about each input file, then it copies the actual data from
- the input files to the output file, and finally it builds the symbol table of
- the output file.
-
- If you give the -s option, makeALF will transform any filename you give it
- ending in .o into one with o. just before the leafname; this can be useful
- if you’re porting programs from other systems.
-
- There are a few arbitrary limitations.
-
- - Lines in input files (that’s input files containing lists of object
- files, rather than the object files themselves) must be no more than
- 254 characters (I think it is) long. Since they can contain only one
- object filename per line, this isn’t likely to be a big problem.
- - And if the chunk file header of any of your object files is bigger than
- 4k (which will only happen if the file contains a really huge number of
- areas; I’d be willing to place a large bet on its never happening
- except through malice) you’ll need to change the function
- process_symbol_table.
-
- If you don’t give an output file name, output is to a file named alf.
-
-
- A few other useful utilities
- ----------------------------
-
- Along with makeALF I’m enclosing four other utilities that are likely to prove
- helpful in working with library files (and, indeed, with object files). I make
- no guarantees of their robustness.
-
- Two of them are specifically for library files. ALFdir displays the contents of
- a library file’s directory; each line contains the chunk number of one of its
- component files, its filename, and its datestamp. (It’s possible that you may
- have an “old-style” library, as created by Acorn’s Fortran-77 compiler and just
- about nothing else; for these the datestamps will be garbage.) ALFsymt displays
- a library’s symbol table; each line contains a symbol name (second column) and
- the chunk number of the component file which defines that symbol (first column).
-
- A library file is a special kind of chunk file. The other two little programs
- are for dealing with chunk files generally. ChunkList lists all the chunks in
- a chunk file, with their chunk identifiers, positions and sizes. (For a library
- file, most of the chunks will be called LIB_DATA.) More usefully, ChunkRead
- will extract a single chunk from a chunk file. This is useful if, for instance,
- you want to do something with a single object file from a library. It takes 3
- arguments: the name of the chunk file, the chunk number and the name of the
- file its output should go to.
-
-
- About me
- --------
-
- You might want to get in touch with me, maybe to let me know of improvements
- you’ve made or to tell me what a pile of rubbish this software is. Or maybe to
- send me huge sums of money in gratitude for makeALF. Hmmm.
-
- Anyway, here are an e-mail and a snail-mail address for me. Both are valid as of
- December 1996, and both are likely to remain valid for quite some time.
-
- e-mail: gjm11@dpmms.cam.ac.uk
-
- snail-mail: Gareth McCaughan
- Peterhouse
- Cambridge CB2 1RD
- England
-
-
- Another program you might want
- ------------------------------
-
- I have a slightly flaky program which reads object files and displays their
- contents, disassembling as it goes, dealing with relocations and so on. I find
- it invaluable. If you want a copy, let me know. (It’s free too.)
-
-
- Acknowledgements
- ----------------
-
- The change from version 1.02 to version 1.03 (which introduced wildcards and
- made the program somewhat faster) was provoked by Nick Burrett, who sent me
- some suggested changes. I haven’t actually used any of his code (not because
- there’s anything wrong with it, but because I have a neurotic preference for
- writing my own!) but the ideas are his. Any bugs are, of course, mine.
-