* dlltool.c (scan_drectve_symbols): Handle type tags in exported
symbols. (scan_filtered_symbols): Likewise.
This commit is contained in:
parent
13d92f2c5b
commit
ce195b4280
|
@ -1,3 +1,9 @@
|
||||||
|
1999-09-29 Mumit Khan <khan@xraylith.wisc.edu>
|
||||||
|
|
||||||
|
* dlltool.c (scan_drectve_symbols): Handle type tags in exported
|
||||||
|
symbols.
|
||||||
|
(scan_filtered_symbols): Likewise.
|
||||||
|
|
||||||
1999-09-19 Ian Lance Taylor <ian@zembu.com>
|
1999-09-19 Ian Lance Taylor <ian@zembu.com>
|
||||||
|
|
||||||
* resrc.c (write_rc_rcdata): Fix local variable shadowing
|
* resrc.c (write_rc_rcdata): Fix local variable shadowing
|
||||||
|
|
|
@ -1203,7 +1203,9 @@ scan_drectve_symbols (abfd)
|
||||||
inform (_("Sucking in info from %s section in %s\n"),
|
inform (_("Sucking in info from %s section in %s\n"),
|
||||||
DRECTVE_SECTION_NAME, bfd_get_filename (abfd));
|
DRECTVE_SECTION_NAME, bfd_get_filename (abfd));
|
||||||
|
|
||||||
/* Search for -export: strings */
|
/* Search for -export: strings. The exported symbols can optionally
|
||||||
|
have type tags (eg., -export:foo,data), so handle those as well.
|
||||||
|
Currently only data tag is supported. */
|
||||||
p = buf;
|
p = buf;
|
||||||
e = buf + size;
|
e = buf + size;
|
||||||
while (p < e)
|
while (p < e)
|
||||||
|
@ -1213,25 +1215,36 @@ scan_drectve_symbols (abfd)
|
||||||
{
|
{
|
||||||
char * name;
|
char * name;
|
||||||
char * c;
|
char * c;
|
||||||
|
flagword flags = BSF_FUNCTION;
|
||||||
|
|
||||||
p += 8;
|
p += 8;
|
||||||
name = p;
|
name = p;
|
||||||
while (p < e && *p != ' ' && *p != '-')
|
while (p < e && *p != ',' && *p != ' ' && *p != '-')
|
||||||
p++;
|
p++;
|
||||||
c = xmalloc (p - name + 1);
|
c = xmalloc (p - name + 1);
|
||||||
memcpy (c, name, p - name);
|
memcpy (c, name, p - name);
|
||||||
c[p - name] = 0;
|
c[p - name] = 0;
|
||||||
|
if (p < e && *p == ',') /* found type tag. */
|
||||||
|
{
|
||||||
|
char *tag_start = ++p;
|
||||||
|
while (p < e && *p != ' ' && *p != '-')
|
||||||
|
p++;
|
||||||
|
if (strncmp (tag_start, "data", 4) == 0)
|
||||||
|
flags &= ~BSF_FUNCTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* FIXME: The 5th arg is for the `constant' field.
|
/* FIXME: The 5th arg is for the `constant' field.
|
||||||
What should it be? Not that it matters since it's not
|
What should it be? Not that it matters since it's not
|
||||||
currently useful. */
|
currently useful. */
|
||||||
def_exports (c, 0, -1, 0, 0, 0);
|
def_exports (c, 0, -1, 0, 0, ! (flags & BSF_FUNCTION));
|
||||||
|
|
||||||
if (add_stdcall_alias && strchr (c, '@'))
|
if (add_stdcall_alias && strchr (c, '@'))
|
||||||
{
|
{
|
||||||
char *exported_name = xstrdup (c);
|
char *exported_name = xstrdup (c);
|
||||||
char *atsym = strchr (exported_name, '@');
|
char *atsym = strchr (exported_name, '@');
|
||||||
*atsym = '\0';
|
*atsym = '\0';
|
||||||
|
/* Note: stdcall alias symbols can never be data. */
|
||||||
def_exports (exported_name, xstrdup (c), -1, 0, 0, 0);
|
def_exports (exported_name, xstrdup (c), -1, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1273,13 +1286,15 @@ scan_filtered_symbols (abfd, minisyms, symcount, size)
|
||||||
if (bfd_get_symbol_leading_char (abfd) == symbol_name[0])
|
if (bfd_get_symbol_leading_char (abfd) == symbol_name[0])
|
||||||
++symbol_name;
|
++symbol_name;
|
||||||
|
|
||||||
def_exports (xstrdup (symbol_name) , 0, -1, 0, 0, 0);
|
def_exports (xstrdup (symbol_name) , 0, -1, 0, 0,
|
||||||
|
! (sym->flags & BSF_FUNCTION));
|
||||||
|
|
||||||
if (add_stdcall_alias && strchr (symbol_name, '@'))
|
if (add_stdcall_alias && strchr (symbol_name, '@'))
|
||||||
{
|
{
|
||||||
char *exported_name = xstrdup (symbol_name);
|
char *exported_name = xstrdup (symbol_name);
|
||||||
char *atsym = strchr (exported_name, '@');
|
char *atsym = strchr (exported_name, '@');
|
||||||
*atsym = '\0';
|
*atsym = '\0';
|
||||||
|
/* Note: stdcall alias symbols can never be data. */
|
||||||
def_exports (exported_name, xstrdup (symbol_name), -1, 0, 0, 0);
|
def_exports (exported_name, xstrdup (symbol_name), -1, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue