Skip to content

Commit 87975c6

Browse files
committed
Treat .got.plt as read-only for Hexagon
This allows types to propagate to thunks in cases where there are GOT entries for internal functions
1 parent 1060a72 commit 87975c6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

view/elf/elfview.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,9 @@ bool ElfView::Init()
653653
vector<string> readWriteDataSectionNames = {".data", ".bss"};
654654
vector<string> readOnlyDataSectionNames = {".rodata", ".dynamic", ".dynsym", ".dynstr", ".ehframe",
655655
".ctors", ".dtors", ".got", ".got2", ".data.rel.ro", ".gnu.hash"};
656+
if (m_arch && m_arch->GetName() == "hexagon") {
657+
readOnlyDataSectionNames.emplace_back(".got.plt");
658+
}
656659
if ((m_elfSections[i].flags & ELF_SHF_EXECINSTR) || In(sectionNames[i], readOnlyCodeSectionNames))
657660
semantics = ReadOnlyCodeSectionSemantics;
658661
else if (!(m_elfSections[i].flags & ELF_SHF_WRITE) || In(sectionNames[i], readOnlyDataSectionNames))
@@ -2561,7 +2564,7 @@ void ElfView::DefineElfSymbol(BNSymbolType type, const string& incomingName, uin
25612564
}
25622565
}
25632566

2564-
if (!typeRef && m_arch->GetName() == "hexagon")
2567+
if (!typeRef && m_arch && m_arch->GetName() == "hexagon")
25652568
{
25662569
// Apply platform types for statically linked Hexagon binaries
25672570
typeRef = GetDefaultPlatform()->GetFunctionByName(rawName);

0 commit comments

Comments
 (0)