[VMS/committed] Handle DSF and STB files
Tristan Gingold
gingold@adacore.com
Fri May 14 07:44:00 GMT 2010
Hi,
in order to handle (well, to read them) DSF (Debug Symbol File) and STB (Symbol Table File), vms-alpha.c
required two minor fixes. One of them fixes in fact a real bug that could appear also with object files.
Tristan.
bfd/
2010-05-14 Tristan Gingold <gingold@adacore.com>
* vms-alpha.c (alpha_vms_object_p): Accept header size of 0.
(_bfd_vms_get_object_record): Handle align byte only in the
foreign case.
diff -c -r1.6 vms-alpha.c
*** vms-alpha.c 3 May 2010 16:04:31 -0000 1.6
--- vms-alpha.c 14 May 2010 07:28:24 -0000
***************
*** 759,765 ****
vms_debug2 ((8, "_bfd_vms_get_obj_record\n"));
/* Skip alignment byte if the current position is odd. */
! if (bfd_tell (abfd) & 1)
{
if (bfd_bread (PRIV (recrd.buf), 1, abfd) != 1)
{
--- 759,765 ----
vms_debug2 ((8, "_bfd_vms_get_obj_record\n"));
/* Skip alignment byte if the current position is odd. */
! if (PRIV (recrd.file_format) == FF_FOREIGN && (bfd_tell (abfd) & 1))
{
if (bfd_bread (PRIV (recrd.buf), 1, abfd) != 1)
{
***************
*** 2450,2455 ****
--- 2450,2459 ----
/* Extract the header size. */
PRIV (recrd.rec_size) = bfd_getl32 (buf + EIHD__L_SIZE);
+ /* The header size is 0 for DSF files. */
+ if (PRIV (recrd.rec_size) == 0)
+ PRIV (recrd.rec_size) = sizeof (struct vms_eihd);
+
if (PRIV (recrd.rec_size) > PRIV (recrd.buf_size))
{
buf = bfd_realloc_or_free (buf, PRIV (recrd.rec_size));
More information about the Binutils
mailing list