[PATCH] D80143: [ELF] Make --trace-symbol track preempted shared definitions

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 19 09:17:53 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG64676499741c: [ELF] Make --trace-symbol track preempted shared definitions (authored by MaskRay).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80143/new/

https://reviews.llvm.org/D80143

Files:
  lld/ELF/Symbols.cpp
  lld/test/ELF/trace-symbols.s


Index: lld/test/ELF/trace-symbols.s
===================================================================
--- lld/test/ELF/trace-symbols.s
+++ lld/test/ELF/trace-symbols.s
@@ -13,6 +13,11 @@
 # RUN: rm -f %t2.a
 # RUN: llvm-ar rcs %t2.a %t2
 
+# RUN: ld.lld -y foo -shared %t1 %t1.so -o /dev/null | \
+# RUN:   FileCheck --check-prefix=PREEMPT %s --implicit-check-not=foo
+# PREEMPT:      trace-symbols.s.tmp1: definition of foo
+# PREEMPT-NEXT: trace-symbols.s.tmp1.so: shared definition of foo
+
 # RUN: ld.lld -y foo -trace-symbol common -trace-symbol=hsymbol \
 # RUN:   %t %t1 %t2 -o %t3 | FileCheck -check-prefix=OBJECTRFOO %s
 # OBJECTRFOO: trace-symbols.s.tmp: reference to foo
Index: lld/ELF/Symbols.cpp
===================================================================
--- lld/ELF/Symbols.cpp
+++ lld/ELF/Symbols.cpp
@@ -726,5 +726,6 @@
     uint8_t bind = binding;
     replace(other);
     binding = bind;
-  }
+  } else if (traced)
+    printTraceSymbol(&other);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80143.264945.patch
Type: text/x-patch
Size: 979 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200519/eef98b0c/attachment.bin>


More information about the llvm-commits mailing list