aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2006-03-01 20:20:22 +0000
committerChristopher Faylor <me@cgf.cx>2006-03-01 20:20:22 +0000
commitee93375872d33a3c4518cda416315f8ea844f5ab (patch)
treeef15cb568d894adc1827393aab9c5f05d62bce2e /winsup
parent3b1f276fca026267c148ee1b4738db224f3f4186 (diff)
downloadnewlib-ee93375872d33a3c4518cda416315f8ea844f5ab.zip
newlib-ee93375872d33a3c4518cda416315f8ea844f5ab.tar.gz
newlib-ee93375872d33a3c4518cda416315f8ea844f5ab.tar.bz2
* analyze_sigfe: New script.
* dllfixdbg: Add copyright. * gendef: Ditto. * gendevices: Ditto. * gentls_offsets: Ditto.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog8
-rwxr-xr-xwinsup/cygwin/analyze_sigfe80
-rwxr-xr-xwinsup/cygwin/dllfixdbg8
-rwxr-xr-xwinsup/cygwin/gendef8
-rwxr-xr-xwinsup/cygwin/gendevices8
-rwxr-xr-xwinsup/cygwin/gentls_offsets8
6 files changed, 120 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 407a09b..f525f0d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,13 @@
2006-03-01 Christopher Faylor <cgf@timesys.com>
+ * analyze_sigfe: New script.
+ * dllfixdbg: Add copyright.
+ * gendef: Ditto.
+ * gendevices: Ditto.
+ * gentls_offsets: Ditto.
+
+2006-03-01 Christopher Faylor <cgf@timesys.com>
+
* cygthread.cc (cygthread::callfunc): Create ev as an auto-reset event
so that it will be reset by WaitFor*Object as appropriate.
(cygthread::stub): Ditto.
diff --git a/winsup/cygwin/analyze_sigfe b/winsup/cygwin/analyze_sigfe
new file mode 100755
index 0000000..0b9b721
--- /dev/null
+++ b/winsup/cygwin/analyze_sigfe
@@ -0,0 +1,80 @@
+#!/usr/bin/perl -s
+# Copyright 2006 Red Hat, Inc.
+#
+# This file is part of Cygwin.
+#
+# This software is a copyrighted work licensed under the terms of the
+# Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+# details.
+
+# This will do a crude test to see if the (NO)?SIGFE stuff is used properly
+# in cygwin.din. It is not perfect so do not use it to do a wholesale replacement.
+#
+# Input is the output of 'objdump --disassemble --demangle cygwin0.dll'.
+#
+use strict;
+use vars qw'$v';
+sub star($);
+
+my %funcs;
+my $func = '';
+
+$| = 1;
+while (<>) {
+ /^610.....\s+<([^\(>]+).*?:/o and do {
+ $func = $1;
+ $funcs{$func} = {} unless defined $funcs{$func};
+ next;
+ };
+ $func and /call\s+\S+\s+<([^\(>]+)/o and do {
+ my $called = $1;
+ $funcs{$func}{$called} = 1;
+ if ($called =~ /^[A-Z].*@/o || ($called = $funcs{$called}{-uses_kernel})) {
+ $funcs{$func}{-uses_kernel} ||= $called;
+ my @a = ($func);
+ while (my $f = shift @a) {
+ for my $k (keys %funcs) {
+ if ($funcs{$k}{$f} && !$funcs{$k}{-uses_kernel}) {
+ $funcs{$k}{-uses_kernel} = $called;
+ push(@a, $k);
+ }
+ }
+ }
+ }
+ next;
+ };
+}
+
+if ($v) {
+ for my $k (sort keys %funcs) {
+ print star($funcs{$k}), $k, $funcs{$k}{-uses_kernel} ? " ($funcs{$k}{-uses_kernel})\n" : "\n";
+ my $indent = ' ';
+ for (sort keys %{$funcs{$k}}) {
+ next if /^-/o;
+ print $indent, $_, star($funcs{$k});
+ $indent = ' ';
+ }
+ print "\n";
+ }
+}
+
+open(DIN, '<', 'cygwin.din') or die "$0: couldn't open cygwin.din - $!\n";
+while (<DIN>) {
+ my $line = $_;
+ /^LIBRARY\s+/o and next;
+ /^\s*$/ and next;
+ /^EXPORTS/o and next;
+ / DATA$/o and next;
+ my $sigfe = (/\s+((?:NO)?SIGFE)\s*$/o)[0] !~ /^NO/o;
+ s/\s+((?:NO)?SIGFE)\s*$//o;
+ my $func = (/\s+=\s+(\S+)/o)[0] || (/^\s*(\S+)/o)[0];
+ if (!defined($funcs{$func})) {
+ warn "hmm. couldn't find $func in disassembled output\n";
+ } elsif (!!$funcs{$func}{-uses_kernel} != $sigfe) {
+ warn "mismatch detected: $line";
+ }
+}
+
+sub star($) {
+ return $_[0]->{-uses_kernel} ? '*' : '';
+}
diff --git a/winsup/cygwin/dllfixdbg b/winsup/cygwin/dllfixdbg
index 8d66988..909d113 100755
--- a/winsup/cygwin/dllfixdbg
+++ b/winsup/cygwin/dllfixdbg
@@ -1,4 +1,12 @@
#!/usr/bin/perl
+# Copyright 2006 Red Hat, Inc.
+#
+# This file is part of Cygwin.
+#
+# This software is a copyrighted work licensed under the terms of the
+# Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+# details.
+#
use integer;
use strict;
sub xit($@);
diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef
index a81105c..c6b6a79 100755
--- a/winsup/cygwin/gendef
+++ b/winsup/cygwin/gendef
@@ -1,4 +1,12 @@
#!/usr/bin/perl
+# Copyright 2003, 2004, 2005 Red Hat, Inc.
+#
+# This file is part of Cygwin.
+#
+# This software is a copyrighted work licensed under the terms of the
+# Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+# details.
+#
use strict;
sub nocr(@);
my $in = shift;
diff --git a/winsup/cygwin/gendevices b/winsup/cygwin/gendevices
index 27d4ed1..df21796 100755
--- a/winsup/cygwin/gendevices
+++ b/winsup/cygwin/gendevices
@@ -1,4 +1,12 @@
#!/usr/bin/perl
+# Copyright 2003, 2004, 2005 Red Hat, Inc.
+#
+# This file is part of Cygwin.
+#
+# This software is a copyrighted work licensed under the terms of the
+# Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+# details.
+#
use File::Basename;
use Cwd;
my $cwd = getcwd;
diff --git a/winsup/cygwin/gentls_offsets b/winsup/cygwin/gentls_offsets
index 931eac3..21c9d1e 100755
--- a/winsup/cygwin/gentls_offsets
+++ b/winsup/cygwin/gentls_offsets
@@ -1,4 +1,12 @@
#!/usr/bin/perl -s
+# Copyright 2003, 2004, 2005 Red Hat, Inc.
+#
+# This file is part of Cygwin.
+#
+# This software is a copyrighted work licensed under the terms of the
+# Cygwin license. Please consult the file "CYGWIN_LICENSE" for
+# details.
+#
my $tls = shift;
my $tls_out = shift;
open(TLS, $tls) or die "$0: couldn't open tls file \"$tls\" - $!\n";