What is this bogus change?

Timothy Wall twall@domesolutions.com
Fri Feb 4 11:15:00 GMT 2000


This was only supposed to have an effect if LISTING_WORD_SIZE was not "1" AND
the target was little-endian (Only m68k and tic54x set LISTING_WORD_SIZE to
something other than "1").  If that is not the case, I'm not sure what
happened.  My bad.

A "byte" on the tic54x is two octets, so each two sequential octets need to be
printed in the correct order.

Go ahead and revert the code; I'll fix the tic54x version later.

Tim

"H . J . Lu" wrote:

> Hi, Timothy,
>
> Could you please tell me why you put in this change:
>
> 2000-02-03  Timothy Wall  <twall@cygnus.com>
>
>         * listing.c (print_lines): Also, if LISTING_WORD_SIZE is not 1, and
>         target is little-endian, print the octets in a word in big-endian
>         order so that the display looks like a proper hexadecimal number,
>         instead of having the octets reversed.
>
> This change breaks "make check" in gas on i386 which is a little-endian
> machine. The old listing order of opcodes looks fine to me. It matches
> the opcodes from the Intel IA-32 reference manual. Could you please
> tell me what is wrong with the previous listing order on i386? I am
> enclosing a patch which reverts your change.
>
> Thanks.
>
> --
> H.J. Lu (hjl@gnu.org)
> ---
> Fri Feb  4 10:13:53 2000  H.J. Lu  (hjl@gnu.org)
>
>         * listing.c (print_lines): Don't treat little-endian
>         differently than big-endian.
>
> Index: listing.c
> ===================================================================
> RCS file: /work/cvs/gnu/binutils/gas/listing.c,v
> retrieving revision 1.1.1.3
> diff -u -p -r1.1.1.3 listing.c
> --- listing.c   2000/02/03 23:24:47     1.1.1.3
> +++ listing.c   2000/02/04 18:13:10
> @@ -713,15 +713,8 @@ print_lines (list, lineno, string, addre
>    while (src[cur] && idx < nchars)
>      {
>        int offset;
> -#if TARGET_BYTES_BIG_ENDIAN != 0
>        offset = cur;
>        fprintf (list_file, "%c%c", src[offset], src[offset+1]);
> -#else
> -      offset = (cur & ~(LISTING_WORD_SIZE * 2 - 1))
> -        + (LISTING_WORD_SIZE - octet_in_word - 1) * 2;
> -      if (offset < end)
> -        fprintf (list_file, "%c%c", src[offset], src[offset+1]);
> -#endif
>        cur += 2;
>        octet_in_word++;
>
> @@ -764,15 +757,8 @@ print_lines (list, lineno, string, addre
>        while (src[cur] && idx < nchars)
>         {
>            int offset;
> -#if TARGET_BYTES_BIG_ENDIAN != 0
>            offset = cur;
>            fprintf (list_file, "%c%c", src[offset], src[offset+1]);
> -#else
> -          offset = (cur & ~(LISTING_WORD_SIZE * 2 - 1))
> -            + (LISTING_WORD_SIZE - octet_in_word - 1) * 2;
> -          if (offset < end)
> -            fprintf (list_file, "%c%c", src[offset], src[offset+1]);
> -#endif
>           cur += 2;
>           idx += 2;
>           octet_in_word++;



More information about the Binutils mailing list