Remove double printed import table lines; add Bound-To comment.

This commit is contained in:
Nick Clifton
2002-05-30 11:06:10 +00:00
parent 37020578cf
commit 5e226794ca
2 changed files with 37 additions and 69 deletions

View File

@ -1,3 +1,8 @@
2002-05-29 Ralf Habacker <ralf.habacker@freenet.de>
* peXXigen.c (pe_print_idata): Remove double printed
import table lines; add Bound-To comment.
2002-05-29 Matt Thomas <matt@3am-software.com>
* Makefile.am (BFD32_BACKENDS): Add elf32-vax.lo.

View File

@ -1142,7 +1142,7 @@ pe_print_idata (abfd, vfile)
adj = section->vma - extra->ImageBase;
/* print all image import descriptors */
/* Print all image import descriptors. */
for (i = 0; i < datasize; i += onaline)
{
bfd_vma hint_addr;
@ -1154,7 +1154,7 @@ pe_print_idata (abfd, vfile)
bfd_size_type j;
char *dll;
/* print (i + extra->DataDirectory[1].VirtualAddress) */
/* Print (i + extra->DataDirectory[1].VirtualAddress). */
fprintf (file, " %08lx\t", (unsigned long) (i + adj + dataoff));
#if 0
if (i + 20 > datasize)
@ -1190,7 +1190,7 @@ pe_print_idata (abfd, vfile)
int differ = 0;
int ft_allocated = 0;
fprintf (file, _("\tvma: Hint/Ord Member-Name\n"));
fprintf (file, _("\tvma: Hint/Ord Member-Name Bound-To\n"));
idx = hint_addr - adj;
@ -1234,7 +1234,10 @@ pe_print_idata (abfd, vfile)
continue;
/* Read datasize bfd_bytes starting at offset ft_idx. */
if (! bfd_get_section_contents (abfd, ft_section, (PTR) ft_data, (bfd_vma) ft_idx, datasize))
if (! bfd_get_section_contents (abfd, ft_section,
(PTR) ft_data,
(bfd_vma) ft_idx,
datasize))
{
free (ft_data);
continue;
@ -1244,17 +1247,19 @@ pe_print_idata (abfd, vfile)
ft_allocated = 1;
}
}
/* print HintName vector entries */
/* Print HintName vector entries. */
for (j = 0; j < datasize; j += 4)
{
unsigned long member = bfd_get_32 (abfd, data + idx + j);
/* print single IMAGE_IMPORT_BY_NAME vector */
/* Print single IMAGE_IMPORT_BY_NAME vector. */
if (member == 0)
break;
if (member & 0x80000000)
fprintf (file, "\t%04lx\t %4lu", member,
member & 0x7fffffff);
fprintf (file, "\t%04lx\t %4lu <none>",
member, member & 0x7fffffff);
else
{
int ordinal;
@ -1268,57 +1273,15 @@ pe_print_idata (abfd, vfile)
/* If the time stamp is not zero, the import address
table holds actual addresses. */
if (time_stamp != 0 && first_thunk != 0 && first_thunk != hint_addr)
if (time_stamp != 0
&& first_thunk != 0
&& first_thunk != hint_addr)
fprintf (file, "\t%04lx",
(long) bfd_get_32 (abfd, ft_data + ft_idx + j));
fprintf (file, "\n");
}
for (j = 0; j < datasize; j += 4)
{
int ordinal;
char *member_name;
bfd_vma hint_member = 0;
bfd_vma iat_member;
if (hint_addr != 0)
hint_member = bfd_get_32 (abfd, data + idx + j);
iat_member = bfd_get_32 (abfd, ft_data + ft_idx + j);
if (hint_addr == 0 && iat_member == 0)
break;
if (hint_addr == 0 || hint_member != iat_member)
{
if (differ == 0)
{
fprintf (file,
_("\tThe Import Address Table (difference found)\n"));
fprintf (file, _("\tvma: Hint/Ord Member-Name\n"));
differ = 1;
}
if (iat_member == 0)
fprintf (file,
_("\t>>> Ran out of IAT members!\n"));
else if (hint_member != 0)
{
ordinal = bfd_get_16 (abfd, data + hint_member - adj);
member_name = (char *) data + hint_member - adj + 2;
fprintf (file, "\t%04lx\t %4d %s\n",
(unsigned long) iat_member, ordinal, member_name);
}
}
if (hint_addr != 0 && hint_member == 0)
break;
}
if (differ == 0)
fprintf (file, _("\tThe Import Address Table is identical\n"));
if (ft_allocated)
free (ft_data);
}