ChangeLog binutils
authorKai Tietz <kai.tietz@onevision.com>
Sat, 11 Feb 2012 20:02:03 +0000 (20:02 +0000)
committerKai Tietz <kai.tietz@onevision.com>
Sat, 11 Feb 2012 20:02:03 +0000 (20:02 +0000)
2012-02-11  Kai Tietz  <ktietz@redhat.com>

PR binutils/13657
* defparse.y (%union): New type id_const.
(opt_name2): New rule.
(keyword_as_name): New rule.
(opt_name): Adjust rule.
(opt_import_name): Likewise.
(opt_equal_name): Likewise.

ChangeLog binutils/testsuite

2012-02-11  Kai Tietz  <ktietz@redhat.com>

* binutils-all/version.def: New file.
* binutils-all/dlltool.exp: Add version-dll test.

ChangeLog ld

2012-02-11  Kai Tietz  <ktietz@redhat.com>

* deffilep.y (%union): New type id_const.
(opt_name2): New rule.
(keyword_as_name): New rule.
(dot_name): Replaced by opt_name2 rule.
(opt_name): Adjust rule.
(opt_equal_name): Likewise.

binutils/ChangeLog
binutils/defparse.y
binutils/testsuite/ChangeLog
binutils/testsuite/binutils-all/dlltool.exp
binutils/testsuite/binutils-all/version.def [new file with mode: 0644]
ld/ChangeLog
ld/deffilep.y

index 1040f9e218b631c79b2d54c42d11ed06c658fe55..261684e1ba046a8d75e4094657047dd5a8471684 100644 (file)
@@ -1,3 +1,13 @@
+2012-02-11  Kai Tietz  <ktietz@redhat.com>
+
+       PR binutils/13657
+       * defparse.y (%union): New type id_const.
+       (opt_name2): New rule.
+       (keyword_as_name): New rule.
+       (opt_name): Adjust rule.
+       (opt_import_name): Likewise.
+       (opt_equal_name): Likewise.
+
 2012-02-11  Kai Tietz  <ktietz@redhat.com>
 
        PR binutils/13297
index c05254a0557497b37febb2f526ec972e28e7899e..b21ce93215094c24eb43e98a92ab383e028b4ab1 100644 (file)
@@ -28,6 +28,7 @@
 
 %union {
   char *id;
+  const char *id_const;
   int number;
 };
 
@@ -40,7 +41,8 @@
 %token <number> NUMBER
 %type  <number> opt_base opt_ordinal opt_NONAME opt_CONSTANT opt_DATA opt_PRIVATE
 %type  <number> attr attr_list opt_number
-%type  <id> opt_name opt_equal_name opt_import_name
+%type  <id> opt_name opt_name2 opt_equal_name opt_import_name
+%type  <id_const> keyword_as_name
 
 %%
 
@@ -150,13 +152,61 @@ opt_PRIVATE:
        |               { $$ = 0; }
        ;
 
-opt_name: ID           { $$ =$1; }
-       | ID '.' ID     
+keyword_as_name: NAME { $$ = "NAME"; }
+       | LIBRARY { $$ = "LIBRARY"; }
+       | DESCRIPTION { $$ = "DESCRIPTION"; }
+       | STACKSIZE { $$ = "STACKSIZE"; }
+       | HEAPSIZE { $$ = "HEAPSIZE"; }
+       | CODE { $$ = "CODE"; }
+       | DATA { $$ = "DATA"; }
+       | SECTIONS { $$ = "SECTIONS"; }
+       | EXPORTS { $$ = "EXPORTS"; }
+       | IMPORTS { $$ = "IMPORTS"; }
+       | VERSIONK { $$ = "VERSION"; }
+       | BASE { $$ = "BASE"; }
+       | CONSTANT { $$ = "CONSTANT"; }
+       | NONAME { $$ = "NONAME"; }
+       | PRIVATE { $$ = "PRIVATE"; }
+       | READ { $$ = "READ"; }
+       | WRITE { $$ = "WRITE"; }
+       | EXECUTE { $$ = "EXECUTE"; }
+       | SHARED { $$ = "SHARED"; }
+       | NONSHARED { $$ = "NONSHARED"; }
+       | SINGLE { $$ = "SINGLE"; }
+       | MULTIPLE { $$ = "MULTIPLE"; }
+       | INITINSTANCE { $$ = "INITINSTANCE"; }
+       | INITGLOBAL { $$ = "INITGLOBAL"; }
+       | TERMINSTANCE { $$ = "TERMINSTANCE"; }
+       | TERMGLOBAL { $$ = "TERMGLOBAL"; }
+       ;
+
+opt_name2: ID { $$ = $1; }
+       | '.' keyword_as_name
+         {
+           char *name = xmalloc (strlen ($2) + 2);
+           sprintf (name, ".%s", $2);
+           $$ = name;
+         }
+       | '.' opt_name2
+         { 
+           char *name = xmalloc (strlen ($2) + 2);
+           sprintf (name, ".%s", $2);
+           $$ = name;
+         }
+       | keyword_as_name '.' opt_name2
+         { 
+           char *name = xmalloc (strlen ($1) + 1 + strlen ($3) + 1);
+           sprintf (name, "%s.%s", $1, $3);
+           $$ = name;
+         }
+       | ID '.' opt_name2
          { 
            char *name = xmalloc (strlen ($1) + 1 + strlen ($3) + 1);
            sprintf (name, "%s.%s", $1, $3);
            $$ = name;
          }
+       ;
+opt_name: opt_name2 { $$ =$1; }
        |               { $$=""; }
        ;
 
@@ -166,18 +216,12 @@ opt_ordinal:
        ;
 
 opt_import_name:
-         EQUAL ID      { $$ = $2; }
+         EQUAL opt_name2       { $$ = $2; }
        |               { $$ = 0; }
        ;
 
 opt_equal_name:
-          '=' ID       { $$ = $2; }
-       | '=' ID '.' ID 
-         { 
-           char *name = xmalloc (strlen ($2) + 1 + strlen ($4) + 1);
-           sprintf (name, "%s.%s", $2, $4);
-           $$ = name;
-         }
+          '=' opt_name2        { $$ = $2; }
         |              { $$ =  0; }                     
        ;
 
index 6f59bafe3635b511c4ffc570f312d92c4a5dfef1..604c824bcb32d4e56b30adee16c4424262e02e66 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-11  Kai Tietz  <ktietz@redhat.com>
+
+       * binutils-all/version.def: New file.
+       * binutils-all/dlltool.exp: Add version-dll test.
+
 2012-02-02  Nick Clifton  <nickc@redhat.com>
 
        * binutils-all/readelf.n: Add #pass to cope with targets that add
index 5a19cf273328e7e406e64b038f84a21ac05a094a..1493e6e19832446accc96354da66ab99c34359ca 100644 (file)
@@ -53,6 +53,17 @@ if { "$target_xfail" == "yes" } {
     setup_xfail *-*
 }
 
+verbose "$DLLTOOL -l libversion.a --def $srcdir/$subdir/version.def" 1
+catch "exec $DLLTOOL -l libersion.a --def $srcdir/$subdir/version.def" err
+
+if ![string match "" $err] then {
+    send_log "$err\n"
+    verbose "$err" 1
+    fail "dlltool (version.dll)"
+} else {
+    pass "dlltool (version.dll)"
+}
+
 verbose "$DLLTOOL -p prefix --leading-underscore -l tmpdir/libalias.a -d $srcdir/$subdir/alias.def $dlltool_gas_flag" 1
 catch "exec $DLLTOOL -p prefix --leading-underscore -l tmpdir/libalias.a -d $srcdir/$subdir/alias.def $dlltool_gas_flag" err
 
diff --git a/binutils/testsuite/binutils-all/version.def b/binutils/testsuite/binutils-all/version.def
new file mode 100644 (file)
index 0000000..ce1c4b5
--- /dev/null
@@ -0,0 +1,17 @@
+LIBRARY VERSION.dll
+EXPORTS
+GetFileVersionInfoA1
+GetFileVersionInfoSizeA2
+GetFileVersionInfoSizeW3
+GetFileVersionInfoW4
+VerFindFileA5
+VerFindFileW6
+VerInstallFileA7
+VerInstallFileW8
+VerLanguageNameA9
+VerLanguageNameW10
+VerQueryValueA11
+VerQueryValueIndexA12
+VerQueryValueIndexW13
+VerQueryValueW14
+
index 6c79882496bc79266129908fd5ff3206b30ee589..56e07775102dcd72193ef18cff0aa3257666cbd6 100644 (file)
@@ -1,3 +1,12 @@
+2012-02-11  Kai Tietz  <ktietz@redhat.com>
+
+       * deffilep.y (%union): New type id_const.
+       (opt_name2): New rule.
+       (keyword_as_name): New rule.
+       (dot_name): Replaced by opt_name2 rule.
+       (opt_name): Adjust rule.
+       (opt_equal_name): Likewise.
+
 2012-02-11  Pascal Obry  <pascal@obry.net>
 
        * pe-dll.c (auto_export): Use bsearch to speed up scan of exports
index 58f3dd27b78bd54fe62504fb7f5ec1422c1a31b8..b192100f78c73f9c015fd876ab15646e4425b8e5 100644 (file)
@@ -113,6 +113,7 @@ static const char *lex_parse_string_end = 0;
 
 %union {
   char *id;
+  const char *id_const;
   int number;
   char *digits;
 };
@@ -127,8 +128,9 @@ static const char *lex_parse_string_end = 0;
 %type  <digits> opt_digits
 %type  <number> opt_base opt_ordinal
 %type  <number> attr attr_list opt_number exp_opt_list exp_opt
-%type  <id> opt_name opt_equal_name dot_name anylang_id opt_id
+%type  <id> opt_name opt_name2 opt_equal_name anylang_id opt_id
 %type  <id> opt_equalequal_name
+%type  <id_const> keyword_as_name
 
 %%
 
@@ -164,7 +166,7 @@ expline:
                /* The opt_comma is necessary to support both the usual
                  DEF file syntax as well as .drectve syntax which
                  mandates <expsym>,<expoptlist>.  */
-               dot_name opt_equal_name opt_ordinal opt_comma exp_opt_list opt_comma opt_equalequal_name
+               opt_name2 opt_equal_name opt_ordinal opt_comma exp_opt_list opt_comma opt_equalequal_name
                        { def_exports ($1, $2, $3, $5, $7); }
        ;
 exp_opt_list:
@@ -234,19 +236,60 @@ attr:
        |       SHARED  { $$=8;}
        ;
 
-opt_name: ID           { $$ = $1; }
-       | '.' ID
+
+keyword_as_name: BASE { $$ = "BASE"; }
+        | CODE { $$ = "CODE"; }
+        | CONSTANTU { $$ = "CONSTANT"; }
+        | CONSTANTL { $$ = "constant"; }
+        | DATAU { $$ = "DATA"; }
+        | DATAL { $$ = "data"; }
+        | DESCRIPTION { $$ = "DESCRIPTION"; }
+        | DIRECTIVE { $$ = "DIRECTIVE"; }
+        | EXECUTE { $$ = "EXECUTE"; }
+        | EXPORTS { $$ = "EXPORTS"; }
+        | HEAPSIZE { $$ = "HEAPSIZE"; }
+        | IMPORTS { $$ = "IMPORTS"; }
+        | LIBRARY { $$ = "LIBRARY"; }
+        | NAME { $$ = "NAME"; }
+        | NONAMEU { $$ = "NONAME"; }
+        | NONAMEL { $$ = "noname"; }
+        | PRIVATEU { $$ = "PRIVATE"; }
+        | PRIVATEL { $$ = "private"; }
+        | READ { $$ = "READ"; }
+        | SHARED  { $$ = "SHARED"; }
+        | STACKSIZE_K { $$ = "STACKSIZE"; }
+        | VERSIONK { $$ = "VERSION"; }
+        | WRITE { $$ = "WRITE"; }
+        ;
+
+opt_name2: ID { $$ = $1; }
+       | '.' keyword_as_name
          {
+           char *name = xmalloc (strlen ($2) + 2);
+           sprintf (name, ".%s", $2);
+           $$ = name;
+         }
+       | '.' opt_name2
+         { 
            char *name = def_pool_alloc (strlen ($2) + 2);
            sprintf (name, ".%s", $2);
            $$ = name;
          }
-       | ID '.' ID     
+       | keyword_as_name '.' opt_name2
          { 
            char *name = def_pool_alloc (strlen ($1) + 1 + strlen ($3) + 1);
            sprintf (name, "%s.%s", $1, $3);
            $$ = name;
          }
+       | ID '.' opt_name2
+         { 
+           char *name = def_pool_alloc (strlen ($1) + 1 + strlen ($3) + 1);
+           sprintf (name, "%s.%s", $1, $3);
+           $$ = name;
+         }
+       ;
+
+opt_name: opt_name2 { $$ = $1; }
        |               { $$ = ""; }
        ;
 
@@ -260,7 +303,7 @@ opt_ordinal:
        ;
 
 opt_equal_name:
-          '=' dot_name { $$ = $2; }
+          '=' opt_name2        { $$ = $2; }
         |              { $$ =  0; }                     
        ;
 
@@ -268,21 +311,6 @@ opt_base: BASE     '=' NUMBER      { $$ = $3;}
        |       { $$ = -1;}
        ;
 
-dot_name: ID           { $$ = $1; }
-       | '.' ID
-         {
-           char *name = def_pool_alloc (strlen ($2) + 2);
-           sprintf (name, ".%s", $2);
-           $$ = name;
-         }
-       | dot_name '.' ID       
-         { 
-           char *name = def_pool_alloc (strlen ($1) + 1 + strlen ($3) + 1);
-           sprintf (name, "%s.%s", $1, $3);
-           $$ = name;
-         }
-       ;
-
 anylang_id: ID         { $$ = $1; }
        | '.' ID
          {