This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Does binutils support 48-bit instructions and half-word based little-endian?
- From: bjgnu at sunnorth dot com dot cn
- To: binutils at sourceware dot org
- Date: Wed, 8 Aug 2007 14:45:14 +0800
- Subject: Does binutils support 48-bit instructions and half-word based little-endian?
Hi all,
I'm now concentrate on a problem about the 48-bit instruction on
half-word based little-endian.
A 32-bit chip which supports both big-endian and little-endian,
and has both 16-bit, 32-bit, and 48-bit instructions.
1, In the .text section, all the instructions are arranged by this
kind of little-endian (half-word per unit):
16-bit-inst big-endian: 1122
32-bit-inst big-endian: aabbccdd
48-bit-inst big-endian: 112233445566
16-bit-inst little-endian: 2211
32-bit-inst little-endian: bbaaddcc
48-bit-inst little-endian: 221144336655
2, But in .data section, using the normal style of little-endian:
16-bit-data big-endian: 1122
32-bit-data big-endian: aabbccdd
16-bit-data little-endian: 2211
32-bit-data little-endian: ddccbbaa
I find it's hard to decide where is writing data, and where is
writing code even if i wrote my_bfd_putl32, my_bfd_putl48 functionss
for the harf-word based little-endian.
And the behavior of writing bfds is not just in the porting
files (tc-target.c or elfxx-target.c), but in a lot of general files.
And all the general files use it's own bfd_putl16, bfd_putl32,
and bfd_putl64 functions defined in libbfd.c.
Does binutils provide some method or other hooks to resolve this issue?
Thanks!