aboutsummaryrefslogtreecommitdiff
path: root/bfd/vms-hdr.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2010-04-01 09:47:14 +0000
committerTristan Gingold <gingold@adacore.com>2010-04-01 09:47:14 +0000
commit4b544b64681eec335bef3d3383772a7a38278fa9 (patch)
treeb6f8dad055f9e6aefab76aa5bf0db703b4445862 /bfd/vms-hdr.c
parent932fd279a972e48933c461d0fc502358d57cc2ec (diff)
downloadfsf-binutils-gdb-4b544b64681eec335bef3d3383772a7a38278fa9.zip
fsf-binutils-gdb-4b544b64681eec335bef3d3383772a7a38278fa9.tar.gz
fsf-binutils-gdb-4b544b64681eec335bef3d3383772a7a38278fa9.tar.bz2
2010-04-01 Tristan Gingold <gingold@adacore.com>
* vms.h: Include time.h. Add prototypes for vms_get_module_name, vms_time_to_time_t and vms_rawtime_to_time_t. * vms.c (vms_alpha_vec): Add archives support. * vms-misc.c: Include safe-ctype.h (vms_get_module_name): New function. (vms_time_to_time_t, vms_rawtime_to_time_t): Ditto. * vms-hdr.c (_bfd_vms_write_hdr): Put module name creation to the vms_get_module_name function. Use this function. * targets.c: Declare vms_lib_txt_vec. Add it to _bfd_target_vector. * libbfd-in.h: Add prototype for _bfd_append_relative_path. Add prototypes for vms-lib.c * libbfd.h: Regenerate. * configure.in (TDEFINES): Add an entry for vms_lib_txt_vec. Add vms-lib.lo to vms_alpha_vec. * config.bfd (targ_cpu): Add targ_selvecs for alpha*-*-*vms*. * configure: Regenerate. * bfd.c: Add selective_search field. * bfd-in2.h: Regenerate. * archive.c (append_relative_path): Rename to _bfd_append_relative_path and make it public. (_bfd_get_elt_at_filepos): Adjust for above renaming. * Makefile.am (BFD32_BACKENDS): Add vms-lib.lo (BFD32_BACKENDS_CFILES): Add vms-lib.c * Makefile.in: Regenerate.
Diffstat (limited to 'bfd/vms-hdr.c')
-rw-r--r--bfd/vms-hdr.c40
1 files changed, 3 insertions, 37 deletions
diff --git a/bfd/vms-hdr.c b/bfd/vms-hdr.c
index 4ac5b97..343f53e 100644
--- a/bfd/vms-hdr.c
+++ b/bfd/vms-hdr.c
@@ -237,43 +237,9 @@ _bfd_vms_write_hdr (bfd *abfd, int objtype)
/* Create module name from filename. */
if (bfd_get_filename (abfd) != 0)
{
- /* Strip path and suffix information. */
- char *fname, *fout, *fptr;
-
- fptr = bfd_get_filename (abfd);
- fname = strdup (fptr);
-
- /* Strip VMS path. */
- fout = strrchr (fname, ']');
- if (fout == NULL)
- fout = strchr (fname, ':');
- if (fout != NULL)
- fout++;
- else
- fout = fname;
-
- /* Strip UNIX path. */
- fptr = strrchr (fout, '/');
- if (fptr != NULL)
- fout = fptr + 1;
-
- /* Strip suffix. */
- fptr = strrchr (fout, '.');
- if (fptr != 0)
- *fptr = 0;
-
- /* Convert to upper case and truncate at 31 characters.
- (VMS object file format restricts module name length to 31). */
- fptr = fout;
- while (*fptr != 0)
- {
- *fptr = TOUPPER (*fptr);
- fptr++;
- if (*fptr == ';' || (fptr - fout) >= 31)
- *fptr = 0;
- }
- _bfd_vms_output_counted (abfd, fout);
- free (fname);
+ char *module = vms_get_module_name (bfd_get_filename (abfd), TRUE);
+ _bfd_vms_output_counted (abfd, module);
+ free (module);
}
else
_bfd_vms_output_counted (abfd, "NONAME");