From 87975c6620347671352c65b7fa518635180809c6 Mon Sep 17 00:00:00 2001 From: Brandon Miller Date: Mon, 15 Sep 2025 11:19:42 -0400 Subject: 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 --- view/elf/elfview.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'view') diff --git a/view/elf/elfview.cpp b/view/elf/elfview.cpp index 2b898ad6..2a138722 100644 --- a/view/elf/elfview.cpp +++ b/view/elf/elfview.cpp @@ -653,6 +653,9 @@ bool ElfView::Init() vector readWriteDataSectionNames = {".data", ".bss"}; vector readOnlyDataSectionNames = {".rodata", ".dynamic", ".dynsym", ".dynstr", ".ehframe", ".ctors", ".dtors", ".got", ".got2", ".data.rel.ro", ".gnu.hash"}; + if (m_arch && m_arch->GetName() == "hexagon") { + readOnlyDataSectionNames.emplace_back(".got.plt"); + } if ((m_elfSections[i].flags & ELF_SHF_EXECINSTR) || In(sectionNames[i], readOnlyCodeSectionNames)) semantics = ReadOnlyCodeSectionSemantics; 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 } } - if (!typeRef && m_arch->GetName() == "hexagon") + if (!typeRef && m_arch && m_arch->GetName() == "hexagon") { // Apply platform types for statically linked Hexagon binaries typeRef = GetDefaultPlatform()->GetFunctionByName(rawName); -- cgit v1.3.1