summaryrefslogtreecommitdiff
path: root/gcc/mkmap-symver.awk
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-27 20:00:14 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2002-11-27 20:00:14 +0000
commit5484670c60f08a0ec70d0e8f48d9115211ad4fec (patch)
tree054e17f1f6649a13f79715fe878a8c67b9afa455 /gcc/mkmap-symver.awk
parent6d219176f20e0f260222b97892df876e359ad647 (diff)
downloadgcc-5484670c60f08a0ec70d0e8f48d9115211ad4fec.tar.gz
* mkmap-symver.awk (BEGIN): Set sawsymbol false.
(nm && NF == 3): Set sawsymbol true. (END): Exit if no symbols seen. (output): Fix map syntax error if no globals for the version. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@59578 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/mkmap-symver.awk')
-rw-r--r--gcc/mkmap-symver.awk14
1 files changed, 13 insertions, 1 deletions
diff --git a/gcc/mkmap-symver.awk b/gcc/mkmap-symver.awk
index 51b6df28ca7..e4bc58e1880 100644
--- a/gcc/mkmap-symver.awk
+++ b/gcc/mkmap-symver.awk
@@ -20,6 +20,7 @@
BEGIN {
state = "nm";
+ sawsymbol = 0;
}
# Remove comment and blank lines.
@@ -42,6 +43,7 @@ state == "nm" && ($1 == "U" || $2 == "U") {
state == "nm" && NF == 3 {
def[$3] = 1;
+ sawsymbol = 1;
next;
}
@@ -77,6 +79,11 @@ $1 == "}" {
}
END {
+ if (!sawsymbol)
+ {
+ print "No symbols seen -- broken or mis-installed nm?" | "cat 1>&2";
+ exit 1;
+ }
for (l in libs)
output(l);
}
@@ -89,10 +96,15 @@ function output(lib) {
output(inherit[lib]);
printf("%s {\n", lib);
- printf(" global:\n");
+ sawglobal = 0;
for (sym in ver)
if ((ver[sym] == lib) && (sym in def))
{
+ if (!sawglobal)
+ {
+ printf(" global:\n");
+ sawglobal = 1;
+ }
printf("\t%s;\n", sym);
if (dotsyms)
printf("\t.%s;\n", sym);