Skip to content
Snippets Groups Projects
Commit dfe1c354 authored by Stefan Schulze Frielinghaus's avatar Stefan Schulze Frielinghaus Committed by Marge Bot
Browse files

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.
parent 292983c8
No related branches found
No related tags found
No related merge requests found
...@@ -89,6 +89,7 @@ genLlvmData (sec, CmmStaticsRaw lbl xs) = do ...@@ -89,6 +89,7 @@ genLlvmData (sec, CmmStaticsRaw lbl xs) = do
align = case sec of align = case sec of
Section CString _ -> if (platformArch platform == ArchS390X) Section CString _ -> if (platformArch platform == ArchS390X)
then Just 2 else Just 1 then Just 2 else Just 1
Section Data _ -> Just $ platformWordSizeInBytes platform
_ -> Nothing _ -> Nothing
const = if sectionProtection sec == ReadOnlySection const = if sectionProtection sec == ReadOnlySection
then Constant else Global then Constant else Global
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment