* ldgram.y (extern_name_list): Do not require symbols to be
authorIan Lance Taylor <ian@airs.com>
Fri, 3 Jul 1998 18:25:46 +0000 (18:25 +0000)
committerIan Lance Taylor <ian@airs.com>
Fri, 3 Jul 1998 18:25:46 +0000 (18:25 +0000)
separated by commas.
(ifile_p1): Add EXTERN.
* ldlex.l: Accept EXTERN in BOTH and SCRIPT mode as well as MRI
mode.
* ld.texinfo (Options): Mention that EXTERN is equivalent to -u.
(Miscellaneous Commands): Document EXTERN.

ld/ChangeLog
ld/NEWS
ld/ld.texinfo
ld/ldgram.y
ld/ldlex.l

index dea26e1c31360b38d0424286a18fefbaf0855397..07e9695c2a7754cd50d116f5020d0fd9a0d4b9ee 100644 (file)
@@ -1,3 +1,13 @@
+Fri Jul  3 14:19:06 1998  Ian Lance Taylor  <ian@cygnus.com>
+
+       * ldgram.y (extern_name_list): Do not require symbols to be
+       separated by commas.
+       (ifile_p1): Add EXTERN.
+       * ldlex.l: Accept EXTERN in BOTH and SCRIPT mode as well as MRI
+       mode.
+       * ld.texinfo (Options): Mention that EXTERN is equivalent to -u.
+       (Miscellaneous Commands): Document EXTERN.
+
 Wed Jul  1 19:40:34 1998  Richard Henderson <rth@cygnus.com>
 
        * ld.h (args_type): Add gc_sections.
diff --git a/ld/NEWS b/ld/NEWS
index 6e4b8f19bd39b8c71ddf9e4290209f83908c66d5..b696804f9bcaea7244330c2b0485a7a2a2d82eef 100644 (file)
--- a/ld/NEWS
+++ b/ld/NEWS
@@ -2,14 +2,17 @@
 
 Changes in version 2.10:
 
+* Added garbage collection of unused sections, enabled by --gc-sections. 
+  It does require a bit of backend support; currently implemented are
+  ppc-elf, mips-elf, and mn10300-elf.  Others will ignore the option.
+
 * Added SORT to the linker script language to permit sorting sections by file
   name or section name.
 
-* The -e option now accepts a number as well as a symbol name.
+* Added EXTERN to the linker script language as an equivalent to the -u
+  command-line option.
 
-* Added garbage collection of unused sections, enabled by --gc-sections. 
-  It does require a bit of backend support; currently implemented are
-  ppc-elf, mips-elf, and mn10300-elf.  Others will ignore the option.
+* The -e option now accepts a number as well as a symbol name.
 
 Changes in version 2.9:
 
index b23d7c93b7c51eb5e4fa92931bb1acde3df129fb..e4731c7abbd882f7db80564050cd42b7bcce83c5 100644 (file)
@@ -626,12 +626,11 @@ options.  Multiple @samp{-T} options accumulate.
 @cindex undefined symbol
 @item -u @var{symbol}
 @itemx --undefined=@var{symbol}
-Force @var{symbol} to be entered in the output file as an undefined symbol.
-Doing this may, for example, trigger linking of additional modules from
-standard libraries.  @samp{-u} may be repeated with different option
-arguments to enter additional undefined symbols.
-@c Nice idea, but no such command: This option is equivalent
-@c to the @code{EXTERN} linker command.
+Force @var{symbol} to be entered in the output file as an undefined
+symbol.  Doing this may, for example, trigger linking of additional
+modules from standard libraries.  @samp{-u} may be repeated with
+different option arguments to enter additional undefined symbols.  This
+option is equivalent to the @code{EXTERN} linker script command.
 
 @kindex -v
 @kindex -V
@@ -1663,6 +1662,15 @@ command is also used to set the format for the output file.  @xref{BFD}.
 There are a few other linker scripts commands.
 
 @table @code
+@item EXTERN(@var{symbol} @var{symbol} @dots{})
+@kindex EXTERN
+@cindex undefined symbol in linker script
+Force @var{symbol} to be entered in the output file as an undefined
+symbol.  Doing this may, for example, trigger linking of additional
+modules from standard libraries.  You may list several @var{symbol}s for
+each @code{EXTERN}, and you may use @code{EXTERN} multiple times.  This
+command has the same effect as the @samp{-u} command-line option.
+
 @item FORCE_COMMON_ALLOCATION
 @kindex FORCE_COMMON_ALLOCATION
 @cindex common allocation in linker script
index da8d2145a15a1a4359160c1d2a2b62b481b210e7..68ff0a244e1b020a745f9c0210e6e912a374241f 100644 (file)
@@ -264,6 +264,8 @@ casesymlist:
 extern_name_list:
          NAME
                        { ldlang_add_undef ($1); }
+       | extern_name_list NAME
+                       { ldlang_add_undef ($2); }
        | extern_name_list ',' NAME
                        { ldlang_add_undef ($3); }
        ;
@@ -325,6 +327,7 @@ ifile_p1:
                {
                  lang_add_nocrossref ($3);
                }
+       |       EXTERN '(' extern_name_list ')'
        ;
 
 input_list:
index 12c9f0e7b2928a154124a95e3ea443f8b13d052b..09c89ad14351af5a827f2e5154c5195d909645be 100644 (file)
@@ -242,6 +242,7 @@ V_IDENTIFIER [*?.$_a-zA-Z][*?_a-zA-Z0-9]*
 <EXPRESSION,BOTH>"MAX"                 { RTOKEN(MAX); }
 <EXPRESSION,BOTH>"MIN"                 { RTOKEN(MIN); }
 <BOTH,SCRIPT>"ENTRY"                   { RTOKEN(ENTRY);}
+<BOTH,SCRIPT,MRI>"EXTERN"              { RTOKEN(EXTERN);}
 <EXPRESSION,BOTH,SCRIPT>"NEXT"                 { RTOKEN(NEXT);}
 <EXPRESSION,BOTH,SCRIPT>"sizeof_headers"       { RTOKEN(SIZEOF_HEADERS);}
 <EXPRESSION,BOTH,SCRIPT>"SIZEOF_HEADERS"       { RTOKEN(SIZEOF_HEADERS);}
@@ -304,7 +305,6 @@ V_IDENTIFIER [*?.$_a-zA-Z][*?_a-zA-Z0-9]*
 <MRI>"NAME"                     { RTOKEN(NAMEWORD); }
 <MRI>"FORMAT"                   { RTOKEN(FORMAT); }
 <MRI>"CASE"                     { RTOKEN(CASE); }
-<MRI>"EXTERN"                   { RTOKEN(EXTERN); }
 <MRI>"START"                    { RTOKEN(START); }
 <MRI>"LIST".*                   { RTOKEN(LIST); /* LIST and ignore to end of line */ }
 <MRI>"SECT"                    { RTOKEN(SECT); }
This page took 0.033555 seconds and 4 git commands to generate.