bug-binutils
[Top][All Lists]
Advanced

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

Re: OCTETS_PER_BYTE and Gas


From: Nick Clifton
Subject: Re: OCTETS_PER_BYTE and Gas
Date: Thu, 18 Feb 2016 09:47:04 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

Hi Dan,

> The assembler support structure provided by the GNU assembler has worked 
> quite well for this circumstance, with only a couple minor changes that 
> I would like to propose. 

Thanks for sending us this patch.  I have decided to apply the changes to 
the alignment functions, but not to the LEB128 encoding functions.  The 
reason for this is that the LEB128 functions currently pack only a single
octet into a byte, which is terribly wasteful for targets such as yours,
but this is how the DWARF spec appears to define the encoding operation.
Changing the functions to pack multiple octets into a single byte (where
possible) would be a much more extensive change, and probably contravene
the DWARF standard.


> Without these changes, the assembler would crash with some strange bugs.

I would be interested to know more about these crashes.

Note - we already support two targets where OCTETS_PER_BYTE_POWER is 2 
(tic4x and tic54x), so I would hope that in general we have the octets
vs bytes thing sorted out.


Attached is the patch that I am going to apply.

Cheers
  Nick

gas/ChangeLog
2016-02-18  Dan Gisselquist  <address@hidden>
            Nick Clifton  <address@hidden>

        * read.c (finish_bundle): Avoid recording a negative alignment.
        (do_align): Use unsigned values for n, len and max.  Only create
        a frag if the alignment requirement is greater than the minimum
        byte alignment.  Avoid recording a negative alignment.
        (s_align): Use unsigned values where appropriate.
        (bss_alloc): Use an unsigned value for the alignment.
        (sizeof_sleb128): Add a comment noting that we encode one octet
        per byte, regardless of the value of OCTETS_PER_BYTE_POWER.
        (emit_leb129_expr): Abort if the emitted encoding was longer than
        expected.
        * read.h (output_leb128): Update prototype.
        (sizeof_leb128): Update prototype.
        (bss_alloc): Update prototype.
        * write.c (record_alignment): Use an unsigned value for the
        alignment.  Do not record alignments less than the minimum
        alignment for a byte.
        * write.h (record_alignment): Update prototype.

Attachment: gas.octets.patch
Description: Text Data


reply via email to

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