/* nlmconv.c -- NLM conversion program
Copyright 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
- 2003, 2004 Free Software Foundation, Inc.
+ 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Binutils.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */
/* Written by Ian Lance Taylor <ian@cygnus.com>.
#undef strerror
extern char *strerror (int);
-#ifndef localtime
-extern struct tm *localtime ();
-#endif
-
#ifndef SEEK_SET
#define SEEK_SET 0
#endif
bfd *sharedbfd;
size_t shared_offset = 0;
size_t shared_size = 0;
- Nlm_Internal_Fixed_Header sharedhdr;
+ static Nlm_Internal_Fixed_Header sharedhdr;
int len;
char *modname;
char **matching;
for (l = modules; l != NULL; l = l->next)
{
*set = strlen (l->string);
- strncpy (set + 1, l->string, *set);
+ strncpy ((char *) set + 1, l->string, *set);
set += *set + 1;
++c;
}
sharedhdr.exitProcedureOffset;
free (data);
}
- len = strlen (output_file);
- if (len > NLM_MODULE_NAME_SIZE - 2)
- len = NLM_MODULE_NAME_SIZE - 2;
- nlm_fixed_header (outbfd)->moduleName[0] = len;
-
- strncpy (nlm_fixed_header (outbfd)->moduleName + 1, output_file,
- NLM_MODULE_NAME_SIZE - 2);
- nlm_fixed_header (outbfd)->moduleName[NLM_MODULE_NAME_SIZE - 1] = '\0';
- for (modname = nlm_fixed_header (outbfd)->moduleName;
- *modname != '\0';
- modname++)
- *modname = TOUPPER (*modname);
+
+ {
+ const int max_len = NLM_MODULE_NAME_SIZE - 2;
+ const char * filename = lbasename (output_file);
+
+ len = strlen (filename);
+ if (len > max_len)
+ len = max_len;
+ nlm_fixed_header (outbfd)->moduleName[0] = len;
+
+ strncpy (nlm_fixed_header (outbfd)->moduleName + 1, filename, max_len);
+ nlm_fixed_header (outbfd)->moduleName[max_len + 1] = '\0';
+
+ for (modname = nlm_fixed_header (outbfd)->moduleName;
+ *modname != '\0';
+ modname++)
+ *modname = TOUPPER (*modname);
+ }
strncpy (nlm_variable_header (outbfd)->oldThreadName, " LONG",
NLM_OLD_THREAD_NAME_LENGTH);