This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pef.c:bfd_pef_object_p breaks other targets


Sorry about that. We have local patches to bfd_check_format_matches() that save and restore the target-specific parts of the bfd before calling each of the recognizers, and I neglected to check the ambiguous-match code on a version without this patch installed.

I've changed pef_object_p, pef_xlib_object_p, and sym_object_p to only trample abfd->tdata if the targets pass the magic-number check (in the case of pef, the first 8 bytes must be "Joy!peff"; for xsym, the first 32 bytes must match "\013Version 3.x" followed by 20 nulls, both of which seem pretty safe).

2002-11-10 Klee Dienes <kdienes@apple.com>

* pef.c: Move version check out of bfd_pef_scan and into
bfd_pef_object_p. Only modify tdata if we have already recognized
the file correctly. Ditto for bfd_pef_xlib_scan and
bfd_pef_xlib_object_p.
* xsym.c (bfd_sym_scan): New function. Does the real work of
parsing an already-recognized xSYM file (moved from
bfd_sym_object_p).
(bfd_sym_object_p): Only modify tdata if we have already
recognized the file correctly.
* xsym.h (bfd_sym_scan): Add prototype.

Attachment: pefsym.txt
Description: Text document


On Thursday, November 7, 2002, at 06:13 PM, Alan Modra wrote:

You can't just willy nilly assign to abfd->tdata.  It's a union and
may contain valid tdata for some other format.  See elf_object_p
for what needs to be done.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]