[gold] Implement HIDDEN syntax in linker scripts

gold/
	* yyscript.y (HIDDEN): New %token.
	(assignment): Handle HIDDEN(string = expr) syntax.
	* script.cc (script_keyword_parsecodes): Add HIDDEN.
This commit is contained in:
Roland McGrath 2016-08-12 09:50:49 -07:00
parent 90ac242072
commit f300578f78
3 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2016-08-12 Roland McGrath <roland@hack.frob.com>
* yyscript.y (HIDDEN): New %token.
(assignment): Handle HIDDEN(string = expr) syntax.
* script.cc (script_keyword_parsecodes): Add HIDDEN.
2016-08-10 Cary Coutant <ccoutant@gmail.com>
PR gold/20216

View file

@ -1755,6 +1755,7 @@ script_keyword_parsecodes[] =
{ "FLOAT", FLOAT },
{ "FORCE_COMMON_ALLOCATION", FORCE_COMMON_ALLOCATION },
{ "GROUP", GROUP },
{ "HIDDEN", HIDDEN },
{ "HLL", HLL },
{ "INCLUDE", INCLUDE },
{ "INFO", INFO },

View file

@ -137,6 +137,7 @@
%token FORCE_COMMON_ALLOCATION
%token GLOBAL /* global */
%token GROUP
%token HIDDEN
%token HLL
%token INCLUDE
%token INHIBIT_COMMON_ALLOCATION
@ -864,6 +865,8 @@ assignment:
Expression_ptr e = script_exp_binary_bitwise_or(s, $3);
script_set_symbol(closure, $1.value, $1.length, e, 0, 0);
}
| HIDDEN '(' string '=' parse_exp ')'
{ script_set_symbol(closure, $3.value, $3.length, $5, 0, 1); }
| PROVIDE '(' string '=' parse_exp ')'
{ script_set_symbol(closure, $3.value, $3.length, $5, 1, 0); }
| PROVIDE_HIDDEN '(' string '=' parse_exp ')'