Fix for pe.em
Nick Clifton
nickc@redhat.com
Fri Oct 13 13:40:00 GMT 2000
Hi DJ,
: > - int nsyms = bfd_canonicalize_symtab (is->the_bfd, symbols);
: > -
:
: I don't understand this one. The symtab is used just a few lines
: later, where it's passed to bfd_canonicalize_reloc(). Perhaps you
: meant to just get rid of the "int nsyms =" part ?
*%&^$%&^%& !!
Yes you are right. *sigh*. I have applied the following patch to fix
this stupid mistake.
Cheers
Nick
Index: emultempl/pe.em
===================================================================
RCS file: /cvs/src//src/ld/emultempl/pe.em,v
retrieving revision 1.35
diff -p -r1.35 pe.em
*** pe.em 2000/10/13 20:16:03 1.35
--- pe.em 2000/10/13 20:35:02
*************** gld_${EMULATION_NAME}_after_open ()
*** 855,865 ****
for (sec = is->the_bfd->sections; sec; sec = sec->next)
{
int i;
! int symsize = bfd_get_symtab_upper_bound (is->the_bfd);
! asymbol **symbols = (asymbol **) xmalloc (symsize);
! int relsize = bfd_get_reloc_upper_bound (is->the_bfd, sec);
! arelent **relocs = (arelent **) xmalloc ((size_t) relsize);
! int nrelocs = bfd_canonicalize_reloc (is->the_bfd, sec,
relocs, symbols);
for (i=0; i<nrelocs; i++)
{
--- 855,872 ----
for (sec = is->the_bfd->sections; sec; sec = sec->next)
{
int i;
! int symsize;
! asymbol **symbols;
! int relsize;
! arelent **relocs;
! int nrelocs;
!
! symsize = bfd_get_symtab_upper_bound (is->the_bfd);
! symbols = (asymbol **) xmalloc (symsize);
! bfd_canonicalize_symtab (is->the_bfd, symbols);
! relsize = bfd_get_reloc_upper_bound (is->the_bfd, sec);
! relocs = (arelent **) xmalloc ((size_t) relsize);
! nrelocs = bfd_canonicalize_reloc (is->the_bfd, sec,
relocs, symbols);
for (i=0; i<nrelocs; i++)
{
More information about the Binutils
mailing list