This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Bogus code in coffgen.c?
- To: binutils at sourceware dot cygnus dot com
- Subject: Bogus code in coffgen.c?
- From: "H . J . Lu" <hjl at lucon dot org>
- Date: Thu, 1 Nov 2001 15:41:40 -0800
In coffgen.c, there is
290 if (internal_f.f_opthdr)
291 {
292 PTR opthdr;
293
294 opthdr = bfd_alloc (abfd, aoutsz);
^^^^^^^^
295 if (opthdr == NULL)
296 return 0;;
297 if (bfd_bread (opthdr, (bfd_size_type) internal_f.f_opthdr, abfd)
^^^^^^^^^^^^^^^^^^^
298 != internal_f.f_opthdr)
299 {
300 return 0;
301 }
302 bfd_coff_swap_aouthdr_in (abfd, opthdr, (PTR) &internal_a);
303 }
304
We allocate a buffer of `aoutsz' bytes. Then we read `internal_f.f_opthdr'
bytes into it. Why?
H.J.