[lld] 29d4676 - [lld-macho] Place LC_FUNCTION_STARTS data at the right position
Jez Ng via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 15 11:56:38 PDT 2021
Author: Jez Ng
Date: 2021-03-15T14:56:31-04:00
New Revision: 29d46760599b32504f4dfda4de69aca8b9f1f65e
URL: https://github.com/llvm/llvm-project/commit/29d46760599b32504f4dfda4de69aca8b9f1f65e
DIFF: https://github.com/llvm/llvm-project/commit/29d46760599b32504f4dfda4de69aca8b9f1f65e.diff
LOG: [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
Added:
Modified:
lld/MachO/Writer.cpp
lld/test/MachO/linkedit-contiguity.s
Removed:
################################################################################
diff --git a/lld/MachO/Writer.cpp b/lld/MachO/Writer.cpp
index dbf20742358d..1776fa01538d 100644
--- a/lld/MachO/Writer.cpp
+++ b/lld/MachO/Writer.cpp
@@ -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)
diff --git a/lld/test/MachO/linkedit-contiguity.s b/lld/test/MachO/linkedit-contiguity.s
index 8e4debbe59ef..3fb9053d4828 100644
--- 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
More information about the llvm-commits
mailing list