Malihe Alikhani

132 papers A* 9A 6B 18Misc 4Journal 63Unranked 31
YearRankTypeTitle / Venue / Authors
2026 J jnl
CoRR
Saki Imai, Pedram Heydari, Anthony Sicilia, Asteria Kaeberlein, Katherine Atwell, Malihe Alikhani
2025 J jnl
CoRR
Katherine Atwell, Saki Imai, Danielle Bragg, Malihe Alikhani
2025 conf
NAACL (Findings)
Anthony Sicilia, Mert Inan, Malihe Alikhani
2025 conf
EMNLP (Findings)
Anthony Sicilia, Malihe Alikhani
2025 B conf
COLING
Sabit Hassan, Anthony B. Sicilia, Malihe Alikhani
2025 J jnl
CoRR
Mert Inan, Anthony Sicilia, Suvodip Dey, Vardhan Dongre, Tejas Srinivasan, Jesse Thomason, Gökhan Tür, Dilek Hakkani-Tür, Malihe Alikhani
2025 A conf
AAMAS
Sabit Hassan, Hye-Young Chung, Xiang Zhi Tan, Malihe Alikhani
2025 conf
COLING (Industry)
Yuya Asano, Sabit Hassan, Paras Sharma, Anthony B. Sicilia, Katherine Atwell, Diane J. Litman, Malihe Alikhani
2025 J jnl
CoRR
Yuya Asano, Sabit Hassan, Paras Sharma, Anthony Sicilia, Katherine Atwell, Diane J. Litman, Malihe Alikhani
2025 conf
ACL (1)
Anthony B. Sicilia, Malihe Alikhani
2025 Misc conf
RANLP
Asteria Kaeberlein, Malihe Alikhani
2025 J jnl
CoRR
Saki Imai, Lee Kezar, Laurel Aichler, Mert Inan, Erin Walker, Alicia Wooten, Lorna C. Quandt, Malihe Alikhani
2025 conf
NAACL (Long Papers)
Mert Inan, Yang Zhong, Vidya Ganesh, Malihe Alikhani
2025 J jnl
CoRR
Yongsu Ahn, Yu-Run Lin, Malihe Alikhani, Eunjeong Cheon
2025 A* conf
EMNLP
Mert Inan, Anthony Sicilia, Alex Xie, Saujas Vaduguru, Daniel Fried, Malihe Alikhani
2025 J jnl
CoRR
Mert Inan, Anthony Sicilia, Alex Xie, Saujas Vaduguru, Daniel Fried, Malihe Alikhani
2025 conf
ACL (Findings)
Katherine Atwell, Mandy Simons, Malihe Alikhani
2025 Misc conf
RANLP
Saki Imai, Mert Inan, Anthony B. Sicilia, Malihe Alikhani
2025 J jnl
CoRR
Saki Imai, Mert Inan, Anthony Sicilia, Malihe Alikhani
2025 J jnl
CoRR
Ziyi Wang, Yuxuan Lu, Wenbo Li, Amirali Amini, Bo Sun, Yakov Bart, Weimin Lyu, Jiri Gesi, Tian Wang, Jing Huang, Yu Su, Upol Ehsan, Malihe Alikhani, Toby Jia-Jun Li, Lydia B. Chilton, Dakuo Wang
2025 J jnl
CoRR
Katherine Atwell, Pedram Heydari, Anthony Sicilia, Malihe Alikhani
2025 Misc conf
RANLP
Asteria Kaeberlein, Malihe Alikhani
2025 Misc conf
RANLP
Saki Imai, Mert Inan, Anthony B. Sicilia, Malihe Alikhani
2025 J jnl
CoRR
Saki Imai, Mert Inan, Anthony Sicilia, Malihe Alikhani
2025 conf
ACL (Findings)
Mert Inan, Anthony Sicilia, Malihe Alikhani
2024 J jnl
Lang. Resour. Evaluation
Shahab Raji, Malihe Alikhani, Gerard de Melo, Matthew Stone
2024 J jnl
CoRR
Anthony Sicilia, Mert Inan, Malihe Alikhani
2024 J jnl
CoRR
Sabit Hassan, Anthony Sicilia, Malihe Alikhani
2024 J jnl
CoRR
Sabit Hassan, Anthony Sicilia, Malihe Alikhani
2024 J jnl
CoRR
Sabit Hassan, Hye-Young Chung, Xiang Zhi Tan, Malihe Alikhani
2024 conf
LREC/COLING
Katherine Atwell, Mert Inan, Anthony B. Sicilia, Malihe Alikhani
2024 conf
ACL (Findings)
Anthony Sicilia, Hyunwoo Kim, Khyathi Raghavi Chandu, Malihe Alikhani, Jack Hessel
2024 J jnl
CoRR
Anthony Sicilia, Hyunwoo Kim, Khyathi Raghavi Chandu, Malihe Alikhani, Jack Hessel
2024 J jnl
CoRR
Casey Kennington, Malihe Alikhani, Heather Pon-Barry, Katherine Atwell, Yonatan Bisk, Daniel Fried, Felix Gervits, Zhao Han, Mert Inan, Michael Johnston, Raj Korpan, Diane J. Litman, Matthew Marge, Cynthia Matuszek, Ross Mead, Shiwali Mohan, Raymond J. Mooney, Natalie Parde, Jivko Sinapov, Angela Stewart, Matthew Stone, Stefanie Tellex, Tom Williams
2024 J jnl
CoRR
Anthony Sicilia, Malihe Alikhani
2024 J jnl
CoRR
Anthony Sicilia, Malihe Alikhani
2024 J jnl
CoRR
Resmi Ramachandranpillai, Kishore Sampath, Ayaazuddin Mohammad, Malihe Alikhani
2024 conf
NAACL (Industry Track)
Mert Inan, Katherine Atwell, Anthony Sicilia, Lorna C. Quandt, Malihe Alikhani
2024 J jnl
CoRR
Mert Inan, Katherine Atwell, Anthony Sicilia, Lorna C. Quandt, Malihe Alikhani
2024 conf
EACL (1)
Anthony Sicilia, Jennifer C. Gates, Malihe Alikhani
2024 J jnl
CoRR
Qi Cheng, Mert Inan, Rahma Mbarki, Grace Grmek, Theresa Choi, Yiming Sun, Kimele Persaud, Jenny Wang, Malihe Alikhani
2024 conf
ML4CMH@AAAI
Maneesh Bilalpur, Mert Inan, Dorsa Zeinali, Jeffrey F. Cohn, Malihe Alikhani
2024 J jnl
CoRR
Maneesh Bilalpur, Mert Inan, Dorsa Zeinali, Jeffrey F. Cohn, Malihe Alikhani
2024 conf
LREC/COLING
Mert Inan, Malihe Alikhani
2024 A* conf
EMNLP
Katherine Atwell, Danielle Bragg, Malihe Alikhani
2024 J jnl
CoRR
Katherine Atwell, Danielle Bragg, Malihe Alikhani
2023 conf
ACL (Findings)
Sabit Hassan, Malihe Alikhani
2023 J jnl
CoRR
Sabit Hassan, Malihe Alikhani
2023 conf
IJCNLP (1)
Sabit Hassan, Malihe Alikhani
2023 J jnl
CoRR
Sabit Hassan, Malihe Alikhani
2023 conf
WMT
Mathias Müller, Malihe Alikhani, Eleftherios Avramidis, Richard Bowden, Annelies Braffort, Necati Cihan Camgöz, Sarah Ebling, Cristina España-Bonet, Anne Göhring, Roman Grundkiewicz, Mert Inan, Zifan Jiang, Oscar Koller, Amit Moryossef, Annette Rios, Dimitar Shterionov, Sandra Sidler-Miserez, Katja Tissi, Davy Van Landuyt
2023 J jnl
CoRR
Anthony Sicilia, Jennifer C. Gates, Malihe Alikhani
2023 A conf
EACL
Venkata Subrahmanyan Govindarajan, Katherine Atwell, Barea Sinno, Malihe Alikhani, David Beaver, Junyi Jessy Li
2023 J jnl
Frontiers Artif. Intell.
Malihe Alikhani, Baber Khalid, Matthew Stone
2023 conf
*SEM@ACL
Carla Viegas, Mert Inan, Lorna C. Quandt, Malihe Alikhani
2023 B conf
SIGDIAL
Qi Cheng, Mert Inan, Rahma Mbarki, Grace Grmek, Theresa Choi, Yiming Sun, Kimele Persaud, Jenny Wang, Malihe Alikhani
2023 conf
ACL (1)
Anthony Sicilia, Malihe Alikhani
2023 J jnl
CoRR
Anthony Sicilia, Malihe Alikhani
2023 conf
ACL (Findings)
Yan Wang, Heidi Ann Scharf Donovan, Sabit Hassan, Malihe Alikhani
2023 J jnl
CoRR
Yan Wang, Heidi Ann Scharf Donovan, Sabit Hassan, Malihe Alikhani
2023 A conf
EACL
Meng Ye, Karan Sikka, Katherine Atwell, Sabit Hassan, Ajay Divakaran, Malihe Alikhani
2023 J jnl
CoRR
Meng Ye, Karan Sikka, Katherine Atwell, Sabit Hassan, Ajay Divakaran, Malihe Alikhani
2023 A conf
EACL
Sedrick Scott Keh, Steven Y. Feng, Varun Gangal, Malihe Alikhani, Eduard H. Hovy
2023 B ed.
SIGDIAL
David Schlangen, Svetlana Stoyanchev, Shafiq Joty, Ondrej Dusek, Casey Kennington, Malihe Alikhani
2023 A* conf
EMNLP
Hyunwoo Kim, Jack Hessel, Liwei Jiang, Peter West, Ximing Lu, Youngjae Yu, Pei Zhou, Ronan Le Bras, Malihe Alikhani, Gunhee Kim, Maarten Sap, Yejin Choi
2022 B conf
COLING
Katherine Atwell, Sabit Hassan, Malihe Alikhani
2022 J jnl
CoRR
Katherine Atwell, Sabit Hassan, Malihe Alikhani
2022 A* conf
AAAI
Malihe Alikhani, Fangda Han, Hareesh Ravi, Mubbasir Kapadia, Vladimir Pavlovic, Matthew Stone
2022 J jnl
CoRR
Venkata Subrahmanyan Govindarajan, Katherine Atwell, Barea Sinno, Malihe Alikhani, David I. Beaver, Junyi Jessy Li
2022 A conf
UMAP
Nhat Tran, Malihe Alikhani, Diane J. Litman
2022 J jnl
CoRR
Carla Viegas, Mert Inan, Lorna C. Quandt, Malihe Alikhani
2022 A* conf
IJCAI
Kayo Yin, Malihe Alikhani
2022 conf
AACL/IJCNLP (Findings)
Anthony Sicilia, Malihe Alikhani
2022 J jnl
CoRR
Anthony Sicilia, Malihe Alikhani
2022 B conf
CogSci
Mert Inan, Yang Zhong, Sabit Hassan, Lorna C. Quandt, Malihe Alikhani
2022 B conf
CogSci
Theresa Choi, Rahma Mbarki, Grace Grmek, Kimele Persaud, Jinjing (Jenny) Wang, Malihe Alikhani
2022 B conf
CogSci
Carla Viegas, Lorna C. Quandt, Malihe Alikhani
2022 conf
ACL (Findings)
Mert Inan, Yang Zhong, Sabit Hassan, Lorna C. Quandt, Malihe Alikhani
2022 J jnl
CoRR
Mert Inan, Yang Zhong, Sabit Hassan, Lorna C. Quandt, Malihe Alikhani
2022 J jnl
CoRR
Anthony Sicilia, Tristan Maidment, Pat Healy, Malihe Alikhani
2022 J jnl
Trans. Assoc. Comput. Linguistics
Anthony Sicilia, Tristan Maidment, Pat Healy, Malihe Alikhani
2022 A* conf
AAAI
Varun Gangal, Steven Y. Feng, Malihe Alikhani, Teruko Mitamura, Eduard H. Hovy
2022 J jnl
CoRR
Anthony Sicilia, Katherine Atwell, Malihe Alikhani, Seong Jae Hwang
2022 A conf
UAI
Anthony Sicilia, Katherine Atwell, Malihe Alikhani, Seong Jae Hwang
2022 J jnl
CoRR
Sedrick Scott Keh, Steven Y. Feng, Varun Gangal, Malihe Alikhani, Eduard H. Hovy
2022 B conf
COLING
Sedrick Scott Keh, Kevin Lu, Varun Gangal, Steven Y. Feng, Harsh Jhamtani, Malihe Alikhani, Eduard H. Hovy
2022 J jnl
CoRR
Sedrick Scott Keh, Kevin Lu, Varun Gangal, Steven Y. Feng, Harsh Jhamtani, Malihe Alikhani, Eduard H. Hovy
2022 conf
NAACL-HLT
Barea Sinno, Bernardo Oviedo, Katherine Atwell, Malihe Alikhani, Junyi Jessy Li
2022 B ed.
SIGDIAL
Oliver Lemon, Dilek Hakkani-Tür, Junyi Jessy Li, Arash Ashrafzadeh, Daniel Hernández García, Malihe Alikhani, David Vandyke, Ondrej Dusek
2022 A* conf
AAAI
Steven Y. Feng, Kevin Lu, Zhuofu Tao, Malihe Alikhani, Teruko Mitamura, Eduard H. Hovy, Varun Gangal
2022 J jnl
CoRR
Hyunwoo Kim, Jack Hessel, Liwei Jiang, Ximing Lu, Youngjae Yu, Pei Zhou, Ronan Le Bras, Malihe Alikhani, Gunhee Kim, Maarten Sap, Yejin Choi
2022 B conf
CogSci
Sabit Hassan, Katherine Atwell, Malihe Alikhani
2022 conf
ACL (Findings)
Katherine Atwell, Anthony Sicilia, Seong Jae Hwang, Malihe Alikhani
2022 J jnl
CoRR
Katherine Atwell, Anthony Sicilia, Seong Jae Hwang, Malihe Alikhani
2022 B conf
COLING
Katherine Atwell, Remi Choi, Junyi Jessy Li, Malihe Alikhani
2022 J jnl
CoRR
Malihe Alikhani, Thomas Kober, Bashar Alhafni, Yue Chen, Mert Inan, Elizabeth Nielsen, Shahab Raji, Mark Steedman, Matthew Stone
2021 J jnl
Lang. Resour. Evaluation
Tuomo Hiippala, Malihe Alikhani, Jonas Haverinen, Timo Kalliokoski, Evanfiya Logacheva, Serafina Orekhova, Aino Tuomainen, Matthew Stone, John A. Bateman
2021 conf
AKBC
Meiqi Guo, Mingda Zhang, Siva Reddy, Malihe Alikhani
2021 conf
EMNLP (Findings)
Mert Inan, Piyush Sharma, Baber Khalid, Radu Soricut, Matthew Stone, Malihe Alikhani
2021 J jnl
CoRR
Mert Inan, Piyush Sharma, Baber Khalid, Radu Soricut, Matthew Stone, Malihe Alikhani
2021 J jnl
CoRR
Malihe Alikhani, Fangda Han, Hareesh Ravi, Mubbasir Kapadia, Vladimir Pavlovic, Matthew Stone
2021 conf
ACL/IJCNLP (Findings)
Carla Viegas, Malihe Alikhani
2021 B conf
INLG
Chloe Ciora, Nur Iren, Malihe Alikhani
2021 J jnl
CoRR
Chloe Ciora, Nur Iren, Malihe Alikhani
2021 conf
ACL/IJCNLP (1)
Kayo Yin, Amit Moryossef, Julie Hochgesang, Yoav Goldberg, Malihe Alikhani
2021 J jnl
CoRR
Kayo Yin, Amit Moryossef, Julie Hochgesang, Yoav Goldberg, Malihe Alikhani
2021 J jnl
Trans. Assoc. Comput. Linguistics
Daniel Khashabi, Arman Cohan, Siamak Shakeri, Pedram Hosseini, Pouya Pezeshkpour, Malihe Alikhani, Moin Aminnaseri, Marzieh Bitaab, Faeze Brahman, Sarik Ghazarian, Mozhdeh Gheini, Arman Kabiri, Rabeeh Karimi Mahabadi, Omid Memarrast, Ahmadreza Mosallanezhad, Erfan Noury, Shahab Raji, Mohammad Sadegh Rasooli, Sepideh Sadeghi, Erfan Sadeqi Azer, Niloofar Safi Samghabadi, Mahsa Shafaei, Saber Sheybani, Ali Tazarv, Yadollah Yaghoobzadeh
2021 J jnl
CoRR
Barea Sinno, Bernardo Oviedo, Katherine Atwell, Malihe Alikhani, Junyi Jessy Li
2021 ed.
DialDoc@ACL-IJCNLP
Song Feng, Siva Reddy, Malihe Alikhani, He He, Yangfeng Ji, Mohit Iyyer, Zhou Yu
2021 J jnl
CoRR
Steven Y. Feng, Kevin Lu, Zhuofu Tao, Malihe Alikhani, Teruko Mitamura, Eduard H. Hovy, Varun Gangal
2021 conf
EMNLP (1)
Kayo Yin, Kenneth DeHaan, Malihe Alikhani
2021 B conf
IVA
Carla Viegas, Malihe Alikhani
2021 B conf
SIGDIAL
Katherine Atwell, Junyi Jessy Li, Malihe Alikhani
2021 J jnl
CoRR
Amanda Buddemeyer, Erin Walker, Malihe Alikhani
2020 conf
ACL (tutorial)
Malihe Alikhani, Matthew Stone
2020 B conf
COLING
Thomas Kober, Malihe Alikhani, Matthew Stone, Mark Steedman
2020 J jnl
CoRR
Thomas Kober, Malihe Alikhani, Matthew Stone, Mark Steedman
2020 J jnl
CoRR
Malihe Alikhani, Piyush Sharma, Shengjie Li, Radu Soricut, Matthew Stone
2020 B conf
COLING
Baber Khalid, Malihe Alikhani, Matthew Stone
2020 A* conf
ACL
Malihe Alikhani, Piyush Sharma, Shengjie Li, Radu Soricut, Matthew Stone
2020 J jnl
CoRR
Baber Khalid, Malihe Alikhani, Michael Fellner, Brian McMahan, Matthew Stone
2020 J jnl
CoRR
Daniel Khashabi, Arman Cohan, Siamak Shakeri, Pedram Hosseini, Pouya Pezeshkpour, Malihe Alikhani, Moin Aminnaseri, Marzieh Bitaab, Faeze Brahman, Sarik Ghazarian, Mozhdeh Gheini, Arman Kabiri, Rabeeh Karimi Mahabadi, Omid Memarrast, Ahmadreza Mosallanezhad, Erfan Noury, Shahab Raji, Mohammad Sadegh Rasooli, Sepideh Sadeghi, Erfan Sadeqi Azer, Niloofar Safi Samghabadi, Mahsa Shafaei, Saber Sheybani, Ali Tazarv, Yadollah Yaghoobzadeh
2020 A* conf
AAAI
Malihe Alikhani, Baber Khalid, Rahul Shome, Chaitanya Mitash, Kostas E. Bekris, Matthew Stone
2019 J jnl
CoRR
Tuomo Hiippala, Malihe Alikhani, Jonas Haverinen, Timo Kalliokoski, Evanfiya Logacheva, Serafina Orekhova, Aino Tuomainen, Matthew Stone, John A. Bateman
2019 conf
NAACL-HLT (1)
Malihe Alikhani, Sreyasi Nag Chowdhury, Gerard de Melo, Matthew Stone
2019 J jnl
CoRR
Malihe Alikhani, Sreyasi Nag Chowdhury, Gerard de Melo, Matthew Stone
2019 J jnl
CoRR
Malihe Alikhani, Baber Khalid, Rahul Shome, Chaitanya Mitash, Kostas E. Bekris, Matthew Stone
2018 B conf
COLING
Malihe Alikhani, Matthew Stone
2018 conf
MIPR
Malihe Alikhani, Matthew Stone
2017 B conf
CogSci
Kimele Persaud, Brian McMahan, Malihe Alikhani, Kevin Pei, Pernille Hemmer, Matthew Stone
2015 J jnl
Algorithmic Finance
Malihe Alikhani, Bjørn Kjos-Hanssen, Amirarsalan Pakravan, Babak Saadat
2015 J jnl
CoRR
Malihe Alikhani, Bjørn Kjos-Hanssen, Amirarsalan Pakravan, Babak Saadat
redb/extractors/elf_extractors/elf_relocations.py
← Index redb/extractors/elf_extractors/elf_relocations.py python
import inspect
from datetime import datetime, timezone
from typing import Any, List, Dict

from elftools.elf.elffile import ELFFile
from elftools.common.exceptions import ELFError

from redb.extractors.enum import Tag
from redb.extractors.elf_extractor import ELFExtractor
from redb.models.dataclasses import ELFRelocation


class ELFRelocationExtractor(ELFExtractor):

    def __init__(
        self,
        filepath,
        log,
        exporters=None,
        index_prefix=None,
        elastic_index=None,
        known_benign=False,
        known_malicious=False,
        elf=None,
    ):
        super().__init__(
            filepath,
            log,
            exporters,
            index_prefix,
            elastic_index,
            known_benign,
            known_malicious,
            elf,
        )
        self.elf_relocations = []
        self.elastic_index = self.index_prefix + "-elf_relocations"
        self.log.debug(inspect.currentframe().f_code.co_name)

    def _get_relocation_type_string(self, reloc_type: int, machine_arch: str) -> str:
        """Convert relocation type number to human-readable string based on architecture."""
        # This is a simplified mapping - real implementation would need comprehensive
        # architecture-specific relocation type mappings

        common_types = {
            0: "R_NONE",
            1: "R_DIRECT",
            2: "R_PC_RELATIVE",
            3: "R_GOT",
            4: "R_PLT",
            5: "R_COPY",
            6: "R_GLOB_DAT",
            7: "R_JMP_SLOT",
            8: "R_RELATIVE"
        }

        # Architecture-specific mappings could be added here
        if machine_arch == "x86_64":
            x86_64_types = {
                1: "R_X86_64_64",
                2: "R_X86_64_PC32",
                3: "R_X86_64_GOT32",
                4: "R_X86_64_PLT32",
                5: "R_X86_64_COPY",
                6: "R_X86_64_GLOB_DAT",
                7: "R_X86_64_JUMP_SLOT",
                8: "R_X86_64_RELATIVE"
            }
            return x86_64_types.get(reloc_type, f"R_X86_64_{reloc_type}")
        elif machine_arch == "x86":
            i386_types = {
                1: "R_386_32",
                2: "R_386_PC32",
                3: "R_386_GOT32",
                4: "R_386_PLT32",
                5: "R_386_COPY",
                6: "R_386_GLOB_DAT",
                7: "R_386_JMP_SLOT",
                8: "R_386_RELATIVE"
            }
            return i386_types.get(reloc_type, f"R_386_{reloc_type}")

        return common_types.get(reloc_type, f"R_UNKNOWN_{reloc_type}")

    def _extract_relocation_data(self, relocation, section_name: str, machine_arch: str) -> Dict:
        """Extract data from a single relocation entry."""
        try:
            # Get relocation offset
            relocation_offset = relocation.entry.get('r_offset', 0)

            # Get relocation type
            relocation_type = relocation.entry.get('r_info_type', 0)

            # Get symbol index
            relocation_symbol_index = relocation.entry.get('r_info_sym', 0)

            # Get addend (only present in RELA sections)
            relocation_addend = None
            if hasattr(relocation.entry, 'r_addend'):
                relocation_addend = relocation.entry.get('r_addend', 0)

            # Get symbol name if available
            relocation_symbol_name = ""
            if hasattr(relocation, 'symbol') and relocation.symbol:
                relocation_symbol_name = relocation.symbol.name or f"<symbol_{relocation_symbol_index}>"
            else:
                relocation_symbol_name = f"<symbol_{relocation_symbol_index}>"

            # Get type string mapping
            relocation_type_str = self._get_relocation_type_string(relocation_type, machine_arch)

            return ELFRelocation(
                relocation_offset=relocation_offset,
                relocation_type=relocation_type,
                relocation_type_str=relocation_type_str,
                relocation_symbol_index=relocation_symbol_index,
                relocation_symbol_name=relocation_symbol_name,
                relocation_section=section_name,
                relocation_addend=relocation_addend
            )

        except Exception as e:
            self.log.error(f"Error extracting relocation data: {e}")
            return None

    def _extract_relocations_from_section(self, section, machine_arch: str) -> List[Dict]:
        """Extract all relocations from a relocation section."""
        relocations = []

        try:
            if not hasattr(section, 'iter_relocations'):
                return relocations

            section_name = section.name or f"<unnamed_section>"

            for relocation in section.iter_relocations():
                reloc_data = self._extract_relocation_data(relocation, section_name, machine_arch)
                if reloc_data:
                    relocations.append(reloc_data)

        except Exception as e:
            self.log.error(f"Error extracting relocations from section {section.name}: {e}")

        return relocations

    def tag(self):
        return Tag.ELF_RELOCATIONS.value if hasattr(Tag, 'ELF_RELOCATIONS') else "elf_relocations"

    def extract(self):
        try:
            self.log.debug(inspect.currentframe().f_code.co_name)

            def extract_data(elf):
                # Get architecture for relocation type mapping
                machine_arch = self._get_architecture()
                all_relocations = []

                # Iterate through all sections looking for relocation sections with per-section error handling
                for section_index, section in enumerate(elf.iter_sections()):
                    try:
                        # Check if this is a relocation section (.rel or .rela)
                        if (section.name and
                            (section.name.startswith('.rel') or section.name.startswith('.rela')) and
                            hasattr(section, 'iter_relocations')):

                            section_relocations = self._extract_relocations_from_section(section, machine_arch)
                            all_relocations.extend(section_relocations)
                            self.log.debug(f"Extracted {len(section_relocations)} relocations from section {section.name}")
                    except Exception as e:
                        section_name = getattr(section, 'name', f'section_{section_index}')
                        self.log.warning(f"Error processing relocation section {section_name}: {e}")
                        # Continue processing other sections

                return all_relocations

            if not self._is_elf_file():
                return None

            result = self._with_elf_file(extract_data)
            if result is None:
                return None

            self.elf_relocations = result
            return self.elf_relocations

        except Exception as e:
            self.log.error(f"Error extracting ELF relocations {self.hash.sha256}: {e}")
            return None

    def prepare_export_data(self, exporter_type: str) -> Any:
        self.log.debug(inspect.currentframe().f_code.co_name)

        if exporter_type == "ElasticsearchExporter":
            return self.elf_relocations
        elif exporter_type == "ClickHouseExporter":
            try:
                # Return valid empty structure if no relocations (e.g., statically linked binary)
                # None is reserved for actual errors

                # Prepare data arrays for all relocations
                data = []
                current_time = datetime.now(timezone.utc)
                for reloc in self.elf_relocations:
                    row = [
                        self.sha256,
                        self.md5,
                        self.sha1,
                        reloc.relocation_offset,
                        reloc.relocation_type,
                        reloc.relocation_type_str,
                        reloc.relocation_symbol_index,
                        reloc.relocation_symbol_name,
                        reloc.relocation_addend,
                        reloc.relocation_section,
                        current_time
                    ]
                    data.append(row)

                column_names = [
                    'sha256', 'md5', 'sha1',
                    'relocation_offset', 'relocation_type', 'relocation_type_str',
                    'relocation_symbol_index', 'relocation_symbol_name',
                    'relocation_addend', 'relocation_section',
                    'analysis_date'
                ]

                if not data:
                    return None

                column_type_names = [
                    'FixedString(64)', 'FixedString(32)', 'FixedString(40)',
                    'UInt64', 'UInt32', 'LowCardinality(String)',
                    'UInt32', 'LowCardinality(String)',
                    'Nullable(Int64)', 'LowCardinality(String)',
                    'DateTime64(3, \'UTC\')'
                ]

                return (data, column_names, column_type_names)

            except Exception as e:
                self.log.error(f"Error preparing export data: {e}")
                raise

    def get_clickhouse_table(self) -> str:
        return "redb_elf_relocations"