aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@college-de-france.fr>2021-02-19 09:31:03 +0100
committerXavier Leroy <xavierleroy@users.noreply.github.com>2021-02-23 11:33:14 +0100
commit014883f2f4cfc4fd64fe9aa5f561a971e2ed1345 (patch)
tree7738077335321874d76379435d596236f192d04c /powerpc
parented89275cb820bb7ab283c51e461d852d1c8bec63 (diff)
downloadcompcert-kvx-014883f2f4cfc4fd64fe9aa5f561a971e2ed1345.tar.gz
compcert-kvx-014883f2f4cfc4fd64fe9aa5f561a971e2ed1345.zip
Fix regression on PowerPC / Diab
On PowerPC/Diab, common declarations must not be used for small data sections. Add a `~common` option to `PrintAsmaux.variable_section` to control the use of common declarations. The default is whatever is specified on the command line using the `-fcommon` and `-fno-common` options. Use `~common:false` for `Section_small_data` on PowerPC / Diab. Note that on PowerPC/Linux, GCC uses common declarations for uninitialized variables in small data section, so we keep doing this in CompCert as well.
Diffstat (limited to 'powerpc')
-rw-r--r--powerpc/TargetPrinter.ml6
1 files changed, 4 insertions, 2 deletions
diff --git a/powerpc/TargetPrinter.ml b/powerpc/TargetPrinter.ml
index e32348a3..52d30e33 100644
--- a/powerpc/TargetPrinter.ml
+++ b/powerpc/TargetPrinter.ml
@@ -212,8 +212,10 @@ module Diab_System : SYSTEM =
let name_of_section = function
| Section_text -> ".text"
- | Section_data i -> variable_section ~sec:".data" ~bss:".bss" i
- | Section_small_data i -> variable_section ~sec:".sdata" ~bss:".sbss" i
+ | Section_data i ->
+ variable_section ~sec:".data" ~bss:".bss" i
+ | Section_small_data i ->
+ variable_section ~sec:".sdata" ~bss:".sbss" ~common:false i
| Section_const _ -> ".text"
| Section_small_const _ -> ".sdata2"
| Section_string -> ".text"