mirror of
https://github.com/ziglang/zig.git
synced 2026-01-01 11:03:11 +00:00
zld: match all __DATA sections as __data except __const
Examples of such sections include: * in Go, you will get `__DATA,__noptrdata` or `__DATA,__go_buildinfo` which should be mapped to `__DATA,__data`
This commit is contained in:
parent
961d556570
commit
b93fd4bb73
@ -857,24 +857,23 @@ fn getMatchingSection(self: *Zld, section: macho.section_64) ?MatchingSection {
|
||||
.seg = self.text_segment_cmd_index.?,
|
||||
.sect = self.ustring_section_index.?,
|
||||
};
|
||||
} else {
|
||||
break :blk .{
|
||||
.seg = self.text_segment_cmd_index.?,
|
||||
.sect = self.text_const_section_index.?,
|
||||
};
|
||||
}
|
||||
} else if (mem.eql(u8, segname, "__DATA")) {
|
||||
if (mem.eql(u8, sectname, "__data")) {
|
||||
break :blk .{
|
||||
.seg = self.data_segment_cmd_index.?,
|
||||
.sect = self.data_section_index.?,
|
||||
};
|
||||
} else if (mem.eql(u8, sectname, "__const")) {
|
||||
break :blk .{
|
||||
.seg = self.text_segment_cmd_index.?,
|
||||
.sect = self.text_const_section_index.?,
|
||||
};
|
||||
}
|
||||
if (mem.eql(u8, segname, "__DATA")) {
|
||||
if (mem.eql(u8, sectname, "__const")) {
|
||||
break :blk .{
|
||||
.seg = self.data_const_segment_cmd_index.?,
|
||||
.sect = self.data_const_section_index.?,
|
||||
};
|
||||
}
|
||||
break :blk .{
|
||||
.seg = self.data_segment_cmd_index.?,
|
||||
.sect = self.data_section_index.?,
|
||||
};
|
||||
}
|
||||
break :blk null;
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user