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: bfd_error_handler extension


Hi Alan,

So my idea was to always pass extension args first.  A call might look
like

  (*_bfd_error_handler)
    (_("%B: bad reloc symbol index (0x%lx >= 0x%lx) for offset 0x%lx in section `%S'"),
     abfd, sec,
     (unsigned long) r_symndx, (unsigned long) nsyms, irela->r_offset);

_bfd_default_error_handler then would process any %B or %S in the format
string, and pass a substituted format string on to vfprint.  There is
some nastiness with this approach, since you need to expand "%" in any
substitutions to "%%".

Which should be a pretty rare case right ? I think that this is a good idea - code simplification is always a good thing.


Cheers
  Nick



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