summaryrefslogtreecommitdiff
path: root/test/elf/undef-from-dso-to-main.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/elf/undef-from-dso-to-main.test')
-rw-r--r--test/elf/undef-from-dso-to-main.test52
1 files changed, 52 insertions, 0 deletions
diff --git a/test/elf/undef-from-dso-to-main.test b/test/elf/undef-from-dso-to-main.test
new file mode 100644
index 000000000000..71d0b51499dd
--- /dev/null
+++ b/test/elf/undef-from-dso-to-main.test
@@ -0,0 +1,52 @@
+# Tests that a reference from a DSO to a regular object
+# forces the final executable to export the symbol.
+
+#RUN: yaml2obj -format=elf %p/Inputs/undef2-so.o.yaml -o=%t.o.so
+#RUN: lld -flavor gnu -target x86_64 -shared %t.o.so -o %T/libundef2.so
+#RUN: yaml2obj -format=elf %s -o=%t.o
+#RUN: lld -flavor gnu -target x86_64 %t.o -L%T -lundef2 -o %t1
+#RUN: llvm-readobj -dyn-symbols %t1 | FileCheck -check-prefix CHECKSYMS %s
+
+---
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_REL
+ Machine: EM_X86_64
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ AddressAlign: 0x0000000000000001
+ Content: C3
+ - Name: .data
+ Type: SHT_PROGBITS
+ Flags: [ SHF_WRITE, SHF_ALLOC ]
+ AddressAlign: 0x0000000000000001
+ Content: ''
+ - Name: .bss
+ Type: SHT_NOBITS
+ Flags: [ SHF_WRITE, SHF_ALLOC ]
+ AddressAlign: 0x0000000000000004
+ Content: '002E7379'
+Symbols:
+ Local:
+ - Name: .text
+ Type: STT_SECTION
+ Section: .text
+ - Name: .data
+ Type: STT_SECTION
+ Section: .data
+ - Name: .bss
+ Type: STT_SECTION
+ Section: .bss
+ Global:
+ - Name: myexportedsymbol
+ Type: STT_OBJECT
+ Section: .bss
+ Size: 0x0000000000000004
+ - Name: _start
+ Section: .text
+ Size: 0x0000000000000001
+
+#CHECKSYMS: myexportedsymbol