summaryrefslogtreecommitdiff
path: root/bcc32/mkexports.rb
diff options
context:
space:
mode:
Diffstat (limited to 'bcc32/mkexports.rb')
-rwxr-xr-xbcc32/mkexports.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/bcc32/mkexports.rb b/bcc32/mkexports.rb
index dc523e2..3cc8e53 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")}