diff options
author | Ian Lance Taylor <ian@airs.com> | 1999-09-07 04:28:27 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1999-09-07 04:28:27 +0000 |
commit | 692b7d62e873949b437e6d9ae68d5526e49e5916 (patch) | |
tree | e8af322a04a896c05d3de2d8a2b981b60fdd32d9 /bfd/coffgen.c | |
parent | 4c117b10b2d627169cead79488c4e0196cf896d2 (diff) | |
download | gdb-692b7d62e873949b437e6d9ae68d5526e49e5916.zip gdb-692b7d62e873949b437e6d9ae68d5526e49e5916.tar.gz gdb-692b7d62e873949b437e6d9ae68d5526e49e5916.tar.bz2 |
* coffcode.h (bfd_coff_backend_data): Add _bfd_filnmlen field.
(bfd_coff_filnmlen): Define.
(bfd_coff_std_swap_table): Initialize new field.
* coffgen.c (coff_fix_symbol_name): Use bfd_coff_filnmlen rather
than FILNMLEN.
(coff_write_symbols): Likewise.
(coff_get_normalized_symtab): Likewise.
* coff-sh.c (bfd_coff_small_swap_table): Initialize new field.
* libcoff.h: Rebuild.
Diffstat (limited to 'bfd/coffgen.c')
-rw-r--r-- | bfd/coffgen.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/bfd/coffgen.c b/bfd/coffgen.c index a104887..feb57a3 100644 --- a/bfd/coffgen.c +++ b/bfd/coffgen.c @@ -811,14 +811,18 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, if (native->u.syment.n_sclass == C_FILE && native->u.syment.n_numaux > 0) { + unsigned int filnmlen; + strncpy (native->u.syment._n._n_name, ".file", SYMNMLEN); auxent = &(native + 1)->u.auxent; + filnmlen = bfd_coff_filnmlen (abfd); + if (bfd_coff_long_filenames (abfd)) { - if (name_length <= FILNMLEN) + if (name_length <= filnmlen) { - strncpy (auxent->x_file.x_fname, name, FILNMLEN); + strncpy (auxent->x_file.x_fname, name, filnmlen); } else { @@ -829,11 +833,9 @@ coff_fix_symbol_name (abfd, symbol, native, string_size_p, } else { - strncpy (auxent->x_file.x_fname, name, FILNMLEN); - if (name_length > FILNMLEN) - { - name[FILNMLEN] = '\0'; - } + strncpy (auxent->x_file.x_fname, name, filnmlen); + if (name_length > filnmlen) + name[filnmlen] = '\0'; } } else @@ -1247,7 +1249,7 @@ coff_write_symbols (abfd) } else if (c_symbol->native->u.syment.n_sclass == C_FILE && c_symbol->native->u.syment.n_numaux > 0) - maxlen = FILNMLEN; + maxlen = bfd_coff_filnmlen (abfd); else maxlen = SYMNMLEN; @@ -1765,7 +1767,7 @@ coff_get_normalized_symtab (abfd) ((long) copy_name (abfd, (internal_ptr + 1)->u.auxent.x_file.x_fname, - FILNMLEN)); + bfd_coff_filnmlen (abfd))); } } } |