[lld] e2c868f - Revert "[lld-macho] Fix bugs around EH_Frame symbols"

Muhammad Omair Javaid via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 17 00:13:41 PST 2022


Author: Muhammad Omair Javaid
Date: 2022-11-17T12:13:13+04:00
New Revision: e2c868fbf7c304ed1814ed53fdeb7605042f3c8c

URL: https://github.com/llvm/llvm-project/commit/e2c868fbf7c304ed1814ed53fdeb7605042f3c8c
DIFF: https://github.com/llvm/llvm-project/commit/e2c868fbf7c304ed1814ed53fdeb7605042f3c8c.diff

LOG: Revert "[lld-macho] Fix bugs around EH_Frame symbols"

This reverts commit 1a2bc103bba04e8fba574c70c6201ba18ccc08ba.
This patch series breaks lld:map-file.s on arm v7 linux buildbots.
e.g https://lab.llvm.org/buildbot/#/builders/178/builds/3190

Added: 
    

Modified: 
    lld/MachO/InputFiles.cpp
    lld/test/MachO/map-file.s

Removed: 
    


################################################################################
diff  --git a/lld/MachO/InputFiles.cpp b/lld/MachO/InputFiles.cpp
index db7050fef2f7..5d45dd8caed8 100644
--- a/lld/MachO/InputFiles.cpp
+++ b/lld/MachO/InputFiles.cpp
@@ -1346,11 +1346,11 @@ void ObjFile::registerEhFrames(Section &ehFrameSection) {
     // that all EH frames have an associated symbol so that we can generate
     // subtractor relocs that reference them.
     if (isec->symbols.size() == 0)
-      make<Defined>("EH_Frame", isec->getFile(), isec, /*value=*/0,
-                    isec->getSize(), /*isWeakDef=*/false, /*isExternal=*/false,
-                    /*isPrivateExtern=*/false, /*includeInSymtab=*/false,
-                    /*isThumb=*/false, /*isReferencedDynamically=*/false,
-                    /*noDeadStrip=*/false);
+      isec->symbols.push_back(make<Defined>(
+          "EH_Frame", isec->getFile(), isec, /*value=*/0, /*size=*/0,
+          /*isWeakDef=*/false, /*isExternal=*/false, /*isPrivateExtern=*/false,
+          /*includeInSymtab=*/false, /*isThumb=*/false,
+          /*isReferencedDynamically=*/false, /*noDeadStrip=*/false));
     else if (isec->symbols[0]->value != 0)
       fatal("found symbol at unexpected offset in __eh_frame");
 

diff  --git a/lld/test/MachO/map-file.s b/lld/test/MachO/map-file.s
index 7fe00fa0d99d..008bad23fd33 100644
--- a/lld/test/MachO/map-file.s
+++ b/lld/test/MachO/map-file.s
@@ -8,9 +8,7 @@
 # RUN:   --time-trace -o %t/test
 # RUN: llvm-objdump --syms --section-headers %t/test > %t/objdump
 ## Check that symbols in cstring sections aren't emitted
-## Also check that we don't have redundant EH_Frame symbols (regression test)
-# RUN: cat %t/objdump %t/map | FileCheck %s --implicit-check-not _hello_world \
-# RUN:   --implicit-check-not EH_Frame
+# RUN: cat %t/objdump %t/map | FileCheck %s --implicit-check-not _hello_world
 # RUN: FileCheck %s --check-prefix=MAPFILE < %t/test.time-trace
 
 # CHECK:      Sections:
@@ -46,18 +44,15 @@
 # CHECK-NEXT: 0x[[#%X,BSS]]       0x{{[0-9A-F]+}}   __DATA   __common
 
 # CHECK-NEXT: # Symbols:
-# CHECK-NEXT: # Address                  Size        File   Name
-# CHECK-DAG:  0x[[#%X,MAIN]]             0x00000001  [  1]  _main
-# CHECK-DAG:  0x[[#%X,BAR]]              0x00000001  [  1]  _bar
-# CHECK-DAG:  0x[[#%X,FOO]]              0x00000001  [  2]  __ZTIN3foo3bar4MethE
-# CHECK-DAG:  0x[[#%X,HIWORLD]]          0x0000000E  [  3]  literal string: Hello world!\n
-# 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
-## Note: ld64 prints "CIE" and "FDE for: <function>" instead of "EH_Frame".
-# CHECK-DAG:  0x[[#%X,EH_FRAME]]         0x00000018  [  1]  EH_Frame
-# CHECK-DAG:  0x[[#%X,EH_FRAME + 0x18]]  0x00000020  [  1]  EH_Frame
+# CHECK-NEXT: # Address                Size        File   Name
+# CHECK-DAG:  0x[[#%X,MAIN]]           0x00000001  [  1]  _main
+# CHECK-DAG:  0x[[#%X,BAR]]            0x00000001  [  1]  _bar
+# CHECK-DAG:  0x[[#%X,FOO]]            0x00000001  [  2]  __ZTIN3foo3bar4MethE
+# CHECK-DAG:  0x[[#%X,HIWORLD]]        0x0000000E  [  3]  literal string: Hello world!\n
+# 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"
 


        


More information about the llvm-commits mailing list