From a0baa2ea2709db83cce485a18523b8de9fc81135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Thu, 31 Jul 2025 17:52:51 -0700 Subject: [PATCH] NetBpfLoad: remove unused readSectionUint() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test: TreeHugger Flag: EXEMPT mainline/noop Signed-off-by: Maciej Żenczykowski Change-Id: I88de4f7d17f3eb28c320a3883638633a2a80f93c --- bpf/loader/NetBpfLoad.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/bpf/loader/NetBpfLoad.cpp b/bpf/loader/NetBpfLoad.cpp index f02241c77e..aebaa9c9e3 100644 --- a/bpf/loader/NetBpfLoad.cpp +++ b/bpf/loader/NetBpfLoad.cpp @@ -271,29 +271,6 @@ static int readSectionByName(const char* name, ifstream& elfFile, vector& dat return -2; } -unsigned int readSectionUint(const char* name, ifstream& elfFile) { - vector theBytes; - int ret = readSectionByName(name, elfFile, theBytes); - if (ret) { - ALOGE("Couldn't find section %s.", name); - abort(); - } else if (theBytes.size() < sizeof(unsigned int)) { - ALOGE("Section %s is too short.", name); - abort(); - } else { - // decode first 4 bytes as LE32 uint, there will likely be more bytes due to alignment. - unsigned int value = static_cast(theBytes[3]); - value <<= 8; - value += static_cast(theBytes[2]); - value <<= 8; - value += static_cast(theBytes[1]); - value <<= 8; - value += static_cast(theBytes[0]); - ALOGD("Section %s value is %u [0x%x]", name, value, value); - return value; - } -} - static int readSectionByType(ifstream& elfFile, int type, vector& data) { int ret; vector shTable;