diff options
Diffstat (limited to 'gcc/mkmap-symver.awk')
-rw-r--r-- | gcc/mkmap-symver.awk | 14 |
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); |