This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: HELP ME - porting to VLIW machine
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- To: "Fabrizio rosciarelli" <frosciarelli at ipitec dot com>
- Cc: "REDHAT(binutils)" <binutils at sources dot redhat dot com>
- Date: 05 Dec 2001 10:21:42 +0000
- Subject: Re: HELP ME - porting to VLIW machine
- References: <00c101c17dbd$a3763ad0$0e0110ac@pcfabrizio>
Hi Fabrizio,
> I'm trying a porting for a VLIW machine (128-bit word and 11 bit
> address field). In my system there's an ARM microcontroller embedded
> that load VLIW machine program memory.
> 1) Is it correct this definition architecture?
>
> const bfd_arch_info_type bfd_magic_arch =
> {
> 32, -32 bits in a word
You said you had a 128 bit word in your machine, so surely this field
should be 128 ? Unless, that is, you pack multiple 32 bit
instructions into that 128 bit word, in which case 32 might be
correct.
> 11, -11 bits in an address
That looks really strange. Do you really only have 11 bit long
addresses ?
> 2) What's Elf32_Internal_Rela type?
It is a structure defined in include/elf/internal.h. It is the
internal representation of an ELF style relocation. (The ELF standard
specifies the layout of a relocation structure in a binary file. This
is the external representation. The BFD library, when it reads in a
binary ELF file, translate the external representation into its
internal representation).
> 3) Concerning the HOWTO macro: what's the relationship between the macro
> parameters and the architecture parameters? e. g. what third and fourth
> fields have got to do with the first second and third fields of
> bfd_arch_info_type?
The third paramter of the HOWTO macro initialises the "size" field of
the reloc_howto_struct. This is the number of bytes in the object
file that are going to be changed by the reloc. For example if the
reloc is filling in missing fields in a machine instruction it might
have a size of 4 (bytes), assuming a 32 bit instruction, whereas if
the reloc is initialising the value of an unsigned short variable
in the .data section it might have a size of 2 (bytes).
The fourth parameter of the HOWTO macro initialises the "bitsize"
field, which is the number of bits that the reloc can modify. When
the BFD library is processing a reloc is will read in "size" bytes,
examine them, modify "bitsize" bits inside these bytes, and then write
them back out again.
The fields in the bfd_arch_info structure refer to the architecture as
a whole, not to individual relocs. Thus the first field,
"bits_per_word" specifies the word size of the architecture. [This
field is not actually used very much inside the BFD library, but you
never know it may be important one day]. The other fields are
"bits_per_address" and "bits_per_byte" whose meanings should be self
explanatory.
Cheers
Nick