mirror of
https://github.com/ziglang/zig.git
synced 2025-12-27 16:43:07 +00:00
link/macho: ensure we set alignment of literals to max alignment
This commit is contained in:
parent
71bbc5efc9
commit
f3a503eca2
@ -165,6 +165,7 @@ pub fn dedupLiterals(self: InternalObject, lp: MachO.LiteralPool, macho_file: *M
|
||||
if (target.getLiteralPoolIndex(macho_file)) |lp_index| {
|
||||
const lp_atom = lp.getAtom(lp_index, macho_file);
|
||||
if (target.atom_index != lp_atom.atom_index) {
|
||||
lp_atom.alignment = lp_atom.alignment.max(target.alignment);
|
||||
target.flags.alive = false;
|
||||
rel.target = lp_atom.atom_index;
|
||||
}
|
||||
@ -176,6 +177,7 @@ pub fn dedupLiterals(self: InternalObject, lp: MachO.LiteralPool, macho_file: *M
|
||||
if (target_atom.getLiteralPoolIndex(macho_file)) |lp_index| {
|
||||
const lp_atom = lp.getAtom(lp_index, macho_file);
|
||||
if (target_atom.atom_index != lp_atom.atom_index) {
|
||||
lp_atom.alignment = lp_atom.alignment.max(target_atom.alignment);
|
||||
target_atom.flags.alive = false;
|
||||
target_sym.atom = lp_atom.atom_index;
|
||||
}
|
||||
@ -193,6 +195,7 @@ pub fn dedupLiterals(self: InternalObject, lp: MachO.LiteralPool, macho_file: *M
|
||||
if (atom.getLiteralPoolIndex(macho_file)) |lp_index| {
|
||||
const lp_atom = lp.getAtom(lp_index, macho_file);
|
||||
if (atom.atom_index != lp_atom.atom_index) {
|
||||
lp_atom.alignment = lp_atom.alignment.max(atom.alignment);
|
||||
atom.flags.alive = false;
|
||||
extra.objc_selrefs = lp_atom.atom_index;
|
||||
sym.setExtra(extra, macho_file);
|
||||
|
||||
@ -593,6 +593,7 @@ pub fn dedupLiterals(self: Object, lp: MachO.LiteralPool, macho_file: *MachO) vo
|
||||
if (target.getLiteralPoolIndex(macho_file)) |lp_index| {
|
||||
const lp_atom = lp.getAtom(lp_index, macho_file);
|
||||
if (target.atom_index != lp_atom.atom_index) {
|
||||
lp_atom.alignment = lp_atom.alignment.max(target.alignment);
|
||||
target.flags.alive = false;
|
||||
rel.target = lp_atom.atom_index;
|
||||
}
|
||||
@ -604,6 +605,7 @@ pub fn dedupLiterals(self: Object, lp: MachO.LiteralPool, macho_file: *MachO) vo
|
||||
if (target_atom.getLiteralPoolIndex(macho_file)) |lp_index| {
|
||||
const lp_atom = lp.getAtom(lp_index, macho_file);
|
||||
if (target_atom.atom_index != lp_atom.atom_index) {
|
||||
lp_atom.alignment = lp_atom.alignment.max(target_atom.alignment);
|
||||
target_atom.flags.alive = false;
|
||||
target_sym.atom = lp_atom.atom_index;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user