Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2241,6 +2241,12 @@ ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id,
// function will be resolved if it is referenced.
symbol_type = eSymbolTypeResolver;
break;

case STT_TLS:
// The symbol is associated with a thread-local data object, such as
// a thread-local variable.
symbol_type = eSymbolTypeData;
break;
}
}

Expand Down
28 changes: 28 additions & 0 deletions lldb/test/Shell/ObjectFile/ELF/stt-tls-symbol.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Test that STT_TLS symbols are recognized and treated as data symbols.
#
# RUN: yaml2obj %s -o %t
# RUN: %lldb %t -o "image dump symtab" -b | FileCheck %s

# CHECK: Index UserID DSX Type File Address/Value Load Address Size Flags Name
# CHECK: [ 0] 1 Data 0x0000000000001000 0x0000000000000004 {{0x[0-9a-f]+}} tls_var

--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Sections:
- Name: .tdata
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_WRITE, SHF_TLS ]
Address: 0x1000
AddressAlign: 0x4
Size: 0x4
Symbols:
- Name: tls_var
Type: STT_TLS
Section: .tdata
Value: 0x1000
Size: 0x4
...
Loading