[lld] r250544 - Add an interesting case where we were already producing the correct result.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 16 12:57:42 PDT 2015


Author: rafael
Date: Fri Oct 16 14:57:42 2015
New Revision: 250544

URL: http://llvm.org/viewvc/llvm-project?rev=250544&view=rev
Log:
Add an interesting case where we were already producing the correct result.

Added:
    lld/trunk/test/elf2/startstop-shared.s

Added: lld/trunk/test/elf2/startstop-shared.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf2/startstop-shared.s?rev=250544&view=auto
==============================================================================
--- lld/trunk/test/elf2/startstop-shared.s (added)
+++ lld/trunk/test/elf2/startstop-shared.s Fri Oct 16 14:57:42 2015
@@ -0,0 +1,18 @@
+// REQUIRES: x86
+// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t.o
+// RUN: ld.lld2 %t.o -o %t.so -shared
+// RUN: llvm-readobj -r -t %t.so | FileCheck  %s
+
+        .quad __start_foo
+        .section foo,"a"
+// By default the symbol is visible and we need a dynamic reloc.
+// CHECK:  R_X86_64_64 __start_foo 0x0
+
+        .hidden __start_bar
+        .quad __start_bar
+        .section bar,"a"
+// Test that we are able to hide the symbol.
+// CHECK:      R_X86_64_RELATIVE - 0x[[ADDR:.*]]
+
+// CHECK:      Name: __start_bar
+// CHECK-NEXT: Value: 0x[[ADDR]]




More information about the llvm-commits mailing list