* relax.c: added handling for new "padding" seclet type, used to
authorSteve Chamberlain <sac@cygnus>
Fri, 17 Apr 1992 15:59:37 +0000 (15:59 +0000)
committerSteve Chamberlain <sac@cygnus>
Fri, 17 Apr 1992 15:59:37 +0000 (15:59 +0000)
fill out gaps between section.
* ldgram.y, ldlex.l: now -defsym on the command line is done
properly.

ld/.Sanitize
ld/ldlex.l
ld/relax.c

index c7190316f961fcd35df0728ff72e85fa9d245cce..409e2e26f9e86b0bb4e9b363e7ef4b23d340cac3 100644 (file)
@@ -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
index 28e067b92fd887becba4738c95396bda57fed50e..b52ba2e4e74fa74313030fe962deff75329f7b11 100644 (file)
@@ -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
 %%
   
-<COMMAND>"-defsym"             { return OPTION_defsym; }
+<DEFSYMEXP>"-"                  { RTOKEN('-');}
+<DEFSYMEXP>"+"                  { RTOKEN('+');}
+<DEFSYMEXP>{FILENAMECHAR1}{SYMBOLCHARN}*   { yylval.name = buystring(yytext); return NAME; }
+<DEFSYMEXP>[ \t]                { RTOKEN(DEFSYMEND); }
+<DEFSYMEXP>"="                  { RTOKEN('='); }
+<COMMAND>"-defsym"{WHITE}*     { return OPTION_defsym; }
 <COMMAND>"-noinhibit_exec"     { return OPTION_noinhibit_exec; }
 <COMMAND>"-noinhibit-exec"     { return OPTION_noinhibit_exec; }
 <COMMAND>"-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
index d3956ef27f1496a704d3538d948c6def0333ee9a..948dd8ac6dbe1a23418e366f9e0fc860041a95e6 100644 (file)
@@ -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 */
     ;