[Git][ghc/ghc][master] llvmGen: Align objects in the data section

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Nov 29 03:45:45 UTC 2023



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
dfe1c354 by Stefan Schulze Frielinghaus at 2023-11-28T22:45:04-05:00
llvmGen: Align objects in the data section

Objects in the data section may be referenced via tagged pointers.
Thus, align those objects to a 4- or 8-byte boundary for 32- or 64-bit
platforms, respectively.  Note, this may need to be reconsidered if
objects with a greater natural alignment requirement are emitted as e.g.
128-bit atomics.

Fixes #24163.

- - - - -


1 changed file:

- compiler/GHC/CmmToLlvm/Data.hs


Changes:

=====================================
compiler/GHC/CmmToLlvm/Data.hs
=====================================
@@ -89,6 +89,7 @@ genLlvmData (sec, CmmStaticsRaw lbl xs) = do
         align          = case sec of
                             Section CString _ -> if (platformArch platform == ArchS390X)
                                                     then Just 2 else Just 1
+                            Section Data _    -> Just $ platformWordSizeInBytes platform
                             _                 -> Nothing
         const          = if sectionProtection sec == ReadOnlySection
                             then Constant else Global



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dfe1c3540e4b519b62b862b5966dfec5cae9ece1

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/dfe1c3540e4b519b62b862b5966dfec5cae9ece1
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231128/a01c8af6/attachment-0001.html>


More information about the ghc-commits mailing list