diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-13 00:02:20 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-10-13 00:02:20 +0000 |
commit | 0b95a09a71c8f296c68f87b9899d6bc0ae7ff63e (patch) | |
tree | 121a9e830b205a364e698c405c255bd51b506cf3 | |
parent | 27158958faf725ff17e04826bfde45841da6577d (diff) |
* {bcc,win}32/mkexports.rb: explicit data. [ruby-list:44108]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@13688 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | bcc32/mkexports.rb | 7 | ||||
-rwxr-xr-x | win32/mkexports.rb | 10 |
3 files changed, 16 insertions, 5 deletions
@@ -1,3 +1,7 @@ +Sat Oct 13 09:02:16 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * {bcc,win}32/mkexports.rb: explicit data. [ruby-list:44108] + Sat Oct 13 00:35:03 2007 Yukihiro Matsumoto <matz@ruby-lang.org> * lib/rexml/source.rb (REXML::SourceFactory::SourceFactory): typo diff --git a/bcc32/mkexports.rb b/bcc32/mkexports.rb index dc523e2541..3cc8e535df 100755 --- a/bcc32/mkexports.rb +++ b/bcc32/mkexports.rb @@ -7,7 +7,7 @@ STDIN.reopen(open("nul")) 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 @@ elsif $library 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")} diff --git a/win32/mkexports.rb b/win32/mkexports.rb index 587081007f..519ed3680e 100755 --- a/win32/mkexports.rb +++ b/win32/mkexports.rb @@ -7,13 +7,14 @@ SYM = {} 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 @@ elsif $library 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")} |