| EXPORTS { $$ = "EXPORTS"; }
| HEAPSIZE { $$ = "HEAPSIZE"; }
| IMPORTS { $$ = "IMPORTS"; }
- | LIBRARY { $$ = "LIBRARY"; }
+/* Disable LIBRARY keyword as valid symbol-name. This is necessary
+ for libtool, which places this command after EXPORTS command.
+ This behavior is illegal by specification, but sadly required by
+ by compatibility reasons.
+ See PR binutils/13710
+ | LIBRARY { $$ = "LIBRARY"; } */
| NAME { $$ = "NAME"; }
| NONAMEU { $$ = "NONAME"; }
| NONAMEL { $$ = "noname"; }
if (!max)
return 0;
if ((e = cmp_export_elem (b, ex_name, in_name, its_name, ord)) <= 0)
- return 0;
+ {
+ if (!e)
+ *is_ident = 1;
+ return 0;
+ }
if (max == 1)
return 1;
if ((e = cmp_export_elem (b + (max - 1), ex_name, in_name, its_name, ord)) > 0)
return max;
else if (!e || max == 2)
- return max - 1;
+ {
+ if (!e)
+ *is_ident = 1;
+ return max - 1;
+ }
l = 0; r = max - 1;
while (l < r)
{
{
int r;
+ if ((r = are_names_equal (module, (e->module ? e->module->name : NULL))))
+ return r;
if ((r = are_names_equal (ex_name, e->name)) != 0)
return r;
if ((r = are_names_equal (in_name, e->internal_name)) != 0)
return r;
if (ord != e->ordinal)
return (ord < e->ordinal ? -1 : 1);
- return are_names_equal (module, (e->module ? e->module->name : NULL));
+ return 0;
}
/* Search the position of the identical element, or returns the position
if (!max)
return 0;
if ((e = cmp_import_elem (b, ex_name, in_name, module, ord)) <= 0)
- return 0;
+ {
+ if (!e)
+ *is_ident = 1;
+ return 0;
+ }
if (max == 1)
return 1;
if ((e = cmp_import_elem (b + (max - 1), ex_name, in_name, module, ord)) > 0)
return max;
else if (!e || max == 2)
- return max - 1;
+ {
+ if (!e)
+ *is_ident = 1;
+ return max - 1;
+ }
l = 0; r = max - 1;
while (l < r)
{