* ldlex.l, ldgram.y: Support new -oformat option.

Remove attempt at supporting script fragments on the command line.
	* ldlang.c (lang_add_output_format): Take new arg, FROM_SCRIPT.
	* mri.c (mri_format), ldgram.y: Change callers.
	* ldlang.h: Change prototype.
This commit is contained in:
David MacKenzie
1993-06-22 17:41:28 +00:00
parent 9ddfb9eb20
commit 346535cc1f
2 changed files with 39 additions and 40 deletions

46
ld/ld.1
View File

@ -69,6 +69,9 @@ ld \- the GNU linker
\&\|] \&\|]
.RB "[\|" \-n | \-N "\|]" .RB "[\|" \-n | \-N "\|]"
.RB "[\|" \-noinhibit-exec "\|]" .RB "[\|" \-noinhibit-exec "\|]"
.RB "[\|" "\-oformat\ "\c
.I output-format\c
\&\|]
.RB "[\|" "\-R\ "\c .RB "[\|" "\-R\ "\c
.I filename\c .I filename\c
\&\|] \&\|]
@ -96,9 +99,6 @@ ld \- the GNU linker
.RB "[\|" \-v "\|]" .RB "[\|" \-v "\|]"
.RB "[\|" \-X "\|]" .RB "[\|" \-X "\|]"
.RB "[\|" \-x "\|]" .RB "[\|" \-x "\|]"
.RB "[\|" { \c
.I script\c
.BR } "\|]"
.ad b .ad b
.hy 1 .hy 1
.SH DESCRIPTION .SH DESCRIPTION
@ -317,7 +317,8 @@ name of a particular format supported by the BFD libraries.
.B \-format \c .B \-format \c
.I input-format\c .I input-format\c
\&\c \&\c
\& has the same effect. \& has the same effect, as does the script command
.BR TARGET .
You may want to use this option if you are linking files with an unusual You may want to use this option if you are linking files with an unusual
binary format. You can also use \c binary format. You can also use \c
@ -586,6 +587,22 @@ script command \c
.B OUTPUT\c .B OUTPUT\c
\& can also specify the output file name. \& can also specify the output file name.
.TP
.BI "-oformat " "output-format"\c
\&
Specify the binary format for the output object file.
You don't usually need to specify this, as
\c
.B ld\c
\& is configured to produce as a default output format the most
usual format on each machine. \c
.I output-format\c
\& is a text string, the
name of a particular format supported by the BFD libraries.
The script command
.B OUTPUT_FORMAT
can also specify the output format, but this option overrides it.
.TP .TP
.BI "-R " "filename"\c .BI "-R " "filename"\c
\& \&
@ -645,27 +662,6 @@ Omits debugger symbol information (but not all symbols) from the output file.
.B \-s .B \-s
Omits all symbol information from the output file. Omits all symbol information from the output file.
.TP
.BI "{ " "script" " }"
You can, if you wish, include a script of linker commands directly in
the command line instead of referring to it via an input file. When the
character `\|\c
.B {\c
\|' occurs on the command line, the linker switches to
interpreting the command language until the end of the list of commands
is reached\(em\&flagged with a closing brace `\|\c
.B }\c
\|'. Other command-line
options will not be recognized while parsing the script.
See the `\|\c
.B ld\c
\|' entry in `\|\c
.B info\c
\|', or the manual
.I
ld: the GNU linker
\&, for a description of the command language.
.TP .TP
.BI "-Tbss " "org"\c .BI "-Tbss " "org"\c
.TP .TP

View File

@ -171,10 +171,11 @@ ld [-o @var{output} ] @var{objfile}@dots{}
[ -format @var{input-format} ] [ -g ] [ -G @var{size} ] [ -i ] [ -format @var{input-format} ] [ -g ] [ -G @var{size} ] [ -i ]
[ -l@var{ar} ] [ -L@var{searchdir} ] [ -M ] [ -Map @var{mapfile} ] [ -l@var{ar} ] [ -L@var{searchdir} ] [ -M ] [ -Map @var{mapfile} ]
[ -m @var{emulation} ] [ -N | -n ] [ -noinhibit-exec ] [ -m @var{emulation} ] [ -N | -n ] [ -noinhibit-exec ]
[ -R @var{filename} ] [ -relax ] [ -r | -Ur ] [ -S ] [ -s ] [ -oformat @var{output-format} ] [ -R @var{filename} ] [ -relax ]
[ -T @var{commandfile} ] [ -Ttext @var{textorg} ] [ -Tdata @var{dataorg} ] [ -r | -Ur ] [ -S ] [ -s ] [ -T @var{commandfile} ]
[ -Ttext @var{textorg} ] [ -Tdata @var{dataorg} ]
[ -Tbss @var{bssorg} ] [ -t ] [ -u @var{sym}] [-V] [-v] [ -X ] [-x ] [ -Tbss @var{bssorg} ] [ -t ] [ -u @var{sym}] [-V] [-v] [ -X ] [-x ]
[ -y@var{symbol} ] [ @{ @var{script} @} ] [ -y@var{symbol} ]
@end smallexample @end smallexample
This plethora of command-line options may seem intimidating, but in This plethora of command-line options may seem intimidating, but in
@ -255,7 +256,9 @@ on the command line. You don't usually need to specify this, as
@code{ld} is configured to expect as a default input format the most @code{ld} is configured to expect as a default input format the most
usual format on each machine. @var{input-format} is a text string, the usual format on each machine. @var{input-format} is a text string, the
name of a particular format supported by the BFD libraries. name of a particular format supported by the BFD libraries.
@w{@samp{-format @var{input-format}}} has the same effect. @xref{BFD}. (You can list the available binary formats with @samp{objdump -i}.)
@w{@samp{-format @var{input-format}}} has the same effect, as does the
script command @code{TARGET}. @xref{BFD}.
You may want to use this option if you are linking files with an unusual You may want to use this option if you are linking files with an unusual
binary format. You can also use @samp{-b} to switch formats explicitly (when binary format. You can also use @samp{-b} to switch formats explicitly (when
@ -436,6 +439,17 @@ Use @var{output} as the name for the program produced by @code{ld}; if this
option is not specified, the name @file{a.out} is used by default. The option is not specified, the name @file{a.out} is used by default. The
script command @code{OUTPUT} can also specify the output file name. script command @code{OUTPUT} can also specify the output file name.
@kindex -oformat
@item -oformat @var{output-format}
Specify the binary format for the output object file. You don't usually
need to specify this, as @code{ld} is configured to produce as a default
output format the most usual format on each machine.
@var{output-format} is a text string, the name of a particular format
supported by the BFD libraries. (You can list the available binary
formats with @samp{objdump -i}.) The script command
@code{OUTPUT_FORMAT} can also specify the output format, but this option
overrides it. @xref{BFD}.
@item -R @var{filename} @item -R @var{filename}
@kindex -R @var{file} @kindex -R @var{file}
@cindex symbol-only input @cindex symbol-only input
@ -488,17 +502,6 @@ Omit debugger symbol information (but not all symbols) from the output file.
@cindex strip all symbols @cindex strip all symbols
Omit all symbol information from the output file. Omit all symbol information from the output file.
@item @{ @var{script} @}
@kindex @{ @var{script} @}
@cindex scripts on command line
You can, if you wish, include a script of linker commands directly in
the command line instead of referring to it via an input file. When the
character @samp{@{} occurs on the command line, the linker switches to
interpreting the command language until the end of the list of commands
is reached; the end is indicated with a closing brace @samp{@}}.
@code{ld} does not recognize other command-line options while parsing
the script. @xref{Commands}, for a description of the command language.
@item -Tbss @var{bssorg} @item -Tbss @var{bssorg}
@kindex -Tbss @var{bssorg} @kindex -Tbss @var{bssorg}
@itemx -Tdata @var{dataorg} @itemx -Tdata @var{dataorg}