Index: test/ELF/static-with-export-dynamic.s =================================================================== --- /dev/null +++ test/ELF/static-with-export-dynamic.s @@ -0,0 +1,32 @@ +// RUN: llvm-mc -filetype=obj -triple=i686-unknown-cloudabi %s -o %t.o +// RUN: ld.lld --export-dynamic %t.o -o %t +// RUN: llvm-readobj -dyn-symbols %t | FileCheck %s +// REQUIRES: x86 + +// Ensure that a dynamic symbol table is present when --export-dynamic +// is passed in, even when creating statically linked executables. +// +// CHECK: DynamicSymbols [ +// CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: @ (0) +// CHECK-NEXT: Value: 0x0 +// CHECK-NEXT: Size: 0 +// CHECK-NEXT: Binding: Local (0x0) +// CHECK-NEXT: Type: None (0x0) +// CHECK-NEXT: Other: 0 +// CHECK-NEXT: Section: Undefined (0x0) +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: _start@ (1) +// CHECK-NEXT: Value: 0x11000 +// CHECK-NEXT: Size: 0 +// CHECK-NEXT: Binding: Global (0x1) +// CHECK-NEXT: Type: None (0x0) +// CHECK-NEXT: Other: 0 +// CHECK-NEXT: Section: .text (0x4) +// CHECK-NEXT: } +// CHECK-NEXT: ] + +.global _start +_start: + ret