* 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.
This commit is contained in:
Ian Lance Taylor 1998-07-03 18:25:46 +00:00
parent 369ee5df3e
commit b2529df1be
5 changed files with 36 additions and 12 deletions

View 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.

13
ld/NEWS
View File

@ -2,15 +2,18 @@
Changes in version 2.10:
* 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 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.
* Added EXTERN to the linker script language as an equivalent to the -u
command-line option.
* The -e option now accepts a number as well as a symbol name.
Changes in version 2.9:
* Added SQUAD to the linker script language.

View 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

View 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:

View 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); }