summaryrefslogtreecommitdiff
path: root/ld/ldgram.y
diff options
context:
space:
mode:
authorUlf Samuelsson <ulf@emagii.com>2023-02-14 10:13:28 +0000
committerNick Clifton <nickc@redhat.com>2023-02-14 10:13:28 +0000
commit0d79a2a8e2d91fc258ac795c19c13e3ab505a6c2 (patch)
tree6d366ae54f94ded995f08e3f2ea8ac47aa542de5 /ld/ldgram.y
parent12ef68305572ed139825be827b2bb1d1aef3ca25 (diff)
downloadbinutils-gdb-0d79a2a8e2d91fc258ac795c19c13e3ab505a6c2.tar.gz
ASCIZ Command for output section
Adds a new directive to the linker script syntax: ASCIZ. This inserts a zero-terminated string into the output at the place where it is used.
Diffstat (limited to 'ld/ldgram.y')
-rw-r--r--ld/ldgram.y7
1 files changed, 5 insertions, 2 deletions
diff --git a/ld/ldgram.y b/ld/ldgram.y
index fa5f01fef1d..8240cf97327 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -125,7 +125,7 @@ static int error_index;
%right UNARY
%token END
%left <token> '('
-%token <token> ALIGN_K BLOCK BIND QUAD SQUAD LONG SHORT BYTE
+%token <token> ALIGN_K BLOCK BIND QUAD SQUAD LONG SHORT BYTE ASCIZ
%token SECTIONS PHDRS INSERT_K AFTER BEFORE
%token DATA_SEGMENT_ALIGN DATA_SEGMENT_RELRO_END DATA_SEGMENT_END
%token SORT_BY_NAME SORT_BY_ALIGNMENT SORT_NONE
@@ -668,7 +668,10 @@ statement:
{
lang_add_data ((int) $1, $3);
}
-
+ | ASCIZ NAME
+ {
+ lang_add_string ($2);
+ }
| FILL '(' fill_exp ')'
{
lang_add_fill ($3);