Minor bug in mkmap-symver.awk? (fwd)
Roger Sayle
roger@www.eyesopen.com
Wed Nov 27 08:15:00 GMT 2002
I suspect that I've come across a problem in GCC's mkmap-symver.awk,
but thought I'd get confirmation that it really is a problem with this
awk script and not with GNU ld. And if so, perhaps beg someone who
speaks "awk" to write the necessary two or three line fix.
The problem concerns the fragment:
printf("%s {\n", lib);
printf(" global:\n");
for (sym in ver)
if ((ver[sym] == lib) && (sym in def))
{
printf("\t%s;\n", sym);
if (dotsyms)
printf("\t.%s;\n", sym);
}
if (inherit[lib])
printf("} %s;\n", inherit[lib]);
else
printf ("\n local:\n\t*;\n};\n");
which, when none of the symbols in "ver" are defined in this library,
can generate a version map that looks like:
GCC_3.3 {
global:
local:
*;
};
or
GCC_3.3 {
global:
} GCC_3.0;
Unfortunately, this causes a parse error with current GNU ld, as
the grammar specifies that "global:", if present, must be followed
by an identifier then semicolon.
The "obvious" fix, is to tweak the mkmap-symver.awk script to
only output "global:" on encountering the first suitable symbol
in the above loop.
Is this the appropriate solution, or should GNU ld's grammar be
modified to allow "global:" to be followed by an empty list?
Anyone willing to add the "init = 1" lines? Or should I just
file a GNATS PR?
Very many thanks in advance,
Roger
--
Roger Sayle, E-mail: roger@eyesopen.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833
More information about the Gcc
mailing list