This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb/binutils-2_27-branch] [gold] Implement HIDDEN syntax in linker scripts
- From: Roland McGrath <roland at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 12 Aug 2016 16:52:07 -0000
- Subject: [binutils-gdb/binutils-2_27-branch] [gold] Implement HIDDEN syntax in linker scripts
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=37bb4d970f17d7f33d0621f7b81b623456b1d183
commit 37bb4d970f17d7f33d0621f7b81b623456b1d183
Author: Roland McGrath <mcgrathr@google.com>
Date: Fri Aug 12 09:50:49 2016 -0700
[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.
(cherry picked from commit f300578f78f5ecddc9cfb28c02d032a0acffdf70)
Diff:
---
gold/ChangeLog | 6 ++++++
gold/script.cc | 3 ++-
gold/yyscript.y | 3 +++
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 687e56e..a156163 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -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
diff --git a/gold/script.cc b/gold/script.cc
index d6aa7b2..bb8b437 100644
--- a/gold/script.cc
+++ b/gold/script.cc
@@ -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 },
@@ -2696,7 +2697,7 @@ script_add_library(void* closurev, const char* name, size_t length)
if (name_string[0] != 'l')
gold_error(_("library name must be prefixed with -l"));
-
+
Input_file_argument file(name_string.c_str() + 1,
Input_file_argument::INPUT_FILE_TYPE_LIBRARY,
"", false,
diff --git a/gold/yyscript.y b/gold/yyscript.y
index 7e6bd27..38831d5 100644
--- a/gold/yyscript.y
+++ b/gold/yyscript.y
@@ -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 ')'