From 9136aa49abcb3f23171e01ebd16ee03cc1032943 Mon Sep 17 00:00:00 2001 From: Dan Gisselquist Date: Thu, 18 Feb 2016 09:47:31 +0000 Subject: Avoid setting or recording negative alignments when the target stores multiple octets in a single byte. gas * 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. --- gas/write.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gas/write.h') diff --git a/gas/write.h b/gas/write.h index b1bc778f745..4aee78d0398 100644 --- a/gas/write.h +++ b/gas/write.h @@ -166,9 +166,9 @@ extern addressT dot_value; extern fragS *dot_frag; extern struct reloc_list* reloc_list; -extern void append (char **charPP, char *fromP, unsigned long length); -extern void record_alignment (segT seg, int align); -extern int get_recorded_alignment (segT seg); +extern void append (char **, char *, unsigned long); +extern void record_alignment (segT, unsigned); +extern int get_recorded_alignment (segT); extern void write_object_file (void); extern long relax_frag (segT, fragS *, long); extern int relax_segment (struct frag *, segT, int); -- cgit v1.2.3-65-gdbad