summaryrefslogtreecommitdiff
path: root/view
diff options
context:
space:
mode:
authorBrandon Miller <brandon@vector35.com>2025-09-15 11:19:42 -0400
committerBrandon Miller <brandon@vector35.com>2025-09-29 07:07:41 -0400
commit87975c6620347671352c65b7fa518635180809c6 (patch)
tree6088b9ca9984065fd479fdf0e34094ccb5fe161e /view
parent1060a72be93a4a229f60e931a003d065beb727e2 (diff)
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
Diffstat (limited to 'view')
-rw-r--r--view/elf/elfview.cpp5
1 files changed, 4 insertions, 1 deletions
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<string> readWriteDataSectionNames = {".data", ".bss"};
vector<string> 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);