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.
+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.
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:
@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
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
extern_name_list:
NAME
{ ldlang_add_undef ($1); }
+ | extern_name_list NAME
+ { ldlang_add_undef ($2); }
| extern_name_list ',' NAME
{ ldlang_add_undef ($3); }
;
{
lang_add_nocrossref ($3);
}
+ | EXTERN '(' extern_name_list ')'
;
input_list:
<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);}
<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); }