2 ## The ELF spec says all symbols with STB_LOCAL binding precede the weak and
3 ## global symbols. If a local symbol is found in the non-local part of the
4 ## symbol table, make sure we have filled in all entries of InputFile::symbols.
5 ## Otherwise a null entry can lead to a null pointer dereference when iterating
6 ## over InputFile::symbols.
8 # RUN: yaml2obj %s -o %t.o
9 # RUN: not ld.lld %t.o %t.o -o /dev/null 2>&1 | FileCheck %s
11 # CHECK: error: {{.*}}.o: symbol (2) has invalid binding: 0
12 # CHECK-NEXT: error: {{.*}}.o: symbol (2) has invalid binding: 0
13 # CHECK-NEXT: error: duplicate symbol: _start
14 # CHECK-NEXT: >>> defined at {{.*}}.o:(.text+0x0)
15 # CHECK-NEXT: >>> defined at {{.*}}.o:(.text+0x0)
17 # CHECK-NEXT: error: duplicate symbol: local
18 # CHECK-NEXT: >>> defined at {{.*}}.o:(.text+0x0)
19 # CHECK-NEXT: >>> defined at {{.*}}.o:(.text+0x0)
22 # RUN: ld.lld --noinhibit-exec %t.o -o /dev/null 2>&1 | FileCheck %s --check-prefix=WARN
23 # WARN: warning: {{.*}}.o: symbol (2) has invalid binding: 0
34 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]