From 55b0f00d5ee787fded11a96dcc6cf8dbead41836 Mon Sep 17 00:00:00 2001 From: Asanka Herath Date: Tue, 24 Aug 2010 04:24:53 -0400 Subject: [PATCH] Windows: Check for DATA symbols when scanning .obj files The export symbol list for ASN.1 on Windows is generated by scanning all the .obj files and extracting the symbols defined in them. The generated list did not specify which were functions and which were data symbols. This distinction is necessary for generating correct import library stubs. --- cf/w32-list-externs-from-objs.pl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cf/w32-list-externs-from-objs.pl b/cf/w32-list-externs-from-objs.pl index ebc776744..882801a22 100644 --- a/cf/w32-list-externs-from-objs.pl +++ b/cf/w32-list-externs-from-objs.pl @@ -17,8 +17,8 @@ sub dump_symbols_for_file($) while () { # 008 00000000 SECT3 notype () External | _encode_AccessDescription - /^[[:xdigit:]]{3,}\s[[:xdigit:]]{8,}\s(\w+)\s+\w*\s+(?:\(\)| )\s+(\w+)\s+\|\s+(\w+)$/ && do { - my ($section, $visibility, $symbol) = ($1, $2, $3); + /^[[:xdigit:]]{3,}\s[[:xdigit:]]{8,}\s(\w+)\s+\w*\s+(\(\)| )\s+(\w+)\s+\|\s+([0-9a-zA-Z\@\_]+)$/ && do { + my ($section, $type, $visibility, $symbol) = ($1, $2, $3, $4); if ($section ne "UNDEF" && $visibility eq "External") { print $fn if $show_module_name; @@ -27,7 +27,13 @@ sub dump_symbols_for_file($) if ($strip_leading_underscore && $symbol =~ /_(.*)/) { $symbol = $1; } + if ($strip_leading_underscore && $symbol =~ /(.*)\@.*$/) { + $symbol = $1; + } print $symbol; + if ($type ne "()") { + print "\tDATA"; + } print "\n"; } }; -- 2.11.4.GIT