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_get_private_data?


Jim Blandy <jimb@redhat.com> writes:

> BFD exports a "bfd_set_private_flags" method for accessing whatever
> private flags field the back end wants to expose.  It's generally used
> by the assembler.
> 
> But I notice that there is no "bfd_get_private_flags" method.  I've
> recently come across a situation where that would be helpful, and I'd
> like to try to implement it.  Would that be considered a good thing?

Personally I think bfd_set_private_flags() is at the wrong level--it
has a name which makes it seem generic, but in fact it has no generic
meaning and it is not possible for generic code to call it.

I tend to prefer exporting specific functions where required, as in
the various declarations found at the end of bfd-in.h (not bfd-in2.h,
where other things follow).  That is, I think it would be better to
have something like bfd_elf_get_hdr_flags() and
bfd_elf_set_hdr_flags().

But since we do already have bfd_set_private_flags(), I suppose it
would be consistent for bfd_get_private_flags() to return whatever
flagword happens to be set by bfd_set_private_flags(), when that makes
sense.

Ian


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