This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [RFC] extending bfd_print_private_bfd_data
Tristan Gingold wrote:
> I can't figure out exactly how this would work with elf backends. See
> for example elf32-m32c.c:
>
> m32c_elf_print_private_bfd_data (bfd *abfd, PTR ptr)
> {
> FILE *file = (FILE *) ptr;
> flagword flags;
>
> BFD_ASSERT (abfd != NULL && ptr != NULL);
>
> /* Print normal ELF private data. */
> _bfd_elf_print_private_bfd_data (abfd, ptr);
>
> ...
> }
Ah. Derivation/inheritance. Didn't allow for that.
> In this case, the complete words string would be a concatenation of the
> one for _bfd_elf_print_private_bfd_data and the one for m32c.
> But the flag value for m32c would depend on the number of words for the
> elf generic printer. Doable but
> more cryptic IMHO.
>
>> Or were you planning that some backends might dynamically generate their
>> list of words?
>
> No I don't plan that.
Ah, no, but since there's implicit concatentation of strings going on there
by having one private print routine call the other... argh. Yeh, can't be
done; best just let them parse the words themselves. Ah well, it would have
been nice - but only if it had been practical and simpler than the alternative!
cheers,
DaveK