• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# REQUIRES: x86
2
3# LLD used to crash when linking against a DSO with an undefined STB_LOCAL
4# symbol in the global part of the dynamic symbol table (i.e. an STB_LOCAL
5# symbol with an index >= the sh_info of the dynamic symbol table section). Such
6# a DSO is very broken, because local symbols should precede all global symbols
7# in the symbol table, and because having a symbol that's both undefined and
8# STB_LOCAL is a nonsensical combination. Nevertheless, we should warn on such
9# input files instead of crashing.
10
11# RUN: yaml2obj %s -o %t.so
12# RUN: ld.lld %t.so -o %t 2>&1 | FileCheck -check-prefix=WARN %s
13# WARN: found local symbol 'foo' in global part of symbol table in file {{.*}}.so
14
15--- !ELF
16FileHeader:
17  Class:           ELFCLASS64
18  Data:            ELFDATA2LSB
19  Type:            ET_DYN
20  Machine:         EM_X86_64
21Sections:
22  - Name:          .dynsym
23    Info:          1
24    Type:          SHT_DYNSYM
25DynamicSymbols:
26  - Name: foo
27