LCOV - code coverage report
Current view: top level - backends - x86_64_init.c (source / functions) Hit Total Coverage
Test: elfutils-0.193 Lines: 21 21 100.0 %
Date: 2025-05-08 22:46:17 Functions: 1 1 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 4 4 100.0 %

           Branch data     Line data    Source code
       1                 :            : /* Initialization of x86-64 specific backend library.
       2                 :            :    Copyright (C) 2002-2009, 2013, 2018, 2025 Red Hat, Inc.
       3                 :            :    Copyright (C) H.J. Lu <hjl.tools@gmail.com>, 2015.
       4                 :            :    This file is part of elfutils.
       5                 :            :    Written by Ulrich Drepper <drepper@redhat.com>, 2002.
       6                 :            : 
       7                 :            :    This file is free software; you can redistribute it and/or modify
       8                 :            :    it under the terms of either
       9                 :            : 
      10                 :            :      * the GNU Lesser General Public License as published by the Free
      11                 :            :        Software Foundation; either version 3 of the License, or (at
      12                 :            :        your option) any later version
      13                 :            : 
      14                 :            :    or
      15                 :            : 
      16                 :            :      * the GNU General Public License as published by the Free
      17                 :            :        Software Foundation; either version 2 of the License, or (at
      18                 :            :        your option) any later version
      19                 :            : 
      20                 :            :    or both in parallel, as here.
      21                 :            : 
      22                 :            :    elfutils is distributed in the hope that it will be useful, but
      23                 :            :    WITHOUT ANY WARRANTY; without even the implied warranty of
      24                 :            :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      25                 :            :    General Public License for more details.
      26                 :            : 
      27                 :            :    You should have received copies of the GNU General Public License and
      28                 :            :    the GNU Lesser General Public License along with this program.  If
      29                 :            :    not, see <http://www.gnu.org/licenses/>.  */
      30                 :            : 
      31                 :            : #ifdef HAVE_CONFIG_H
      32                 :            : # include <config.h>
      33                 :            : #endif
      34                 :            : 
      35                 :            : #define BACKEND         x86_64_
      36                 :            : #define RELOC_PREFIX    R_X86_64_
      37                 :            : #include "libebl_CPU.h"
      38                 :            : #include "libebl_PERF_FLAGS.h"
      39                 :            : 
      40                 :            : /* This defines the common reloc hooks based on x86_64_reloc.def.  */
      41                 :            : #include "common-reloc.c"
      42                 :            : 
      43                 :            : extern __typeof (EBLHOOK (core_note)) x32_core_note attribute_hidden;
      44                 :            : 
      45                 :            : Ebl *
      46                 :       1045 : x86_64_init (Elf *elf __attribute__ ((unused)),
      47                 :            :              GElf_Half machine __attribute__ ((unused)),
      48                 :            :              Ebl *eh)
      49                 :            : {
      50                 :            :   /* We handle it.  */
      51         [ +  + ]:       1045 :   x86_64_init_reloc (eh);
      52                 :       1045 :   HOOK (eh, reloc_simple_type);
      53                 :       1045 :   HOOK (eh, section_type_name);
      54         [ +  + ]:       1045 :   if (eh->class == ELFCLASS32)
      55                 :         17 :     eh->core_note = x32_core_note;
      56                 :            :   else
      57                 :       1028 :     HOOK (eh, core_note);
      58                 :       1045 :   HOOK (eh, return_value_location);
      59                 :       1045 :   HOOK (eh, register_info);
      60                 :       1045 :   HOOK (eh, auxv_info);
      61                 :       1045 :   HOOK (eh, disasm);
      62                 :       1045 :   HOOK (eh, abi_cfi);
      63                 :            :   /* gcc/config/ #define DWARF_FRAME_REGISTERS.  */
      64                 :       1045 :   eh->frame_nregs = 17;
      65                 :       1045 :   HOOK (eh, set_initial_registers_tid);
      66                 :       1045 :   HOOK (eh, set_initial_registers_sample);
      67                 :       1045 :   HOOK (eh, sample_base_addr);
      68                 :       1045 :   HOOK (eh, sample_pc);
      69                 :       1045 :   eh->perf_frame_regs_mask = PERF_FRAME_REGISTERS_X86_64;
      70                 :       1045 :   HOOK (eh, unwind);
      71                 :       1045 :   HOOK (eh, check_reloc_target_type);
      72                 :            : 
      73                 :       1045 :   return eh;
      74                 :            : }

Generated by: LCOV version 1.16