This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: problem with bfd update from 2001/12/17
On Fri, Apr 26, 2002 at 12:46:15PM +0930, Alan Modra wrote:
> On Fri, Apr 26, 2002 at 11:31:15AM +0930, Alan Modra wrote:
> > list, for fast addition to the list. It's likely that the cygwin code
> > does some section list manipulation without properly adjusting the tail
> > pointer, then another section is added and the list is broken.
>
> It might be this one.
>
> bfd/ChangeLog
> * coffcode.h (coff_compute_section_file_positions): Set
> section_tail after shuffling section list.
Ah ha, more section list problems. bfd_make_readable is very likely
the culprit, and it's only used in pe-dll.c. The xcofflink.c bug
was benign, I think.
bfd/ChangeLog
* opncls.c (bfd_make_readable): Call bfd_section_list_clear.
* xcofflink.c (xcoff_link_add_dynamic_symbols): Likewise.
Index: bfd/opncls.c
===================================================================
RCS file: /cvs/src/src/bfd/opncls.c,v
retrieving revision 1.7
diff -u -p -r1.7 opncls.c
--- bfd/opncls.c 15 Apr 2002 14:32:28 -0000 1.7
+++ bfd/opncls.c 26 Apr 2002 13:37:12 -0000
@@ -614,7 +614,6 @@ bfd_make_readable(abfd)
abfd->arch_info = &bfd_default_arch_struct;
abfd->where = 0;
- abfd->sections = (asection *) NULL;
abfd->format = bfd_unknown;
abfd->my_archive = (bfd *) NULL;
abfd->origin = 0;
@@ -633,7 +632,8 @@ bfd_make_readable(abfd)
abfd->outsymbols = 0;
abfd->tdata.any = 0;
- bfd_check_format(abfd, bfd_object);
+ bfd_section_list_clear (abfd);
+ bfd_check_format (abfd, bfd_object);
return true;
}
Index: bfd/xcofflink.c
===================================================================
RCS file: /cvs/src/src/bfd/xcofflink.c,v
retrieving revision 1.23
diff -u -p -r1.23 xcofflink.c
--- bfd/xcofflink.c 4 Apr 2002 19:53:38 -0000 1.23
+++ bfd/xcofflink.c 26 Apr 2002 13:37:17 -0000
@@ -2121,7 +2121,7 @@ xcoff_link_add_dynamic_symbols (abfd, in
/* Remove the sections from this object, so that they do not get
included in the link. */
- abfd->sections = NULL;
+ bfd_section_list_clear (abfd);
bfd_xcoff_swap_ldhdr_in (abfd, contents, &ldhdr);
--
Alan Modra
IBM OzLabs - Linux Technology Centre