[PATCH] D137803: [lld-macho] Set 4-byte alignment for `__init_offsets`

Daniel Bertalan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 14:33:24 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG948fc66f5e86: [lld-macho] Set 4-byte alignment for `__init_offsets` (authored by BertalanD).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137803/new/

https://reviews.llvm.org/D137803

Files:
  lld/MachO/SyntheticSections.cpp
  lld/test/MachO/init-offsets.s


Index: lld/test/MachO/init-offsets.s
===================================================================
--- lld/test/MachO/init-offsets.s
+++ lld/test/MachO/init-offsets.s
@@ -27,7 +27,7 @@
 # FLAGS-NEXT:     addr
 # FLAGS-NEXT:     size 0x0000000000000010
 # FLAGS-NEXT:   offset
-# FLAGS-NEXT:    align
+# FLAGS-NEXT:    align 2^2 (4)
 # FLAGS-NEXT:   reloff 0
 # FLAGS-NEXT:   nreloc 0
 # FLAGS-NEXT:     type S_INIT_FUNC_OFFSETS
Index: lld/MachO/SyntheticSections.cpp
===================================================================
--- lld/MachO/SyntheticSections.cpp
+++ lld/MachO/SyntheticSections.cpp
@@ -1899,6 +1899,7 @@
 InitOffsetsSection::InitOffsetsSection()
     : SyntheticSection(segment_names::text, section_names::initOffsets) {
   flags = S_INIT_FUNC_OFFSETS;
+  align = 4; // This section contains 32-bit integers.
 }
 
 uint64_t InitOffsetsSection::getSize() const {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D137803.474612.patch
Type: text/x-patch
Size: 893 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221110/8bc92010/attachment.bin>


More information about the llvm-commits mailing list