[lld-macho] Place LC_FUNCTION_STARTS data at the right position

This pleases the codesign

(Otherwise it complains about "function starts data out of place")

Reviewed By: #lld-macho, smeenai

Differential Revision: https://reviews.llvm.org/D98648
This commit is contained in:
Jez Ng 2021-03-15 14:54:18 -04:00
parent 57a532b3ac
commit 29d4676059
2 changed files with 11 additions and 6 deletions

View File

@ -671,11 +671,12 @@ static int sectionOrder(OutputSection *osec) {
}
} else if (segname == segment_names::linkEdit) {
return StringSwitch<int>(osec->name)
.Case(section_names::rebase, -8)
.Case(section_names::binding, -7)
.Case(section_names::weakBinding, -6)
.Case(section_names::lazyBinding, -5)
.Case(section_names::export_, -4)
.Case(section_names::rebase, -9)
.Case(section_names::binding, -8)
.Case(section_names::weakBinding, -7)
.Case(section_names::lazyBinding, -6)
.Case(section_names::export_, -5)
.Case(section_names::functionStarts, -4)
.Case(section_names::symbolTable, -3)
.Case(section_names::indirectSymbolTable, -2)
.Case(section_names::stringTable, -1)

View File

@ -30,7 +30,11 @@
# CHECK-NEXT: lazy_bind_off [[#LAZY_OFF: BIND_OFF + BIND_SIZE]]
# CHECK-NEXT: lazy_bind_size [[#LAZY_SIZE:]]
# CHECK-NEXT: export_off [[#EXPORT_OFF: LAZY_OFF + LAZY_SIZE]]
# CHECK-NEXT: export_size [[#]]
# CHECK-NEXT: export_size [[#EXPORT_SIZE:]]
# CHECK: cmd LC_FUNCTION_STARTS
# CHECK-NEXT: cmdsize
# CHECK-NEXT: dataoff [[#FUNCSTARTS_OFF: EXPORT_OFF + EXPORT_SIZE]]
.text
.globl _main