[前][次][番号順一覧][スレッド一覧]

ruby-changes:2197

From: ko1@a...
Date: 13 Oct 2007 09:02:34 +0900
Subject: [ruby-changes:2197] nobu - Ruby:r13688 (ruby_1_8, trunk): * {bcc,win}32/mkexports.rb: explicit data.

nobu	2007-10-13 09:02:20 +0900 (Sat, 13 Oct 2007)

  New Revision: 13688

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/bcc32/mkexports.rb
    branches/ruby_1_8/win32/mkexports.rb
    trunk/ChangeLog
    trunk/bcc32/mkexports.rb
    trunk/win32/mkexports.rb

  Log:
    * {bcc,win}32/mkexports.rb: explicit data.  [ruby-list:44108]


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/bcc32/mkexports.rb?r1=13688&r2=13687
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/win32/mkexports.rb?r1=13688&r2=13687
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=13688&r2=13687
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13688&r2=13687
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/bcc32/mkexports.rb?r1=13688&r2=13687
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/win32/mkexports.rb?r1=13688&r2=13687

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 13687)
+++ ChangeLog	(revision 13688)
@@ -1,3 +1,7 @@
+Sat Oct 13 09:02:16 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* {bcc,win}32/mkexports.rb: explicit data.  [ruby-list:44108]
+
 Sat Oct 13 00:17:49 2007  Yukihiro Matsumoto  <matz@r...>
 
 	* lib/rexml/document.rb (REXML::Document::write): leaky
Index: win32/mkexports.rb
===================================================================
--- win32/mkexports.rb	(revision 13687)
+++ win32/mkexports.rb	(revision 13688)
@@ -75,7 +75,7 @@
   end
 
   def symbols()
-    @syms.sort.collect {|k, v| v ? "#{k}=#{v}" : k}
+    @syms.sort.collect {|k, v| v ? v == true ? "#{k} DATA" : "#{k}=#{v}" : k}
   end
 end
 
@@ -90,7 +90,8 @@
           case filetype
           when /OBJECT/, /LIBRARY/
             next if /^[[:xdigit:]]+ 0+ UNDEF / =~ l
-            next unless l.sub!(/.*\sExternal\s+\|\s+/, '')
+            next unless l.sub!(/.*?\s(\(\)\s+)?External\s+\|\s+/, '')
+            is_data = !$1
             if noprefix or l.sub!(/^_/, '')
               next if /@.*@/ =~ l || /@[[:xdigit:]]{16}$/ =~ l
               l.sub!(/^/, '_') if /@\d+$/ =~ l
@@ -102,7 +103,7 @@
           else
             next
           end
-          yield l.strip
+          yield l.strip, is_data
         end
       end
     end
Index: bcc32/mkexports.rb
===================================================================
--- bcc32/mkexports.rb	(revision 13687)
+++ bcc32/mkexports.rb	(revision 13688)
@@ -15,7 +15,7 @@
     opt = /\.(?:so|dll)\z/i =~ obj ? "-ee" : "-oiPUBDEF -oiPUBD32"
     IO.foreach("|tdump -q #{opt} #{obj.tr('/', '\\')} < nul") do |l|
       next unless /(?:PUBDEF|PUBD32|EXPORT)/ =~ l
-        yield $1 if /'(.*?)'/ =~ l
+        yield $1, !$2 /'(.*?)'\s+Segment:\s+_(TEXT)?/ =~ l
       end
     end
     yield "_strcasecmp", "_stricmp"
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 13687)
+++ ruby_1_8/ChangeLog	(revision 13688)
@@ -1,3 +1,7 @@
+Sat Oct 13 09:02:16 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* {bcc,win}32/mkexports.rb: explicit data.  [ruby-list:44108]
+
 Sat Oct 13 00:35:03 2007  Yukihiro Matsumoto  <matz@r...>
 
 	* lib/rexml/source.rb (REXML::SourceFactory::SourceFactory): typo
Index: ruby_1_8/bcc32/mkexports.rb
===================================================================
--- ruby_1_8/bcc32/mkexports.rb	(revision 13687)
+++ ruby_1_8/bcc32/mkexports.rb	(revision 13688)
@@ -7,7 +7,7 @@
 ARGV.each do |obj|
   IO.foreach("|tdump -q -oiPUBDEF -oiPUBD32 #{obj.tr('/', '\\')}") do |l|
     next unless /(?:PUBDEF|PUBD32)/ =~ l
-    SYM[$1] = true if /'(.*?)'/ =~ l
+    SYM[$1] = !$2 if /'(.*?)'\s+Segment:\s+_(TEXT)?/ =~ l
   end
 end
 
@@ -18,7 +18,10 @@
   exports << "Library " + $library
 end
 exports << "Description " + $description.dump if $description
-exports << "EXPORTS" << SYM.keys.sort
+exports << "EXPORTS"
+SYM.sort.each do |sym, is_data|
+  exports << (is_data ? "#{sym} DATA" : sym)
+end
 
 if $output
   open($output, 'w') {|f| f.puts exports.join("\n")}
Index: ruby_1_8/win32/mkexports.rb
===================================================================
--- ruby_1_8/win32/mkexports.rb	(revision 13687)
+++ ruby_1_8/win32/mkexports.rb	(revision 13688)
@@ -7,13 +7,14 @@
 objs = ARGV.collect {|s| s.tr('/', '\\')}
 IO.foreach("|dumpbin -symbols " + objs.join(' ')) do |l|
   next if /^[0-9A-F]+ 0+ UNDEF / =~ l
-  next unless l.sub!(/.*\sExternal\s+\|\s+/, '')
+  next unless l.sub!(/.*?\s(\(\)\s+)?External\s+\|\s+/, "")
+  is_data = !$1
   if l.sub!(/^_(?!\w+@\d+$)/, '')
     next if /@.*@/ =~ l || /@[0-9a-f]{16}$/ =~ l
   elsif !l.sub!(/^(\S+) \([^@?\`\']*\)$/, '\1')
     next
   end
-  SYM[l.strip] = true
+  SYM[l.strip] = is_data
 end
 
 exports = []
@@ -23,7 +24,10 @@
   exports << "Library " + $library
 end
 exports << "Description " + $description.dump if $description
-exports << "EXPORTS" << SYM.keys.sort
+exports << "EXPORTS"
+SYM.sort.each do |sym, is_data|
+  exports << (is_data ? "#{sym} DATA" : sym)
+end
 
 if $output
   open($output, 'w') {|f| f.puts exports.join("\n")}

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]