[llvm] [llvm-objcopy] Add llvm-objcopy option --set-visibility-sym (PR #80872)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 14 01:15:32 PST 2024
================
@@ -0,0 +1,106 @@
+
+# RUN: yaml2obj %s -o %t.o
+
+# Check if the visibility of a single symbol is set correctly,
+# and none of other symbols are affected
+# RUN: cp %t.o %t0.o
+# RUN: llvm-objcopy %t0.o --set-symbol-visibility=default_local=hidden
+# RUN: llvm-objcopy %t0.o --set-symbol-visibility=internal_local=protected
+# RUN: llvm-objcopy %t0.o --set-symbol-visibility=hidden_local=internal
+# RUN: llvm-objcopy %t0.o --set-symbol-visibility=protected_local=default
+# RUN: llvm-readelf -s %t0.o | FileCheck %s --check-prefix=SINGLE
+
+# SINGLE-DAG: HIDDEN 1 default_local
+# SINGLE-DAG: PROTECTED 1 internal_local
+# SINGLE-DAG: INTERNAL 1 hidden_local
+# SINGLE-DAG: DEFAULT 1 protected_local
+# Unaffected symbols:
+# SINGLE-DAG: DEFAULT 1 default_global
+# SINGLE-DAG: DEFAULT 1 default_weak
+# SINGLE-DAG: INTERNAL 1 internal_global
+# SINGLE-DAG: INTERNAL 1 internal_weak
+# SINGLE-DAG: HIDDEN 1 hidden_global
+# SINGLE-DAG: HIDDEN 1 hidden_weak
+# SINGLE-DAG: PROTECTED 1 protected_global
+# SINGLE-DAG: PROTECTED 1 protected_weak
+
+
+# Check if the visibility of symbols specified by a regex are set correctly,
+# and none of other symbols are affected
----------------
jh7370 wrote:
```suggestion
# Check that the visibility of symbols specified by a regex are set correctly,
# and that no other symbols are affected
```
https://github.com/llvm/llvm-project/pull/80872
More information about the llvm-commits
mailing list