[sw] Prevent use of COMMON Sections
Old versions of GCC default to using `-fcommon`, but this changed in
GCC version 10.0 to default to `-fno-common`, which Clang matches.
The DV environment was using an old GCC version with the wrong default,
which was causing issues when exposed to the changes in
lowrisc/opentitan#4014. This ensures we avoid using COMMON at all costs,
instead favouring using real, defined sections for our C code.
Signed-off-by: Sam Elliott <selliott@lowrisc.org>
diff --git a/sw/device/info_sections.ld b/sw/device/info_sections.ld
index 5c756a2..dae83a5 100644
--- a/sw/device/info_sections.ld
+++ b/sw/device/info_sections.ld
@@ -88,4 +88,7 @@
*(.stab)
*(.stab.*)
*(.stabstr)
+
+ /* COMMON Sections */
+ *(COMMON)
}