From ba916c8af2642aebace1778a707e90a6a4f9095f Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Tue, 26 Oct 2004 18:41:52 +0000 Subject: * Makefile.in (earmsymbian.c): Depend on armbpabi.sc, not elf.sc. * ldexp.h (segment_type): New type. (segments): New variable. * ldexp.c (segments): New variable. (exp_print_token): Handle SEGMENT_START. (fold_binary): Likewise. * ldgram.y (SEGMENT_START): Declare it as a token. (exp): Handle SEGMENT_START. * ldlang.h (lang_address_statement_type): Add segment field. (lang_section_start): Change prototype. * ldlang.c (map_input_to_output_sections): Do not process section assignments if a corresponding SEGMENT_START has already been seen. (lang_section_start): Add segment parameter. * ldlex.l (SEGMENT_START): Add it. * lexsup.c (seg_segment_start): New function. (parse_args): Use it for -Tbss, -Tdata, and -Ttext. * ld.texinfo (SEGMENT_START): Document it. * emulparams/armsymbian.sh (EMBEDDED): Set it. * scripttempl/armbpabi.sc: Use SEGMENT_START to control segment base addresses. Do not map relocations. * NEWS: Mention SEGMENT_START. --- ld/ldgram.y | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ld/ldgram.y') diff --git a/ld/ldgram.y b/ld/ldgram.y index bdfdcd5..13e4ca6 100644 --- a/ld/ldgram.y +++ b/ld/ldgram.y @@ -134,6 +134,7 @@ static int error_index; %token SIZEOF_HEADERS OUTPUT_FORMAT FORCE_COMMON_ALLOCATION OUTPUT_ARCH %token INHIBIT_COMMON_ALLOCATION %token SIZEOF_HEADERS +%token SEGMENT_START %token INCLUDE %token MEMORY DEFSYMEND %token NOLOAD DSECT COPY INFO OVERLAY @@ -843,6 +844,15 @@ exp : { $$ = exp_binop (DATA_SEGMENT_RELRO_END, $5, $3); } | DATA_SEGMENT_END '(' exp ')' { $$ = exp_unop(DATA_SEGMENT_END, $3); } + | SEGMENT_START '(' NAME ',' exp ')' + { /* The operands to the expression node are + placed in the opposite order from the way + in which they appear in the script as + that allows us to reuse more code in + fold_binary. */ + $$ = exp_binop (SEGMENT_START, + $5, + exp_nameop (NAME, $3)); } | BLOCK '(' exp ')' { $$ = exp_unop(ALIGN_K,$3); } | NAME -- cgit v1.1