as: Check that data and bss sections are readable - scc - simple c99 compiler
 (HTM) git clone git://git.simple-cc.org/scc
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Submodules
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit c658360817ac84cd259dbff0ea836dac8b647ad1
 (DIR) parent 7e58afa199c101cf286652c305ba91e63a8fc40c
 (HTM) Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
       Date:   Thu, 21 Mar 2024 07:51:00 +0100
       
       as: Check that data and bss sections are readable
       
       We should not consider a non readable section as bss or data. We
       cannot check for writing because there are use cases where we want
       to define read only data or bss sections.
       
       Diffstat:
         M src/cmd/as/symbol.c                 |       4 ++--
       
       1 file changed, 2 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/src/cmd/as/symbol.c b/src/cmd/as/symbol.c
       @@ -266,9 +266,9 @@ sectype(int flags)
        {
                if (flags & SEXEC)
                        return 'T';
       -        if ((flags & (SALLOC|SLOAD)) == (SALLOC|SLOAD))
       +        if ((flags & (SALLOC|SLOAD|SREAD)) == (SALLOC|SLOAD|SREAD))
                        return 'D';
       -        if ((flags  & (SALLOC|SLOAD)) == SALLOC)
       +        if ((flags  & (SALLOC|SLOAD|SREAD)) == (SALLOC|SREAD))
                        return 'B';
                return '?';
        }