This is the mail archive of the binutils@sourceware.cygnus.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]

Re: PATCH BFD octets per byte support


Hi Tim,

: * archures.c: add new functions to determine a target's byte size.
: * bfd-in2.h: regenerated
: * coffgen.c: indicate that the offset parameter is in bytes, not octets
: * cofflink.c: use bfd_octets_per_byte where appropriate to get the octet
: offset when calling bfd_set_section_contents.
: * linker.c: ditto
: * reloc.c (bfd_perform_relocation, bfd_install_relocation) distinguish
: between octets and bytes.  Use octets when indexing into octet data; use
: bytes when calculating target addresses.
: * section.c: Distinguish between octets and bytes for usage of
: _cooked_size,  _raw_size, and output_offset.  Clarify description of
: bfd_set_section_contents.
: * srec.c (srec_write_section): distinguish between octets and bytes.
: Target addresses are in bytes, offsets into octet data are in octets.

This patch is much clearer - thank you.

There are still a couple of minor points, but basically I think that
the patch is acceptable now.  Do you have write permission on the
repository ?  If not then let me know and I will check it in for you,
otherwise please follow my suggestions below and check the patch in
yourself.


The minor points are:

  * Your ChangeLog entry is not formatted correctly.  It ought to read
like this:

2000-01-13  Tim Wall  <twall@tiac.net>

	* archures.c (bfd_octets_per_byte): New function: Return
	target byte size.
	(bfd_arch_mach_octets_per_byte): New function: Return target
	byte size.

	* section.c: Distinguish between octets and bytes for usage of 
	_cooked_size,  _raw_size, and output_offset.  Clarify
	description of bfd_set_section_contents.

	* bfd-in2.h: Regenerate.

and so on....

  * The text you have describing the lma and _raw_size fields does
not quite follow the rules of proper English grammar.  May I suggest
the following slight rewording: 

 .   bfd_vma lma;
 .
 .        {* The size of the section in octets, as it will be output.
 .           Contains a value even if the section has no contents (e.g., the
 .           size of <<.bss>>).  This will be filled in after relocation.  *}
 .
 .   bfd_size_type _cooked_size;
 .
 .        {* The original size on disk of the section, in octets.  Normally this
 .	    value is the same as the size, but if some relaxing has
 .	    been done, then this value will be bigger.  *}
 .
 .   bfd_size_type _raw_size;
 .
 .        {* If this section is going to be output, then this value is the
 .           offset in *bytes* into the output section of the first byte in the
 .           input section (byte ==> smallest addressable unit on the
 .           target).  In most cases, if this was going to start at the
 .           100th octet (8-bit quantity) in the output section, this value
 .           would be 100.  However, if the target byte size is 16 bits
 .           (bfd_octets_per_byte is "2"), this value would be 50.  *}

Cheers
	Nick


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