scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit c658360817ac84cd259dbff0ea836dac8b647ad1
parent 7e58afa199c101cf286652c305ba91e63a8fc40c
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:
Msrc/cmd/as/symbol.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

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 '?'; }