diff options
author | Greg Clayton <gclayton@apple.com> | 2012-03-27 21:10:07 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-03-27 21:10:07 +0000 |
commit | 741f3f9a5577ae5e8c2f594e1d5df70ac78092ce (patch) | |
tree | e0809897ef60ab37589c72526b9b6d2e6d7bc963 /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | |
parent | 52656d1047f53dd7018922793e132da87f7b52ff (diff) | |
download | bcm5719-llvm-741f3f9a5577ae5e8c2f594e1d5df70ac78092ce.tar.gz bcm5719-llvm-741f3f9a5577ae5e8c2f594e1d5df70ac78092ce.zip |
lldb_private::Section objects have a boolean flag that can be set that
indicates that the section is thread specific. Any functions the load a module
given a slide, will currently ignore any sections that are thread specific.
lldb_private::Section now has:
bool
Section::IsThreadSpecific () const
{
return m_thread_specific;
}
void
Section::SetIsThreadSpecific (bool b)
{
m_thread_specific = b;
}
The ELF plug-in has been modified to set this for the ".tdata" and the ".tbss"
sections.
Eventually we need to have each lldb_private::Thread subclass be able to
resolve a thread specific section, but for now they will just not resolve. The
code for that should be trivual to add, but the address resolving functions
will need to be changed to take a "ExecutionContext" object instead of just
a target so that thread specific sections can be resolved.
llvm-svn: 153537
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp index a024d1b3148..181d6d08f13 100644 --- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp +++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp @@ -621,6 +621,8 @@ ObjectFileELF::GetSectionList() static ConstString g_sect_name_text (".text"); static ConstString g_sect_name_data (".data"); static ConstString g_sect_name_bss (".bss"); + static ConstString g_sect_name_tdata (".tdata"); + static ConstString g_sect_name_tbss (".tbss"); static ConstString g_sect_name_dwarf_debug_abbrev (".debug_abbrev"); static ConstString g_sect_name_dwarf_debug_aranges (".debug_aranges"); static ConstString g_sect_name_dwarf_debug_frame (".debug_frame"); @@ -636,9 +638,21 @@ ObjectFileELF::GetSectionList() SectionType sect_type = eSectionTypeOther; + bool is_thread_specific = false; + if (name == g_sect_name_text) sect_type = eSectionTypeCode; else if (name == g_sect_name_data) sect_type = eSectionTypeData; else if (name == g_sect_name_bss) sect_type = eSectionTypeZeroFill; + else if (name == g_sect_name_tdata) + { + sect_type = eSectionTypeData; + is_thread_specific = true; + } + else if (name == g_sect_name_tbss) + { + sect_type = eSectionTypeZeroFill; + is_thread_specific = true; + } else if (name == g_sect_name_dwarf_debug_abbrev) sect_type = eSectionTypeDWARFDebugAbbrev; else if (name == g_sect_name_dwarf_debug_aranges) sect_type = eSectionTypeDWARFDebugAranges; else if (name == g_sect_name_dwarf_debug_frame) sect_type = eSectionTypeDWARFDebugFrame; @@ -653,7 +667,7 @@ ObjectFileELF::GetSectionList() else if (name == g_sect_name_eh_frame) sect_type = eSectionTypeEHFrame; - SectionSP section(new Section( + SectionSP section_sp(new Section( GetModule(), // Module to which this section belongs. SectionIndex(I), // Section ID. name, // Section name. @@ -664,7 +678,9 @@ ObjectFileELF::GetSectionList() file_size, // Size of the section as found in the file. header.sh_flags)); // Flags for this section. - m_sections_ap->AddSection(section); + if (is_thread_specific) + section_sp->SetIsThreadSpecific (is_thread_specific); + m_sections_ap->AddSection(section_sp); } } |