[lld] 41f90e9 - Reland "[lld-macho] Emit map file entry for compact unwind info"
Jez Ng via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 6 13:42:56 PST 2022
Author: Jez Ng
Date: 2022-12-06T16:41:47-05:00
New Revision: 41f90e970e381f0a4980395e7597d72f0054937e
URL: https://github.com/llvm/llvm-project/commit/41f90e970e381f0a4980395e7597d72f0054937e
DIFF: https://github.com/llvm/llvm-project/commit/41f90e970e381f0a4980395e7597d72f0054937e.diff
LOG: Reland "[lld-macho] Emit map file entry for compact unwind info"
This reverts commit ac3096e1dd77a2687797d38976d5f8c93f7353e5.
The buildbot failure from the earlier patch set has been fixed by 7c7e39db7a.
Differential Revision: https://reviews.llvm.org/D137369
Added:
Modified:
lld/MachO/MapFile.cpp
lld/test/MachO/map-file.s
Removed:
################################################################################
diff --git a/lld/MachO/MapFile.cpp b/lld/MachO/MapFile.cpp
index a136c7292c55a..351c435e110d2 100644
--- a/lld/MachO/MapFile.cpp
+++ b/lld/MachO/MapFile.cpp
@@ -182,6 +182,9 @@ void macho::writeMapFile() {
info.fileIndex);
os.write_escaped(info.str) << "\n";
}
+ } else if (osec == (void *)in.unwindInfo) {
+ os << format("0x%08llX\t0x%08llX\t[ 0] compact unwind info\n",
+ osec->addr, osec->getSize());
}
// TODO print other synthetic sections
}
diff --git a/lld/test/MachO/map-file.s b/lld/test/MachO/map-file.s
index fe1ef88604e1e..008bad23fd33e 100644
--- a/lld/test/MachO/map-file.s
+++ b/lld/test/MachO/map-file.s
@@ -15,7 +15,9 @@
# CHECK-NEXT: Idx Name Size VMA Type
# CHECK-NEXT: 0 __text {{[0-9a-f]+}} [[#%x,TEXT:]] TEXT
# CHECK-NEXT: 1 __cstring {{[0-9a-f]+}} [[#%x,CSTR:]] DATA
-# CHECK-NEXT: 2 __common {{[0-9a-f]+}} [[#%x,BSS:]] BSS
+# CHECK-NEXT: 2 __unwind_info {{[0-9a-f]+}} [[#%x,UNWIND:]] DATA
+# CHECK-NEXT: 3 __eh_frame {{[0-9a-f]+}} [[#%x,EH_FRAME:]] DATA
+# CHECK-NEXT: 4 __common {{[0-9a-f]+}} [[#%x,BSS:]] BSS
# CHECK: SYMBOL TABLE:
# CHECK-DAG: [[#%x,MAIN:]] g F __TEXT,__text _main
@@ -34,10 +36,12 @@
# CHECK-NEXT: [ 3] {{.*}}{{/|\\}}map-file.s.tmp/c-string-literal.o
# CHECK-NEXT: # Sections:
-# CHECK-NEXT: # Address Size Segment Section
-# CHECK-NEXT: 0x[[#%X,TEXT]] 0x{{[0-9A-F]+}} __TEXT __text
-# CHECK-NEXT: 0x[[#%X,CSTR]] 0x{{[0-9A-F]+}} __TEXT __cstring
-# CHECK-NEXT: 0x[[#%X,BSS]] 0x{{[0-9A-F]+}} __DATA __common
+# CHECK-NEXT: # Address Size Segment Section
+# CHECK-NEXT: 0x[[#%X,TEXT]] 0x{{[0-9A-F]+}} __TEXT __text
+# CHECK-NEXT: 0x[[#%X,CSTR]] 0x{{[0-9A-F]+}} __TEXT __cstring
+# CHECK-NEXT: 0x[[#%X,UNWIND]] 0x{{[0-9A-F]+}} __TEXT __unwind_info
+# CHECK-NEXT: 0x[[#%X,EH_FRAME]] 0x{{[0-9A-F]+}} __TEXT __eh_frame
+# CHECK-NEXT: 0x[[#%X,BSS]] 0x{{[0-9A-F]+}} __DATA __common
# CHECK-NEXT: # Symbols:
# CHECK-NEXT: # Address Size File Name
@@ -48,6 +52,7 @@
# CHECK-DAG: 0x[[#%X,HIITSME]] 0x0000000F [ 3] literal string: Hello, it's me
# CHECK-DAG: 0x[[#%X,HIITSME + 0xf]] 0x0000000E [ 3] literal string: Hello world!\n
# CHECK-DAG: 0x[[#%X,NUMBER]] 0x00000001 [ 1] _number
+# CHECK-DAG: 0x[[#%X,UNWIND]] 0x0000103C [ 0] compact unwind info
# MAPFILE: "name":"Total Write map file"
@@ -89,7 +94,10 @@ __ZTIN3foo3bar4MethE:
.globl _main, _bar
_main:
+.cfi_startproc
+.cfi_def_cfa_offset 16
ret
+.cfi_endproc
_bar:
nop
More information about the llvm-commits
mailing list