diff --git a/lld/MachO/Writer.cpp b/lld/MachO/Writer.cpp --- a/lld/MachO/Writer.cpp +++ b/lld/MachO/Writer.cpp @@ -671,11 +671,12 @@ } } else if (segname == segment_names::linkEdit) { return StringSwitch(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) diff --git a/lld/test/MachO/linkedit-contiguity.s b/lld/test/MachO/linkedit-contiguity.s --- a/lld/test/MachO/linkedit-contiguity.s +++ b/lld/test/MachO/linkedit-contiguity.s @@ -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