This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: bfd_get_private_data?
- From: Ian Lance Taylor <ian at airs dot com>
- To: Jim Blandy <jimb at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 10 Jul 2003 18:13:50 -0700
- Subject: Re: bfd_get_private_data?
- References: <vt23che2d91.fsf@zenia.home>
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