This is the mail archive of the
mailing list for the binutils project.
Re: ELF octets_per_byte
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: dgisselq at ieee dot org
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 23 Feb 2016 07:58:21 -0800
- Subject: Re: ELF octets_per_byte
- Authentication-results: sourceware.org; auth=none
- References: <1456242622 dot 30661 dot 448 dot camel at jericho>
On Tue, Feb 23, 2016 at 7:50 AM, Dan <firstname.lastname@example.org> wrote:
> I am in the process of trying to port binutils to a new architecture,
> the ZipCPU. (You can find a description of it here:
> https://opencores.org/project,zipcpu) One unique "feature" of this
> processor is that the size of the minimum addressable unit is 32-bits.
> While binutils has support for an "octets_per_byte" value other than
> one, this feature does not appear to be fully supported. Indeed, the
> "bfd/elflink.c" file contains several "FIXME" lines regarding the
> insufficiency of the current support.
> All of these can be easily fixed, and I would like to propose a patch
> (or series of patches) to do this. The first part of this process will
> need to be identifying which ELF variables/values are "bytes" (units of
> the targets address space), and which are "octets" (8-bit values, units
> of the more commonly used address space). Sadly, these units are not
> consistent with the meaning of "bytes" found within the ELF
> specification, nor can they be since the ELF specification does not
> acknowledge the potential difference between these two.
> For the purpose of beginning a discussion, and based upon a reading of
> the ELF specification, I propose the following values be in units of
> section size
> section header size
> section header offset
> For the most part, these values *must* be in octets, or it will be
> impossible to read and process an ELF file.
> I also propose that the following values are in units of target address
> space "bytes":
> ELF header "entry" address
> section header address
> symbol value
> symbol size
> relocation offset
> relocation addend
> Using this definition, applications of "bfd_octets_per_byte()" can be
> applied to convert units from one to the other as necessary.
> Comments? Are there any values that I have missed?
Please open a binutils bug for each issue you find.