Skip to content

Commit bede883

Browse files
committed
Added different logic to declare extern symbols
1 parent 3a44733 commit bede883

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

aarch64/translation/file.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,16 @@ func FileToMachoObject(file *gen.FileInfo) ([]byte, core.ResultList) {
3030
for _, function := range file.Functions {
3131
symbol := nlist64_builders.SectionNlist64Builder{
3232
Name: "_" + function.Name[1:],
33-
Type: nlist64.ExternalSymbol | nlist64.SectionSymbolType,
34-
Section: 1,
35-
Offset: fileCtx.FunctionOffsets[function],
33+
Type: nlist64.ExternalSymbol,
3634
Description: nlist64.ReferenceFlagUndefinedNonLazy,
3735
}
3836

37+
if function.IsDefined() {
38+
symbol.Type |= nlist64.SectionSymbolType
39+
symbol.Section = 1
40+
symbol.Offset = fileCtx.FunctionOffsets[function]
41+
}
42+
3943
symbols = append(symbols, symbol)
4044
}
4145

0 commit comments

Comments
 (0)