Mon Jun 16 12:49:36 1997 H.J. Lu <hjl@gnu.ai.mit.edu>
authorIan Lance Taylor <ian@airs.com>
Mon, 16 Jun 1997 16:56:22 +0000 (16:56 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 16 Jun 1997 16:56:22 +0000 (16:56 +0000)
* ldlang.c (lang_place_undefineds): Add \n in einfo call.
(lang_size_sections): Likewise.
* ldlex.l: Likewise.
* emultempl/aix.em (gld${EMULATION_NAME}_read_file): Likewise.
* emultempl/mipsecoff.em (gld${EMULATION_NAME}_after_open):
Likewise.
(check_sections): Likewise.
(gld${EMULATION_NAME}_after_allocation): Likewise.
* emultempl/pe.em (gld_$${EMULATION_NAME}_before_allocation):
Likewise.
* mpw-eppcmac.c (gldppcmacos_read_file): Likewise.
* mpw-idtmips.c (gldmipsidt_after_open): Likewise.
(check_sections): Likewise.
(gldmipsidt_after_allocation): Likewise.

ld/ChangeLog
ld/ldlex.l
ld/mpw-eppcmac.c
ld/mpw-idtmips.c

index 42f955782debf133c69420c5260814ed67057cd4..2301d889e8d5d4b1f685daa8cb577e9b381d5eb2 100644 (file)
@@ -1,5 +1,20 @@
 Mon Jun 16 12:49:36 1997  H.J. Lu  <hjl@gnu.ai.mit.edu>
 
+       * ldlang.c (lang_place_undefineds): Add \n in einfo call.
+       (lang_size_sections): Likewise.
+       * ldlex.l: Likewise.
+       * emultempl/aix.em (gld${EMULATION_NAME}_read_file): Likewise.
+       * emultempl/mipsecoff.em (gld${EMULATION_NAME}_after_open):
+       Likewise.
+       (check_sections): Likewise.
+       (gld${EMULATION_NAME}_after_allocation): Likewise.
+       * emultempl/pe.em (gld_$${EMULATION_NAME}_before_allocation):
+       Likewise.
+       * mpw-eppcmac.c (gldppcmacos_read_file): Likewise.
+       * mpw-idtmips.c (gldmipsidt_after_open): Likewise.
+       (check_sections): Likewise.
+       (gldmipsidt_after_allocation): Likewise.
+
        * ldemul.c (ldemul_choose_mode): Remove unused einfo argument.
 
 Fri Jun  6 23:47:42 1997  Ian Lance Taylor  <ian@cygnus.com>
index 681988d3e0907829ca24dbfd0e1b956f48b20625..e8214942f70baa48aa2611a8214800bf0c31116a 100644 (file)
@@ -1,6 +1,6 @@
 %{
 
-/* Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
 
 This file is part of GLD, the Gnu Linker.
 
@@ -89,6 +89,9 @@ static void lex_warn_invalid PARAMS ((char *where, char *what));
        BOTH            either EXPRESSION or SCRIPT
        DEFSYMEXP       in an argument to -defsym
         MRI             in an MRI script
+       VERS_START      starting a Sun style mapfile
+       VERS_SCRIPT     a Sun style mapfile
+       VERS_NODE       a node within a Sun style mapfile
 */
 #define RTOKEN(x)  {  yylval.token = x; return x; }
 
@@ -104,19 +107,24 @@ int yywrap () { return 1; }
 CMDFILENAMECHAR   [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\-\~]
 CMDFILENAMECHAR1  [_a-zA-Z0-9\/\.\\_\+\$\:\[\]\\\,\=\&\!\<\>\~]
 FILENAMECHAR1  [_a-zA-Z\/\.\\\$\_\~]
-SYMBOLCHARN     [_a-zA-Z\/\.\\0-9]
+SYMBOLCHARN     [_a-zA-Z\/\.\\\$\_\~0-9]
 FILENAMECHAR   [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~]
 WILDCHAR       [_a-zA-Z0-9\/\.\-\_\+\=\$\:\[\]\\\,\~\?\*]
 WHITE          [ \t\n\r]+ 
 
 NOCFILENAMECHAR        [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
 
+V_TAG [.$_a-zA-Z][._a-zA-Z0-9]*
+V_IDENTIFIER [*?$_a-zA-Z][*?_a-zA-Z0-9]*
 
 %s SCRIPT
 %s EXPRESSION
 %s BOTH
 %s DEFSYMEXP
 %s MRI
+%s VERS_START
+%s VERS_SCRIPT
+%s VERS_NODE
 %%
 
   if (parser_input != input_selected)
@@ -128,6 +136,7 @@ NOCFILENAMECHAR     [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
        {
        case input_script: return INPUT_SCRIPT; break;
        case input_mri_script: return INPUT_MRI_SCRIPT; break;
+       case input_version_script: return INPUT_VERSION_SCRIPT; break;
        case input_defsym: return INPUT_DEFSYM; break;
        default: abort ();
        }
@@ -223,12 +232,15 @@ NOCFILENAMECHAR   [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
 <BOTH,SCRIPT,EXPRESSION,MRI>";"                { RTOKEN(';');}
 <BOTH,SCRIPT>"MEMORY"          { RTOKEN(MEMORY);}
 <BOTH,SCRIPT>"ORIGIN"          { RTOKEN(ORIGIN);}
+<BOTH,SCRIPT>"VERSION"         { RTOKEN(VERSION);}
 <EXPRESSION,BOTH,SCRIPT>"BLOCK"                { RTOKEN(BLOCK);}
 <EXPRESSION,BOTH,SCRIPT>"BIND"         { RTOKEN(BIND);}
 <BOTH,SCRIPT>"LENGTH"          { RTOKEN(LENGTH);}
 <EXPRESSION,BOTH,SCRIPT>"ALIGN"                        { RTOKEN(ALIGN_K);}
 <EXPRESSION,BOTH,SCRIPT>"ADDR"                 { RTOKEN(ADDR);}
 <EXPRESSION,BOTH,SCRIPT>"LOADADDR"             { RTOKEN(LOADADDR);}
+<EXPRESSION,BOTH>"MAX"                 { RTOKEN(MAX); }
+<EXPRESSION,BOTH>"MIN"                 { RTOKEN(MIN); }
 <BOTH,SCRIPT>"ENTRY"                   { RTOKEN(ENTRY);}
 <EXPRESSION,BOTH,SCRIPT>"NEXT"                 { RTOKEN(NEXT);}
 <EXPRESSION,BOTH,SCRIPT>"sizeof_headers"       { RTOKEN(SIZEOF_HEADERS);}
@@ -253,11 +265,13 @@ NOCFILENAMECHAR   [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
 <BOTH,SCRIPT>"SYSLIB"          { RTOKEN(SYSLIB);}
 <BOTH,SCRIPT>"FLOAT"                   { RTOKEN(FLOAT);}
 <BOTH,SCRIPT>"QUAD"                    { RTOKEN( QUAD);}
+<BOTH,SCRIPT>"SQUAD"                   { RTOKEN( SQUAD);}
 <BOTH,SCRIPT>"LONG"                    { RTOKEN( LONG);}
 <BOTH,SCRIPT>"SHORT"                   { RTOKEN( SHORT);}
 <BOTH,SCRIPT>"BYTE"                    { RTOKEN( BYTE);}
 <BOTH,SCRIPT>"NOFLOAT"         { RTOKEN(NOFLOAT);}
-<BOTH,SCRIPT>"NOCROSSREFS"             { RTOKEN(NOCROSSREFS);}
+<EXPRESSION,BOTH,SCRIPT>"NOCROSSREFS"  { RTOKEN(NOCROSSREFS);}
+<BOTH,SCRIPT>"OVERLAY"                 { RTOKEN(OVERLAY); }
 <EXPRESSION,BOTH,SCRIPT>"NOLOAD"       { RTOKEN(NOLOAD);}
 <EXPRESSION,BOTH,SCRIPT>"DSECT"                { RTOKEN(DSECT);}
 <EXPRESSION,BOTH,SCRIPT>"COPY"         { RTOKEN(COPY);}
@@ -341,6 +355,29 @@ NOCFILENAMECHAR    [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
 <BOTH,SCRIPT,EXPRESSION>"\r"           { lineno++;}
 <MRI,BOTH,SCRIPT,EXPRESSION>[ \t]
 
+<VERS_NODE,VERS_SCRIPT>[:,;]   { return *yytext; }
+
+<VERS_NODE>global              { RTOKEN(GLOBAL); }
+
+<VERS_NODE>local               { RTOKEN(LOCAL); }
+
+<VERS_NODE>{V_IDENTIFIER}      { yylval.name = buystring (yytext);
+                                 return VERS_IDENTIFIER; }
+
+<VERS_SCRIPT>{V_TAG}           { yylval.name = buystring (yytext);
+                                 return VERS_TAG; }
+
+<VERS_START>"{"                        { BEGIN(VERS_SCRIPT); return *yytext; }
+
+<VERS_SCRIPT>"{"               { BEGIN(VERS_NODE); return *yytext; }
+<VERS_SCRIPT,VERS_NODE>"}"     { BEGIN(VERS_SCRIPT); return *yytext; }
+
+<VERS_START,VERS_NODE,VERS_SCRIPT>[\n\r]       { lineno++; }
+
+<VERS_START,VERS_NODE,VERS_SCRIPT>#.*          { /* Eat up comments */ }
+
+<VERS_START,VERS_NODE,VERS_SCRIPT>[ \t]+       { /* Eat up whitespace */ }
+
 <<EOF>> {
   include_stack_ptr--;
     
@@ -360,7 +397,7 @@ NOCFILENAMECHAR     [_a-zA-Z0-9\/\.\-\_\+\$\:\[\]\\\~]
   return END;
 }
 
-<SCRIPT,MRI>.          lex_warn_invalid(" in script", yytext);
+<SCRIPT,MRI,VERS_START,VERS_SCRIPT,VERS_NODE>. lex_warn_invalid(" in script", yytext);
 <EXPRESSION,DEFSYMEXP,BOTH>.   lex_warn_invalid(" in expression", yytext);
     
 %%
@@ -468,6 +505,20 @@ ldlex_mri_script ()
   BEGIN (MRI);
 }
 
+void
+ldlex_version_script ()
+{
+  *(state_stack_p)++ = yy_start;
+  BEGIN (VERS_START);
+}
+
+void
+ldlex_version_file ()
+{
+  *(state_stack_p)++ = yy_start;
+  BEGIN (VERS_SCRIPT);
+}
+
 void
 ldlex_defsym ()
 {
@@ -512,7 +563,7 @@ yy_input (buf, result, max_size)
        {
          *result = read (fileno (yyin), (char *) buf, max_size);
          if (*result < 0) 
-           einfo ("%F%P: read in flex scanner failed");
+           einfo ("%F%P: read in flex scanner failed\n");
        }
     }
 }
index 007d2658a30e641bc6d4abf7e31485838a4171e6..3df5a024ea69eab980202d0e2aee8233bfa40ed4 100644 (file)
@@ -731,7 +731,7 @@ gldppcmacos_read_file (filename, import)
              obstack_free (o, obstack_base (o));
            }
          else if (*s == '(')
-           einfo ("%F%s%d: #! ([member]) is not supported in import files",
+           einfo ("%F%s%d: #! ([member]) is not supported in import files\n",
                   filename, lineno);
          else
            {
index 554f9a8c50c1a6ed06803c78b7942918b22de6f8..b8450e06eccf57f7a77bba664d18a7997fb06b45 100644 (file)
@@ -90,7 +90,7 @@ gldmipsidt_after_open ()
              || ! bfd_set_section_alignment (abfd, relsec, 2)
              || ! bfd_set_section_size (abfd, relsec,
                                         datasec->reloc_count * 4))
-           einfo ("%F%B: can not create .rel.sdata section: %E");
+           einfo ("%F%B: can not create .rel.sdata section: %E\n");
        }
 
       /* Double check that all other data sections are empty, as is
@@ -111,7 +111,7 @@ check_sections (abfd, sec, sdatasec)
   if ((bfd_get_section_flags (abfd, sec) & SEC_CODE) == 0
       && sec != (asection *) sdatasec
       && sec->reloc_count != 0)
-    einfo ("%F%X: section %s has relocs; can not use --embedded-relocs",
+    einfo ("%F%X: section %s has relocs; can not use --embedded-relocs\n",
           abfd, bfd_get_section_name (abfd, sec));
 }
 
@@ -146,10 +146,10 @@ gldmipsidt_after_allocation ()
                                                   &errmsg))
        {
          if (errmsg == NULL)
-           einfo ("%B%X: can not create runtime reloc information: %E",
+           einfo ("%B%X: can not create runtime reloc information: %E\n",
                   abfd);
          else
-           einfo ("%X%B: can not create runtime reloc information: %s",
+           einfo ("%X%B: can not create runtime reloc information: %s\n",
                   abfd, errmsg);
        }
     }