diff options
author | Tristan Gingold <gingold@adacore.com> | 2012-04-17 10:51:07 +0000 |
---|---|---|
committer | Tristan Gingold <gingold@adacore.com> | 2012-04-17 10:51:07 +0000 |
commit | da03bf4d5bf7cdf56a85d10b85b05028649f94f7 (patch) | |
tree | 0adc0e39dcb080fa25e2abf41f7f56ee3085b813 /bfd | |
parent | d22260241bfa41c701365adf714a6cc04c4810d8 (diff) | |
download | gdb-da03bf4d5bf7cdf56a85d10b85b05028649f94f7.zip gdb-da03bf4d5bf7cdf56a85d10b85b05028649f94f7.tar.gz gdb-da03bf4d5bf7cdf56a85d10b85b05028649f94f7.tar.bz2 |
2012-04-17 Tristan Gingold <gingold@adacore.com>
* vms-lib.c (_bfd_vms_lib_get_module): Append .obj extension to
member of an object archive.<
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/vms-lib.c | 21 |
2 files changed, 25 insertions, 1 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index da0ebee..7871002 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,10 @@ 2012-04-17 Tristan Gingold <gingold@adacore.com> + * vms-lib.c (_bfd_vms_lib_get_module): Append .obj extension to + member of an object archive.< + +2012-04-17 Tristan Gingold <gingold@adacore.com> + * vms-lib.c (MAX_EKEYLEN): Define. (MAX_KEYLEN): Fix value. (vms_write_index): Add comments and fix indentation. diff --git a/bfd/vms-lib.c b/bfd/vms-lib.c index 7869695..a0649d0 100644 --- a/bfd/vms-lib.c +++ b/bfd/vms-lib.c @@ -1296,6 +1296,7 @@ _bfd_vms_lib_get_module (bfd *abfd, unsigned int modidx) struct lib_tdata *tdata = bfd_libdata (abfd); bfd *res; file_ptr file_off; + char *name; /* Sanity check. */ if (modidx >= tdata->nbr_modules) @@ -1357,7 +1358,25 @@ _bfd_vms_lib_get_module (bfd *abfd, unsigned int modidx) res->origin = file_off + tdata->mhd_size; } - res->filename = tdata->modules[modidx].name; + /* Set filename. */ + name = tdata->modules[modidx].name; + switch (tdata->type) + { + case LBR__C_TYP_IOBJ: + case LBR__C_TYP_EOBJ: + /* For object archives, append .obj to mimic standard behaviour. */ + { + size_t namelen = strlen (name); + char *name1 = bfd_alloc (res, namelen + 4 + 1); + memcpy (name1, name, namelen); + strcpy (name1 + namelen, ".obj"); + name = name1; + } + break; + default: + break; + } + res->filename = name; tdata->cache[modidx] = res; |