From ed89275cb820bb7ab283c51e461d852d1c8bec63 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Wed, 30 Dec 2020 11:00:22 +0100 Subject: Section handling: finer control of variable initialization Distinguish between: - uninitialized variables, which can go in COMM if supported - variables initialized with fixed, numeric quantities, which can go in a readonly section if "const" - variables initialized with symbol addresses which may need relocation, which cannot go in a readonly section even if "const", but can go in a special "const_data" section. Also: on macOS, use ".const" instead of ".literal8" for literals, as not all literals have size 8. --- powerpc/TargetPrinter.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'powerpc') diff --git a/powerpc/TargetPrinter.ml b/powerpc/TargetPrinter.ml index cf00e659..e32348a3 100644 --- a/powerpc/TargetPrinter.ml +++ b/powerpc/TargetPrinter.ml @@ -213,7 +213,7 @@ 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 -> if i then ".sdata" else ".sbss" + | Section_small_data i -> variable_section ~sec:".sdata" ~bss:".sbss" i | Section_const _ -> ".text" | Section_small_const _ -> ".sdata2" | Section_string -> ".text" -- cgit