[ELF] Added test case for PROVIDE and PROVIDE_HIDDEN within section
authorEugene Leviant <evgeny.leviant@gmail.com>
Fri, 26 Aug 2016 09:48:32 +0000 (09:48 +0000)
committerEugene Leviant <evgeny.leviant@gmail.com>
Fri, 26 Aug 2016 09:48:32 +0000 (09:48 +0000)
llvm-svn: 279809

lld/test/ELF/linkerscript/linkerscript-symbols-synthetic.s

index f1d27a7..ac899c8 100644 (file)
@@ -7,8 +7,10 @@
 # RUN: echo "SECTIONS { \
 # RUN:          .foo : { \
 # RUN:              begin_foo = .; \
+# RUN:              PROVIDE(_begin_foo = .); \
 # RUN:              *(.foo) \
 # RUN:              end_foo = .; \
+# RUN:              PROVIDE_HIDDEN(_end_foo = .); \
 # RUN:              size_foo_1 = SIZEOF(.foo); \
 # RUN:              . = ALIGN(0x1000); \
 # RUN:              begin_bar = .; \
 # RUN:            size_foo_3 = SIZEOF(.foo); }" > %t.script
 # RUN: ld.lld -o %t1 --script %t.script %t
 # RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=SIMPLE %s
-# SIMPLE:      0000000000000120         .foo    00000000 begin_foo
+
+# SIMPLE:      0000000000000128         .foo    00000000 .hidden _end_foo
+# SIMPLE:      0000000000000120         .foo    00000000 _begin_foo
+# SIMPLE-NEXT: 0000000000000120         .foo    00000000 begin_foo
 # SIMPLE-NEXT: 0000000000000128         .foo    00000000 end_foo
 # SIMPLE-NEXT: 0000000000000008         .foo    00000000 size_foo_1
 # SIMPLE-NEXT: 0000000000001000         .foo    00000000 begin_bar
@@ -36,3 +41,5 @@ _start:
 
 .section .bar,"a"
  .long 0
+
+.global _begin_foo, _end_foo