projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add "arm_any" architecture type to allow -m option to various binutils to match any...
[deliverable/binutils-gdb.git]
/
bfd
/
vms-alpha.c
diff --git
a/bfd/vms-alpha.c
b/bfd/vms-alpha.c
index 8c24ef0c28171c25283ac5bb890aad0be93a0ebb..b00ab2a54df11305c068dcb950dfcf5e3f1b1424 100644
(file)
--- a/
bfd/vms-alpha.c
+++ b/
bfd/vms-alpha.c
@@
-1,5
+1,5
@@
/* vms.c -- BFD back-end for EVAX (openVMS/Alpha) files.
/* vms.c -- BFD back-end for EVAX (openVMS/Alpha) files.
- Copyright (C) 1996-201
4
Free Software Foundation, Inc.
+ Copyright (C) 1996-201
6
Free Software Foundation, Inc.
Initial version written by Klaus Kaempf (kkaempf@rmi.de)
Major rewrite by Adacore.
Initial version written by Klaus Kaempf (kkaempf@rmi.de)
Major rewrite by Adacore.
@@
-521,9
+521,11
@@
_bfd_vms_slurp_eisd (bfd *abfd, unsigned int offset)
asection *section;
flagword bfd_flags;
asection *section;
flagword bfd_flags;
+ /* PR 17512: file: 3d9e9fe9. */
+ if (offset >= PRIV (recrd.rec_size))
+ return FALSE;
eisd = (struct vms_eisd *)(PRIV (recrd.rec) + offset);
rec_size = bfd_getl32 (eisd->eisdsize);
eisd = (struct vms_eisd *)(PRIV (recrd.rec) + offset);
rec_size = bfd_getl32 (eisd->eisdsize);
-
if (rec_size == 0)
break;
if (rec_size == 0)
break;
@@
-827,7
+829,7
@@
vms_get_remaining_object_record (bfd *abfd, unsigned int read_so_far)
/* PR 17512: file: 025-1974-0.004. */
else if (to_read <= read_so_far)
return 0;
/* PR 17512: file: 025-1974-0.004. */
else if (to_read <= read_so_far)
return 0;
-
+
/* Read the remaining record. */
to_read -= read_so_far;
/* Read the remaining record. */
to_read -= read_so_far;
@@
-857,9
+859,12
@@
_bfd_vms_slurp_ehdr (bfd *abfd)
{
unsigned char *ptr;
unsigned char *vms_rec;
{
unsigned char *ptr;
unsigned char *vms_rec;
+ unsigned char *end;
int subtype;
vms_rec = PRIV (recrd.rec);
int subtype;
vms_rec = PRIV (recrd.rec);
+ /* PR 17512: file: 62736583. */
+ end = PRIV (recrd.buf) + PRIV (recrd.buf_size);
vms_debug2 ((2, "HDR/EMH\n"));
vms_debug2 ((2, "HDR/EMH\n"));
@@
-871,28
+876,42
@@
_bfd_vms_slurp_ehdr (bfd *abfd)
{
case EMH__C_MHD:
/* Module header. */
{
case EMH__C_MHD:
/* Module header. */
+ if (vms_rec + 21 >= end)
+ goto fail;
PRIV (hdr_data).hdr_b_strlvl = vms_rec[6];
PRIV (hdr_data).hdr_l_arch1 = bfd_getl32 (vms_rec + 8);
PRIV (hdr_data).hdr_l_arch2 = bfd_getl32 (vms_rec + 12);
PRIV (hdr_data).hdr_l_recsiz = bfd_getl32 (vms_rec + 16);
PRIV (hdr_data).hdr_b_strlvl = vms_rec[6];
PRIV (hdr_data).hdr_l_arch1 = bfd_getl32 (vms_rec + 8);
PRIV (hdr_data).hdr_l_arch2 = bfd_getl32 (vms_rec + 12);
PRIV (hdr_data).hdr_l_recsiz = bfd_getl32 (vms_rec + 16);
+ if ((vms_rec + 20 + vms_rec[20] + 1) >= end)
+ goto fail;
PRIV (hdr_data).hdr_t_name = _bfd_vms_save_counted_string (vms_rec + 20);
ptr = vms_rec + 20 + vms_rec[20] + 1;
PRIV (hdr_data).hdr_t_name = _bfd_vms_save_counted_string (vms_rec + 20);
ptr = vms_rec + 20 + vms_rec[20] + 1;
+ if ((ptr + *ptr + 1) >= end)
+ goto fail;
PRIV (hdr_data).hdr_t_version =_bfd_vms_save_counted_string (ptr);
ptr += *ptr + 1;
PRIV (hdr_data).hdr_t_version =_bfd_vms_save_counted_string (ptr);
ptr += *ptr + 1;
+ if (ptr + 17 >= end)
+ goto fail;
PRIV (hdr_data).hdr_t_date = _bfd_vms_save_sized_string (ptr, 17);
break;
case EMH__C_LNM:
PRIV (hdr_data).hdr_t_date = _bfd_vms_save_sized_string (ptr, 17);
break;
case EMH__C_LNM:
+ if (vms_rec + PRIV (recrd.rec_size - 6) > end)
+ goto fail;
PRIV (hdr_data).hdr_c_lnm =
_bfd_vms_save_sized_string (vms_rec, PRIV (recrd.rec_size - 6));
break;
case EMH__C_SRC:
PRIV (hdr_data).hdr_c_lnm =
_bfd_vms_save_sized_string (vms_rec, PRIV (recrd.rec_size - 6));
break;
case EMH__C_SRC:
+ if (vms_rec + PRIV (recrd.rec_size - 6) > end)
+ goto fail;
PRIV (hdr_data).hdr_c_src =
_bfd_vms_save_sized_string (vms_rec, PRIV (recrd.rec_size - 6));
break;
case EMH__C_TTL:
PRIV (hdr_data).hdr_c_src =
_bfd_vms_save_sized_string (vms_rec, PRIV (recrd.rec_size - 6));
break;
case EMH__C_TTL:
+ if (vms_rec + PRIV (recrd.rec_size - 6) > end)
+ goto fail;
PRIV (hdr_data).hdr_c_ttl =
_bfd_vms_save_sized_string (vms_rec, PRIV (recrd.rec_size - 6));
break;
PRIV (hdr_data).hdr_c_ttl =
_bfd_vms_save_sized_string (vms_rec, PRIV (recrd.rec_size - 6));
break;
@@
-903,6
+922,7
@@
_bfd_vms_slurp_ehdr (bfd *abfd)
break;
default:
break;
default:
+ fail:
bfd_set_error (bfd_error_wrong_format);
return FALSE;
}
bfd_set_error (bfd_error_wrong_format);
return FALSE;
}
@@
-1621,9
+1641,8
@@
_bfd_vms_get_value (bfd *abfd, const unsigned char *ascic,
*vma = 0;
else
{
*vma = 0;
else
{
- if (!(*info->callbacks->undefined_symbol)
- (info, name, abfd, PRIV (image_section), PRIV (image_offset), TRUE))
- abort ();
+ (*info->callbacks->undefined_symbol)
+ (info, name, abfd, PRIV (image_section), PRIV (image_offset), TRUE);
*vma = 0;
}
}
*vma = 0;
}
}
@@
-2527,6
+2546,9
@@
alpha_vms_object_p (bfd *abfd)
/* Reset the record pointer. */
PRIV (recrd.rec) = buf;
/* Reset the record pointer. */
PRIV (recrd.rec) = buf;
+ /* PR 17512: file: 7d7c57c2. */
+ if (PRIV (recrd.rec_size) < sizeof (struct vms_eihd))
+ goto error_ret;
vms_debug2 ((2, "file type is image\n"));
if (_bfd_vms_slurp_eihd (abfd, &eisd_offset, &eihs_offset) != TRUE)
vms_debug2 ((2, "file type is image\n"));
if (_bfd_vms_slurp_eihd (abfd, &eisd_offset, &eihs_offset) != TRUE)
@@
-8179,7
+8201,7
@@
alpha_vms_link_add_archive_symbols (bfd *abfd, struct bfd_link_info *info)
to include it. We don't need to check anything. */
if (!(*info->callbacks
->add_archive_element) (info, element, h->root.string, &element))
to include it. We don't need to check anything. */
if (!(*info->callbacks
->add_archive_element) (info, element, h->root.string, &element))
-
return FALSE
;
+
continue
;
if (!alpha_vms_link_add_object_symbols (element, info))
return FALSE;
if (!alpha_vms_link_add_object_symbols (element, info))
return FALSE;
@@
-8574,7
+8596,7
@@
alpha_vms_bfd_final_link (bfd *abfd, struct bfd_link_info *info)
asection *dst;
asection *dmt;
asection *dst;
asection *dmt;
- if (
info->relocatable
)
+ if (
bfd_link_relocatable (info)
)
{
/* FIXME: we do not yet support relocatable link. It is not obvious
how to do it for debug infos. */
{
/* FIXME: we do not yet support relocatable link. It is not obvious
how to do it for debug infos. */
@@
-8990,13
+9012,13
@@
vms_new_section_hook (bfd * abfd, asection *section)
{
bfd_size_type amt;
{
bfd_size_type amt;
- vms_debug2 ((1, "vms_new_section_hook (%p, [%
d
]%s)\n",
+ vms_debug2 ((1, "vms_new_section_hook (%p, [%
u
]%s)\n",
abfd, section->index, section->name));
if (! bfd_set_section_alignment (abfd, section, 0))
return FALSE;
abfd, section->index, section->name));
if (! bfd_set_section_alignment (abfd, section, 0))
return FALSE;
- vms_debug2 ((7, "%
d
: %s\n", section->index, section->name));
+ vms_debug2 ((7, "%
u
: %s\n", section->index, section->name));
amt = sizeof (struct vms_section_data_struct);
section->used_by_bfd = bfd_zalloc (abfd, amt);
amt = sizeof (struct vms_section_data_struct);
section->used_by_bfd = bfd_zalloc (abfd, amt);
@@
-9237,6
+9259,7
@@
bfd_vms_get_data (bfd *abfd)
_bfd_nodynamic_get_dynamic_reloc_upper_bound
#define alpha_vms_canonicalize_dynamic_reloc \
_bfd_nodynamic_canonicalize_dynamic_reloc
_bfd_nodynamic_get_dynamic_reloc_upper_bound
#define alpha_vms_canonicalize_dynamic_reloc \
_bfd_nodynamic_canonicalize_dynamic_reloc
+#define alpha_vms_bfd_link_check_relocs _bfd_generic_link_check_relocs
const bfd_target alpha_vms_vec =
{
const bfd_target alpha_vms_vec =
{
This page took
0.02748 seconds
and
4
git commands to generate.