mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-09-12 01:24:12 +08:00
* ldgram.y (AS_NEEDED): New token.
(input_list): Handle AS_NEEDED ( input_list ). * ldlex.l (AS_NEEDED): Add. * ld.texinfo: Document AS_NEEDED (). * NEWS: Mention AS_NEEDED ().
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2005-01-21 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
* ldgram.y (AS_NEEDED): New token.
|
||||||
|
(input_list): Handle AS_NEEDED ( input_list ).
|
||||||
|
* ldlex.l (AS_NEEDED): Add.
|
||||||
|
* ld.texinfo: Document AS_NEEDED ().
|
||||||
|
* NEWS: Mention AS_NEEDED ().
|
||||||
|
|
||||||
2005-01-21 Ben Elliston <bje@au.ibm.com>
|
2005-01-21 Ben Elliston <bje@au.ibm.com>
|
||||||
|
|
||||||
* ldlang.c (lang_reasonable_defaults): Remove.
|
* ldlang.c (lang_reasonable_defaults): Remove.
|
||||||
|
3
ld/NEWS
3
ld/NEWS
@ -1,5 +1,8 @@
|
|||||||
-*- text -*-
|
-*- text -*-
|
||||||
|
|
||||||
|
* New linker script construct AS_NEEDED(), which sets the --as-needed flag
|
||||||
|
for input files listed inside of it.
|
||||||
|
|
||||||
* A new command-line option, --sysroot, can be used to override the
|
* A new command-line option, --sysroot, can be used to override the
|
||||||
default sysroot location. It only applies to toolchains that were
|
default sysroot location. It only applies to toolchains that were
|
||||||
configured using --with-sysroot.
|
configured using --with-sysroot.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
\input texinfo
|
\input texinfo
|
||||||
@setfilename ld.info
|
@setfilename ld.info
|
||||||
@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
@c Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||||
@c 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
@c 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
@syncodeindex ky cp
|
@syncodeindex ky cp
|
||||||
@include configdoc.texi
|
@include configdoc.texi
|
||||||
@c (configdoc.texi is generated by the Makefile)
|
@c (configdoc.texi is generated by the Makefile)
|
||||||
@ -2576,6 +2576,18 @@ files should all be archives, and they are searched repeatedly until no
|
|||||||
new undefined references are created. See the description of @samp{-(}
|
new undefined references are created. See the description of @samp{-(}
|
||||||
in @ref{Options,,Command Line Options}.
|
in @ref{Options,,Command Line Options}.
|
||||||
|
|
||||||
|
@item AS_NEEDED(@var{file}, @var{file}, @dots{})
|
||||||
|
@itemx AS_NEEDED(@var{file} @var{file} @dots{})
|
||||||
|
@kindex AS_NEEDED(@var{files})
|
||||||
|
This construct can appear only inside of the @code{INPUT} or @code{GROUP}
|
||||||
|
commands, among other filenames. The files listed will be handled
|
||||||
|
as if they appear directly in the @code{INPUT} or @code{GROUP} commands,
|
||||||
|
with the exception of ELF shared libraries, that will be added only
|
||||||
|
when they are actually needed. This construct essentially enables
|
||||||
|
@option{--as-needed} option for all the files listed inside of it
|
||||||
|
and restores previous @option{--as-needed} resp. @option{--no-as-needed}
|
||||||
|
setting afterwards.
|
||||||
|
|
||||||
@item OUTPUT(@var{filename})
|
@item OUTPUT(@var{filename})
|
||||||
@kindex OUTPUT(@var{filename})
|
@kindex OUTPUT(@var{filename})
|
||||||
@cindex output file name in linker scripot
|
@cindex output file name in linker scripot
|
||||||
|
16
ld/ldgram.y
16
ld/ldgram.y
@ -1,6 +1,6 @@
|
|||||||
/* A YACC grammar to parse a superset of the AT&T linker scripting language.
|
/* A YACC grammar to parse a superset of the AT&T linker scripting language.
|
||||||
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
|
||||||
2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
|
Written by Steve Chamberlain of Cygnus Support (steve@cygnus.com).
|
||||||
|
|
||||||
This file is part of GNU ld.
|
This file is part of GNU ld.
|
||||||
@ -144,7 +144,7 @@ static int error_index;
|
|||||||
%token STARTUP HLL SYSLIB FLOAT NOFLOAT NOCROSSREFS
|
%token STARTUP HLL SYSLIB FLOAT NOFLOAT NOCROSSREFS
|
||||||
%token ORIGIN FILL
|
%token ORIGIN FILL
|
||||||
%token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS
|
%token LENGTH CREATE_OBJECT_SYMBOLS INPUT GROUP OUTPUT CONSTRUCTORS
|
||||||
%token ALIGNMOD AT SUBALIGN PROVIDE
|
%token ALIGNMOD AT SUBALIGN PROVIDE AS_NEEDED
|
||||||
%type <token> assign_op atype attributes_opt sect_constraint
|
%type <token> assign_op atype attributes_opt sect_constraint
|
||||||
%type <name> filename
|
%type <name> filename
|
||||||
%token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K
|
%token CHIP LIST SECT ABSOLUTE LOAD NEWLINE ENDWORD ORDER NAMEWORD ASSERT_K
|
||||||
@ -372,6 +372,18 @@ input_list:
|
|||||||
| input_list LNAME
|
| input_list LNAME
|
||||||
{ lang_add_input_file($2,lang_input_file_is_l_enum,
|
{ lang_add_input_file($2,lang_input_file_is_l_enum,
|
||||||
(char *)NULL); }
|
(char *)NULL); }
|
||||||
|
| AS_NEEDED '('
|
||||||
|
{ $<integer>$ = as_needed; as_needed = TRUE; }
|
||||||
|
input_list ')'
|
||||||
|
{ as_needed = $<integer>3; }
|
||||||
|
| input_list ',' AS_NEEDED '('
|
||||||
|
{ $<integer>$ = as_needed; as_needed = TRUE; }
|
||||||
|
input_list ')'
|
||||||
|
{ as_needed = $<integer>5; }
|
||||||
|
| input_list AS_NEEDED '('
|
||||||
|
{ $<integer>$ = as_needed; as_needed = TRUE; }
|
||||||
|
input_list ')'
|
||||||
|
{ as_needed = $<integer>4; }
|
||||||
;
|
;
|
||||||
|
|
||||||
sections:
|
sections:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
%{
|
%{
|
||||||
|
|
||||||
/* Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
/* Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||||
2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
|
2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GLD, the Gnu Linker.
|
This file is part of GLD, the Gnu Linker.
|
||||||
|
|
||||||
@ -269,6 +269,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)*
|
|||||||
<BOTH,SCRIPT>"OUTPUT" { RTOKEN(OUTPUT);}
|
<BOTH,SCRIPT>"OUTPUT" { RTOKEN(OUTPUT);}
|
||||||
<BOTH,SCRIPT>"INPUT" { RTOKEN(INPUT);}
|
<BOTH,SCRIPT>"INPUT" { RTOKEN(INPUT);}
|
||||||
<EXPRESSION,BOTH,SCRIPT>"GROUP" { RTOKEN(GROUP);}
|
<EXPRESSION,BOTH,SCRIPT>"GROUP" { RTOKEN(GROUP);}
|
||||||
|
<EXPRESSION,BOTH,SCRIPT>"AS_NEEDED" { RTOKEN(AS_NEEDED);}
|
||||||
<EXPRESSION,BOTH,SCRIPT>"DEFINED" { RTOKEN(DEFINED);}
|
<EXPRESSION,BOTH,SCRIPT>"DEFINED" { RTOKEN(DEFINED);}
|
||||||
<BOTH,SCRIPT>"CREATE_OBJECT_SYMBOLS" { RTOKEN(CREATE_OBJECT_SYMBOLS);}
|
<BOTH,SCRIPT>"CREATE_OBJECT_SYMBOLS" { RTOKEN(CREATE_OBJECT_SYMBOLS);}
|
||||||
<BOTH,SCRIPT>"CONSTRUCTORS" { RTOKEN( CONSTRUCTORS);}
|
<BOTH,SCRIPT>"CONSTRUCTORS" { RTOKEN( CONSTRUCTORS);}
|
||||||
|
Reference in New Issue
Block a user