summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Brodkin <alexey.brodkin@synopsys.com>2018-10-11 23:12:05 +0300
committerAlexey Brodkin <abrodkin@synopsys.com>2018-10-15 13:35:17 +0300
commit6e63314f432d32d2ce12a51dafa78129e81fe9cf (patch)
treec1244e81de36f67e98dfa34bb3cd80953e128884
parenta2110918559b34219721cf31bbe8bd94a843e1ac (diff)
downloadu-boot-6e63314f432d32d2ce12a51dafa78129e81fe9cf.tar.gz
ARC: Don't use COMMON section for global not-initialized variables
By default GCC puts global non-initialized variables in COMMON section. And we used to ignore existence of COMMON section in our linker scripts though smart LD silently appended it right after .bss. And the problem here is variables from COMMON section even though require zeroing in run-time were not zeroed as they were placed right after __bss_end symbol. It was a pure luck we never faced serious problem due to this, but now it is fixed. Now as for some other architectures we'll just force GCC to put those global variables in normal .bss section. This solution is much nicer than adding COMMON section to each and every linker script. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
-rw-r--r--arch/arc/config.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arc/config.mk b/arch/arc/config.mk
index d255c90e35..18005d9993 100644
--- a/arch/arc/config.mk
+++ b/arch/arc/config.mk
@@ -43,7 +43,7 @@ PLATFORM_CPPFLAGS += -mcpu=archs
endif
PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -gdwarf-2 -mno-sdata
-PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
+PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections -fno-common
# Needed for relocation
LDFLAGS_FINAL += -pie --gc-sections