aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Konka <kubkon@jakubkonka.com>2021-09-06 11:17:20 +0200
committerJakub Konka <kubkon@jakubkonka.com>2021-09-06 11:17:20 +0200
commit2914ea9e3388da2bf0240b9bd6b0474f9686322c (patch)
treefa48deabdf6dc6377c5f612b4d649943db46ed86 /src
parent5e64d9745ba54d4dd61f8f98be4a3b7e6f2d8205 (diff)
downloadzig-2914ea9e3388da2bf0240b9bd6b0474f9686322c.tar.gz
zig-2914ea9e3388da2bf0240b9bd6b0474f9686322c.zip
macho: require atom padding for machine code only
Diffstat (limited to 'src')
-rw-r--r--src/link/MachO.zig17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/link/MachO.zig b/src/link/MachO.zig
index 40c2c0dd83..e0396dc6da 100644
--- a/src/link/MachO.zig
+++ b/src/link/MachO.zig
@@ -1632,22 +1632,7 @@ pub fn allocateAtom(self: *MachO, atom: *TextBlock, match: MatchingSection) !u64
const sect = &seg.sections.items[match.sect];
const sym = &self.locals.items[atom.local_sym_index];
- // Padding is not required for pointer-type sections and any synthetic sections such as
- // stubs or stub_helper.
- // TODO audit this.
- const needs_padding = switch (commands.sectionType(sect.*)) {
- macho.S_SYMBOL_STUBS,
- macho.S_NON_LAZY_SYMBOL_POINTERS,
- macho.S_LAZY_SYMBOL_POINTERS,
- macho.S_LITERAL_POINTERS,
- macho.S_THREAD_LOCAL_VARIABLES,
- => false,
- else => blk: {
- if (match.seg == self.text_segment_cmd_index.? and
- match.sect == self.stub_helper_section_index.?) break :blk false;
- break :blk true;
- },
- };
+ const needs_padding = match.seg == self.text_segment_cmd_index.? and match.sect == self.text_section_index.?;
var atom_placement: ?*TextBlock = null;