Skip to content

Commit 5ae0465

Browse files
committed
[MachO] Fix Windows build
1 parent 2f531f7 commit 5ae0465

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

view/macho/chained_fixups.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,32 @@ namespace {
3939

4040
FixupInfo BindFixup(uint32_t ordinal, int32_t addend, uint16_t next)
4141
{
42-
return { .bind = { ordinal, addend }, FixupType::Bind, .next = next };
42+
return { .bind = { ordinal, addend }, .type = FixupType::Bind, .next = next };
4343
}
4444

4545
FixupInfo RebaseFixup(uint64_t target, uint16_t next)
4646
{
47-
return { .rebase = { target }, FixupType::Rebase, .next = next };
47+
return { .rebase = { target }, .type = FixupType::Rebase, .next = next };
4848
}
4949

5050
FixupInfo AuthBindFixup(uint32_t ordinal,
5151
AuthKeyType keyType, bool usesAddressDiversity, uint16_t addressDiversity, uint16_t next)
5252
{
53-
return { .bind = { ordinal, 0 }, FixupType::Bind, true, keyType, usesAddressDiversity, addressDiversity, next };
53+
return {
54+
.bind = { ordinal, 0 }, .type = FixupType::Bind, .isAuthenticated = true,
55+
.authKeyType = keyType, .usesAddressDiversity = usesAddressDiversity,
56+
.addressDiversity = addressDiversity, .next = next
57+
};
5458
}
5559

5660
FixupInfo AuthRebaseFixup(uint64_t target,
5761
AuthKeyType keyType, bool usesAddressDiversity, uint16_t addressDiversity, uint16_t next)
5862
{
59-
return { .rebase = { target }, FixupType::Rebase, true, keyType, usesAddressDiversity, addressDiversity, next };
63+
return {
64+
.rebase = { target }, .type = FixupType::Rebase, .isAuthenticated = true,
65+
.authKeyType = keyType, .usesAddressDiversity = usesAddressDiversity,
66+
.addressDiversity = addressDiversity, .next = next
67+
};
6068
}
6169

6270
FixupInfo ConvertFromAddressToOffset(FixupInfo fixup, uint64_t preferredLoadAddress)
@@ -239,7 +247,7 @@ ImportEntry ReadChainedImport32(BinaryReader& reader, std::span<const char> symb
239247
return {
240248
std::string_view(&symbolData[import.name_offset]),
241249
0,
242-
import.lib_ordinal,
250+
static_cast<int32_t>(import.lib_ordinal),
243251
(bool)import.weak_import,
244252
};
245253
}
@@ -251,7 +259,7 @@ ImportEntry ReadChainedImportAddend32(BinaryReader& reader, std::span<const char
251259
return {
252260
std::string_view(&symbolData[import.name_offset]),
253261
static_cast<uint32_t>(import.addend),
254-
import.lib_ordinal,
262+
static_cast<int32_t>(import.lib_ordinal),
255263
(bool)import.weak_import,
256264
};
257265
}
@@ -263,7 +271,7 @@ ImportEntry ReadChainedImportAddend64(BinaryReader& reader, std::span<const char
263271
return {
264272
std::string_view(&symbolData[import.name_offset]),
265273
import.addend,
266-
(int32_t)import.lib_ordinal,
274+
static_cast<int32_t>(import.lib_ordinal),
267275
(bool)import.weak_import,
268276
};
269277
}

0 commit comments

Comments
 (0)