summaryrefslogtreecommitdiff
path: root/ld/ldgram.y
diff options
context:
space:
mode:
authorH.J. Lu <hjl@lucon.org>2005-09-28 00:34:21 +0000
committerH.J. Lu <hjl@lucon.org>2005-09-28 00:34:21 +0000
commit0ea1b4916e1077f03e0c591c0d078cae5b85d5db (patch)
tree23365db32a5df7882b18230e3885851c8323a535 /ld/ldgram.y
parentc8683d0dde74be0c27eb69a4d9a0c7bb843face5 (diff)
downloadbinutils-redhat-0ea1b4916e1077f03e0c591c0d078cae5b85d5db.tar.gz
2005-09-27 H.J. Lu <hongjiu.lu@intel.com>
* ld.texinfo (ALIGN): Document it as forcing output section alignment. * ldgram.y (ALIGN): Support it for forcing output section alignment.
Diffstat (limited to 'ld/ldgram.y')
-rw-r--r--ld/ldgram.y12
1 files changed, 9 insertions, 3 deletions
diff --git a/ld/ldgram.y b/ld/ldgram.y
index c8cf6c1d26..f6e2aa2215 100644
--- a/ld/ldgram.y
+++ b/ld/ldgram.y
@@ -92,7 +92,7 @@ static int error_index;
}
%type <etree> exp opt_exp_with_type mustbe_exp opt_at phdr_type phdr_val
-%type <etree> opt_exp_without_type opt_subalign
+%type <etree> opt_exp_without_type opt_subalign opt_align
%type <fill> fill_opt fill_exp
%type <name_list> exclude_name_list
%type <wildcard_list> file_NAME_list
@@ -889,6 +889,11 @@ opt_at:
| { $$ = 0; }
;
+opt_align:
+ ALIGN_K '(' exp ')' { $$ = $3; }
+ | { $$ = 0; }
+ ;
+
opt_subalign:
SUBALIGN '(' exp ')' { $$ = $3; }
| { $$ = 0; }
@@ -904,20 +909,21 @@ sect_constraint:
section: NAME { ldlex_expression(); }
opt_exp_with_type
opt_at
+ opt_align
opt_subalign { ldlex_popstate (); ldlex_script (); }
sect_constraint
'{'
{
lang_enter_output_section_statement($1, $3,
sectype,
- 0, $5, $4, $7);
+ $5, $6, $4, $8);
}
statement_list_opt
'}' { ldlex_popstate (); ldlex_expression (); }
memspec_opt memspec_at_opt phdr_opt fill_opt
{
ldlex_popstate ();
- lang_leave_output_section_statement ($16, $13, $15, $14);
+ lang_leave_output_section_statement ($17, $14, $16, $15);
}
opt_comma
{}