## Check we do not crash/assert when .dynsym is specified
## explicitly, but .dynstr is not present.

# RUN: yaml2obj %s -o %t
# RUN: llvm-readelf --section-headers %t | FileCheck %s

## Check that .dynsym has Link field set to 0.

# CHECK:      Section Headers:
# CHECK-NEXT:  [Nr] Name    Type   Address          Off    Size   ES Flg Lk
# CHECK-NEXT:  [ 0]         NULL   0000000000000000 000000 000000 00 0   0
# CHECK-NEXT:  [ 1] .dynsym DYNSYM 0000000000000000 000040 000018 18 A   0

--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2LSB
  Type:    ET_DYN
  Machine: EM_X86_64
Sections:
  - Name: .dynsym
    Type: SHT_DYNSYM
