eld Manual

Table Of Contents
Introduction to eld
eld Manual527255-009
1-7
Obey Files and the Use of Standard Input
If no tokens are given to the linker in its command stream then the linker writes out
messages to the output listing to give a one-line summary of each of the available
options and does nothing else.
If some tokens are given, and based on these tokens the linker should create a new
object file from one or more linkfiles, but no linkfiles are brought into the link, eld
reports an error.
Obey Files and the Use of Standard Input
The -obey option lets the user put tokens into a file that is read by the linker. This file
is a text file, and must be either a file code 101, or a code 180 file. The parameter to
the -obey option is the name of the file, and anything that could be given on the linker
command line is permissible in that file. In simple cases the contents of the file are
treated the same as if they were on the command line, in the place of the -obey
option. White space in the obey file, including ends of lines, serves to separate tokens.
Within obey files, if a token begins with two consecutive hyphens, those hyphens and
the rest of the line are treated as a comment (ignored).
There is also a special rule with regard to (double) quotation marks within obey files.
The special rule only applies to a quotation mark that comes at the beginning of a
token, i.e., it is either the first character in the obey file or it follows white space. In this
case, if it is the last quotation mark on that line, eld reports an error. Otherwise, the
characters between it and the next quotation mark are considered to be a single token,
even if they include white space. The linker will then start looking for the next token
immediately after the second quotation mark. For example, if a line in an obey file
contains the following:
-o “abc -def”ghi
then the linker will consider this to contain three tokens, namely, “-o”, “abc -def”, and
“ghi”. Note that there is a space between the ‘c’ and the ‘-’, and that the name of the
output file created by the linker is “abc -def”. On some platforms this will work, and on
other platforms it won’t. Also note that no space is required between the second
quotation mark and the ‘g’. As another example, if a line in an obey file contains the
following:
-o abc“d e”f
then this contains two tokens after the -o, where the first token is abc”d and the
second one is e”f. The quotation marks do not fall under the special rule here, because
they are not at the beginnings of tokens. Thus, the space between the d and e serves
to separate tokens.
Note that the above examples show that it is possible to put a space in the middle of a
token, and that it is possible to put a quotation mark in the middle of a token, but it is
not possible to have both of these things in the same token.
There can be multiple -obey options on the command line, each being processed as
explained above. There can be -obey options within obey files, with no limit on the