aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/vms-lib.c21
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;