projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gdb: Convert language la_word_break_characters field to a method
[deliverable/binutils-gdb.git]
/
bfd
/
vms-lib.c
diff --git
a/bfd/vms-lib.c
b/bfd/vms-lib.c
index 65fd70a720e51c27217b9dbe5186ea78c141e033..f000bc2a8f1fbf08fd9db209a0d872deb8090dc0 100644
(file)
--- a/
bfd/vms-lib.c
+++ b/
bfd/vms-lib.c
@@
-242,7
+242,8
@@
vms_write_block (bfd *abfd, unsigned int vbn, void *blk)
If the entry is indirect, recurse. */
static bfd_boolean
If the entry is indirect, recurse. */
static bfd_boolean
-vms_traverse_index (bfd *abfd, unsigned int vbn, struct carsym_mem *cs)
+vms_traverse_index (bfd *abfd, unsigned int vbn, struct carsym_mem *cs,
+ unsigned int recur_count)
{
struct vms_indexdef indexdef;
file_ptr off;
{
struct vms_indexdef indexdef;
file_ptr off;
@@
-250,6
+251,12
@@
vms_traverse_index (bfd *abfd, unsigned int vbn, struct carsym_mem *cs)
unsigned char *endp;
unsigned int n;
unsigned char *endp;
unsigned int n;
+ if (recur_count == 100)
+ {
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
+ }
+
/* Read the index block. */
BFD_ASSERT (sizeof (indexdef) == VMS_BLOCK_SIZE);
if (!vms_read_block (abfd, vbn, &indexdef))
/* Read the index block. */
BFD_ASSERT (sizeof (indexdef) == VMS_BLOCK_SIZE);
if (!vms_read_block (abfd, vbn, &indexdef))
@@
-307,7
+314,7
@@
vms_traverse_index (bfd *abfd, unsigned int vbn, struct carsym_mem *cs)
if (idx_off == RFADEF__C_INDEX)
{
/* Indirect entry. Recurse. */
if (idx_off == RFADEF__C_INDEX)
{
/* Indirect entry. Recurse. */
- if (!vms_traverse_index (abfd, idx_vbn, cs))
+ if (!vms_traverse_index (abfd, idx_vbn, cs
, recur_count + 1
))
return FALSE;
}
else
return FALSE;
}
else
@@
-454,7
+461,7
@@
vms_lib_read_index (bfd *abfd, int idx, unsigned int *nbrel)
/* Note: if the index is empty, there is no block to traverse. */
vbn = bfd_getl32 (idd.vbn);
/* Note: if the index is empty, there is no block to traverse. */
vbn = bfd_getl32 (idd.vbn);
- if (vbn != 0 && !vms_traverse_index (abfd, vbn, &csm))
+ if (vbn != 0 && !vms_traverse_index (abfd, vbn, &csm
, 0
))
{
if (csm.realloced)
free (csm.idx);
{
if (csm.realloced)
free (csm.idx);
@@
-482,7
+489,7
@@
vms_lib_read_index (bfd *abfd, int idx, unsigned int *nbrel)
/* Standard function. */
/* Standard function. */
-static
const bfd_target *
+static
bfd_cleanup
_bfd_vms_lib_archive_p (bfd *abfd, enum vms_lib_kind kind)
{
struct vms_lhd lhd;
_bfd_vms_lib_archive_p (bfd *abfd, enum vms_lib_kind kind)
{
struct vms_lhd lhd;
@@
-686,7
+693,7
@@
_bfd_vms_lib_archive_p (bfd *abfd, enum vms_lib_kind kind)
if (tdata->type == LBR__C_TYP_ESHSTB || tdata->type == LBR__C_TYP_ISHSTB)
abfd->is_thin_archive = TRUE;
if (tdata->type == LBR__C_TYP_ESHSTB || tdata->type == LBR__C_TYP_ISHSTB)
abfd->is_thin_archive = TRUE;
- return
abfd->xvec
;
+ return
_bfd_no_cleanup
;
err:
bfd_release (abfd, tdata);
err:
bfd_release (abfd, tdata);
@@
-696,7
+703,7
@@
_bfd_vms_lib_archive_p (bfd *abfd, enum vms_lib_kind kind)
/* Standard function for alpha libraries. */
/* Standard function for alpha libraries. */
-const bfd_target *
+bfd_cleanup
_bfd_vms_lib_alpha_archive_p (bfd *abfd)
{
return _bfd_vms_lib_archive_p (abfd, vms_lib_alpha);
_bfd_vms_lib_alpha_archive_p (bfd *abfd)
{
return _bfd_vms_lib_archive_p (abfd, vms_lib_alpha);
@@
-704,7
+711,7
@@
_bfd_vms_lib_alpha_archive_p (bfd *abfd)
/* Standard function for ia64 libraries. */
/* Standard function for ia64 libraries. */
-const bfd_target *
+bfd_cleanup
_bfd_vms_lib_ia64_archive_p (bfd *abfd)
{
return _bfd_vms_lib_archive_p (abfd, vms_lib_ia64);
_bfd_vms_lib_ia64_archive_p (bfd *abfd)
{
return _bfd_vms_lib_archive_p (abfd, vms_lib_ia64);
@@
-712,7
+719,7
@@
_bfd_vms_lib_ia64_archive_p (bfd *abfd)
/* Standard function for text libraries. */
/* Standard function for text libraries. */
-static
const bfd_target *
+static
bfd_cleanup
_bfd_vms_lib_txt_archive_p (bfd *abfd)
{
return _bfd_vms_lib_archive_p (abfd, vms_lib_txt);
_bfd_vms_lib_txt_archive_p (bfd *abfd)
{
return _bfd_vms_lib_archive_p (abfd, vms_lib_txt);
@@
-1445,6
+1452,12
@@
_bfd_vms_lib_get_module (bfd *abfd, unsigned int modidx)
break;
}
bfd_set_filename (res, newname);
break;
}
bfd_set_filename (res, newname);
+ free (newname);
+ if (bfd_get_filename (res) == NULL)
+ {
+ bfd_close (res);
+ return NULL;
+ }
tdata->cache[modidx] = res;
tdata->cache[modidx] = res;
@@
-1484,7
+1497,7
@@
bfd *
_bfd_vms_lib_get_imagelib_file (bfd *el)
{
bfd *archive = el->my_archive;
_bfd_vms_lib_get_imagelib_file (bfd *el)
{
bfd *archive = el->my_archive;
- const char *modname =
el->filename
;
+ const char *modname =
bfd_get_filename (el)
;
int modlen = strlen (modname);
char *filename;
int j;
int modlen = strlen (modname);
char *filename;
int j;
@@
-1510,7
+1523,7
@@
_bfd_vms_lib_get_imagelib_file (bfd *el)
{
/* xgettext:c-format */
_bfd_error_handler(_("could not open shared image '%s' from '%s'"),
{
/* xgettext:c-format */
_bfd_error_handler(_("could not open shared image '%s' from '%s'"),
- filename,
archive->filename
);
+ filename,
bfd_get_filename (archive)
);
bfd_release (archive, filename);
return NULL;
}
bfd_release (archive, filename);
return NULL;
}
@@
-2032,8
+2045,7
@@
_bfd_vms_lib_build_map (unsigned int nbr_modules,
{
if (storage > syms_max)
{
{
if (storage > syms_max)
{
- if (syms_max > 0)
- free (syms);
+ free (syms);
syms_max = storage;
syms = (asymbol **) bfd_malloc (syms_max);
if (syms == NULL)
syms_max = storage;
syms = (asymbol **) bfd_malloc (syms_max);
if (syms == NULL)
@@
-2084,10
+2096,8
@@
_bfd_vms_lib_build_map (unsigned int nbr_modules,
return TRUE;
error_return:
return TRUE;
error_return:
- if (syms_max > 0)
- free (syms);
- if (map != NULL)
- free (map);
+ free (syms);
+ free (map);
return FALSE;
}
return FALSE;
}
@@
-2145,7
+2155,7
@@
_bfd_vms_lib_write_archive_contents (bfd *arch)
unsigned int nl;
modules[i].abfd = current;
unsigned int nl;
modules[i].abfd = current;
- modules[i].name = vms_get_module_name (
current->filename
, FALSE);
+ modules[i].name = vms_get_module_name (
bfd_get_filename (current)
, FALSE);
modules[i].ref = 1;
/* FIXME: silently truncate long names ? */
modules[i].ref = 1;
/* FIXME: silently truncate long names ? */
This page took
0.025175 seconds
and
4
git commands to generate.