aboutsummaryrefslogtreecommitdiff
path: root/binutils
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-01-04 15:47:38 +0000
committerNick Clifton <nickc@redhat.com>2005-01-04 15:47:38 +0000
commit8b626bcf2c36015a4488c30775d524c0c3be4b19 (patch)
treee7b8d1a10a8b8878f4d5f89dfde144a23c1ac04f /binutils
parent5f81b918e0b75dbd0feaace54f163982f2874316 (diff)
downloadgdb-8b626bcf2c36015a4488c30775d524c0c3be4b19.zip
gdb-8b626bcf2c36015a4488c30775d524c0c3be4b19.tar.gz
gdb-8b626bcf2c36015a4488c30775d524c0c3be4b19.tar.bz2
PR binutils/630
* nlmconv.c (main): Only store the basename of the output filename in the module table.
Diffstat (limited to 'binutils')
-rw-r--r--binutils/ChangeLog6
-rw-r--r--binutils/nlmconv.c30
2 files changed, 24 insertions, 12 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index ad750eb..755b5e7 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,9 @@
+2005-01-04 Armin Diehl <diehl@nordrhein.de>
+
+ PR binutils/630
+ * nlmconv.c (main): Only store the basename of the output filename
+ in the module table.
+
2005-01-04 H.J. Lu <hongjiu.lu@intel.com>
BZ 615
diff --git a/binutils/nlmconv.c b/binutils/nlmconv.c
index 9b5e4c8..1bbd22a 100644
--- a/binutils/nlmconv.c
+++ b/binutils/nlmconv.c
@@ -1057,18 +1057,24 @@ main (int argc, char **argv)
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);