* ld.texinfo, ld.1: Document -Bstatic, -Bdynamic, -Bshared, and
-shared. Mon Jul 10 13:29:43 1995 Eric Youngdale <eric@aib.com> * ldmain.c (main): Set link_info.symbolic to false. * lexsup.c (parse_args): Handle -Bsymbolic.
This commit is contained in:
parent
951fe66d62
commit
4551e108a0
5 changed files with 86 additions and 11 deletions
10
ld/ChangeLog
10
ld/ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
Mon Jul 10 13:38:28 1995 Ian Lance Taylor <ian@cygnus.com>
|
||||||
|
|
||||||
|
* ld.texinfo, ld.1: Document -Bstatic, -Bdynamic, -Bshared, and
|
||||||
|
-shared.
|
||||||
|
|
||||||
|
Mon Jul 10 13:29:43 1995 Eric Youngdale <eric@aib.com>
|
||||||
|
|
||||||
|
* ldmain.c (main): Set link_info.symbolic to false.
|
||||||
|
* lexsup.c (parse_args): Handle -Bsymbolic.
|
||||||
|
|
||||||
Wed Jul 5 00:12:11 1995 Fred Fish (fnf@cygnus.com)
|
Wed Jul 5 00:12:11 1995 Fred Fish (fnf@cygnus.com)
|
||||||
|
|
||||||
* ldmain.c (HAVE_SBRK): Define for everything except
|
* ldmain.c (HAVE_SBRK): Define for everything except
|
||||||
|
|
28
ld/ld.1
28
ld/ld.1
|
@ -28,6 +28,8 @@ ld \- the GNU linker
|
||||||
.I input-format\c
|
.I input-format\c
|
||||||
\&\|]
|
\&\|]
|
||||||
.RB "[\|" \-Bstatic "\|]"
|
.RB "[\|" \-Bstatic "\|]"
|
||||||
|
.RB "[\|" \-Bdynamic "\|]"
|
||||||
|
.RB "[\|" \-Bsymbolic "\|]"
|
||||||
.RB "[\|" "\-c\ "\c
|
.RB "[\|" "\-c\ "\c
|
||||||
.I commandfile\c
|
.I commandfile\c
|
||||||
\&\|]
|
\&\|]
|
||||||
|
@ -82,6 +84,7 @@ ld \- the GNU linker
|
||||||
.RB "[\|" \-r | \-Ur "\|]"
|
.RB "[\|" \-r | \-Ur "\|]"
|
||||||
.RB "[\|" \-S "\|]"
|
.RB "[\|" \-S "\|]"
|
||||||
.RB "[\|" \-s "\|]"
|
.RB "[\|" \-s "\|]"
|
||||||
|
.RB "[\|" \-shared "\|]"
|
||||||
.RB "[\|" \-sort\-common "\|]"
|
.RB "[\|" \-sort\-common "\|]"
|
||||||
.RB "[\|" \-split\-by\-reloc\ "\c
|
.RB "[\|" \-split\-by\-reloc\ "\c
|
||||||
.I count\c
|
.I count\c
|
||||||
|
@ -354,10 +357,22 @@ format from a script, using the command \c
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-Bstatic
|
.B \-Bstatic
|
||||||
This flag is accepted for command-line compatibility with the SunOS linker,
|
Do not link against shared libraries. This is only meaningful on
|
||||||
but has no effect on \c
|
platforms for which shared libraries are supported.
|
||||||
.B ld\c
|
|
||||||
\&.
|
.TP
|
||||||
|
.B \-Bdynamic
|
||||||
|
Link against dynamic libraries. This is only meaningful on platforms
|
||||||
|
for which shared libraries are supported. This option is normally the
|
||||||
|
default on such platforms.
|
||||||
|
|
||||||
|
.TP
|
||||||
|
.B \-Bsymbolic
|
||||||
|
When creating a shared library, bind references to global symbols to
|
||||||
|
the definition within the shared library, if any. Normally, it is
|
||||||
|
possible for a program linked against a shared library to override the
|
||||||
|
definition within the shared library. This option is only meaningful
|
||||||
|
on ELF platforms which support shared libraries.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.BI "\-c " "commandfile"\c
|
.BI "\-c " "commandfile"\c
|
||||||
|
@ -704,6 +719,11 @@ 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
|
||||||
|
.B \-shared
|
||||||
|
Create a shared library. This is currently only supported on ELF
|
||||||
|
platforms.
|
||||||
|
|
||||||
.TP
|
.TP
|
||||||
.B \-sort\-common
|
.B \-sort\-common
|
||||||
Normally, when
|
Normally, when
|
||||||
|
|
|
@ -167,7 +167,8 @@ line:
|
||||||
@c FIXME! -relax only avail h8/300, i960. Conditionals screwed in examples.
|
@c FIXME! -relax only avail h8/300, i960. Conditionals screwed in examples.
|
||||||
@smallexample
|
@smallexample
|
||||||
ld [ -o @var{output} ] @var{objfile}@dots{}
|
ld [ -o @var{output} ] @var{objfile}@dots{}
|
||||||
[ -A@var{architecture} ] [ -b @var{input-format} ] [ -Bstatic ]
|
[ -A@var{architecture} ] [ -b @var{input-format} ]
|
||||||
|
[ -Bstatic ] [ -Bdynamic ] [ -Bsymbolic ]
|
||||||
[ -c @var{MRI-commandfile} ] [ -d | -dc | -dp ]
|
[ -c @var{MRI-commandfile} ] [ -d | -dc | -dp ]
|
||||||
[ -defsym @var{symbol}=@var{expression} ]
|
[ -defsym @var{symbol}=@var{expression} ]
|
||||||
[ -dynamic-linker @var{file} ] [ -embedded-relocs ]
|
[ -dynamic-linker @var{file} ] [ -embedded-relocs ]
|
||||||
|
@ -175,16 +176,16 @@ ld [ -o @var{output} ] @var{objfile}@dots{}
|
||||||
[ -format @var{input-format} ] [ -g ] [ -G @var{size} ] [ -help ]
|
[ -format @var{input-format} ] [ -g ] [ -G @var{size} ] [ -help ]
|
||||||
[ -i ] [ -l@var{archive} ] [ -L@var{searchdir} ] [ -M ]
|
[ -i ] [ -l@var{archive} ] [ -L@var{searchdir} ] [ -M ]
|
||||||
[ -Map @var{mapfile} ] [ -m @var{emulation} ] [ -N | -n ]
|
[ -Map @var{mapfile} ] [ -m @var{emulation} ] [ -N | -n ]
|
||||||
[ -noinhibit-exec ] [ -oformat @var{output-format} ]
|
[ -noinhibit-exec ] [ -no-keep-memory ] [ -oformat @var{output-format} ]
|
||||||
[ -R @var{filename} ] [ -relax ] [ -retain-symbols-file @var{filename} ]
|
[ -R @var{filename} ] [ -relax ] [ -retain-symbols-file @var{filename} ]
|
||||||
[ -r | -Ur ] [ -rpath @var{dir} ] [ -S ] [ -s ] [ -soname @var{name} ]
|
[ -r | -Ur ] [ -rpath @var{dir} ] [ -S ] [ -s ] [ -soname @var{name} ]
|
||||||
[ -sort-common ] [ -stats ] [ -T @var{commandfile} ]
|
[ -shared ] [ -sort-common ] [ -stats ] [ -T @var{commandfile} ]
|
||||||
[ -Ttext @var{org} ] [ -Tdata @var{org} ]
|
[ -Ttext @var{org} ] [ -Tdata @var{org} ]
|
||||||
[ -Tbss @var{org} ] [ -t ] [ -traditional-format ]
|
[ -Tbss @var{org} ] [ -t ] [ -traditional-format ]
|
||||||
[ -u @var{symbol}] [-V] [-v] [ -verbose] [ -version ]
|
[ -u @var{symbol}] [-V] [-v] [ -verbose] [ -version ]
|
||||||
[ -warn-common ] [ -warn-once ] [ -y @var{symbol} ] [ -X ] [-x ]
|
[ -warn-common ] [ -warn-once ] [ -y @var{symbol} ] [ -X ] [-x ]
|
||||||
[ -( [ archives ] -) ] [ --start-group [ archives ] --end-group ]
|
[ -( [ archives ] -) ] [ --start-group [ archives ] --end-group ]
|
||||||
[ -split-by-reloc @var{count} ] [-split-by-file]
|
[ -split-by-reloc @var{count} ] [ -split-by-file ] [ --whole-archive ]
|
||||||
@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
|
||||||
|
@ -308,8 +309,22 @@ Commands}.
|
||||||
|
|
||||||
@kindex -Bstatic
|
@kindex -Bstatic
|
||||||
@item -Bstatic
|
@item -Bstatic
|
||||||
Do not link against shared libraries. This option is accepted for
|
Do not link against shared libraries. This is only meaningful on
|
||||||
command-line compatibility with the SunOS linker.
|
platforms for which shared libraries are supported.
|
||||||
|
|
||||||
|
@kindex -Bdynamic
|
||||||
|
@item -Bdynamic
|
||||||
|
Link against dynamic libraries. This is only meaningful on platforms
|
||||||
|
for which shared libraries are supported. This option is normally the
|
||||||
|
default on such platforms.
|
||||||
|
|
||||||
|
@kindex -Bsymbolic
|
||||||
|
@item -Bsymbolic
|
||||||
|
When creating a shared library, bind references to global symbols to the
|
||||||
|
definition within the shared library, if any. Normally, it is possible
|
||||||
|
for a program linked against a shared library to override the definition
|
||||||
|
within the shared library. This option is only meaningful on ELF
|
||||||
|
platforms which support shared libraries.
|
||||||
|
|
||||||
@kindex -c @var{MRI-cmdfile}
|
@kindex -c @var{MRI-cmdfile}
|
||||||
@cindex compatibility, MRI
|
@cindex compatibility, MRI
|
||||||
|
@ -488,6 +503,15 @@ Normally, the linker will not produce an output file if it encounters
|
||||||
errors during the link process; it exits without writing an output file
|
errors during the link process; it exits without writing an output file
|
||||||
when it issues any error whatsoever.
|
when it issues any error whatsoever.
|
||||||
|
|
||||||
|
@item -no-keep-memory
|
||||||
|
@cindex memory usage
|
||||||
|
@kindex -no-keep-memory
|
||||||
|
@code{ld} normally optimizes for speed over memory usage by caching the
|
||||||
|
symbol tables of input files in memory. This option tells @code{ld} to
|
||||||
|
instead optimize for memory usage, by rereading the symbol tables as
|
||||||
|
necessary. This may be required if @code{ld} runs out of memory space
|
||||||
|
while linking a large executable.
|
||||||
|
|
||||||
@item -o @var{output}
|
@item -o @var{output}
|
||||||
@kindex -o @var{output}
|
@kindex -o @var{output}
|
||||||
@cindex naming the output file
|
@cindex naming the output file
|
||||||
|
@ -610,7 +634,14 @@ linker will attempt to load the shared object specified by the DT_SONAME
|
||||||
field rather than the using the file name given to the linker.
|
field rather than the using the file name given to the linker.
|
||||||
@end ifset
|
@end ifset
|
||||||
|
|
||||||
|
@item -shared
|
||||||
|
@cindex shared libraries
|
||||||
|
@kindex -shared
|
||||||
|
Create a shared library. This is currently only supported on ELF
|
||||||
|
platforms.
|
||||||
|
|
||||||
@item -sort-common
|
@item -sort-common
|
||||||
|
@kindex -sort-common
|
||||||
Normally, when @code{ld} places the global common symbols in the
|
Normally, when @code{ld} places the global common symbols in the
|
||||||
appropriate output sections, it sorts them by size. First come all the
|
appropriate output sections, it sorts them by size. First come all the
|
||||||
one byte symbols, then all the two bytes, then all the four bytes, and
|
one byte symbols, then all the two bytes, then all the four bytes, and
|
||||||
|
@ -816,6 +847,14 @@ encountered in a different order.
|
||||||
Only warn once for each undefined symbol, rather than once per module
|
Only warn once for each undefined symbol, rather than once per module
|
||||||
which refers to it.
|
which refers to it.
|
||||||
|
|
||||||
|
@kindex --whole-archive
|
||||||
|
@cindex including an entire archive
|
||||||
|
For each archive mentioned on the command line, include every object
|
||||||
|
file in the archive in the link, rather than searching the archive for
|
||||||
|
the required object files. This is normally used to turn an archive
|
||||||
|
file into a shared library, forcing every object to be included in the
|
||||||
|
resulting shared library.
|
||||||
|
|
||||||
@kindex -X
|
@kindex -X
|
||||||
@cindex local symbols, deleting
|
@cindex local symbols, deleting
|
||||||
@cindex L, deleting symbols beginning
|
@cindex L, deleting symbols beginning
|
||||||
|
|
|
@ -180,6 +180,7 @@ main (argc, argv)
|
||||||
link_info.callbacks = &link_callbacks;
|
link_info.callbacks = &link_callbacks;
|
||||||
link_info.relocateable = false;
|
link_info.relocateable = false;
|
||||||
link_info.shared = false;
|
link_info.shared = false;
|
||||||
|
link_info.symbolic = false;
|
||||||
link_info.strip = strip_none;
|
link_info.strip = strip_none;
|
||||||
link_info.discard = discard_none;
|
link_info.discard = discard_none;
|
||||||
link_info.lprefix_len = 1;
|
link_info.lprefix_len = 1;
|
||||||
|
|
|
@ -93,7 +93,8 @@ parse_args (argc, argv)
|
||||||
#define OPTION_STACK (OPTION_SORT_COMMON + 1) /*WINDOWS_NT*/
|
#define OPTION_STACK (OPTION_SORT_COMMON + 1) /*WINDOWS_NT*/
|
||||||
#define OPTION_STATS (OPTION_STACK + 1)
|
#define OPTION_STATS (OPTION_STACK + 1)
|
||||||
#define OPTION_SUBSYSTEM (OPTION_STATS + 1) /* WINDOWS_NT */
|
#define OPTION_SUBSYSTEM (OPTION_STATS + 1) /* WINDOWS_NT */
|
||||||
#define OPTION_TBSS (OPTION_SUBSYSTEM + 1)
|
#define OPTION_SYMBOLIC (OPTION_SUBSYSTEM + 1)
|
||||||
|
#define OPTION_TBSS (OPTION_SYMBOLIC + 1)
|
||||||
#define OPTION_TDATA (OPTION_TBSS + 1)
|
#define OPTION_TDATA (OPTION_TBSS + 1)
|
||||||
#define OPTION_TTEXT (OPTION_TDATA + 1)
|
#define OPTION_TTEXT (OPTION_TDATA + 1)
|
||||||
#define OPTION_TRADITIONAL_FORMAT (OPTION_TTEXT + 1)
|
#define OPTION_TRADITIONAL_FORMAT (OPTION_TTEXT + 1)
|
||||||
|
@ -109,6 +110,7 @@ parse_args (argc, argv)
|
||||||
static struct option longopts[] = {
|
static struct option longopts[] = {
|
||||||
{"Bdynamic", no_argument, NULL, OPTION_CALL_SHARED},
|
{"Bdynamic", no_argument, NULL, OPTION_CALL_SHARED},
|
||||||
{"Bstatic", no_argument, NULL, OPTION_NON_SHARED},
|
{"Bstatic", no_argument, NULL, OPTION_NON_SHARED},
|
||||||
|
{"Bsymbolic", no_argument, NULL, OPTION_SYMBOLIC},
|
||||||
{"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
|
{"call_shared", no_argument, NULL, OPTION_CALL_SHARED},
|
||||||
{"dc", no_argument, NULL, 'd'},
|
{"dc", no_argument, NULL, 'd'},
|
||||||
{"defsym", required_argument, NULL, OPTION_DEFSYM},
|
{"defsym", required_argument, NULL, OPTION_DEFSYM},
|
||||||
|
@ -394,6 +396,9 @@ parse_args (argc, argv)
|
||||||
case OPTION_SUBSYSTEM: /* WINDOWS_NT */
|
case OPTION_SUBSYSTEM: /* WINDOWS_NT */
|
||||||
set_subsystem (optarg);
|
set_subsystem (optarg);
|
||||||
break;
|
break;
|
||||||
|
case OPTION_SYMBOLIC:
|
||||||
|
link_info.symbolic = true;
|
||||||
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
trace_files = true;
|
trace_files = true;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue