This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Getting rid of BFD section->_raw_size and section->_cooked_size
- From: Andrew Cagney <cagney at gnu dot org>
- To: Hans-Peter Nilsson <hp at bitrange dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 22 Oct 2003 10:35:38 -0400
- Subject: Re: Getting rid of BFD section->_raw_size and section->_cooked_size
- References: <Pine.BSF.4.44.0310220929260.39723-100000@dair.pair.com>
Ya! And nice timing. Its really good to see BFD tightening the hatch
on its interfaces! The tighter the iterfaces, the greater the freedom
to inovate the internals.
Some, slightly mindless, suggestions taken from an external point of
view follow.
- bfd_section_size (abfd, sec)
- bfd_unaltered_section_size (abfd, sec)
Per a recent post from me, if the BFD isn't needed, don't include it.
GDB, in various places, is draging around "struct bfd"s just so that it
can it pass (unused) into these methods. Also, an alternative name,
such as bfd_section_current_size (sec), would drop a stronger hint that
the former can and will change. However, whichever.
bfd_set_section_size (abfd, sec, size)
If the intent is for this method to only be used when constructing a
section then a full initialization method, such as bfd_section_init
VARIANT (sec, variant argument list), will be better. No matter how
hard you try, people will subvert the _raw_size-write method in ways you
never intend, "trust me" :-).
bfd_incr_section_size
bfd_incr_set_section_size
Suggest bfd_section_adjust_size(sec). "incr" strongly suggests only
positive adjustment is permitted, and that negative adjustments requires
the use of the [missing] "decr" method :-) A word like "adjust", being
more vague, should make the general intent clear.
Happy hacking!
Andrew