[binutils-gdb] Ensure that space allocated by assembler directives converts from an octet count to a byte count.

Nick Clifton nickc@sourceware.org
Fri Sep 18 12:29:49 GMT 2020


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=5947daaf7545b2887abb977af6700b4cc9a807be

commit 5947daaf7545b2887abb977af6700b4cc9a807be
Author: Nick Clifton <nickc@redhat.com>
Date:   Fri Sep 18 13:28:46 2020 +0100

    Ensure that space allocated by assembler directives converts from an octet count to a byte count.
    
            PR 26556
            * read.c (bss_alloc): Convert size parameter from octets to
            bytes.

Diff:
---
 gas/ChangeLog | 6 ++++++
 gas/read.c    | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 6b788859487..057feeb1ebf 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2020-09-18  Tucker  <tuckkern+sourceware@gmail.com>
+
+	PR 26556
+	* read.c (bss_alloc): Convert size parameter from octets to
+	bytes.
+
 2020-09-17  Alan Modra  <amodra@gmail.com>
 
 	* testsuite/gas/i386/i386.exp: Return early if not x86.
diff --git a/gas/read.c b/gas/read.c
index ff4737ef2cb..7fd9af05fad 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -2547,7 +2547,7 @@ bss_alloc (symbolS *symbolP, addressT size, unsigned int align)
     symbol_get_frag (symbolP)->fr_symbol = NULL;
 
   symbol_set_frag (symbolP, frag_now);
-  pfrag = frag_var (rs_org, 1, 1, 0, symbolP, size, NULL);
+  pfrag = frag_var (rs_org, 1, 1, 0, symbolP, size * OCTETS_PER_BYTE, NULL);
   *pfrag = 0;
 
 #ifdef S_SET_SIZE


More information about the Binutils-cvs mailing list