bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

aout_gnu.h _LITTLE confused ?


From: Peter Lawrence
Subject: aout_gnu.h _LITTLE confused ?
Date: Thu, 20 Jan 2011 14:42:25 -0800

All,
      my sincerest apologies if I am missing something obvious, but
these defines from  "gas/config/aout_gnu.h" sure look fishy.

the big-endian defines all march down in value from 0x80 to 0x02,
to match bits numbers 0 to 6 of the unsigned char r_bits[1]

but the little-endian values aren't consistently increasing or decreasing, it looks like some cut-n-pasting took place without some necessary editing...

#define RELOC_STD_BITS_PCREL_BIG        0x80
#define RELOC_STD_BITS_PCREL_LITTLE     0x01

#define RELOC_STD_BITS_LENGTH_BIG       0x60
#define RELOC_STD_BITS_LENGTH_SH_BIG    5
#define RELOC_STD_BITS_LENGTH_LITTLE    0x06
#define RELOC_STD_BITS_LENGTH_SH_LITTLE 1

#define RELOC_STD_BITS_EXTERN_BIG       0x10
#define RELOC_STD_BITS_EXTERN_LITTLE    0x08

#define RELOC_STD_BITS_BASEREL_BIG      0x08
#define RELOC_STD_BITS_BASEREL_LITTLE 0x08 <<=== shouldn't this be 0x10

#define RELOC_STD_BITS_JMPTABLE_BIG     0x04
#define RELOC_STD_BITS_JMPTABLE_LITTLE 0x04 <<=== shouldn't this be 0x20

#define RELOC_STD_BITS_RELATIVE_BIG     0x02
#define RELOC_STD_BITS_RELATIVE_LITTLE 0x02 <<=== shouldn't this be 0x40


so for example without the suggested fixes we have little-endian conflicts

_EXTERN_LITTLE  has the exact same value 0x08 as  _BASEREL_LITTLE

and _LENGTH_LITTLE value 0x06 gets overlapped by _JMPTABLE_LITTLE 0x04
and  _RELATIVE_LITTLE  0x02.


sincerely,
Peter Lawrence.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]