LCOV - code coverage report
Current view: top level - backends - csky_symbol.c (source / functions) Hit Total Coverage
Test: elfutils-0.189 Lines: 2 11 18.2 %
Date: 2023-10-12 16:07:27 Functions: 1 3 33.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 6 16.7 %

           Branch data     Line data    Source code
       1                 :            : /* C-SKY specific symbolic name handling.
       2                 :            :    Copyright (C) 2019 Hangzhou C-SKY Microsystems co.,ltd.
       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 csky_
      39                 :            : #include "libebl_CPU.h"
      40                 :            : 
      41                 :            : /* Check for the simple reloc types.  */
      42                 :            : Elf_Type
      43                 :      10426 : csky_reloc_simple_type (Ebl *ebl __attribute__ ((unused)), int type,
      44                 :            :                         int *addsub __attribute__ ((unused)))
      45                 :            : {
      46         [ -  + ]:      10426 :   switch (type)
      47                 :            :     {
      48                 :            :     case R_CKCORE_ADDR32:
      49                 :            :       return ELF_T_WORD;
      50                 :          0 :     default:
      51                 :          0 :       return ELF_T_NUM;
      52                 :            :     }
      53                 :            : }
      54                 :            : 
      55                 :            : bool
      56                 :          0 : csky_machine_flag_check (GElf_Word flags)
      57                 :            : {
      58         [ #  # ]:          0 :   switch (flags & EF_CSKY_ABIMASK)
      59                 :            :     {
      60                 :            :     case EF_CSKY_ABIV2:
      61                 :            :       return true;
      62                 :          0 :     case EF_CSKY_ABIV1:
      63                 :            :     default:
      64                 :          0 :       return false;
      65                 :            :     }
      66                 :            : }
      67                 :            : 
      68                 :            : const char *
      69                 :          0 : csky_section_type_name (int type,
      70                 :            :                        char *buf __attribute__ ((unused)),
      71                 :            :                        size_t len __attribute__ ((unused)))
      72                 :            : {
      73         [ #  # ]:          0 :   if (type == SHT_CSKY_ATTRIBUTES)
      74                 :          0 :     return "CSKY_ATTRIBUTES";
      75                 :            : 
      76                 :            :   return NULL;
      77                 :            : }

Generated by: LCOV version 1.16