From 0d3e45eab084b2bca8b6e3dc94952264868b033b Mon Sep 17 00:00:00 2001 From: Steve Chamberlain Date: Fri, 17 Apr 1992 15:59:37 +0000 Subject: [PATCH] * relax.c: added handling for new "padding" seclet type, used to fill out gaps between section. * ldgram.y, ldlex.l: now -defsym on the command line is done properly. --- ld/.Sanitize | 12 +++++++++++- ld/ldlex.l | 23 +++++++++++++++++++---- ld/relax.c | 21 ++++++++++++++++++++- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/ld/.Sanitize b/ld/.Sanitize index c7190316f96..409e2e26f9e 100644 --- a/ld/.Sanitize +++ b/ld/.Sanitize @@ -46,10 +46,14 @@ genscripts.sh gld.1 gld960.em gld960.sh +go32.sh hp300bsd.sh h8300hms.em h8300hms.sc-sh h8300hms.sh +h8300xray.em +h8300xray.sc-sh +h8300xray.sh i386aout.sh i960.sc-sh ld.h @@ -107,7 +111,13 @@ echo Done in `pwd`. # # # $Log$ -# Revision 1.34 1992/04/15 23:11:53 sac +# Revision 1.35 1992/04/17 15:59:22 sac +# * relax.c: added handling for new "padding" seclet type, used to +# fill out gaps between section. +# * ldgram.y, ldlex.l: now -defsym on the command line is done +# properly. +# +# Revision 1.34 1992/04/15 23:11:53 sac # added mri.c # # Revision 1.33 1992/04/05 01:46:05 sac diff --git a/ld/ldlex.l b/ld/ldlex.l index 28e067b92fd..b52ba2e4e74 100644 --- a/ld/ldlex.l +++ b/ld/ldlex.l @@ -1,4 +1,5 @@ %{ + /* Copyright (C) 1991 Free Software Foundation, Inc. This file is part of GLD, the Gnu Linker. @@ -65,7 +66,8 @@ unsigned int include_stack_ptr = 0; %a 4000 %o 5000 FILENAMECHAR1 [_a-zA-Z\/\.\\] -FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\] +SYMBOLCHARN [_a-zA-Z\/\.\\0-9] +FILENAMECHAR [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\] FILENAME {FILENAMECHAR}+ WHITE [ \t\n]+ @@ -74,10 +76,16 @@ WHITE [ \t\n]+ %x EXPRESSION %x COMMENT %x BOTH +%x DEFSYMEXP %x MRI %% -"-defsym" { return OPTION_defsym; } +"-" { RTOKEN('-');} +"+" { RTOKEN('+');} +{FILENAMECHAR1}{SYMBOLCHARN}* { yylval.name = buystring(yytext); return NAME; } +[ \t] { RTOKEN(DEFSYMEND); } +"=" { RTOKEN('='); } +"-defsym"{WHITE}* { return OPTION_defsym; } "-noinhibit_exec" { return OPTION_noinhibit_exec; } "-noinhibit-exec" { return OPTION_noinhibit_exec; } "-sort_common" { return OPTION_sort_common;} @@ -441,8 +449,15 @@ BEGIN(SCRIPT); void DEFUN_VOID(ldlex_mri_script) { - *(state_stack_p)++ = yy_start; - BEGIN(MRI); +*(state_stack_p)++ = yy_start; +BEGIN(MRI); +} + +void +DEFUN_VOID(ldlex_defsym) +{ +*(state_stack_p)++ = yy_start; +BEGIN(DEFSYMEXP); } void diff --git a/ld/relax.c b/ld/relax.c index d3956ef27f1..948dd8ac6db 100644 --- a/ld/relax.c +++ b/ld/relax.c @@ -27,7 +27,6 @@ DEFUN(build_it,(statement), lang_statement_union_type *statement) { switch (statement->header.type) { - case lang_fill_statement_enum: { #if 0 bfd_byte play_area[SHORT_SIZE]; @@ -113,7 +112,27 @@ DEFUN(build_it,(statement), } break; + case lang_padding_statement_enum: + /* Make a new seclet with the right filler */ + { + /* Create a new seclet in the output section with this + attached */ + bfd_seclet_type *seclet = + bfd_new_seclet(statement->padding_statement.output_section->owner, + statement->padding_statement.output_section); + + seclet->type = bfd_fill_seclet; + seclet->size = statement->padding_statement.size; + seclet->offset = statement->padding_statement.output_offset; + seclet->u.fill.value = statement->padding_statement.fill; + seclet->next = 0; + } + break; + + + + break; default: /* All the other ones fall through */ ; -- 2.30.2