LCOV - code coverage report
Current view: top level - backends - loongarch_symbol.c (source / functions) Hit Total Coverage
Test: elfutils-0.189 Lines: 0 27 0.0 %
Date: 2023-04-06 23:11:33 Functions: 0 2 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 9 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* LoongArch specific symbolic name handling.
       2                 :            :    Copyright (C) 2022 Hengqi Chen
       3                 :            :    This file is part of elfutils.
       4                 :            : 
       5                 :            :    This file is free software; you can redistribute it and/or modify
       6                 :            :    it under the terms of either
       7                 :            : 
       8                 :            :      * the GNU Lesser General Public License as published by the Free
       9                 :            :        Software Foundation; either version 3 of the License, or (at
      10                 :            :        your option) any later version
      11                 :            : 
      12                 :            :    or
      13                 :            : 
      14                 :            :      * the GNU General Public License as published by the Free
      15                 :            :        Software Foundation; either version 2 of the License, or (at
      16                 :            :        your option) any later version
      17                 :            : 
      18                 :            :    or both in parallel, as here.
      19                 :            : 
      20                 :            :    elfutils is distributed in the hope that it will be useful, but
      21                 :            :    WITHOUT ANY WARRANTY; without even the implied warranty of
      22                 :            :    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      23                 :            :    General Public License for more details.
      24                 :            : 
      25                 :            :    You should have received copies of the GNU General Public License and
      26                 :            :    the GNU Lesser General Public License along with this program.  If
      27                 :            :    not, see <http://www.gnu.org/licenses/>.  */
      28                 :            : 
      29                 :            : #ifdef HAVE_CONFIG_H
      30                 :            : # include <config.h>
      31                 :            : #endif
      32                 :            : 
      33                 :            : #include <assert.h>
      34                 :            : #include <elf.h>
      35                 :            : #include <stddef.h>
      36                 :            : #include <string.h>
      37                 :            : 
      38                 :            : #define BACKEND loongarch_
      39                 :            : #include "libebl_CPU.h"
      40                 :            : 
      41                 :            : 
      42                 :            : /* Check for the simple reloc types.  */
      43                 :            : Elf_Type
      44                 :          0 : loongarch_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type,
      45                 :            :                              int *addsub)
      46                 :            : {
      47   [ #  #  #  #  :          0 :   switch (type)
             #  #  #  #  
                      # ]
      48                 :            :     {
      49                 :            :     case R_LARCH_32:
      50                 :            :       return ELF_T_WORD;
      51                 :          0 :     case R_LARCH_64:
      52                 :          0 :       return ELF_T_XWORD;
      53                 :          0 :     case R_LARCH_ADD16:
      54                 :          0 :       *addsub = 1;
      55                 :          0 :       return ELF_T_HALF;
      56                 :          0 :     case R_LARCH_ADD32:
      57                 :          0 :       *addsub = 1;
      58                 :          0 :       return ELF_T_WORD;
      59                 :          0 :     case R_LARCH_ADD64:
      60                 :          0 :       *addsub = 1;
      61                 :          0 :       return ELF_T_XWORD;
      62                 :          0 :     case R_LARCH_SUB16:
      63                 :          0 :       *addsub = -1;
      64                 :          0 :       return ELF_T_HALF;
      65                 :          0 :     case R_LARCH_SUB32:
      66                 :          0 :       *addsub = -1;
      67                 :          0 :       return ELF_T_WORD;
      68                 :          0 :     case R_LARCH_SUB64:
      69                 :          0 :       *addsub = -1;
      70                 :          0 :       return ELF_T_XWORD;
      71                 :          0 :     default:
      72                 :          0 :       return ELF_T_NUM;
      73                 :            :     }
      74                 :            : }
      75                 :            : 
      76                 :            : bool
      77                 :          0 : loongarch_machine_flag_check (GElf_Word flags)
      78                 :            : {
      79                 :          0 :   return ((flags &~ (EF_LARCH_ABI_MODIFIER_MASK
      80                 :          0 :                      | EF_LARCH_OBJABI_V1)) == 0);
      81                 :            : }

Generated by: LCOV version 1.14